From 2dfecbfa898c7db2f5039c81c23a8475966ecfef Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 26 May 2022 21:45:34 +0200 Subject: syscalls/memflag: FINDFREE flag --- src/shared/syscalls.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/shared/syscalls.h') 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); -- cgit v1.2.3