Modules | |
Address Conversion | |
Linux' __va()/__pa() macro replacements. | |
Page Allocation/Deallocation | |
Page allocation just triggers mapping and deallocation triggers unmapping. | |
Slab Caches | |
This simple slab cache emulation was introduced for the Linux USB drivers. | |
Functions | |
void * | kmalloc (size_t size, int gfp) |
kmem Allocation | |
void | kfree (const void *addr) |
kmem Deallocation | |
void * | vmalloc (unsigned long size) |
vmem Allocation | |
void | vfree (void *addr) |
vmem Deallocation | |
int | l4dde_mm_init (unsigned int max_vsize, unsigned int max_ksize) |
Initalize LMM pools and initial regions. |
Linux DDE manages two OSKit LMM pools for memory allocations - one for kmalloc() (kmem) and one for vmalloc() (vmem) allocations. Each pool consists of one ore more LMM regions.
Malloc functions have to keep track of chunk sizes and store them in the first dword of the chunk.
Configuration:
void kfree | ( | const void * | addr | ) |
void* kmalloc | ( | size_t | size, | |
int | gfp | |||
) |
int l4dde_mm_init | ( | unsigned int | max_vsize, | |
unsigned int | max_ksize | |||
) |
Initalize LMM pools and initial regions.
max_vsize | max size of virtual memory allocations | |
max_ksize | max size of kernel memory allocations |
kmem pool is divided into MM_KREGIONS regions of same size. The total size will be max_ksize
(or greater because of rounding/page size). vmem pool has only one region of max_vsize
.
void vfree | ( | void * | addr | ) |
void* vmalloc | ( | unsigned long | size | ) |