From 802d18a97098e5d1fd14924d04514944b5a0e21b Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 2 Aug 2008 20:11:11 +0000 Subject: [PATCH] Small semantical change of map_max_pages_need(): If given a 0 start address, it is supposed to consider the worst case address range of the given size. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26740 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_vm_translation_map.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 585dc04dca..47813057c4 100644 --- a/src/system/kernel/arch/x86/arch_vm_translation_map.cpp +++ b/src/system/kernel/arch/x86/arch_vm_translation_map.cpp @@ -328,6 +328,12 @@ put_page_table_entry_in_pgtable(page_table_entry *entry, static size_t 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; + end += 1023 * B_PAGE_SIZE; + } return VADDR_TO_PDENT(end) + 1 - VADDR_TO_PDENT(start); }