From 0b3b63ffdedb2e37e0732c09eb0e967e256f0d71 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 1 Jun 2020 23:30:40 +0200 Subject: Very clean mmap approach Sorry for the previous commit messages, I was kind of frustrated. --- src/kernel/memory/alloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/kernel/memory/alloc.c') diff --git a/src/kernel/memory/alloc.c b/src/kernel/memory/alloc.c index d1d8b47..4f76080 100644 --- a/src/kernel/memory/alloc.c +++ b/src/kernel/memory/alloc.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -22,13 +23,13 @@ int liballoc_unlock() void *liballoc_alloc(u32 p) { - u32 ptr = paging_alloc_pages((u32)p); + u32 ptr = kmalloc_frames((u32)p); return (void *)ptr; } int liballoc_free(void *ptr, u32 p) { - paging_set_free((u32)ptr, (u32)p); + kfree_frames((u32)ptr, (u32)p); return 0; } @@ -96,8 +97,7 @@ static long long l_possible_overruns = 0; static void *liballoc_memset(void *s, int c, u32 n) { - u32 i; - for (i = 0; i < n; i++) + for (u32 i = 0; i < n; i++) ((char *)s)[i] = c; return s; -- cgit v1.2.3