x86, apic: untangle the send_IPI_*() jungle
[linux-2.6-block.git] / arch / x86 / mach-generic / bigsmp.c
CommitLineData
637cba02 1/*
1da177e4
LT
2 * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
3 * Drives the local APIC in "clustered mode".
4 */
5#define APIC_DEFINITION 1
1da177e4
LT
6#include <linux/threads.h>
7#include <linux/cpumask.h>
8#include <asm/mpspec.h>
9#include <asm/genapic.h>
10#include <asm/fixmap.h>
11#include <asm/apicdef.h>
12#include <linux/kernel.h>
1da177e4
LT
13#include <linux/init.h>
14#include <linux/dmi.h>
1176fa91 15#include <asm/bigsmp/apicdef.h>
4696ca5b 16#include <linux/smp.h>
1176fa91
YL
17#include <asm/bigsmp/apic.h>
18#include <asm/bigsmp/ipi.h>
1da177e4 19#include <asm/mach-default/mach_mpparse.h>
569712b2 20#include <asm/mach-default/mach_wakecpu.h>
1da177e4
LT
21
22static int dmi_bigsmp; /* can be set by dmi scanners */
23
1855256c 24static int hp_ht_bigsmp(const struct dmi_system_id *d)
1da177e4 25{
1da177e4
LT
26 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
27 dmi_bigsmp = 1;
1da177e4
LT
28 return 0;
29}
30
31
1855256c 32static const struct dmi_system_id bigsmp_dmi_table[] = {
637cba02
PC
33 { hp_ht_bigsmp, "HP ProLiant DL760 G2",
34 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
35 DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
36 },
37
38 { hp_ht_bigsmp, "HP ProLiant DL740",
39 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
40 DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
41 },
1da177e4
LT
42 { }
43};
44
e2d40b18 45static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask)
497c9a19 46{
e7986739
MT
47 cpus_clear(*retmask);
48 cpu_set(cpu, *retmask);
497c9a19 49}
1da177e4 50
af669c97 51static int probe_bigsmp(void)
637cba02 52{
911a62d4 53 if (def_to_bigsmp)
e0da3364 54 dmi_bigsmp = 1;
911a62d4
VP
55 else
56 dmi_check_system(bigsmp_dmi_table);
637cba02
PC
57 return dmi_bigsmp;
58}
1da177e4 59
d26b6d66
IM
60struct genapic apic_bigsmp = {
61
62 .name = "bigsmp",
63 .probe = probe_bigsmp,
306db03b 64 .acpi_madt_oem_check = NULL,
7ed248da 65 .apic_id_registered = bigsmp_apic_id_registered,
d26b6d66 66
d8a3539e
IM
67 .irq_delivery_mode = dest_Fixed,
68 /* phys delivery to target CPU: */
69 .irq_dest_mode = 0,
d26b6d66 70
0a9cc20b 71 .target_cpus = bigsmp_target_cpus,
08125d3e 72 .disable_esr = 1,
bdb1a9b6 73 .dest_logical = 0,
d1d7cae8
IM
74 .check_apicid_used = bigsmp_check_apicid_used,
75 .check_apicid_present = bigsmp_check_apicid_present,
d26b6d66 76
e2d40b18 77 .vector_allocation_domain = bigsmp_vector_allocation_domain,
a5c43296 78 .init_apic_ldr = bigsmp_init_apic_ldr,
d26b6d66 79
d190cb87 80 .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map,
72ce0165 81 .setup_apic_routing = bigsmp_setup_apic_routing,
33a201fa 82 .multi_timer_check = NULL,
3f57a318 83 .apicid_to_node = bigsmp_apicid_to_node,
5257c511 84 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid,
a21769a4 85 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
8058714a 86 .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present,
d83093b5 87 .setup_portio_remap = NULL,
a27a6210 88 .check_phys_apicid_present = bigsmp_check_phys_apicid_present,
49040333 89 .enable_apic_mode = NULL,
cb8cc442 90 .phys_pkg_id = bigsmp_phys_pkg_id,
9c764247 91 .mps_oem_check = NULL,
d26b6d66 92
ca6c8ed4 93 .get_apic_id = bigsmp_get_apic_id,
d26b6d66 94 .set_apic_id = NULL,
94af1875 95 .apic_id_mask = 0xFF << 24,
d26b6d66 96
debccb3e
IM
97 .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid,
98 .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and,
d26b6d66 99
dac5f412 100 .send_IPI_mask = default_send_IPI_mask,
d26b6d66 101 .send_IPI_mask_allbutself = NULL,
dac5f412
IM
102 .send_IPI_allbutself = bigsmp_send_IPI_allbutself,
103 .send_IPI_all = bigsmp_send_IPI_all,
d26b6d66
IM
104 .send_IPI_self = NULL,
105
106 .wakeup_cpu = NULL,
107 .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
108 .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
109 .wait_for_init_deassert = wait_for_init_deassert,
110 .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
111 .store_NMI_vector = store_NMI_vector,
112 .restore_NMI_vector = restore_NMI_vector,
113 .inquire_remote_apic = inquire_remote_apic,
114};