From 219c27d420fe0abe5515cefc2513c6fe60aafdf9 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 7 Jul 2024 21:47:14 +0300 Subject: add req_page back in as I realized it's useful + Can be used to pass contiguous memory regions to things like virtio block devices for implementing disk drivers etc. --- arch/riscv64/conf/init | Bin 3960 -> 3968 bytes arch/riscv64/conf/init.c | 14 +++++++------- arch/riscv64/conf/initrd | Bin 4608 -> 4608 bytes 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'arch/riscv64/conf') diff --git a/arch/riscv64/conf/init b/arch/riscv64/conf/init index 5248f8f..b378582 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 c3e8334..c4e8064 100644 --- a/arch/riscv64/conf/init.c +++ b/arch/riscv64/conf/init.c @@ -277,12 +277,12 @@ static void sys_sleep() #define CSR_CYCLE "0xc00" -static void handle_kernel(long a0, long a1, long d0, long d1, long d2, long d3) +static void handle_kernel(long pid, long tid, long d0, long d1, long d2, + long d3) { - if (a1 != SYS_USER_BOOTED) + if (d0 != SYS_USER_BOOTED) return; - long tid = d0; if (tid != 1) { puts("Woo, more cores!\n"); while (1) @@ -311,11 +311,11 @@ static void handle_kernel(long a0, long a1, long d0, long d1, long d2, long d3) print_value("Executed cycles per second", cend - cstart); puts("Starting fork():\n"); - long pid = sys_fork(); - if (pid != 0) { - print_value("Child pid", pid); + long cid = sys_fork(); + if (cid != 0) { + print_value("Child pid", cid); puts("Swapping to child...\n"); - while(1) sys_swap(pid); + while(1) sys_swap(cid); } puts("Hello from child!\n"); diff --git a/arch/riscv64/conf/initrd b/arch/riscv64/conf/initrd index bc0858e..4647812 100644 Binary files a/arch/riscv64/conf/initrd and b/arch/riscv64/conf/initrd differ -- cgit v1.3