#include "cpu/arch_consts.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
|
#define | KMALLOC_BMAP_SZ (((KMALLOC_SZ*1024)/4)/8) |
| The size of the kmalloc bitmap.
|
|
|
static char | bitmap [KMALLOC_BMAP_SZ] |
| Bitmap of used areas of the heap.
|
|
static void * | data =(void*)KMALLOC_START |
| Start of the kmalloc heap.
|
|
◆ clear_bmap_bit()
static void clear_bmap_bit |
( |
size_t |
index | ) |
|
|
static |
Clear a bit in the heap bitmap
- Parameters
-
◆ get_bmap_bit()
static char get_bmap_bit |
( |
size_t |
index | ) |
|
|
static |
Get a bit in the heap bitmap
- Parameters
-
- Returns
- the bit
◆ kfree()
Free a block in the kernel heap
- Parameters
-
mem | The address of the block |
◆ kmalloc()
void* kmalloc |
( |
size_t |
size | ) |
|
Allocate a block in the kernel heap
- Parameters
-
size | The size of the block |
- Returns
- the address of the block in the heap.
◆ set_bmap_bit()
static void set_bmap_bit |
( |
size_t |
index | ) |
|
|
static |
Set a bit in the heap bitmap
- Parameters
-