From 8936cd9b376e2231ba0e4767a55e2e7d3ed80465 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 1 Jun 2011 14:32:04 +0800 Subject: [PATCH] x86_64: Move base_memory from mp_machdep.c to machdep.c --- sys/platform/pc64/x86_64/machdep.c | 5 ++++- sys/platform/pc64/x86_64/mp_machdep.c | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/platform/pc64/x86_64/machdep.c b/sys/platform/pc64/x86_64/machdep.c index a5ede79c9e..0336032e55 100644 --- a/sys/platform/pc64/x86_64/machdep.c +++ b/sys/platform/pc64/x86_64/machdep.c @@ -178,6 +178,8 @@ int imcr_present = 0; int naps = 0; /* # of Applications processors */ +u_int base_memory; + static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { @@ -1433,9 +1435,10 @@ getmemsize(caddr_t kmdp, u_int64_t first) physmap[physmap_idx + 1] = smap->base + smap->length; } + base_memory = physmap[1] / 1024; #ifdef SMP /* make hole for AP bootstrap code */ - physmap[1] = mp_bootaddress(physmap[1] / 1024); + physmap[1] = mp_bootaddress(base_memory); #endif /* Save EBDA address, if any */ diff --git a/sys/platform/pc64/x86_64/mp_machdep.c b/sys/platform/pc64/x86_64/mp_machdep.c index 5f100357b7..bcbcc444d3 100644 --- a/sys/platform/pc64/x86_64/mp_machdep.c +++ b/sys/platform/pc64/x86_64/mp_machdep.c @@ -174,8 +174,6 @@ cpumask_t smp_active_mask = 1; /* which cpus are ready for IPIs etc? */ SYSCTL_INT(_machdep, OID_AUTO, smp_active, CTLFLAG_RD, &smp_active_mask, 0, ""); static u_int bootMP_size; -u_int base_memory; - /* * Calculate usable address in base memory for AP trampoline code. */ @@ -184,8 +182,6 @@ mp_bootaddress(u_int basemem) { POSTCODE(MP_BOOTADDRESS_POST); - base_memory = basemem; - bootMP_size = mptramp_end - mptramp_start; boot_address = trunc_page(basemem * 1024); /* round down to 4k boundary */ if (((basemem * 1024) - boot_address) < bootMP_size) -- 2.41.0