aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-05 21:02:52 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-05 21:02:52 +0300
commit608f44306a6f0d5692f5c81bcbfe7a621ec254ba (patch)
tree72a9f917694be91e4795bd04fddabac8139e1059 /arch/riscv64/kernel
parentbef6a76b602eee8f43c2e7dd65c5bd9cf5d909e4 (diff)
downloadkmi-608f44306a6f0d5692f5c81bcbfe7a621ec254ba.tar.gz
kmi-608f44306a6f0d5692f5c81bcbfe7a621ec254ba.zip
implement bkl
+ Start out using big kernel lock, apparently seL4 thinks its good enough. I might have a go at using a more fair lock, and possibly moving to more fine-grained locks if I really feel the need to get scalability up.
Diffstat (limited to 'arch/riscv64/kernel')
-rw-r--r--arch/riscv64/kernel/entry.S2
-rw-r--r--arch/riscv64/kernel/proc.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/arch/riscv64/kernel/entry.S b/arch/riscv64/kernel/entry.S
index 815694b..1680a35 100644
--- a/arch/riscv64/kernel/entry.S
+++ b/arch/riscv64/kernel/entry.S
@@ -90,7 +90,7 @@ continue_trap:
save_regs
save_args
- mv t5, a0
+ mv a0, t5
call riscv_handle_interrupt
j _load_context
diff --git a/arch/riscv64/kernel/proc.c b/arch/riscv64/kernel/proc.c
index 55ccbb8..0c43b3d 100644
--- a/arch/riscv64/kernel/proc.c
+++ b/arch/riscv64/kernel/proc.c
@@ -8,6 +8,7 @@
#include <kmi/tcb.h>
#include <kmi/elf.h>
+#include <kmi/bkl.h>
#include <kmi/string.h>
#include <arch/proc.h>
@@ -27,6 +28,7 @@ void run_init(struct tcb *t, vm_t fdt, vm_t initrd)
* Could be fixed with a separate pure asm run_init, but I guess this
* works for now.
*/
+ bkl_unlock();
__asm__ volatile ("mv sp, %0\n"
"mv a0, %1\n"
"mv a1, %2\n"