aboutsummaryrefslogtreecommitdiff
path: root/common/uapi/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/uapi/mem.c')
-rw-r--r--common/uapi/mem.c10
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)