aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv64')
-rwxr-xr-xarch/riscv64/conf/initbin3960 -> 3968 bytes
-rw-r--r--arch/riscv64/conf/init.c14
-rw-r--r--arch/riscv64/conf/initrdbin4608 -> 4608 bytes
-rw-r--r--arch/riscv64/kernel/proc.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/arch/riscv64/conf/init b/arch/riscv64/conf/init
index 5248f8f..b378582 100755
--- a/arch/riscv64/conf/init
+++ b/arch/riscv64/conf/init
Binary files 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
--- a/arch/riscv64/conf/initrd
+++ b/arch/riscv64/conf/initrd
Binary files differ
diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c
index 413c078..f21ce5c 100644
--- a/arch/riscv64/kernel/proc.c
+++ b/arch/riscv64/kernel/proc.c
@@ -35,7 +35,7 @@ void run_init(struct tcb *t, vm_t fdt, vm_t initrd)
"li a2, %3\n"
"mv a3, %4\n"
"mv a4, %5\n"
- "li a5, %6\n"
+ "li a5, %6\n"
"sret\n"
:
: "r" (stack_top),