diff options
author | Anton Kling <anton@kling.gg> | 2023-11-13 16:09:45 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-11-13 16:09:45 +0100 |
commit | 01c13017bf595935022d31eaaa0349bb60233fee (patch) | |
tree | 1139983aaee80cb76270ffa18f13cc1c6a47e087 /kernel/kmalloc.c | |
parent | 761f57a1b167abeda40c5cc0fce801a4230f2400 (diff) |
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.
Diffstat (limited to 'kernel/kmalloc.c')
-rw-r--r-- | kernel/kmalloc.c | 25 |
1 files changed, 0 insertions, 25 deletions
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; |