aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/syscall/actions
diff options
context:
space:
mode:
authorMarvin Borner2020-01-06 00:06:45 +0100
committerMarvin Borner2020-01-06 00:06:45 +0100
commit84a8b41f4d4c444385e0d7ef058a57af07f0c2e1 (patch)
tree71184009c6fc25c3ee1b6d097d5af6705325419a /src/kernel/syscall/actions
parent9390f6408884d0631e5d9865150851d53e2d6aec (diff)
Usermode based allocating works a bit now
*a bit*
Diffstat (limited to 'src/kernel/syscall/actions')
-rw-r--r--src/kernel/syscall/actions/sys_alloc.c7
-rw-r--r--src/kernel/syscall/actions/sys_free.c8
-rw-r--r--src/kernel/syscall/actions/sys_paging_alloc.c9
-rw-r--r--src/kernel/syscall/actions/sys_paging_free.c8
4 files changed, 15 insertions, 17 deletions
diff --git a/src/kernel/syscall/actions/sys_alloc.c b/src/kernel/syscall/actions/sys_alloc.c
new file mode 100644
index 0000000..6579e0e
--- /dev/null
+++ b/src/kernel/syscall/actions/sys_alloc.c
@@ -0,0 +1,7 @@
+#include <stdint.h>
+#include <kernel/lib/stdlib/liballoc.h>
+
+uint32_t sys_alloc(uint32_t count)
+{
+ return (uint32_t) umalloc(count);
+} \ No newline at end of file
diff --git a/src/kernel/syscall/actions/sys_free.c b/src/kernel/syscall/actions/sys_free.c
new file mode 100644
index 0000000..6c3a82f
--- /dev/null
+++ b/src/kernel/syscall/actions/sys_free.c
@@ -0,0 +1,8 @@
+#include <stdint.h>
+#include <kernel/lib/stdlib/liballoc.h>
+
+uint32_t sys_free(uint32_t ptr)
+{
+ ufree((void *) ptr);
+ return 0;
+} \ No newline at end of file
diff --git a/src/kernel/syscall/actions/sys_paging_alloc.c b/src/kernel/syscall/actions/sys_paging_alloc.c
deleted file mode 100644
index 57ffd39..0000000
--- a/src/kernel/syscall/actions/sys_paging_alloc.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <stdint.h>
-#include <kernel/paging/paging.h>
-
-uint32_t sys_paging_alloc(uint32_t count)
-{
- uint32_t ptr = paging_alloc_pages((uint32_t) count);
- paging_set_user(ptr, count);
- return ptr;
-} \ No newline at end of file
diff --git a/src/kernel/syscall/actions/sys_paging_free.c b/src/kernel/syscall/actions/sys_paging_free.c
deleted file mode 100644
index cdf7bb1..0000000
--- a/src/kernel/syscall/actions/sys_paging_free.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdint.h>
-#include <kernel/paging/paging.h>
-
-uint32_t sys_paging_free(uint32_t virt, uint32_t count)
-{
- paging_set_free(virt, count);
- return count;
-} \ No newline at end of file