aboutsummaryrefslogtreecommitdiff
path: root/common/pmem.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-01-06 17:41:38 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-01-06 17:41:38 +0200
commit513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f (patch)
treea4d2cc6cc0bd0990c282d6163767fbfaa12d0718 /common/pmem.c
parent6f052e236715846b1a14f9fe59f89346efb809e6 (diff)
downloadkmi-513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f.tar.gz
kmi-513a8d20beeacb3a7fc2c3c140d014f7fb25cd6f.zip
Jump back to kernelspace tested
+ Added automated categories to debugging, bug/info/warn/error etc. Now I should just try to use them here and there :D
Diffstat (limited to 'common/pmem.c')
-rw-r--r--common/pmem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/pmem.c b/common/pmem.c
index c919204..ae01175 100644
--- a/common/pmem.c
+++ b/common/pmem.c
@@ -1,3 +1,4 @@
+#include <apos/mem_nodes.h>
#include <apos/pmem.h>
#include <apos/dev.h>
#include <apos/debug.h>
@@ -426,7 +427,7 @@ void init_pmem(void *fdt)
size_t actual_size = populate_pmap(ram_base, ram_size, pmap_base);
if(probe_size != actual_size)
- dbg("BUG! probe_size (%#lx) != actual_size (%#lx)\n",
+ bug("probe_size (%#lx) != actual_size (%#lx)\n",
probe_size, actual_size);
/* mark init stack, this should be unmapped once we get to executing
@@ -434,7 +435,8 @@ void init_pmem(void *fdt)
mark_area_used((pm_t)__va(PM_STACK_BASE), (pm_t)__va(PM_STACK_TOP));
/* mark kernel */
- mark_area_used((pm_t)__va(PM_KERN_BASE), (pm_t)__va(PM_KERN_TOP));
+ /* this could be made more explicit, I suppose. */
+ mark_area_used(VM_KERN, VM_KERN + PM_KERN_SIZE);
/* mark fdt and initrd */
mark_area_used(get_initrdbase(fdt), initrd_top);
@@ -446,5 +448,7 @@ void init_pmem(void *fdt)
/* mark reserved mem */
mark_reserved_mem(fdt);
+ init_mem_blocks();
+
init_devmem((pm_t)__pa(ram_base), (pm_t)__pa(ram_base + ram_size));
}