From fe4c623cb9320226866829317cea8ba0c49e7dbc Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 7 Jul 2024 18:12:55 +0300 Subject: 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 --- arch/riscv64/conf/init | Bin 3960 -> 3960 bytes arch/riscv64/conf/init.c | 16 +++------------- arch/riscv64/conf/initrd | Bin 4608 -> 4608 bytes 3 files changed, 3 insertions(+), 13 deletions(-) (limited to 'arch/riscv64/conf') diff --git a/arch/riscv64/conf/init b/arch/riscv64/conf/init index 5b06586..5248f8f 100755 Binary files a/arch/riscv64/conf/init and b/arch/riscv64/conf/init differ diff --git a/arch/riscv64/conf/init.c b/arch/riscv64/conf/init.c index c61848e..c3e8334 100644 --- a/arch/riscv64/conf/init.c +++ b/arch/riscv64/conf/init.c @@ -178,14 +178,6 @@ static uint64_t sys_swap(long tid) return 0; } -static void sys_ipc_server(void *f) -{ - struct sys_ret r = ecall2(SYS_IPC_SERVER, (long)f); - - if (r.s != 0) - print_value("ipc_server() failed with error ", r.s); -} - static inline struct sys_ret sys_ipc_req(sys_arg_t pid, sys_arg_t d0, sys_arg_t d1, sys_arg_t d2, @@ -381,14 +373,12 @@ static void handle_kernel(long a0, long a1, long d0, long d1, long d2, long d3) sys_poweroff(0); } -void _start(long a0, long a1, long d0, long d1, long d2, long d3) +void _start(long pid, long tid, long d0, long d1, long d2, long d3) { - if (a0 == 0) - handle_kernel(a0, a1, d0, d1, d2, d3); + if (pid == 0) + handle_kernel(pid, tid, d0, d1, d2, d3); /* otherwise, implement test functionality */ - long pid = a0; - long tid = a1; if (d0 == 1) { void *cbuf = 0; rw_buf = sys_req_sharedmem(pid, rw_buf_size, &cbuf); diff --git a/arch/riscv64/conf/initrd b/arch/riscv64/conf/initrd index a792456..bc0858e 100644 Binary files a/arch/riscv64/conf/initrd and b/arch/riscv64/conf/initrd differ -- cgit v1.3