diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-22 13:19:50 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-22 13:19:50 +0300 |
| commit | 66b39eb7ce9605cbb70defdca7f0eb144855ddcd (patch) | |
| tree | 702bd65c46591052f40987c848b664a84057f7e7 /src | |
| parent | 4168cca8124acdbd1866eb87810efe1cfe16903c (diff) | |
| download | kmi-66b39eb7ce9605cbb70defdca7f0eb144855ddcd.tar.gz kmi-66b39eb7ce9605cbb70defdca7f0eb144855ddcd.zip | |
change sys_ret handling to always include id
Diffstat (limited to 'src')
| -rw-r--r-- | src/orphanage.c | 2 | ||||
| -rw-r--r-- | src/uapi/dispatch.c | 4 | ||||
| -rw-r--r-- | src/uapi/ipc.c | 11 | ||||
| -rw-r--r-- | src/uapi/proc.c | 4 |
4 files changed, 12 insertions, 9 deletions
diff --git a/src/orphanage.c b/src/orphanage.c index 3ca016e..526affc 100644 --- a/src/orphanage.c +++ b/src/orphanage.c @@ -44,7 +44,7 @@ void unorphanize(struct tcb *t) alloc_stack(t); assert(init->callback); - set_args4(t, 0, t->tid, SYS_USER_ORPHANED, old_rid); + set_ret4(t, 0, t->tid, SYS_USER_ORPHANED, old_rid); set_return(t, init->callback); t->callback = init->callback; diff --git a/src/uapi/dispatch.c b/src/uapi/dispatch.c index ad53536..399f02b 100644 --- a/src/uapi/dispatch.c +++ b/src/uapi/dispatch.c @@ -23,7 +23,7 @@ SYSCALL_DEFINE0(noop)(struct tcb *t) { info("sys_noop\n"); - set_args1(t, OK); + return_args1(t, OK); } /** @@ -37,7 +37,7 @@ SYSCALL_DEFINE0(noop)(struct tcb *t) SYSCALL_DEFINE1(putch)(struct tcb *t, sys_arg_t a) { dbg("%c", (char)a); - set_args1(t, OK); + return_args1(t, OK); } void handle_syscall(sys_arg_t syscall, sys_arg_t a, sys_arg_t b, diff --git a/src/uapi/ipc.c b/src/uapi/ipc.c index 4a5a6d9..3d77639 100644 --- a/src/uapi/ipc.c +++ b/src/uapi/ipc.c @@ -97,7 +97,7 @@ static inline vm_t enter_rpc(struct tcb *t, struct sys_ret a, /* try to get rid of args as fast as possible to free up registers for * later use */ - set_args(t, 6, a); + set_ret(t, 6, a); ctx->exec = t->exec; ctx->pid = t->pid; @@ -239,7 +239,7 @@ static void leave_rpc(struct tcb *t, struct sys_ret a) t->regs = ctx->regs; /* again, get rid of args as fast as possible */ - set_args(t, 6, a); + set_ret(t, 6, a); struct tcb *r = get_tcb(ctx->pid); while (!r || !is_proc(r) || zombie(r)) { @@ -254,7 +254,10 @@ static void leave_rpc(struct tcb *t, struct sys_ret a) ctx = (struct call_ctx *)(rpc_stack) - 1; r = get_tcb(ctx->pid); - set_args1(t, ERR_NF); + /* equivalent to return_args1 but without returning so we can + * handle other cases in the loop. */ + /** @todo is set_args useful? */ + set_ret2(t, 0, ERR_NF); } if (orphan(t) && !is_rpc(t)) @@ -450,7 +453,7 @@ SYSCALL_DEFINE0(ipc_ghost)(struct tcb *t) return_args1(t, ERR_MISC); enable_irqs(); - leave_rpc(t, get_args(t)); + leave_rpc(t, get_ret(t)); } /** diff --git a/src/uapi/proc.c b/src/uapi/proc.c index 74f211c..c0fe5f0 100644 --- a/src/uapi/proc.c +++ b/src/uapi/proc.c @@ -43,7 +43,7 @@ SYSCALL_DEFINE5(create)(struct tcb *t, sys_arg_t func, * function? */ alloc_stack(c); - set_args5(c, c->tid, d0, d1, d2, d3); + set_ret5(c, c->tid, d0, d1, d2, d3); set_return(c, func); c->notify_id = t->notify_id; @@ -227,7 +227,7 @@ static void swap(struct tcb *t, struct tcb *s) notify(s, 0); /* no notifications, so get register state for new thread */ - return_args(s, get_args(s)); + set_ret(s, 6, get_ret(s)); } /** |
