From 513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 6 Jan 2022 17:41:38 +0200 Subject: Jump back to kernelspace tested + Added automated categories to debugging, bug/info/warn/error etc. Now I should just try to use them here and there :D --- common/uapi/mem.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'common/uapi/mem.c') diff --git a/common/uapi/mem.c b/common/uapi/mem.c index 34ddda2..8c63a87 100644 --- a/common/uapi/mem.c +++ b/common/uapi/mem.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -21,7 +22,11 @@ vm_t sys_free_mem(vm_t start, vm_t u0, vm_t u1, vm_t u2) { UNUSED(u0); UNUSED(u1); UNUSED(u2); struct tcb *r = cur_tcb(); - free_uvmem(r, start); + if(start > __pre_top && start < __post_base) + free_uvmem(r, start); + else + free_devmem(r, start); + return 0; } @@ -33,7 +38,8 @@ vm_t sys_req_pmem(vm_t paddr, vm_t size, vm_t flags, vm_t u0) * outside the RAM area, and I'll probably have to implement some method * that keeps track of used regions outside of RAM. We'll see. */ - return 0; + struct tcb *r = cur_tcb(); + return alloc_devmem(r, paddr, size, flags); } vm_t sys_req_sharedmem(vm_t pid, vm_t start, vm_t size, vm_t flags) -- cgit v1.3