aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-07 18:12:55 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-07 18:12:55 +0300
commitfe4c623cb9320226866829317cea8ba0c49e7dbc (patch)
tree7ea3723077c72ff7969747a70ece0b94d88d2219 /arch/riscv64/kernel
parentd592abd8ccc4026c51e196777031eb65c4acc4de (diff)
downloadkmi-fe4c623cb9320226866829317cea8ba0c49e7dbc.tar.gz
kmi-fe4c623cb9320226866829317cea8ba0c49e7dbc.zip
make executable entrypoint universal callback
+ Effectively means that all executables can be called into, but if an exe doesn't want to deal with anyone else it should just set a flag like `not_really_a_server` or whatever
Diffstat (limited to 'arch/riscv64/kernel')
-rw-r--r--arch/riscv64/kernel/proc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c
index 4310378..413c078 100644
--- a/arch/riscv64/kernel/proc.c
+++ b/arch/riscv64/kernel/proc.c
@@ -31,15 +31,16 @@ void run_init(struct tcb *t, vm_t fdt, vm_t initrd)
bkl_unlock();
__asm__ volatile ("mv sp, %0\n"
"li a0, %1\n"
- "li a1, %2\n"
- "mv a2, %3\n"
+ "mv a1, %2\n"
+ "li a2, %3\n"
"mv a3, %4\n"
"mv a4, %5\n"
+ "li a5, %6\n"
"sret\n"
:
: "r" (stack_top),
- "K" (0), "K" (SYS_USER_BOOTED),
- "r" (t->tid), "r" (fdt), "r" (initrd)
+ "K" (0), "r" (t->tid), "K" (SYS_USER_BOOTED),
+ "r" (fdt), "r" (initrd), "K" (1)
: "memory");
/* we should never reach this */
unreachable();