unsigned long phys_cpu_present_map;
int summit_x86 = 0;
+u8 raw_phys_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
/*
* Intel MP BIOS table parsing routines:
if (clustered_apic_mode) {
phys_cpu_present_map |= (logical_apicid&0xf) << (4*quad);
} else {
- phys_cpu_present_map |= 1 << m->mpc_apicid;
+ phys_cpu_present_map |= apicid_to_cpu_present(m->mpc_apicid);
}
/*
* Validate version
ver = 0x10;
}
apic_version[m->mpc_apicid] = ver;
+ raw_phys_apicid[num_processors - 1] = m->mpc_apicid;
}
static void __init MP_bus_info (struct mpc_config_bus *m)
#include <asm/desc.h>
#include <asm/arch_hooks.h>
#include "smpboot_hooks.h"
+#include "mach_apic.h"
/* Set if we find a B stepping CPU */
static int __initdata smp_b_stepping;
(clustered_apic_mode ? "NUMA-Q" : "Flat"), nr_ioapics);
}
+static inline int cpu_present_to_apicid(int mps_cpu)
+{
+ if (clustered_apic_mode)
+ return ( ((mps_cpu/4)*16) + (1<<(mps_cpu%4)) );
+ else
+ return mps_cpu;
+}
+
+static inline unsigned long apicid_to_cpu_present(int apicid)
+{
+ return (1ul << apicid);
+}
+
#endif /* __ASM_MACH_APIC_H */
(x86_summit ? "Summit" : "Flat"), nr_ioapics);
}
+static inline int cpu_present_to_apicid(int mps_cpu)
+{
+ if (x86_summit)
+ return (int) raw_phys_apicid[mps_cpu];
+ else
+ return mps_cpu;
+}
+
+static inline unsigned long apicid_to_phys_cpu_present(int apicid)
+{
+ if (x86_summit)
+ return (1ul << (((apicid >> 4) << 2) | (apicid & 0x3)));
+ else
+ return (1ul << apicid);
+}
+
#endif /* __ASM_MACH_APIC_H */
/*
* a maximum of 16 APICs with the current APIC ID architecture.
*/
-#ifdef CONFIG_X86_NUMAQ
+#ifdef CONFIG_X86_NUMA
#define MAX_APICS 256
-#else /* !CONFIG_X86_NUMAQ */
+#else /* !CONFIG_X86_NUMA */
#define MAX_APICS 16
-#endif /* CONFIG_X86_NUMAQ */
+#endif /* CONFIG_X86_NUMA */
#define MAX_MPC_ENTRY 1024
* the real APIC ID <-> CPU # mapping.
*/
#define MAX_APICID 256
+#define BAD_APICID 0xFFu
extern volatile int cpu_to_physical_apicid[NR_CPUS];
extern volatile int physical_apicid_to_cpu[MAX_APICID];
extern volatile int cpu_to_logical_apicid[NR_CPUS];
#define boot_cpu_apicid boot_cpu_physical_apicid
#endif /* CONFIG_CLUSTERED_APIC */
-/*
- * How to map from the cpu_present_map
- */
-#ifdef CONFIG_CLUSTERED_APIC
- #define cpu_present_to_apicid(mps_cpu) ( ((mps_cpu/4)*16) + (1<<(mps_cpu%4)) )
-#else /* !CONFIG_CLUSTERED_APIC */
- #define cpu_present_to_apicid(apicid) (apicid)
-#endif /* CONFIG_CLUSTERED_APIC */
-
/*
* Mappings between logical cpu number and logical / physical apicid
* The first four macros are trivial, but it keeps the abstraction consistent