aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/arch.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-07 14:34:39 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-07 14:34:39 +0300
commitd592abd8ccc4026c51e196777031eb65c4acc4de (patch)
treebfcffec608ede13653a21a56a5b731a4178ecda3 /arch/riscv64/kernel/arch.c
parentd1c5e2700add7627e22c49a6021f200f03e8a62b (diff)
downloadkmi-d592abd8ccc4026c51e196777031eb65c4acc4de.tar.gz
kmi-d592abd8ccc4026c51e196777031eb65c4acc4de.zip
misc fixes
+ Align kernel to 2MiB boundary in u-boot + Optimize alignment functions a little bit, should still have to check on real hardware but 'feels' more clean + Add early boot debugging + Put extra cores we aren't ready to account for to sleep if/when they boot. + Make BASE_PAGE_SIZE constant on riscv64/32, helps the compiler with some alignment checks among other things.
Diffstat (limited to 'arch/riscv64/kernel/arch.c')
-rw-r--r--arch/riscv64/kernel/arch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/riscv64/kernel/arch.c b/arch/riscv64/kernel/arch.c
index ec4cf43..4561d8b 100644
--- a/arch/riscv64/kernel/arch.c
+++ b/arch/riscv64/kernel/arch.c
@@ -8,6 +8,8 @@
#include <kmi/assert.h>
#include <kmi/debug.h>
+#include <kmi/power.h>
+#include <kmi/bkl.h>
#include "csr.h"
#include "arch.h"
@@ -19,8 +21,11 @@ id_t hartid_to_cpuid(id_t hart)
if (cpuid_to_hartid(i) == hart)
return i;
+ /* put extra cores to sleep so they don't do anything bad */
error("failed to match hart id %ld to cpu id\n", (long)hart);
- /* default to zero, though this should maybe be a panic? */
+ bkl_unlock();
+ sleep();
+ /* should never really be reached but eh */
return 0;
}