Paolo Ciarrocchi | 651bbe1 | 2008-02-20 00:02:58 +0100 | [diff] [blame] | 1 | /* |
Simon Arlott | 27b46d7 | 2007-10-20 01:13:56 +0200 | [diff] [blame] | 2 | * Default generic APIC driver. This handles up to 8 CPUs. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | */ |
| 4 | #define APIC_DEFINITION 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Yinghai Lu | 569712b | 2008-11-16 03:12:49 -0800 | [diff] [blame] | 19 | #include <asm/mach-default/mach_wakecpu.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
Ingo Molnar | e2d40b1 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 21 | static void default_vector_allocation_domain(int cpu, struct cpumask *retmask) |
| 22 | { |
| 23 | /* |
| 24 | * Careful. Some cpus do not strictly honor the set of cpus |
| 25 | * specified in the interrupt destination when using lowest |
| 26 | * priority interrupt delivery mode. |
| 27 | * |
| 28 | * In particular there was a hyperthreading cpu observed to |
| 29 | * deliver interrupts to the wrong hyperthread when only one |
| 30 | * hyperthread was specified in the interrupt desitination. |
| 31 | */ |
| 32 | *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } }; |
| 33 | } |
| 34 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | /* should be called last. */ |
Vivek Goyal | e96763d | 2007-01-11 01:52:44 +0100 | [diff] [blame] | 36 | static int probe_default(void) |
Paolo Ciarrocchi | 651bbe1 | 2008-02-20 00:02:58 +0100 | [diff] [blame] | 37 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | return 1; |
Paolo Ciarrocchi | 651bbe1 | 2008-02-20 00:02:58 +0100 | [diff] [blame] | 39 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Ingo Molnar | 0a7e8c6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 41 | struct genapic apic_default = { |
| 42 | |
| 43 | .name = "default", |
| 44 | .probe = probe_default, |
Ingo Molnar | 306db03 | 2009-01-28 03:43:47 +0100 | [diff] [blame] | 45 | .acpi_madt_oem_check = NULL, |
Ingo Molnar | 7ed248d | 2009-01-28 03:43:47 +0100 | [diff] [blame] | 46 | .apic_id_registered = default_apic_id_registered, |
Ingo Molnar | 0a7e8c6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 47 | |
Ingo Molnar | dcafa4a | 2009-01-28 04:16:01 +0100 | [diff] [blame] | 48 | .irq_delivery_mode = dest_LowestPrio, |
| 49 | /* logical delivery broadcast to all CPUs: */ |
| 50 | .irq_dest_mode = 1, |
Ingo Molnar | 0a7e8c6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 51 | |
Ingo Molnar | 0a9cc20 | 2009-01-28 04:30:40 +0100 | [diff] [blame] | 52 | .target_cpus = default_target_cpus, |
Ingo Molnar | 08125d3 | 2009-01-28 05:08:44 +0100 | [diff] [blame] | 53 | .disable_esr = 0, |
Ingo Molnar | bdb1a9b | 2009-01-28 05:29:25 +0100 | [diff] [blame] | 54 | .dest_logical = APIC_DEST_LOGICAL, |
Ingo Molnar | d1d7cae | 2009-01-28 05:41:42 +0100 | [diff] [blame] | 55 | .check_apicid_used = default_check_apicid_used, |
| 56 | .check_apicid_present = default_check_apicid_present, |
Ingo Molnar | 0a7e8c6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 57 | |
Ingo Molnar | e2d40b1 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 58 | .vector_allocation_domain = default_vector_allocation_domain, |
Ingo Molnar | a5c4329 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 59 | .init_apic_ldr = default_init_apic_ldr, |
Ingo Molnar | 0a7e8c6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 60 | |
Ingo Molnar | d190cb8 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 61 | .ioapic_phys_id_map = default_ioapic_phys_id_map, |
Ingo Molnar | 72ce016 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 62 | .setup_apic_routing = default_setup_apic_routing, |
Ingo Molnar | 33a201f | 2009-01-28 07:17:26 +0100 | [diff] [blame] | 63 | .multi_timer_check = NULL, |
Ingo Molnar | 3f57a31 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 64 | .apicid_to_node = default_apicid_to_node, |
Ingo Molnar | 5257c51 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 65 | .cpu_to_logical_apicid = default_cpu_to_logical_apicid, |
Ingo Molnar | a21769a4 | 2009-01-28 06:50:47 +0100 | [diff] [blame] | 66 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
Ingo Molnar | 8058714 | 2009-01-28 06:50:47 +0100 | [diff] [blame^] | 67 | .apicid_to_cpu_present = default_apicid_to_cpu_present, |
Ingo Molnar | 0a7e8c6 | 2009-01-28 03:32:03 +0100 | [diff] [blame] | 68 | .setup_portio_remap = setup_portio_remap, |
| 69 | .check_phys_apicid_present = check_phys_apicid_present, |
| 70 | .enable_apic_mode = enable_apic_mode, |
| 71 | .phys_pkg_id = phys_pkg_id, |
| 72 | .mps_oem_check = mps_oem_check, |
| 73 | |
| 74 | .get_apic_id = get_apic_id, |
| 75 | .set_apic_id = NULL, |
| 76 | .apic_id_mask = APIC_ID_MASK, |
| 77 | |
| 78 | .cpu_mask_to_apicid = cpu_mask_to_apicid, |
| 79 | .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and, |
| 80 | |
| 81 | .send_IPI_mask = send_IPI_mask, |
| 82 | .send_IPI_mask_allbutself = NULL, |
| 83 | .send_IPI_allbutself = send_IPI_allbutself, |
| 84 | .send_IPI_all = send_IPI_all, |
| 85 | .send_IPI_self = NULL, |
| 86 | |
| 87 | .wakeup_cpu = NULL, |
| 88 | .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, |
| 89 | .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, |
| 90 | .wait_for_init_deassert = wait_for_init_deassert, |
| 91 | .smp_callin_clear_local_apic = smp_callin_clear_local_apic, |
| 92 | .store_NMI_vector = store_NMI_vector, |
| 93 | .restore_NMI_vector = restore_NMI_vector, |
| 94 | .inquire_remote_apic = inquire_remote_apic, |
| 95 | }; |