diff options
author | Marvin Borner | 2021-03-12 23:56:42 +0100 |
---|---|---|
committer | Marvin Borner | 2021-03-12 23:56:42 +0100 |
commit | e8f17844d05fdc0e44d3793dc73996c7c09e44d6 (patch) | |
tree | 5d4cae66d97f2507aad7fe86ed11867b9a939bbe /kernel/features/syscall.c | |
parent | 928f2662d1469e815a7e32e04d6c68bae4a61c14 (diff) |
New memory allocation algorithms
Diffstat (limited to 'kernel/features/syscall.c')
-rw-r--r-- | kernel/features/syscall.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c index bac1738..486da6c 100644 --- a/kernel/features/syscall.c +++ b/kernel/features/syscall.c @@ -5,6 +5,7 @@ #include <interrupts.h> #include <load.h> #include <mem.h> +#include <mm.h> #include <net.h> #include <print.h> #include <proc.h> @@ -25,12 +26,13 @@ static void syscall_handler(struct regs *r) loop(); break; } - case SYS_MALLOC: { - r->eax = (u32)malloc(r->ebx); + case SYS_ALLOC: { + r->eax = (u32)memory_alloc(proc_current()->page_dir, r->ebx, + MEMORY_CLEAR | MEMORY_USER); break; } case SYS_FREE: { - free((void *)r->ebx); + memory_free(proc_current()->page_dir, memory_range(r->ebx, r->ecx)); break; } case SYS_STAT: { |