diff --git a/src/system/kernel/arch/x86/arch_vm_translation_map.cpp b/src/system/kernel/arch/x86/arch_vm_translation_map.cpp index 59abd88f4c..8a6e77bf30 100644 --- a/src/system/kernel/arch/x86/arch_vm_translation_map.cpp +++ b/src/system/kernel/arch/x86/arch_vm_translation_map.cpp @@ -295,10 +295,9 @@ map_max_pages_need(vm_translation_map */*map*/, addr_t start, addr_t end) { // If start == 0, the actual base address is not yet known to the caller and // we shall assume the worst case. - if (start == 0) { - start = 1023 * B_PAGE_SIZE; + if (start == 0) end += 1023 * B_PAGE_SIZE; - } + return VADDR_TO_PDENT(end) + 1 - VADDR_TO_PDENT(start); }