aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/genapic_flat_64.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-07-22 01:08:21 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-22 03:09:15 -0400
commit1b9b89e7f163336ad84200b66a17284dbf26aced (patch)
treee5f84e8c4e63de6029c38d10c979054014599874 /arch/x86/kernel/genapic_flat_64.c
parent76c3bb15d6786a0b8da0ad0090e0c9c3672fc08b (diff)
x86: add apic probe for genapic 64bit, v2
introducing an APIC handling probing abstraction: static struct genapic *apic_probe[] __initdata = { &apic_x2apic_uv_x, &apic_x2apic_phys, &apic_x2apic_cluster, &apic_physflat, NULL, }; This way we can remove UV, x2apic specific code from genapic_64.c and move them to their specific genapic files. [ v2: fix compiling when CONFIG_ACPI is not set ] Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/genapic_flat_64.c')
-rw-r--r--arch/x86/kernel/genapic_flat_64.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 2c973cbf054f..1740b83329f6 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -21,6 +21,15 @@
21#include <asm/genapic.h> 21#include <asm/genapic.h>
22#include <mach_apicdef.h> 22#include <mach_apicdef.h>
23 23
24#ifdef CONFIG_ACPI
25#include <acpi/acpi_bus.h>
26#endif
27
28static int __init flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
29{
30 return 1;
31}
32
24static cpumask_t flat_target_cpus(void) 33static cpumask_t flat_target_cpus(void)
25{ 34{
26 return cpu_online_map; 35 return cpu_online_map;
@@ -138,6 +147,7 @@ static unsigned int phys_pkg_id(int index_msb)
138 147
139struct genapic apic_flat = { 148struct genapic apic_flat = {
140 .name = "flat", 149 .name = "flat",
150 .acpi_madt_oem_check = flat_acpi_madt_oem_check,
141 .int_delivery_mode = dest_LowestPrio, 151 .int_delivery_mode = dest_LowestPrio,
142 .int_dest_mode = (APIC_DEST_LOGICAL != 0), 152 .int_dest_mode = (APIC_DEST_LOGICAL != 0),
143 .target_cpus = flat_target_cpus, 153 .target_cpus = flat_target_cpus,
@@ -160,6 +170,21 @@ struct genapic apic_flat = {
160 * We cannot use logical delivery in this case because the mask 170 * We cannot use logical delivery in this case because the mask
161 * overflows, so use physical mode. 171 * overflows, so use physical mode.
162 */ 172 */
173static int __init physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
174{
175#ifdef CONFIG_ACPI
176 /*
177 * Quirk: some x86_64 machines can only use physical APIC mode
178 * regardless of how many processors are present (x86_64 ES7000
179 * is an example).
180 */
181 if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID &&
182 (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL))
183 return 1;
184#endif
185
186 return 0;
187}
163 188
164static cpumask_t physflat_target_cpus(void) 189static cpumask_t physflat_target_cpus(void)
165{ 190{
@@ -206,6 +231,7 @@ static unsigned int physflat_cpu_mask_to_apicid(cpumask_t cpumask)
206 231
207struct genapic apic_physflat = { 232struct genapic apic_physflat = {
208 .name = "physical flat", 233 .name = "physical flat",
234 .acpi_madt_oem_check = physflat_acpi_madt_oem_check,
209 .int_delivery_mode = dest_Fixed, 235 .int_delivery_mode = dest_Fixed,
210 .int_dest_mode = (APIC_DEST_PHYSICAL != 0), 236 .int_dest_mode = (APIC_DEST_PHYSICAL != 0),
211 .target_cpus = physflat_target_cpus, 237 .target_cpus = physflat_target_cpus,