From e0e08a12d4de86b558674fb9f90ad0b0204c26f0 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Thu, 26 Dec 2019 15:50:21 -0500 Subject: working memory manager --- src/kernel/mem.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/kernel/mem.h') diff --git a/src/kernel/mem.h b/src/kernel/mem.h index 106db90..5c0d387 100644 --- a/src/kernel/mem.h +++ b/src/kernel/mem.h @@ -35,7 +35,11 @@ struct mmap_entry { struct mmap_entry *next; }; +#define MMAP_SIZE 65536 struct mmap_entry *mmap_start; +struct mmap_entry mmap_bss[MMAP_SIZE]; +uint32_t mmap_bitmap[MMAP_SIZE / 32]; +#define unmark_entry(entry) mmap_bitmap[((entry) - mmap_bss) >> 5] ^= 1 << (((entry) - mmap_bss) & 0x0000001f); void *allocate_block(uint32_t size, uint16_t proc_n); void deallocate_block(void *start); -- cgit v1.2.3