seg_kmem.h revision ad23a2db4cfc94c0ed1d58554479ce8d2e7e5768
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _VM_SEG_KMEM_H
#define _VM_SEG_KMEM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* VM - Kernel Segment Driver
*/
#if defined(_KERNEL)
extern char *kernelheap; /* start of primary kernel heap */
extern char *ekernelheap; /* end of primary kernel heap */
extern char *heap_lp_base; /* start of kernel large page heap arena */
extern char *heap_lp_end; /* end of kernel large page heap arena */
extern int segkmem_reloc; /* enable/disable segkmem relocatable pages */
extern int segkmem_create(struct seg *);
extern void kernelheap_init(void *, void *, char *, void *, void *);
extern void kernelheap_extend(void *, void *);
extern void segkmem_gc(void);
extern int segkmem_zio_create(struct seg *);
extern void segkmem_zio_init(void *, size_t);
/*
* Flags for segkmem_xalloc().
*
* SEGKMEM_SHARELOCKED requests pages which are locked SE_SHARED to be
* returned rather than unlocked which is now the default. Note that
* memory returned by SEGKMEM_SHARELOCKED cannot be freed by segkmem_free().
* This is a hack for seg_dev that should be cleaned up in the future.
*/
#define SEGKMEM_SHARELOCKED 0x20000
/*
* Large page for kmem caches support
*/
typedef struct segkmem_lpcb {
/* stats */
extern int segkmem_lpsetup();
extern void segkmem_heap_lp_init(void);
extern size_t segkmem_lpsize;
extern size_t segkmem_heaplp_quantum;
extern size_t segkmem_kmemlp_max;
#define IS_KMEM_VA_LARGEPAGE(vaddr) \
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _VM_SEG_KMEM_H */