genapic_64.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef _ASM_X86_GENAPIC_64_H
  2. #define _ASM_X86_GENAPIC_64_H
  3. #include <linux/cpumask.h>
  4. /*
  5. * Copyright 2004 James Cleverdon, IBM.
  6. * Subject to the GNU Public License, v.2
  7. *
  8. * Generic APIC sub-arch data struct.
  9. *
  10. * Hacked for x86-64 by James Cleverdon from i386 architecture code by
  11. * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
  12. * James Cleverdon.
  13. */
  14. struct genapic {
  15. char *name;
  16. int (*probe)(void);
  17. int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
  18. int (*apic_id_registered)(void);
  19. u32 int_delivery_mode;
  20. u32 int_dest_mode;
  21. const struct cpumask *(*target_cpus)(void);
  22. int ESR_DISABLE;
  23. int apic_destination_logical;
  24. unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
  25. unsigned long (*check_apicid_present)(int apicid);
  26. int no_balance_irq;
  27. int no_ioapic_check;
  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. #ifdef CONFIG_X86_32
  41. u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
  42. #else
  43. unsigned int (*phys_pkg_id)(int index_msb);
  44. #endif
  45. /*
  46. * When one of the next two hooks returns 1 the genapic
  47. * is switched to this. Essentially they are additional
  48. * probe functions:
  49. */
  50. int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
  51. char *productid);
  52. unsigned int (*get_apic_id)(unsigned long x);
  53. unsigned long (*set_apic_id)(unsigned int id);
  54. unsigned long apic_id_mask;
  55. unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
  56. unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
  57. const struct cpumask *andmask);
  58. #ifdef CONFIG_SMP
  59. /* ipi */
  60. void (*send_IPI_mask)(const struct cpumask *mask, int vector);
  61. void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
  62. int vector);
  63. void (*send_IPI_allbutself)(int vector);
  64. void (*send_IPI_all)(int vector);
  65. void (*send_IPI_self)(int vector);
  66. #endif
  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 *genapic;
  78. extern struct genapic apic_flat;
  79. extern struct genapic apic_physflat;
  80. extern struct genapic apic_x2apic_cluster;
  81. extern struct genapic apic_x2apic_phys;
  82. extern int acpi_madt_oem_check(char *, char *);
  83. extern void apic_send_IPI_self(int vector);
  84. extern struct genapic apic_x2apic_uv_x;
  85. DECLARE_PER_CPU(int, x2apic_extra_bits);
  86. extern void setup_apic_routing(void);
  87. #endif /* _ASM_X86_GENAPIC_64_H */