From 01c13017bf595935022d31eaaa0349bb60233fee Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 13 Nov 2023 16:09:45 +0100 Subject: Kernel: Remove kmalloc_eternal I would like to be able to free some of those objects but I have not decided upon how that will be done yet. Even if not freeded the added complexity of having two functions does not make the extra bytes saved worth it IMO. --- kernel/kmalloc.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'kernel/kmalloc.c') diff --git a/kernel/kmalloc.c b/kernel/kmalloc.c index 8a674f5..3871d62 100644 --- a/kernel/kmalloc.c +++ b/kernel/kmalloc.c @@ -147,31 +147,6 @@ void *kmalloc(size_t s) { return rc; } -#define HEAP 0x00E00000 -#define PHYS 0x403000 - -void *latest = NULL; -u64 left = 0; - -void *kmalloc_eternal_physical_align(size_t s, void **physical) { - void *return_address = ksbrk(s); - if (physical) { - if (0 == get_active_pagedirectory()) - *physical = - (void *)((uintptr_t)return_address - (0xC0000000 + PHYS) + HEAP); - else - *physical = (void *)virtual_to_physical(return_address, 0); - } - memset(return_address, 0, 0x1000); - return return_address; -} - -void *kmalloc_eternal_align(size_t s) { - return kmalloc_eternal_physical_align(s, NULL); -} - -void *kmalloc_eternal(size_t s) { return kmalloc_eternal_align(s); } - size_t get_mem_size(void *ptr) { if (!ptr) return 0; -- cgit v1.2.3