sandbox: vm: add temporary vm_virt_to_phys() implementation

This commit is contained in:
2023-02-02 21:06:04 +00:00
parent 90dd51008f
commit c47da5864c
3 changed files with 17 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ static struct mem_map_region mem_map[] = {
{ .base = 0x00800000, .limit = MB_TO_BYTES(MEMORY_SIZE_MB) - 1, .status = REGION_FREE },
};
extern void tmp_set_vaddr_base(void *);
extern void tmp_set_vaddr_base(void *, size_t);
/* virtual address of where system memory is mapped */
static void *system_memory = NULL;
@@ -110,7 +110,9 @@ int memory_test(void)
}
}
tmp_set_vaddr_base(system_memory);
printf("virtual memory range: 0x%" PRIxPTR "-0x%" PRIxPTR "\n", (uintptr_t)system_memory, (uintptr_t)system_memory + MB_TO_BYTES(MEMORY_SIZE_MB));
tmp_set_vaddr_base(system_memory, MB_TO_BYTES(MEMORY_SIZE_MB));
memblock_add(pmem_base, pmem_limit + 1);
for (size_t i = 0; i < nr_mem_map_entries; i++) {