diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-11-13 06:11:43 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-11-13 06:11:43 +0200 |
| commit | 6d3586aa42409fc720e30856cb5df5284329463a (patch) | |
| tree | 571136fdb4f6fb333c1bb4b1274a76eb70263de9 /arch/riscv64/kernel/proc.c | |
| parent | 7da8912c0eee10315dac37cecd4c84f11e5dad59 (diff) | |
| download | kmi-6d3586aa42409fc720e30856cb5df5284329463a.tar.gz kmi-6d3586aa42409fc720e30856cb5df5284329463a.zip | |
~700k ipc requests
+ Eliminated need for save/load_regs, now the register save area is
behind a pointer which _slightly_ increases overall syscall delay, but
speeds up ipc requests by a fair bit.
Diffstat (limited to 'arch/riscv64/kernel/proc.c')
| -rw-r--r-- | arch/riscv64/kernel/proc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c index b8f6c5d..4180bf8 100644 --- a/arch/riscv64/kernel/proc.c +++ b/arch/riscv64/kernel/proc.c @@ -30,7 +30,7 @@ void run_init(struct tcb *t, void *fdt) void set_args(struct tcb *t, struct sys_ret a) { - struct riscv_regs *r = (struct riscv_regs *)(t) - 1; + struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1; r->a0 = a.s; r->a1 = a.ar0; r->a2 = a.ar1; @@ -41,7 +41,7 @@ void set_args(struct tcb *t, struct sys_ret a) struct sys_ret get_args(struct tcb *t) { - struct riscv_regs *r = (struct riscv_regs *)(t) - 1; + struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1; return SYS_RET6(r->a0, r->a1, r->a2, r->a3, r->a4, r->a5); } @@ -49,7 +49,7 @@ void set_thread(struct tcb *t) { /* get location of registers in memory */ /** \todo check alignment, should be fine but just to be sure */ - struct riscv_regs *r = (struct riscv_regs *)(t) - 1; + struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1; /* insert important values into register slots */ r->sp = (long)t->thread_stack_top; @@ -58,28 +58,28 @@ void set_thread(struct tcb *t) vm_t get_stack(struct tcb *t) { - struct riscv_regs *r = (struct riscv_regs *)(t) - 1; + struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1; return r->sp; } void save_regs(struct tcb *t, void *p) { - struct riscv_regs *r = (struct riscv_regs *)(t) - 1; - struct riscv_regs *rp = (struct riscv_regs *)(p); + struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1; + struct riscv_regs *rp = (struct riscv_regs *)(p) - 1; *rp = *r; } void load_regs(void *p, struct tcb *t) { - struct riscv_regs *r = (struct riscv_regs *)(t) - 1; - struct riscv_regs *rp = (struct riscv_regs *)(p); + struct riscv_regs *r = (struct riscv_regs *)(t->regs) - 1; + struct riscv_regs *rp = (struct riscv_regs *)(p) - 1; *r = *rp; } void clone_regs(struct tcb *d, struct tcb *s) { - struct riscv_regs *rd = (struct riscv_regs *)(d) - 1; - struct riscv_regs *rs = (struct riscv_regs *)(s) - 1; + struct riscv_regs *rd = (struct riscv_regs *)(d->regs) - 1; + struct riscv_regs *rs = (struct riscv_regs *)(s->regs) - 1; *rd = *rs; } |
