default.c 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. #include <asm/mach-default/mach_wakecpu.h>
  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. /* should be called last. */
  34. static int probe_default(void)
  35. {
  36. return 1;
  37. }
  38. struct genapic apic_default = {
  39. .name = "default",
  40. .probe = probe_default,
  41. .acpi_madt_oem_check = NULL,
  42. .apic_id_registered = default_apic_id_registered,
  43. .irq_delivery_mode = dest_LowestPrio,
  44. /* logical delivery broadcast to all CPUs: */
  45. .irq_dest_mode = 1,
  46. .target_cpus = default_target_cpus,
  47. .disable_esr = 0,
  48. .dest_logical = APIC_DEST_LOGICAL,
  49. .check_apicid_used = default_check_apicid_used,
  50. .check_apicid_present = default_check_apicid_present,
  51. .vector_allocation_domain = default_vector_allocation_domain,
  52. .init_apic_ldr = default_init_apic_ldr,
  53. .ioapic_phys_id_map = default_ioapic_phys_id_map,
  54. .setup_apic_routing = default_setup_apic_routing,
  55. .multi_timer_check = NULL,
  56. .apicid_to_node = apicid_to_node,
  57. .cpu_to_logical_apicid = cpu_to_logical_apicid,
  58. .cpu_present_to_apicid = cpu_present_to_apicid,
  59. .apicid_to_cpu_present = apicid_to_cpu_present,
  60. .setup_portio_remap = setup_portio_remap,
  61. .check_phys_apicid_present = check_phys_apicid_present,
  62. .enable_apic_mode = enable_apic_mode,
  63. .phys_pkg_id = phys_pkg_id,
  64. .mps_oem_check = mps_oem_check,
  65. .get_apic_id = get_apic_id,
  66. .set_apic_id = NULL,
  67. .apic_id_mask = APIC_ID_MASK,
  68. .cpu_mask_to_apicid = cpu_mask_to_apicid,
  69. .cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
  70. .send_IPI_mask = send_IPI_mask,
  71. .send_IPI_mask_allbutself = NULL,
  72. .send_IPI_allbutself = send_IPI_allbutself,
  73. .send_IPI_all = send_IPI_all,
  74. .send_IPI_self = NULL,
  75. .wakeup_cpu = NULL,
  76. .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
  77. .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
  78. .wait_for_init_deassert = wait_for_init_deassert,
  79. .smp_callin_clear_local_apic = smp_callin_clear_local_apic,
  80. .store_NMI_vector = store_NMI_vector,
  81. .restore_NMI_vector = restore_NMI_vector,
  82. .inquire_remote_apic = inquire_remote_apic,
  83. };