diff options
author | dzwdz | 2021-09-08 19:45:50 +0200 |
---|---|---|
committer | dzwdz | 2021-09-08 19:45:50 +0200 |
commit | f44b80c3f0004418c4953f0a2f32f7bec2e26e36 (patch) | |
tree | f5258a5d90316d8ea033eb09bf7220a0271fd808 /src/kernel/syscalls.c | |
parent | 67c847f8660ed73db1017f2ca8b01bfe4eb9ba1b (diff) |
process struct: replace the generic saved_addr with an union
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r-- | src/kernel/syscalls.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index ddc3d4b..124333a 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -17,11 +17,11 @@ _Noreturn static void await_finish(struct process *dead, struct process *listene dead->state = PS_DEADER; listener->state = PS_RUNNING; - len = listener->saved_len < dead->saved_len - ? listener->saved_len : dead->saved_len; + len = listener->death_msg.len < dead->death_msg.len + ? listener->death_msg.len : dead->death_msg.len; res = virt_cpy( - listener->pages, listener->saved_addr, - dead->pages, dead->saved_addr, len); + listener->pages, listener->death_msg.buf, + dead->pages, dead->death_msg.buf, len); regs_savereturn(&listener->regs, res ? len : -1); process_switch(listener); } @@ -29,8 +29,8 @@ _Noreturn static void await_finish(struct process *dead, struct process *listene _Noreturn void _syscall_exit(const user_ptr msg, size_t len) { process_current->state = PS_DEAD; - process_current->saved_addr = msg; - process_current->saved_len = len; + process_current->death_msg.buf = msg; + process_current->death_msg.len = len; if (process_current->parent->state == PS_WAITS4CHILDDEATH) await_finish(process_current, process_current->parent); @@ -44,8 +44,8 @@ _Noreturn void _syscall_exit(const user_ptr msg, size_t len) { int _syscall_await(user_ptr buf, int len) { process_current->state = PS_WAITS4CHILDDEATH; - process_current->saved_addr = buf; - process_current->saved_len = len; + process_current->death_msg.buf = buf; + process_current->death_msg.len = len; // find any already dead children for (struct process *iter = process_current->child; |