diff options
Diffstat (limited to 'src/user/lib')
-rw-r--r-- | src/user/lib/elfload.c | 4 | ||||
-rw-r--r-- | src/user/lib/esemaphore.c | 4 | ||||
-rw-r--r-- | src/user/lib/file.c | 2 | ||||
-rw-r--r-- | src/user/lib/fs/misc.c | 2 | ||||
-rw-r--r-- | src/user/lib/syscall.c | 32 | ||||
-rw-r--r-- | src/user/lib/syscall.c.awk | 4 |
6 files changed, 24 insertions, 24 deletions
diff --git a/src/user/lib/elfload.c b/src/user/lib/elfload.c index 71714ab..e3853ba 100644 --- a/src/user/lib/elfload.c +++ b/src/user/lib/elfload.c @@ -87,8 +87,8 @@ void _freejmp(void *entry, void *low, size_t len, char **argv, char **envp) { uintptr_t high = (uintptr_t)low + len; uint64_t buf[] = { - EXECBUF_SYSCALL, _SYSCALL_MEMFLAG, 0, (uintptr_t)low, 0, 0, - EXECBUF_SYSCALL, _SYSCALL_MEMFLAG, high, ~0 - 0xF000 - high, 0, 0, + EXECBUF_SYSCALL, _SYSCALL_MEMFLAG, 0, (uintptr_t)low, 0, 0, 0, + EXECBUF_SYSCALL, _SYSCALL_MEMFLAG, high, ~0 - 0xF000 - high, 0, 0, 0, EXECBUF_JMP, (uintptr_t)entry, }; execbuf_chstack(stack_w, buf, sizeof buf); diff --git a/src/user/lib/esemaphore.c b/src/user/lib/esemaphore.c index 70cedae..f58b510 100644 --- a/src/user/lib/esemaphore.c +++ b/src/user/lib/esemaphore.c @@ -5,7 +5,7 @@ #include <user/lib/esemaphore.h> void esem_signal(struct evil_sem *sem) { - _syscall_write(sem->signal, NULL, 0, 0); + _syscall_write(sem->signal, NULL, 0, 0, 0); } void esem_wait(struct evil_sem *sem) { @@ -25,7 +25,7 @@ struct evil_sem *esem_new(int value) { close(ends_signal[1]); while (_syscall_read(ends_signal[0], NULL, 0, 0) >= 0) { if (!_syscall_fork(FORK_NOREAP, NULL)) { - _syscall_write(ends_wait[1], NULL, 0, 0); + _syscall_write(ends_wait[1], NULL, 0, 0, 0); exit(0); } } diff --git a/src/user/lib/file.c b/src/user/lib/file.c index a26c8bb..b7e70e6 100644 --- a/src/user/lib/file.c +++ b/src/user/lib/file.c @@ -127,7 +127,7 @@ size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restri return 0; while (pos < total) { - long res = _syscall_write(f->fd, buf + pos, total - pos, f->pos); + long res = _syscall_write(f->fd, buf + pos, total - pos, f->pos, 0); if (res < 0) { f->error = true; errno = -res; diff --git a/src/user/lib/fs/misc.c b/src/user/lib/fs/misc.c index 32464b3..55ba9a6 100644 --- a/src/user/lib/fs/misc.c +++ b/src/user/lib/fs/misc.c @@ -151,7 +151,7 @@ void fs_dir_inject(const char *path) { case VFSOP_WRITE: if (data->delegate >= 0) - ret = _syscall_write(data->delegate, buf, res.len, res.offset); + ret = _syscall_write(data->delegate, buf, res.len, res.offset, res.flags); else ret = -1; _syscall_fs_respond(NULL, ret, 0); diff --git a/src/user/lib/syscall.c b/src/user/lib/syscall.c index 7e0de88..842b7b9 100644 --- a/src/user/lib/syscall.c +++ b/src/user/lib/syscall.c @@ -6,63 +6,63 @@ _Noreturn void _syscall_exit(long ret) { - _syscall(_SYSCALL_EXIT, ret, 0, 0, 0); + _syscall(_SYSCALL_EXIT, ret, 0, 0, 0, 0); __builtin_unreachable(); } long _syscall_await(void) { - return _syscall(_SYSCALL_AWAIT, 0, 0, 0, 0); + return _syscall(_SYSCALL_AWAIT, 0, 0, 0, 0, 0); } long _syscall_fork(int flags, handle_t __user *fs_front) { - return _syscall(_SYSCALL_FORK, (long)flags, (long)fs_front, 0, 0); + return _syscall(_SYSCALL_FORK, (long)flags, (long)fs_front, 0, 0, 0); } handle_t _syscall_open(const char __user *path, long len, int flags) { - return (handle_t)_syscall(_SYSCALL_OPEN, (long)path, len, (long)flags, 0); + return (handle_t)_syscall(_SYSCALL_OPEN, (long)path, len, (long)flags, 0, 0); } long _syscall_mount(handle_t h, const char __user *path, long len) { - return _syscall(_SYSCALL_MOUNT, (long)h, (long)path, len, 0); + return _syscall(_SYSCALL_MOUNT, (long)h, (long)path, len, 0, 0); } handle_t _syscall_dup(handle_t from, handle_t to, int flags) { - return (handle_t)_syscall(_SYSCALL_DUP, (long)from, (long)to, (long)flags, 0); + return (handle_t)_syscall(_SYSCALL_DUP, (long)from, (long)to, (long)flags, 0, 0); } long _syscall_read(handle_t h, void __user *buf, size_t len, long offset) { - return _syscall(_SYSCALL_READ, (long)h, (long)buf, (long)len, offset); + return _syscall(_SYSCALL_READ, (long)h, (long)buf, (long)len, offset, 0); } -long _syscall_write(handle_t h, const void __user *buf, size_t len, long offset) { - return _syscall(_SYSCALL_WRITE, (long)h, (long)buf, (long)len, offset); +long _syscall_write(handle_t h, const void __user *buf, size_t len, long offset, int flags) { + return _syscall(_SYSCALL_WRITE, (long)h, (long)buf, (long)len, offset, (long)flags); } long _syscall_close(handle_t h) { - return _syscall(_SYSCALL_CLOSE, (long)h, 0, 0, 0); + return _syscall(_SYSCALL_CLOSE, (long)h, 0, 0, 0, 0); } long _syscall_fs_wait(char __user *buf, long max_len, struct fs_wait_response __user *res) { - return _syscall(_SYSCALL_FS_WAIT, (long)buf, max_len, (long)res, 0); + return _syscall(_SYSCALL_FS_WAIT, (long)buf, max_len, (long)res, 0, 0); } long _syscall_fs_respond(void __user *buf, long ret, int flags) { - return _syscall(_SYSCALL_FS_RESPOND, (long)buf, ret, (long)flags, 0); + return _syscall(_SYSCALL_FS_RESPOND, (long)buf, ret, (long)flags, 0, 0); } void __user *_syscall_memflag(void __user *addr, size_t len, int flags) { - return (void __user *)_syscall(_SYSCALL_MEMFLAG, (long)addr, (long)len, (long)flags, 0); + return (void __user *)_syscall(_SYSCALL_MEMFLAG, (long)addr, (long)len, (long)flags, 0, 0); } long _syscall_pipe(handle_t __user user_ends[2], int flags) { - return _syscall(_SYSCALL_PIPE, (long)user_ends, (long)flags, 0, 0); + return _syscall(_SYSCALL_PIPE, (long)user_ends, (long)flags, 0, 0, 0); } long _syscall_execbuf(void __user *buf, size_t len) { - return _syscall(_SYSCALL_EXECBUF, (long)buf, (long)len, 0, 0); + return _syscall(_SYSCALL_EXECBUF, (long)buf, (long)len, 0, 0, 0); } void _syscall_debug_klog(const void __user *buf, size_t len) { - return (void)_syscall(_SYSCALL_DEBUG_KLOG, (long)buf, (long)len, 0, 0); + return (void)_syscall(_SYSCALL_DEBUG_KLOG, (long)buf, (long)len, 0, 0, 0); } diff --git a/src/user/lib/syscall.c.awk b/src/user/lib/syscall.c.awk index 58f9a4c..192df6a 100644 --- a/src/user/lib/syscall.c.awk +++ b/src/user/lib/syscall.c.awk @@ -23,7 +23,7 @@ BEGIN { if (params == "void") params = "" split(params, p, /,/); - for (i = 0; i <= 4; i += 1) { + for (i = 0; i < 6; i += 1) { if (p[i]) { # p[i] is a parameter, convert it into an expression to pass to _syscall() sub(/^ */, "", p[i]); # strip @@ -44,7 +44,7 @@ BEGIN { printf "return "; if (rets != "long") printf "(%s)", rets; } - printf "_syscall(%s, %s, %s, %s, %s);\n", toupper(name), p[1], p[2], p[3], p[4]; + printf "_syscall(%s, %s, %s, %s, %s, %s);\n", toupper(name), p[1], p[2], p[3], p[4], p[5]; if (index($0, "_Noreturn")) print "\t__builtin_unreachable();"; print "}\n"; |