aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/arch.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-05 19:38:11 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-05 19:38:11 +0300
commite09edb5d54e39bd9509a1dc450df5ab320759f97 (patch)
tree78e050b0db87df3a3ddfbb6570d44513ac34e02a /arch/riscv64/kernel/arch.c
parent98f21e694a6b0964d6d08196cb6bfbc1c2ae2ff4 (diff)
downloadkmi-e09edb5d54e39bd9509a1dc450df5ab320759f97.tar.gz
kmi-e09edb5d54e39bd9509a1dc450df5ab320759f97.zip
allow booting with Qemu's -kernel flag directly
+ Took some fairly significant changes, for one the kernel is no longer relocated at the start of a boot, instead it sits wherever the user decides the kernel should sit. Similarly, the initial kernel stack and page table are stored within the binary, slightly bloating the size but making it much safer to boot since there's really no chance of us overwriting the fdt or initrd in memory.
Diffstat (limited to 'arch/riscv64/kernel/arch.c')
-rw-r--r--arch/riscv64/kernel/arch.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/riscv64/kernel/arch.c b/arch/riscv64/kernel/arch.c
index ff2c04c..ec4cf43 100644
--- a/arch/riscv64/kernel/arch.c
+++ b/arch/riscv64/kernel/arch.c
@@ -19,7 +19,7 @@ id_t hartid_to_cpuid(id_t hart)
if (cpuid_to_hartid(i) == hart)
return i;
- error("failed to match hart id %ld to cpu id\n", hart);
+ error("failed to match hart id %ld to cpu id\n", (long)hart);
/* default to zero, though this should maybe be a panic? */
return 0;
}
@@ -27,7 +27,6 @@ id_t hartid_to_cpuid(id_t hart)
pm_t branch_to_satp(struct vmem *branch, enum mm_mode mode)
{
/* Sv57 && Sv64 in the future? */
- branch = (struct vmem *)__pa(branch);
pm_t pn = (pm_t)(branch) >> page_shift();
pm_t m = DEFAULT_Sv_MODE;