umem 1.0.1
Macros | Typedefs | Functions
vmem.h File Reference
#include <sys/types.h>

Go to the source code of this file.

Macros

#define VM_SLEEP   0x00000000 /* same as KM_SLEEP */
 
#define VM_NOSLEEP   0x00000001 /* same as KM_NOSLEEP */
 
#define VM_PANIC   0x00000002 /* same as KM_PANIC */
 
#define VM_PUSHPAGE   0x00000004 /* same as KM_PUSHPAGE */
 
#define VM_KMFLAGS   0x000000ff /* flags that must match KM_* flags */
 
#define VM_BESTFIT   0x00000100
 
#define VM_FIRSTFIT   0x00000200
 
#define VM_NEXTFIT   0x00000400
 
#define VM_MEMLOAD   0x00000800
 
#define VM_NORELOC   0x00001000
 
#define VM_ABORT   0x00002000
 
#define VM_FLAGS   0x0000FFFF
 
#define VMC_POPULATOR   0x00010000
 
#define VMC_NO_QCACHE   0x00020000 /* cannot use quantum caches */
 
#define VMC_IDENTIFIER   0x00040000 /* not backed by memory */
 
#define VMC_XALLOC   0x00080000
 
#define VMC_FLAGS   0xFFFF0000
 
#define VMEM_ALLOC   0x01
 
#define VMEM_FREE   0x02
 
#define VMEM_SPAN   0x10
 
#define VMEM_ROTOR   0x20
 
#define VMEM_WALKER   0x40
 
#define VMEM_REENTRANT   0x80000000
 

Typedefs

typedef struct vmem vmem_t
 
typedef void *() vmem_alloc_t(vmem_t *, size_t, int)
 
typedef void() vmem_free_t(vmem_t *, void *, size_t)
 
typedef void *() vmem_ximport_t(vmem_t *, size_t *, int)
 

Functions

vmem_t * vmem_create (const char *, void *, size_t, size_t, vmem_alloc_t *, vmem_free_t *, vmem_t *, size_t, int)
 
vmem_t * vmem_xcreate (const char *, void *, size_t, size_t, vmem_ximport_t *, vmem_free_t *, vmem_t *, size_t, int)
 
void vmem_destroy (vmem_t *)
 
void * vmem_alloc (vmem_t *, size_t, int)
 
void * vmem_xalloc (vmem_t *, size_t, size_t, size_t, size_t, void *, void *, int)
 
void vmem_free (vmem_t *, void *, size_t)
 
void vmem_xfree (vmem_t *, void *, size_t)
 
void * vmem_add (vmem_t *, void *, size_t, int)
 
int vmem_contains (vmem_t *, void *, size_t)
 
void vmem_walk (vmem_t *, int, void(*)(void *, void *, size_t), void *)
 
size_t vmem_size (vmem_t *, int)
 

Macro Definition Documentation

◆ VM_ABORT

#define VM_ABORT   0x00002000

◆ VM_BESTFIT

#define VM_BESTFIT   0x00000100

◆ VM_FIRSTFIT

#define VM_FIRSTFIT   0x00000200

◆ VM_FLAGS

#define VM_FLAGS   0x0000FFFF

◆ VM_KMFLAGS

#define VM_KMFLAGS   0x000000ff /* flags that must match KM_* flags */

◆ VM_MEMLOAD

#define VM_MEMLOAD   0x00000800

◆ VM_NEXTFIT

#define VM_NEXTFIT   0x00000400

◆ VM_NORELOC

#define VM_NORELOC   0x00001000

◆ VM_NOSLEEP

#define VM_NOSLEEP   0x00000001 /* same as KM_NOSLEEP */

◆ VM_PANIC

#define VM_PANIC   0x00000002 /* same as KM_PANIC */

◆ VM_PUSHPAGE

#define VM_PUSHPAGE   0x00000004 /* same as KM_PUSHPAGE */

◆ VM_SLEEP

#define VM_SLEEP   0x00000000 /* same as KM_SLEEP */

◆ VMC_FLAGS

#define VMC_FLAGS   0xFFFF0000

◆ VMC_IDENTIFIER

#define VMC_IDENTIFIER   0x00040000 /* not backed by memory */

◆ VMC_NO_QCACHE

#define VMC_NO_QCACHE   0x00020000 /* cannot use quantum caches */

◆ VMC_POPULATOR

#define VMC_POPULATOR   0x00010000

◆ VMC_XALLOC

#define VMC_XALLOC   0x00080000

◆ VMEM_ALLOC

#define VMEM_ALLOC   0x01

◆ VMEM_FREE

#define VMEM_FREE   0x02

◆ VMEM_REENTRANT

#define VMEM_REENTRANT   0x80000000

◆ VMEM_ROTOR

#define VMEM_ROTOR   0x20

◆ VMEM_SPAN

#define VMEM_SPAN   0x10

◆ VMEM_WALKER

#define VMEM_WALKER   0x40

Typedef Documentation

◆ vmem_alloc_t

typedef void *() vmem_alloc_t(vmem_t *, size_t, int)

◆ vmem_free_t

typedef void() vmem_free_t(vmem_t *, void *, size_t)

◆ vmem_t

typedef struct vmem vmem_t

◆ vmem_ximport_t

typedef void *() vmem_ximport_t(vmem_t *, size_t *, int)

Function Documentation

◆ vmem_add()

void * vmem_add ( vmem_t *  vmp,
void *  vaddr,
size_t  size,
int  vmflag 
)

◆ vmem_alloc()

void * vmem_alloc ( vmem_t *  vmp,
size_t  size,
int  vmflag 
)

◆ vmem_contains()

int vmem_contains ( vmem_t *  vmp,
void *  vaddr,
size_t  size 
)

◆ vmem_create()

vmem_t * vmem_create ( const char *  name,
void *  base,
size_t  size,
size_t  quantum,
vmem_alloc_t *  afunc,
vmem_free_t *  ffunc,
vmem_t *  source,
size_t  qcache_max,
int  vmflag 
)

◆ vmem_destroy()

void vmem_destroy ( vmem_t *  vmp)

◆ vmem_free()

void vmem_free ( vmem_t *  vmp,
void *  vaddr,
size_t  size 
)

◆ vmem_size()

size_t vmem_size ( vmem_t *  vmp,
int  typemask 
)

◆ vmem_walk()

void vmem_walk ( vmem_t *  vmp,
int  typemask,
void(*)(void *, void *, size_t)  func,
void *  arg 
)

◆ vmem_xalloc()

void * vmem_xalloc ( vmem_t *  vmp,
size_t  size,
size_t  align,
size_t  phase,
size_t  nocross,
void *  minaddr,
void *  maxaddr,
int  vmflag 
)

◆ vmem_xcreate()

vmem_t * vmem_xcreate ( const char *  ,
void *  ,
size_t  ,
size_t  ,
vmem_ximport_t *  ,
vmem_free_t *  ,
vmem_t *  ,
size_t  ,
int   
)

◆ vmem_xfree()

void vmem_xfree ( vmem_t *  vmp,
void *  vaddr,
size_t  size 
)