genapic_32.h 3.5 KB

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