aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-05-11 22:55:31 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-05-11 22:55:31 +0300
commit27ffa747f36aee9c1d5bbc61395a078238366070 (patch)
treef37c544aaca6bebd1cc146d1eb002483c7cfd474 /arch/riscv64/kernel
parent3109effe7297232e17c1792e63c3a9c7d129a4eb (diff)
downloadkmi-27ffa747f36aee9c1d5bbc61395a078238366070.tar.gz
kmi-27ffa747f36aee9c1d5bbc61395a078238366070.zip
arbitrary load address and RAM base detection
+ Both kind of go hand in hand, made sense to do both at the same time. Some parts feel slightly hacky, the loader works by placing everything on the stack and avoiding global values. Still, seems to work?
Diffstat (limited to 'arch/riscv64/kernel')
-rw-r--r--arch/riscv64/kernel/vmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv64/kernel/vmem.c b/arch/riscv64/kernel/vmem.c
index 6fd7069..d0cac2c 100644
--- a/arch/riscv64/kernel/vmem.c
+++ b/arch/riscv64/kernel/vmem.c
@@ -427,7 +427,7 @@ stat_t populate_kvmem(struct vmem *b)
size_t flags = VM_V | VM_R | VM_W | VM_X | VM_G;
for (size_t i = KSTART_PAGE; i < IO_PAGE; ++i)
b->leaf[i] = (struct vmem *)to_pte(
- RAM_BASE + TOP_PAGE_SIZE * (i - KSTART_PAGE), flags);
+ get_ram_base() + TOP_PAGE_SIZE * (i - KSTART_PAGE), flags);
/* map in IO region */
map_io_dbg(b);