io_apic_64.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #ifndef __ASM_IO_APIC_H
  2. #define __ASM_IO_APIC_H
  3. #include <asm/types.h>
  4. #include <asm/mpspec.h>
  5. #include <asm/apicdef.h>
  6. /*
  7. * Intel IO-APIC support for SMP and UP systems.
  8. *
  9. * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar
  10. */
  11. #define APIC_MISMATCH_DEBUG
  12. /*
  13. * The structure of the IO-APIC:
  14. */
  15. union IO_APIC_reg_00 {
  16. u32 raw;
  17. struct {
  18. u32 __reserved_2 : 14,
  19. LTS : 1,
  20. delivery_type : 1,
  21. __reserved_1 : 8,
  22. ID : 8;
  23. } __attribute__ ((packed)) bits;
  24. };
  25. union IO_APIC_reg_01 {
  26. u32 raw;
  27. struct {
  28. u32 version : 8,
  29. __reserved_2 : 7,
  30. PRQ : 1,
  31. entries : 8,
  32. __reserved_1 : 8;
  33. } __attribute__ ((packed)) bits;
  34. };
  35. union IO_APIC_reg_02 {
  36. u32 raw;
  37. struct {
  38. u32 __reserved_2 : 24,
  39. arbitration : 4,
  40. __reserved_1 : 4;
  41. } __attribute__ ((packed)) bits;
  42. };
  43. union IO_APIC_reg_03 {
  44. u32 raw;
  45. struct {
  46. u32 boot_DT : 1,
  47. __reserved_1 : 31;
  48. } __attribute__ ((packed)) bits;
  49. };
  50. /*
  51. * # of IO-APICs and # of IRQ routing registers
  52. */
  53. extern int nr_ioapics;
  54. extern int nr_ioapic_registers[MAX_IO_APICS];
  55. enum ioapic_irq_destination_types {
  56. dest_Fixed = 0,
  57. dest_LowestPrio = 1,
  58. dest_SMI = 2,
  59. dest__reserved_1 = 3,
  60. dest_NMI = 4,
  61. dest_INIT = 5,
  62. dest__reserved_2 = 6,
  63. dest_ExtINT = 7
  64. };
  65. struct IO_APIC_route_entry {
  66. __u32 vector : 8,
  67. delivery_mode : 3, /* 000: FIXED
  68. * 001: lowest prio
  69. * 111: ExtINT
  70. */
  71. dest_mode : 1, /* 0: physical, 1: logical */
  72. delivery_status : 1,
  73. polarity : 1,
  74. irr : 1,
  75. trigger : 1, /* 0: edge, 1: level */
  76. mask : 1, /* 0: enabled, 1: disabled */
  77. __reserved_2 : 15;
  78. __u32 __reserved_3 : 24,
  79. dest : 8;
  80. } __attribute__ ((packed));
  81. /*
  82. * MP-BIOS irq configuration table structures:
  83. */
  84. /* I/O APIC entries */
  85. extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
  86. /* # of MP IRQ source entries */
  87. extern int mp_irq_entries;
  88. /* MP IRQ source entries */
  89. extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
  90. /* non-0 if default (table-less) MP configuration */
  91. extern int mpc_default_type;
  92. /* 1 if "noapic" boot option passed */
  93. extern int skip_ioapic_setup;
  94. static inline void disable_ioapic_setup(void)
  95. {
  96. skip_ioapic_setup = 1;
  97. }
  98. /*
  99. * If we use the IO-APIC for IRQ routing, disable automatic
  100. * assignment of PCI IRQ's.
  101. */
  102. #define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
  103. #ifdef CONFIG_ACPI
  104. extern int io_apic_get_version (int ioapic);
  105. extern int io_apic_get_redir_entries (int ioapic);
  106. extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int);
  107. #endif
  108. extern int sis_apic_bug; /* dummy */
  109. void enable_NMI_through_LVT0 (void * dummy);
  110. extern spinlock_t i8259A_lock;
  111. #endif