401957142fda9535d5a6cb3223956ab47c851354
[safe/jmp/linux-2.6] / arch / x86 / mach-generic / numaq.c
1 /*
2  * APIC driver for the IBM NUMAQ chipset.
3  */
4 #define APIC_DEFINITION 1
5 #include <linux/threads.h>
6 #include <linux/cpumask.h>
7 #include <asm/mpspec.h>
8 #include <asm/genapic.h>
9 #include <asm/fixmap.h>
10 #include <asm/apicdef.h>
11 #include <linux/kernel.h>
12 #include <linux/string.h>
13 #include <linux/init.h>
14 #include <asm/numaq/apicdef.h>
15 #include <linux/smp.h>
16 #include <asm/numaq/apic.h>
17 #include <asm/numaq/ipi.h>
18 #include <asm/numaq/mpparse.h>
19 #include <asm/numaq/wakecpu.h>
20 #include <asm/numaq.h>
21
22 static int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
23 {
24         numaq_mps_oem_check(mpc, oem, productid);
25         return found_numaq;
26 }
27
28 static int probe_numaq(void)
29 {
30         /* already know from get_memcfg_numaq() */
31         return found_numaq;
32 }
33
34 static void vector_allocation_domain(int cpu, cpumask_t *retmask)
35 {
36         /* Careful. Some cpus do not strictly honor the set of cpus
37          * specified in the interrupt destination when using lowest
38          * priority interrupt delivery mode.
39          *
40          * In particular there was a hyperthreading cpu observed to
41          * deliver interrupts to the wrong hyperthread when only one
42          * hyperthread was specified in the interrupt desitination.
43          */
44         *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
45 }
46
47 struct genapic apic_numaq = {
48
49         .name                           = "NUMAQ",
50         .probe                          = probe_numaq,
51         .acpi_madt_oem_check            = NULL,
52         .apic_id_registered             = numaq_apic_id_registered,
53
54         .irq_delivery_mode              = IRQ_DELIVERY_MODE,
55         .irq_dest_mode                  = IRQ_DEST_MODE,
56
57         .target_cpus                    = target_cpus,
58         .ESR_DISABLE                    = esr_disable,
59         .apic_destination_logical       = APIC_DEST_LOGICAL,
60         .check_apicid_used              = check_apicid_used,
61         .check_apicid_present           = check_apicid_present,
62
63         .no_balance_irq                 = NO_BALANCE_IRQ,
64         .no_ioapic_check                = 0,
65
66         .vector_allocation_domain       = vector_allocation_domain,
67         .init_apic_ldr                  = init_apic_ldr,
68
69         .ioapic_phys_id_map             = ioapic_phys_id_map,
70         .setup_apic_routing             = setup_apic_routing,
71         .multi_timer_check              = multi_timer_check,
72         .apicid_to_node                 = apicid_to_node,
73         .cpu_to_logical_apicid          = cpu_to_logical_apicid,
74         .cpu_present_to_apicid          = cpu_present_to_apicid,
75         .apicid_to_cpu_present          = apicid_to_cpu_present,
76         .setup_portio_remap             = setup_portio_remap,
77         .check_phys_apicid_present      = check_phys_apicid_present,
78         .enable_apic_mode               = enable_apic_mode,
79         .phys_pkg_id                    = phys_pkg_id,
80         .mps_oem_check                  = mps_oem_check,
81
82         .get_apic_id                    = get_apic_id,
83         .set_apic_id                    = NULL,
84         .apic_id_mask                   = APIC_ID_MASK,
85
86         .cpu_mask_to_apicid             = cpu_mask_to_apicid,
87         .cpu_mask_to_apicid_and         = cpu_mask_to_apicid_and,
88
89         .send_IPI_mask                  = send_IPI_mask,
90         .send_IPI_mask_allbutself       = NULL,
91         .send_IPI_allbutself            = send_IPI_allbutself,
92         .send_IPI_all                   = send_IPI_all,
93         .send_IPI_self                  = NULL,
94
95         .wakeup_cpu                     = NULL,
96         .trampoline_phys_low            = TRAMPOLINE_PHYS_LOW,
97         .trampoline_phys_high           = TRAMPOLINE_PHYS_HIGH,
98         .wait_for_init_deassert         = wait_for_init_deassert,
99         .smp_callin_clear_local_apic    = smp_callin_clear_local_apic,
100         .store_NMI_vector               = store_NMI_vector,
101         .restore_NMI_vector             = restore_NMI_vector,
102         .inquire_remote_apic            = inquire_remote_apic,
103 };