#include <config.h>
#include <mem.h>
#include <stdlib.h>
Include dependency graph for mm.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | MM_FREE 0x0000 |
marker: block free. More... | |
#define | MM_RESERVED 0xffff |
marker: block reserved. More... | |
#define | MM_HEADER_SIZE 2 |
2 words header: pid, size. More... | |
#define | MM_SPLIT_THRESH (MM_HEADER_SIZE+8) |
split off if 8+ data bytes. More... | |
#define | MM_BLOCK_FREE(addr) |
memory from addr on can be allocated. More... | |
#define | MM_BLOCK_RESERVED(addr) |
memory from addr on is reserved. More... | |
Functions | |
void | mm_init () |
initialize memory management. More... | |
void | mm_reaper () |
free all blocks allocated by the current process. More... | |
int | mm_free_mem (void) |
how many bytes of memory are free? More... | |
Variables | |
size_t | mm_start |
end of kernel code + data. More... | |
size_t * | mm_first_free |
ptr to first free block. More... |
Definition in file mm.h.
|
Value: next=(size_t*)(addr); \ *current=((((size_t)next)-(size_t)current)-2)>>1; \ *(next++)=MM_FREE; \ current=next; Macro for mm_init(). Always alternate MM_BLOCK_FREE and MM_BLOCK_RESERVED. |
|
Value: next=(size_t*)(((size_t)addr)-4); \ *current=((((size_t)next)-(size_t)current)-2)>>1; \ *(next++)=MM_RESERVED; \ current=next; Macro for mm_init(). Always alternate MM_BLOCK_FREE and MM_BLOCK_RESERVED. |
|
marker: block free.
|
|
2 words header: pid, size.
|
|
marker: block reserved.
|
|
split off if 8+ data bytes.
|
|
how many bytes of memory are free?
|
|
initialize memory management.
Referenced by kmain(). |
|
free all blocks allocated by the current process.
|
|
ptr to first free block.
|
|
end of kernel code + data.
|
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2002 by the authors. |