xref: /onnv-gate/usr/src/lib/libumem/common/vmem_base.h (revision 1528:30ad6286c4a5)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*1528Sjwadams  * Common Development and Distribution License (the "License").
6*1528Sjwadams  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*1528Sjwadams  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_VMEM_BASE_H
270Sstevel@tonic-gate #define	_VMEM_BASE_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #include <sys/vmem.h>
320Sstevel@tonic-gate #include <umem.h>
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #ifdef	__cplusplus
350Sstevel@tonic-gate extern "C" {
360Sstevel@tonic-gate #endif
370Sstevel@tonic-gate 
380Sstevel@tonic-gate #include "misc.h"
390Sstevel@tonic-gate 
400Sstevel@tonic-gate extern void vmem_startup(void);
410Sstevel@tonic-gate extern vmem_t *vmem_init(const char *parent_name, size_t parent_quantum,
420Sstevel@tonic-gate 	vmem_alloc_t *parent_alloc, vmem_free_t *parent_free,
430Sstevel@tonic-gate 	const char *heap_name,
440Sstevel@tonic-gate 	void *heap_start, size_t heap_size, size_t heap_quantum,
450Sstevel@tonic-gate 	vmem_alloc_t *heap_alloc, vmem_free_t *heap_free);
460Sstevel@tonic-gate 
470Sstevel@tonic-gate extern void *_vmem_extend_alloc(vmem_t *vmp, void *vaddr, size_t size,
480Sstevel@tonic-gate 	size_t alloc, int vmflag);
490Sstevel@tonic-gate 
500Sstevel@tonic-gate extern vmem_t *vmem_heap_arena(vmem_alloc_t **, vmem_free_t **);
510Sstevel@tonic-gate extern void vmem_heap_init(void);
520Sstevel@tonic-gate 
530Sstevel@tonic-gate extern vmem_t *vmem_sbrk_arena(vmem_alloc_t **, vmem_free_t **);
540Sstevel@tonic-gate extern vmem_t *vmem_mmap_arena(vmem_alloc_t **, vmem_free_t **);
550Sstevel@tonic-gate extern vmem_t *vmem_stand_arena(vmem_alloc_t **, vmem_free_t **);
560Sstevel@tonic-gate 
570Sstevel@tonic-gate extern void vmem_update(void *);
580Sstevel@tonic-gate extern void vmem_reap(void);		/* vmem_populate()-safe reap */
590Sstevel@tonic-gate 
600Sstevel@tonic-gate extern size_t pagesize;
610Sstevel@tonic-gate extern size_t vmem_sbrk_pagesize;
62*1528Sjwadams extern size_t vmem_sbrk_minalloc;
630Sstevel@tonic-gate 
640Sstevel@tonic-gate extern uint_t vmem_backend;
650Sstevel@tonic-gate #define	VMEM_BACKEND_SBRK	0x0000001
660Sstevel@tonic-gate #define	VMEM_BACKEND_MMAP	0x0000002
670Sstevel@tonic-gate #define	VMEM_BACKEND_STAND	0x0000003
680Sstevel@tonic-gate 
690Sstevel@tonic-gate extern vmem_t *vmem_heap;
700Sstevel@tonic-gate extern vmem_alloc_t *vmem_heap_alloc;
710Sstevel@tonic-gate extern vmem_free_t *vmem_heap_free;
720Sstevel@tonic-gate 
730Sstevel@tonic-gate extern void vmem_lockup(void);
740Sstevel@tonic-gate extern void vmem_release(void);
750Sstevel@tonic-gate 
760Sstevel@tonic-gate extern void vmem_sbrk_lockup(void);
770Sstevel@tonic-gate extern void vmem_sbrk_release(void);
780Sstevel@tonic-gate 
790Sstevel@tonic-gate extern void vmem_no_debug(void);
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #ifdef	__cplusplus
820Sstevel@tonic-gate }
830Sstevel@tonic-gate #endif
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #endif	/* _VMEM_BASE_H */
86