fs: fix bugs that broke processes in userspace

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-21 05:50:22 -04:00
commit b603eacbb7
3 changed files with 6 additions and 7 deletions

View file

@ -126,7 +126,7 @@ void *krealloc(void *old, size_t size, u64 flags)
rbnode_t *node = rbt_search(&kalloc_tree, (u64)old);
if (!node)
return NULL;
return kalloc(size, flags);
struct alloc_entry *entry = (void *)node->value;

View file

@ -105,7 +105,7 @@ static void map_hhdm_zones(pgd_t *pgd_table)
}
hhdm_end = top_paddr;
device_base = ALIGN_UP(hhdm_end + PAGE_SIZE, PAGE_SIZE);
device_base = ALIGN_UP((u64)TO_VIRT(hhdm_end) + PAGE_SIZE, PAGE_SIZE);
for (paddr_t p = 0; p < top_paddr; p += 0x200000) {
vaddr_t v = (vaddr_t)TO_VIRT(p);