x86_64: Move base_memory from mp_machdep.c to machdep.c
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 1 Jun 2011 06:32:04 +0000 (14:32 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 1 Jun 2011 09:31:02 +0000 (17:31 +0800)
sys/platform/pc64/x86_64/machdep.c
sys/platform/pc64/x86_64/mp_machdep.c

index a5ede79..0336032 100644 (file)
@@ -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 */
index 5f10035..bcbcc44 100644 (file)
@@ -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)