aboutsummaryrefslogtreecommitdiff
path: root/common/pmem.c
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 /common/pmem.c
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 'common/pmem.c')
-rw-r--r--common/pmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/pmem.c b/common/pmem.c
index 16e6adf..22a1493 100644
--- a/common/pmem.c
+++ b/common/pmem.c
@@ -609,8 +609,8 @@ void init_pmem(void *fdt)
stat_pmem_conf(fdt, &max_order, &base_bits, bits);
init_mem(max_order, bits, base_bits);
- pm_t ram_size = __get_ramtop(fdt) - RAM_BASE;
- pm_t ram_base = (pm_t)__va(RAM_BASE);
+ pm_t ram_size = __get_ramtop(fdt) - get_ram_base();
+ pm_t ram_base = (pm_t)__va(get_ram_base());
pm_t initrd_top = get_initrdtop(fdt);
pm_t fdt_top = __get_fdttop(fdt);
@@ -629,7 +629,7 @@ void init_pmem(void *fdt)
/* mark init stack, this should be unmapped once we get to executing
* processes */
- __mark_area_used((pm_t)__va(PM_STACK_BASE), (pm_t)__va(PM_STACK_TOP));
+ __mark_area_used(VM_STACK_BASE, VM_STACK_TOP);
/* mark kernel */
/* this could be made more explicit, I suppose. */