genapic.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef _ASM_X86_GENAPIC_H
  2. #define _ASM_X86_GENAPIC_H
  3. #include <linux/cpumask.h>
  4. #include <asm/mpspec.h>
  5. #include <asm/atomic.h>
  6. /*
  7. * Copyright 2004 James Cleverdon, IBM.
  8. * Subject to the GNU Public License, v.2
  9. *
  10. * Generic APIC sub-arch data struct.
  11. *
  12. * Hacked for x86-64 by James Cleverdon from i386 architecture code by
  13. * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
  14. * James Cleverdon.
  15. */
  16. struct genapic {
  17. char *name;
  18. int (*probe)(void);
  19. int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
  20. int (*apic_id_registered)(void);
  21. u32 irq_delivery_mode;
  22. u32 irq_dest_mode;
  23. const struct cpumask *(*target_cpus)(void);
  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 (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
  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. #ifdef CONFIG_X86_32
  43. u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
  44. #else
  45. unsigned int (*phys_pkg_id)(int index_msb);
  46. #endif
  47. /*
  48. * When one of the next two hooks returns 1 the genapic
  49. * is switched to this. Essentially they are additional
  50. * probe functions:
  51. */
  52. int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
  53. char *productid);
  54. unsigned int (*get_apic_id)(unsigned long x);
  55. unsigned long (*set_apic_id)(unsigned int id);
  56. unsigned long apic_id_mask;
  57. unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
  58. unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
  59. const struct cpumask *andmask);
  60. /* ipi */
  61. void (*send_IPI_mask)(const struct cpumask *mask, int vector);
  62. void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
  63. int vector);
  64. void (*send_IPI_allbutself)(int vector);
  65. void (*send_IPI_all)(int vector);
  66. void (*send_IPI_self)(int vector);
  67. /* wakeup_secondary_cpu */
  68. int (*wakeup_cpu)(int apicid, unsigned long start_eip);
  69. int trampoline_phys_low;
  70. int trampoline_phys_high;
  71. void (*wait_for_init_deassert)(atomic_t *deassert);
  72. void (*smp_callin_clear_local_apic)(void);
  73. void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
  74. void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
  75. void (*inquire_remote_apic)(int apicid);
  76. };
  77. extern struct genapic *apic;
  78. #ifdef CONFIG_X86_32
  79. extern void es7000_update_genapic_to_cluster(void);
  80. #else
  81. extern struct genapic apic_flat;
  82. extern struct genapic apic_physflat;
  83. extern struct genapic apic_x2apic_cluster;
  84. extern struct genapic apic_x2apic_phys;
  85. extern int default_acpi_madt_oem_check(char *, char *);
  86. extern void apic_send_IPI_self(int vector);
  87. extern struct genapic apic_x2apic_uv_x;
  88. DECLARE_PER_CPU(int, x2apic_extra_bits);
  89. extern void setup_apic_routing(void);
  90. #endif
  91. #endif /* _ASM_X86_GENAPIC_64_H */