e3c5114fd91d89d8b7ece2e9054ac31ab4d343ba
[safe/jmp/linux-2.6] / arch / x86 / mach-generic / default.c
1 /*
2  * Default generic APIC driver. This handles up to 8 CPUs.
3  */
4 #define APIC_DEFINITION 1
5 #include <linux/threads.h>
6 #include <linux/cpumask.h>
7 #include <asm/mpspec.h>
8 #include <asm/mach-default/mach_apicdef.h>
9 #include <asm/genapic.h>
10 #include <asm/fixmap.h>
11 #include <asm/apicdef.h>
12 #include <linux/kernel.h>
13 #include <linux/string.h>
14 #include <linux/smp.h>
15 #include <linux/init.h>
16 #include <asm/mach-default/mach_apic.h>
17 #include <asm/mach-default/mach_ipi.h>
18 #include <asm/mach-default/mach_mpparse.h>
19
20 static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
21 {
22         /*
23          * Careful. Some cpus do not strictly honor the set of cpus
24          * specified in the interrupt destination when using lowest
25          * priority interrupt delivery mode.
26          *
27          * In particular there was a hyperthreading cpu observed to
28          * deliver interrupts to the wrong hyperthread when only one
29          * hyperthread was specified in the interrupt desitination.
30          */
31         *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } };
32 }
33
34 /* should be called last. */
35 static int probe_default(void)
36 {
37         return 1;
38 }
39
40 struct genapic apic_default = {
41
42         .name                           = "default",
43         .probe                          = probe_default,
44         .acpi_madt_oem_check            = NULL,
45         .apic_id_registered             = default_apic_id_registered,
46
47         .irq_delivery_mode              = dest_LowestPrio,
48         /* logical delivery broadcast to all CPUs: */
49         .irq_dest_mode                  = 1,
50
51         .target_cpus                    = default_target_cpus,
52         .disable_esr                    = 0,
53         .dest_logical                   = APIC_DEST_LOGICAL,
54         .check_apicid_used              = default_check_apicid_used,
55         .check_apicid_present           = default_check_apicid_present,
56
57         .vector_allocation_domain       = default_vector_allocation_domain,
58         .init_apic_ldr                  = default_init_apic_ldr,
59
60         .ioapic_phys_id_map             = default_ioapic_phys_id_map,
61         .setup_apic_routing             = default_setup_apic_routing,
62         .multi_timer_check              = NULL,
63         .apicid_to_node                 = default_apicid_to_node,
64         .cpu_to_logical_apicid          = default_cpu_to_logical_apicid,
65         .cpu_present_to_apicid          = default_cpu_present_to_apicid,
66         .apicid_to_cpu_present          = default_apicid_to_cpu_present,
67         .setup_portio_remap             = NULL,
68         .check_phys_apicid_present      = default_check_phys_apicid_present,
69         .enable_apic_mode               = NULL,
70         .phys_pkg_id                    = default_phys_pkg_id,
71         .mps_oem_check                  = NULL,
72
73         .get_apic_id                    = default_get_apic_id,
74         .set_apic_id                    = NULL,
75         .apic_id_mask                   = 0x0F << 24,
76
77         .cpu_mask_to_apicid             = default_cpu_mask_to_apicid,
78         .cpu_mask_to_apicid_and         = default_cpu_mask_to_apicid_and,
79
80         .send_IPI_mask                  = default_send_IPI_mask,
81         .send_IPI_mask_allbutself       = NULL,
82         .send_IPI_allbutself            = default_send_IPI_allbutself,
83         .send_IPI_all                   = default_send_IPI_all,
84         .send_IPI_self                  = NULL,
85
86         .wakeup_cpu                     = NULL,
87         .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
88         .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
89
90         .wait_for_init_deassert         = default_wait_for_init_deassert,
91
92         .smp_callin_clear_local_apic    = NULL,
93         .store_NMI_vector               = NULL,
94         .inquire_remote_apic            = default_inquire_remote_apic,
95 };