kmem.h revision b942e89b21c9ea698fd94b07082bee381672203d
/*
* 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 (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _SYS_KMEM_H
#define _SYS_KMEM_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Kernel memory allocator: DDI interfaces.
* See kmem_alloc(9F) for details.
*/
#ifdef _KERNEL
extern void kmem_dump_init(size_t);
extern void kmem_dump_begin(void);
#endif /* _KERNEL */
/*
* Kernel memory allocator: private interfaces.
* These interfaces are still evolving.
* Do not use them in unbundled drivers.
*/
/*
* Flags for kmem_cache_create()
*/
#define KMC_NOTOUCH 0x00010000
#define KMC_NODEBUG 0x00020000
#define KMC_NOMAGAZINE 0x00040000
#define KMC_NOHASH 0x00080000
#define KMC_QCACHE 0x00100000
#define KMC_PREFILL 0x00800000
struct kmem_cache; /* cache structure is opaque to kmem clients */
typedef struct kmem_cache kmem_cache_t;
/* Client response to kmem move callback */
typedef enum kmem_cbrc {
} kmem_cbrc_t;
#ifdef _KERNEL
extern int kmem_ready;
extern pgcnt_t kmem_reapahead;
extern void kmem_init(void);
extern void kmem_thread_init(void);
extern void kmem_mp_init(void);
extern void kmem_reap(void);
extern void kmem_reap_idspace(void);
extern int kmem_debugging(void);
extern size_t kmem_avail(void);
extern size_t kmem_maxavail(void);
int (*)(void *, void *, int), void (*)(void *, void *),
void (*)(void *), void *, vmem_t *, int);
extern void kmem_cache_set_move(kmem_cache_t *,
kmem_cbrc_t (*)(void *, void *, size_t, void *));
extern void kmem_cache_destroy(kmem_cache_t *);
extern void *kmem_cache_alloc(kmem_cache_t *, int);
extern void kmem_cache_free(kmem_cache_t *, void *);
extern void kmem_cache_reap_now(kmem_cache_t *);
extern void kmem_cache_move_notify(kmem_cache_t *, void *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_KMEM_H */