genapic.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 disable_esr;
  25. int dest_logical;
  26. unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
  27. unsigned long (*check_apicid_present)(int apicid);
  28. void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
  29. void (*init_apic_ldr)(void);
  30. physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
  31. void (*setup_apic_routing)(void);
  32. int (*multi_timer_check)(int apic, int irq);
  33. int (*apicid_to_node)(int logical_apicid);
  34. int (*cpu_to_logical_apicid)(int cpu);
  35. int (*cpu_present_to_apicid)(int mps_cpu);
  36. physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
  37. void (*setup_portio_remap)(void);
  38. int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
  39. void (*enable_apic_mode)(void);
  40. int (*phys_pkg_id)(int cpuid_apic, int index_msb);
  41. /*
  42. * When one of the next two hooks returns 1 the genapic
  43. * is switched to this. Essentially they are additional
  44. * probe functions:
  45. */
  46. int (*mps_oem_check)(struct mpc_table *mpc, char *oem, char *productid);
  47. unsigned int (*get_apic_id)(unsigned long x);
  48. unsigned long (*set_apic_id)(unsigned int id);
  49. unsigned long apic_id_mask;
  50. unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
  51. unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
  52. const struct cpumask *andmask);
  53. /* ipi */
  54. void (*send_IPI_mask)(const struct cpumask *mask, int vector);
  55. void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
  56. int vector);
  57. void (*send_IPI_allbutself)(int vector);
  58. void (*send_IPI_all)(int vector);
  59. void (*send_IPI_self)(int vector);
  60. /* wakeup_secondary_cpu */
  61. int (*wakeup_cpu)(int apicid, unsigned long start_eip);
  62. int trampoline_phys_low;
  63. int trampoline_phys_high;
  64. void (*wait_for_init_deassert)(atomic_t *deassert);
  65. void (*smp_callin_clear_local_apic)(void);
  66. void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
  67. void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
  68. void (*inquire_remote_apic)(int apicid);
  69. };
  70. extern struct genapic *apic;
  71. #ifdef CONFIG_X86_32
  72. extern void es7000_update_genapic_to_cluster(void);
  73. #else
  74. extern struct genapic apic_flat;
  75. extern struct genapic apic_physflat;
  76. extern struct genapic apic_x2apic_cluster;
  77. extern struct genapic apic_x2apic_phys;
  78. extern int default_acpi_madt_oem_check(char *, char *);
  79. extern void apic_send_IPI_self(int vector);
  80. extern struct genapic apic_x2apic_uv_x;
  81. DECLARE_PER_CPU(int, x2apic_extra_bits);
  82. extern void default_setup_apic_routing(void);
  83. extern int default_cpu_present_to_apicid(int mps_cpu);
  84. extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
  85. #endif
  86. #endif /* _ASM_X86_GENAPIC_64_H */