aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
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 /src/main.c
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 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 506d7fe..33d9596 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,6 +14,7 @@
#include <kmi/debug.h>
#include <kmi/vmem.h>
#include <kmi/irq.h>
+#include <kmi/bkl.h>
#include <arch/arch.h>
#include <arch/proc.h>
#include <arch/smp.h>
@@ -60,6 +61,8 @@ __noreturn void kernel(void *fdt, uintptr_t load_addr, struct vmem *d)
/* we should be in kernelspace, so use the virtual address of our FDT. */
fdt = __va(fdt);
+ bkl_lock();
+
/* dbg uses direct mapping at this point */
init_dbg(fdt);
/* start up debugging in kernel IO */
@@ -101,6 +104,8 @@ __noreturn void main(unsigned long hart, void *fdt, uintptr_t load_addr)
* have to get the function signature right */
(void)hart;
+ /** @todo some kind of lottery? */
+
pm_t ram_base = __fdt_ram_base(fdt);
pm_t ram_size = __fdt_ram_size(fdt);
set_ram_base(ram_base);