genapic_32.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #ifndef _ASM_X86_GENAPIC_32_H
  2. #define _ASM_X86_GENAPIC_32_H
  3. #include <asm/mpspec.h>
  4. #include <asm/atomic.h>
  5. /*
  6. * Generic APIC driver interface.
  7. *
  8. * An straight forward mapping of the APIC related parts of the
  9. * x86 subarchitecture interface to a dynamic object.
  10. *
  11. * This is used by the "generic" x86 subarchitecture.
  12. *
  13. * Copyright 2003 Andi Kleen, SuSE Labs.
  14. */
  15. struct mpc_config_bus;
  16. struct mp_config_table;
  17. struct mpc_config_processor;
  18. struct genapic {
  19. char *name;
  20. int (*probe)(void);
  21. int (*apic_id_registered)(void);
  22. const struct cpumask *(*target_cpus)(void);
  23. int int_delivery_mode;
  24. int int_dest_mode;
  25. int ESR_DISABLE;
  26. int apic_destination_logical;
  27. unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
  28. unsigned long (*check_apicid_present)(int apicid);
  29. int no_balance_irq;
  30. int no_ioapic_check;
  31. void (*init_apic_ldr)(void);
  32. physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
  33. void (*setup_apic_routing)(void);
  34. int (*multi_timer_check)(int apic, int irq);
  35. int (*apicid_to_node)(int logical_apicid);
  36. int (*cpu_to_logical_apicid)(int cpu);
  37. int (*cpu_present_to_apicid)(int mps_cpu);
  38. physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
  39. void (*setup_portio_remap)(void);
  40. int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
  41. void (*enable_apic_mode)(void);
  42. u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
  43. /* mpparse */
  44. /* When one of the next two hooks returns 1 the genapic
  45. is switched to this. Essentially they are additional probe
  46. functions. */
  47. int (*mps_oem_check)(struct mp_config_table *mpc, char *oem,
  48. char *productid);
  49. int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
  50. unsigned (*get_apic_id)(unsigned long x);
  51. unsigned long apic_id_mask;
  52. unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
  53. unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
  54. const struct cpumask *andmask);
  55. void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
  56. #ifdef CONFIG_SMP
  57. /* ipi */
  58. void (*send_IPI_mask)(const struct cpumask *mask, int vector);
  59. void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
  60. int vector);
  61. void (*send_IPI_allbutself)(int vector);
  62. void (*send_IPI_all)(int vector);
  63. #endif
  64. int (*wakeup_cpu)(int apicid, unsigned long start_eip);
  65. int trampoline_phys_low;
  66. int trampoline_phys_high;
  67. void (*wait_for_init_deassert)(atomic_t *deassert);
  68. void (*smp_callin_clear_local_apic)(void);
  69. void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
  70. void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
  71. void (*inquire_remote_apic)(int apicid);
  72. };
  73. #define APICFUNC(x) .x = x,
  74. /* More functions could be probably marked IPIFUNC and save some space
  75. in UP GENERICARCH kernels, but I don't have the nerve right now
  76. to untangle this mess. -AK */
  77. #ifdef CONFIG_SMP
  78. #define IPIFUNC(x) APICFUNC(x)
  79. #else
  80. #define IPIFUNC(x)
  81. #endif
  82. #define APIC_INIT(aname, aprobe) \
  83. { \
  84. .name = aname, \
  85. .probe = aprobe, \
  86. .int_delivery_mode = INT_DELIVERY_MODE, \
  87. .int_dest_mode = INT_DEST_MODE, \
  88. .no_balance_irq = NO_BALANCE_IRQ, \
  89. .ESR_DISABLE = esr_disable, \
  90. .apic_destination_logical = APIC_DEST_LOGICAL, \
  91. APICFUNC(apic_id_registered) \
  92. APICFUNC(target_cpus) \
  93. APICFUNC(check_apicid_used) \
  94. APICFUNC(check_apicid_present) \
  95. APICFUNC(init_apic_ldr) \
  96. APICFUNC(ioapic_phys_id_map) \
  97. APICFUNC(setup_apic_routing) \
  98. APICFUNC(multi_timer_check) \
  99. APICFUNC(apicid_to_node) \
  100. APICFUNC(cpu_to_logical_apicid) \
  101. APICFUNC(cpu_present_to_apicid) \
  102. APICFUNC(apicid_to_cpu_present) \
  103. APICFUNC(setup_portio_remap) \
  104. APICFUNC(check_phys_apicid_present) \
  105. APICFUNC(mps_oem_check) \
  106. APICFUNC(get_apic_id) \
  107. .apic_id_mask = APIC_ID_MASK, \
  108. APICFUNC(cpu_mask_to_apicid) \
  109. APICFUNC(cpu_mask_to_apicid_and) \
  110. APICFUNC(vector_allocation_domain) \
  111. APICFUNC(acpi_madt_oem_check) \
  112. IPIFUNC(send_IPI_mask) \
  113. IPIFUNC(send_IPI_allbutself) \
  114. IPIFUNC(send_IPI_all) \
  115. APICFUNC(enable_apic_mode) \
  116. APICFUNC(phys_pkg_id) \
  117. .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, \
  118. .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, \
  119. APICFUNC(wait_for_init_deassert) \
  120. APICFUNC(smp_callin_clear_local_apic) \
  121. APICFUNC(store_NMI_vector) \
  122. APICFUNC(restore_NMI_vector) \
  123. APICFUNC(inquire_remote_apic) \
  124. }
  125. extern struct genapic *genapic;
  126. extern void es7000_update_genapic_to_cluster(void);
  127. enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
  128. #define get_uv_system_type() UV_NONE
  129. #define is_uv_system() 0
  130. #define uv_wakeup_secondary(a, b) 1
  131. #define uv_system_init() do {} while (0)
  132. #endif /* _ASM_X86_GENAPIC_32_H */