diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-07-07 07:02:46 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-07-07 07:02:46 +0300 |
| commit | b97967ab660243b723f246db03c2e4a82e125f3f (patch) | |
| tree | d30ef3f9dbbc33453c868282b749018659fb6a6b /src/pmem.c | |
| parent | 122374c362ba8bb9082385da3c82e264ab594f15 (diff) | |
| download | kmi-b97967ab660243b723f246db03c2e4a82e125f3f.tar.gz kmi-b97967ab660243b723f246db03c2e4a82e125f3f.zip | |
simplify assertions
+ No real point having multiple different levels of assertions, just say
you assert something and be done with it
Diffstat (limited to 'src/pmem.c')
| -rw-r--r-- | src/pmem.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -564,7 +564,7 @@ static size_t build_reserved_map(size_t exists, struct avoid_region avoid[64], pm_t size = (pm_t)fdt_load_reg_size(ci, rmem_reg, 0); avoid[exists++] = (struct avoid_region){(pm_t)__va(base), size}; - catastrophic_assert(exists < 64); + assert(exists < 64); } return exists; @@ -636,10 +636,14 @@ void init_pmem(void *fdt, uintptr_t load_addr) info("found initrd at [%lx - %lx]\n", initrd_base, initrd_base + initrd_size); + assert(is_aligned(initrd_base, BASE_PAGE_SIZE)); + pm_t fdt_base = (pm_t)fdt; pm_t fdt_size = fdt_totalsize(fdt); info("found fdt at [%lx - %lx]\n", fdt_base, fdt_base + fdt_size); + assert(is_aligned(fdt_base, BASE_PAGE_SIZE)); + /* find probably most suitable contiguous region of ram for our physical * ram map */ @@ -661,7 +665,7 @@ void init_pmem(void *fdt, uintptr_t load_addr) pm_t pmap_base = select_base(ram_base, ram_size, probe_size, avoid_count, avoid); - catastrophic_assert(pmap_base); + assert(pmap_base); info("choosing to place pmem map at %lx\n", pmap_base); size_t actual_size = populate_pmap(ram_base, ram_size, pmap_base); |
