io_apic_32.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. /*
  12. * The structure of the IO-APIC:
  13. */
  14. union IO_APIC_reg_00 {
  15. u32 raw;
  16. struct {
  17. u32 __reserved_2 : 14,
  18. LTS : 1,
  19. delivery_type : 1,
  20. __reserved_1 : 8,
  21. ID : 8;
  22. } __attribute__ ((packed)) bits;
  23. };
  24. union IO_APIC_reg_01 {
  25. u32 raw;
  26. struct {
  27. u32 version : 8,
  28. __reserved_2 : 7,
  29. PRQ : 1,
  30. entries : 8,
  31. __reserved_1 : 8;
  32. } __attribute__ ((packed)) bits;
  33. };
  34. union IO_APIC_reg_02 {
  35. u32 raw;
  36. struct {
  37. u32 __reserved_2 : 24,
  38. arbitration : 4,
  39. __reserved_1 : 4;
  40. } __attribute__ ((packed)) bits;
  41. };
  42. union IO_APIC_reg_03 {
  43. u32 raw;
  44. struct {
  45. u32 boot_DT : 1,
  46. __reserved_1 : 31;
  47. } __attribute__ ((packed)) bits;
  48. };
  49. enum ioapic_irq_destination_types {
  50. dest_Fixed = 0,
  51. dest_LowestPrio = 1,
  52. dest_SMI = 2,
  53. dest__reserved_1 = 3,
  54. dest_NMI = 4,
  55. dest_INIT = 5,
  56. dest__reserved_2 = 6,
  57. dest_ExtINT = 7
  58. };
  59. struct IO_APIC_route_entry {
  60. __u32 vector : 8,
  61. delivery_mode : 3, /* 000: FIXED
  62. * 001: lowest prio
  63. * 111: ExtINT
  64. */
  65. dest_mode : 1, /* 0: physical, 1: logical */
  66. delivery_status : 1,
  67. polarity : 1,
  68. irr : 1,
  69. trigger : 1, /* 0: edge, 1: level */
  70. mask : 1, /* 0: enabled, 1: disabled */
  71. __reserved_2 : 15;
  72. union { struct { __u32
  73. __reserved_1 : 24,
  74. physical_dest : 4,
  75. __reserved_2 : 4;
  76. } physical;
  77. struct { __u32
  78. __reserved_1 : 24,
  79. logical_dest : 8;
  80. } logical;
  81. } dest;
  82. } __attribute__ ((packed));
  83. #ifdef CONFIG_X86_IO_APIC
  84. /*
  85. * # of IO-APICs and # of IRQ routing registers
  86. */
  87. extern int nr_ioapics;
  88. extern int nr_ioapic_registers[MAX_IO_APICS];
  89. /*
  90. * MP-BIOS irq configuration table structures:
  91. */
  92. /* I/O APIC entries */
  93. extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
  94. /* # of MP IRQ source entries */
  95. extern int mp_irq_entries;
  96. /* MP IRQ source entries */
  97. extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
  98. /* non-0 if default (table-less) MP configuration */
  99. extern int mpc_default_type;
  100. /* Older SiS APIC requires we rewrite the index register */
  101. extern int sis_apic_bug;
  102. /* 1 if "noapic" boot option passed */
  103. extern int skip_ioapic_setup;
  104. static inline void disable_ioapic_setup(void)
  105. {
  106. skip_ioapic_setup = 1;
  107. }
  108. static inline int ioapic_setup_disabled(void)
  109. {
  110. return skip_ioapic_setup;
  111. }
  112. /*
  113. * If we use the IO-APIC for IRQ routing, disable automatic
  114. * assignment of PCI IRQ's.
  115. */
  116. #define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
  117. #ifdef CONFIG_ACPI
  118. extern int io_apic_get_unique_id (int ioapic, int apic_id);
  119. extern int io_apic_get_version (int ioapic);
  120. extern int io_apic_get_redir_entries (int ioapic);
  121. extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low);
  122. extern int timer_uses_ioapic_pin_0;
  123. #endif /* CONFIG_ACPI */
  124. extern int (*ioapic_renumber_irq)(int ioapic, int irq);
  125. #else /* !CONFIG_X86_IO_APIC */
  126. #define io_apic_assign_pci_irqs 0
  127. #endif
  128. #endif