default.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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/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/smp.h>
  14. #include <linux/init.h>
  15. #include <asm/genapic.h>
  16. #include <asm/mach-default/mach_ipi.h>
  17. static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
  18. {
  19. /*
  20. * Careful. Some cpus do not strictly honor the set of cpus
  21. * specified in the interrupt destination when using lowest
  22. * priority interrupt delivery mode.
  23. *
  24. * In particular there was a hyperthreading cpu observed to
  25. * deliver interrupts to the wrong hyperthread when only one
  26. * hyperthread was specified in the interrupt desitination.
  27. */
  28. *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } };
  29. }
  30. /* should be called last. */
  31. static int probe_default(void)
  32. {
  33. return 1;
  34. }
  35. struct genapic apic_default = {
  36. .name = "default",
  37. .probe = probe_default,
  38. .acpi_madt_oem_check = NULL,
  39. .apic_id_registered = default_apic_id_registered,
  40. .irq_delivery_mode = dest_LowestPrio,
  41. /* logical delivery broadcast to all CPUs: */
  42. .irq_dest_mode = 1,
  43. .target_cpus = default_target_cpus,
  44. .disable_esr = 0,
  45. .dest_logical = APIC_DEST_LOGICAL,
  46. .check_apicid_used = default_check_apicid_used,
  47. .check_apicid_present = default_check_apicid_present,
  48. .vector_allocation_domain = default_vector_allocation_domain,
  49. .init_apic_ldr = default_init_apic_ldr,
  50. .ioapic_phys_id_map = default_ioapic_phys_id_map,
  51. .setup_apic_routing = default_setup_apic_routing,
  52. .multi_timer_check = NULL,
  53. .apicid_to_node = default_apicid_to_node,
  54. .cpu_to_logical_apicid = default_cpu_to_logical_apicid,
  55. .cpu_present_to_apicid = default_cpu_present_to_apicid,
  56. .apicid_to_cpu_present = default_apicid_to_cpu_present,
  57. .setup_portio_remap = NULL,
  58. .check_phys_apicid_present = default_check_phys_apicid_present,
  59. .enable_apic_mode = NULL,
  60. .phys_pkg_id = default_phys_pkg_id,
  61. .mps_oem_check = NULL,
  62. .get_apic_id = default_get_apic_id,
  63. .set_apic_id = NULL,
  64. .apic_id_mask = 0x0F << 24,
  65. .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
  66. .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
  67. .send_IPI_mask = default_send_IPI_mask,
  68. .send_IPI_mask_allbutself = NULL,
  69. .send_IPI_allbutself = default_send_IPI_allbutself,
  70. .send_IPI_all = default_send_IPI_all,
  71. .send_IPI_self = NULL,
  72. .wakeup_cpu = NULL,
  73. .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
  74. .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
  75. .wait_for_init_deassert = default_wait_for_init_deassert,
  76. .smp_callin_clear_local_apic = NULL,
  77. .store_NMI_vector = NULL,
  78. .inquire_remote_apic = default_inquire_remote_apic,
  79. };