diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-01-06 17:41:38 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-01-06 17:41:38 +0200 |
| commit | 513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f (patch) | |
| tree | a4d2cc6cc0bd0990c282d6163767fbfaa12d0718 /common/uapi | |
| parent | 6f052e236715846b1a14f9fe59f89346efb809e6 (diff) | |
| download | kmi-513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f.tar.gz kmi-513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f.zip | |
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
Diffstat (limited to 'common/uapi')
| -rw-r--r-- | common/uapi/mem.c | 10 |
1 files changed, 8 insertions, 2 deletions
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 <apos/dev.h> #include <apos/uapi.h> #include <apos/utils.h> #include <apos/vmem.h> @@ -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) |
