From c855ebba084377ff9f61df01333bcb5ea92174a3 Mon Sep 17 00:00:00 2001 From: Jordan Gordeev Date: Mon, 6 Jul 2009 14:12:33 +0300 Subject: [PATCH] amd64: Sync mp_bootaddress() with FreeBSD. Changed to match invocation in 'machdep.c'. --- sys/platform/pc64/amd64/mp_machdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/platform/pc64/amd64/mp_machdep.c b/sys/platform/pc64/amd64/mp_machdep.c index ce94a078fe..7fef311c3f 100644 --- a/sys/platform/pc64/amd64/mp_machdep.c +++ b/sys/platform/pc64/amd64/mp_machdep.c @@ -316,12 +316,12 @@ mp_bootaddress(u_int basemem) { POSTCODE(MP_BOOTADDRESS_POST); - bootMP_size = mptramp_end - mptramp_start; base_memory = basemem; - boot_address = base_memory & ~0xfff; /* round down to 4k boundary */ - if ((base_memory - boot_address) < bootMP_size) - boot_address -= 4096; /* not enough, lower by 4k */ + bootMP_size = mptramp_end - mptramp_start; + boot_address = trunc_page(basemem * 1024); /* round down to 4k boundary */ + if (((basemem * 1024) - boot_address) < bootMP_size) + boot_address -= PAGE_SIZE; /* not enough, lower by 4k */ /* 3 levels of page table pages */ mptramp_pagetables = boot_address - (PAGE_SIZE * 3); -- 2.41.0