summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/flags.h1
-rw-r--r--src/shared/syscalls.h11
2 files changed, 11 insertions, 1 deletions
diff --git a/src/shared/flags.h b/src/shared/flags.h
index 9ab8d9d..dd20a3f 100644
--- a/src/shared/flags.h
+++ b/src/shared/flags.h
@@ -2,4 +2,5 @@
enum {
MEMFLAG_PRESENT = 1 << 0,
+ MEMFLAG_FINDFREE = 1 << 1,
};
diff --git a/src/shared/syscalls.h b/src/shared/syscalls.h
index 8dee783..5d98429 100644
--- a/src/shared/syscalls.h
+++ b/src/shared/syscalls.h
@@ -66,4 +66,13 @@ struct fs_wait_response {
int _syscall_fs_wait(char __user *buf, int max_len, struct fs_wait_response __user *res);
int _syscall_fs_respond(char __user *buf, int ret);
-int _syscall_memflag(void __user *addr, size_t len, int flags);
+/** Modifies the virtual address space.
+ *
+ * If the MEMFLAG_PRESENT flag is present - mark the memory region as allocated.
+ * Otherwise, free it.
+ *
+ * MEMFLAG_FINDFREE tries to find the first free region of length `len`.
+ *
+ * @return address of the first affected page (usually == addr)
+ */
+void __user *_syscall_memflag(void __user *addr, size_t len, int flags);