diff options
author | Marvin Borner | 2020-06-01 23:30:40 +0200 |
---|---|---|
committer | Marvin Borner | 2020-06-01 23:30:40 +0200 |
commit | 0b3b63ffdedb2e37e0732c09eb0e967e256f0d71 (patch) | |
tree | f92a97a59e15d699b2594d3d313214f241ae8565 /src/kernel/memory/alloc.c | |
parent | 5782d6b0c10b322d78c5d1284cbd4199d2e0f7ce (diff) |
Very clean mmap approach
Sorry for the previous commit messages, I was kind of frustrated.
Diffstat (limited to 'src/kernel/memory/alloc.c')
-rw-r--r-- | src/kernel/memory/alloc.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 <io/io.h> #include <lib/lib.h> #include <memory/alloc.h> +#include <memory/mmap.h> #include <memory/paging.h> #include <stddef.h> #include <stdint.h> @@ -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; |