hw_irq.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #ifndef _ASM_HW_IRQ_H
  2. #define _ASM_HW_IRQ_H
  3. /*
  4. * linux/include/asm/hw_irq.h
  5. *
  6. * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
  7. *
  8. * moved some of the old arch/i386/kernel/irq.h to here. VY
  9. *
  10. * IRQ/IPI changes taken from work by Thomas Radke
  11. * <tomsoft@informatik.tu-chemnitz.de>
  12. *
  13. * hacked by Andi Kleen for x86-64.
  14. */
  15. #ifndef __ASSEMBLY__
  16. #include <asm/atomic.h>
  17. #include <asm/irq.h>
  18. #include <linux/profile.h>
  19. #include <linux/smp.h>
  20. #include <linux/percpu.h>
  21. #endif
  22. #define NMI_VECTOR 0x02
  23. /*
  24. * IDT vectors usable for external interrupt sources start
  25. * at 0x20:
  26. */
  27. #define FIRST_EXTERNAL_VECTOR 0x20
  28. #define IA32_SYSCALL_VECTOR 0x80
  29. /*
  30. * Vectors 0x20-0x2f are used for ISA interrupts.
  31. */
  32. /*
  33. * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
  34. *
  35. * some of the following vectors are 'rare', they are merged
  36. * into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
  37. * TLB, reschedule and local APIC vectors are performance-critical.
  38. */
  39. #define SPURIOUS_APIC_VECTOR 0xff
  40. #define ERROR_APIC_VECTOR 0xfe
  41. #define RESCHEDULE_VECTOR 0xfd
  42. #define CALL_FUNCTION_VECTOR 0xfc
  43. /* fb free - please don't readd KDB here because it's useless
  44. (hint - think what a NMI bit does to a vector) */
  45. #define THERMAL_APIC_VECTOR 0xfa
  46. #define THRESHOLD_APIC_VECTOR 0xf9
  47. /* f8 free */
  48. #define INVALIDATE_TLB_VECTOR_END 0xf7
  49. #define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */
  50. #define NUM_INVALIDATE_TLB_VECTORS 8
  51. /*
  52. * Local APIC timer IRQ vector is on a different priority level,
  53. * to work around the 'lost local interrupt if more than 2 IRQ
  54. * sources per level' errata.
  55. */
  56. #define LOCAL_TIMER_VECTOR 0xef
  57. /*
  58. * First APIC vector available to drivers: (vectors 0x30-0xee)
  59. * we start at 0x31 to spread out vectors evenly between priority
  60. * levels. (0x80 is the syscall vector)
  61. */
  62. #define FIRST_DEVICE_VECTOR 0x31
  63. #define FIRST_SYSTEM_VECTOR 0xef /* duplicated in irq.h */
  64. #ifndef __ASSEMBLY__
  65. typedef int vector_irq_t[NR_VECTORS];
  66. DECLARE_PER_CPU(vector_irq_t, vector_irq);
  67. /*
  68. * Various low-level irq details needed by irq.c, process.c,
  69. * time.c, io_apic.c and smp.c
  70. *
  71. * Interrupt entry/exit code at both C and assembly level
  72. */
  73. extern void disable_8259A_irq(unsigned int irq);
  74. extern void enable_8259A_irq(unsigned int irq);
  75. extern int i8259A_irq_pending(unsigned int irq);
  76. extern void make_8259A_irq(unsigned int irq);
  77. extern void init_8259A(int aeoi);
  78. extern void FASTCALL(send_IPI_self(int vector));
  79. extern void init_VISWS_APIC_irqs(void);
  80. extern void setup_IO_APIC(void);
  81. extern void disable_IO_APIC(void);
  82. extern void print_IO_APIC(void);
  83. extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
  84. extern void send_IPI(int dest, int vector);
  85. extern void setup_ioapic_dest(void);
  86. extern unsigned long io_apic_irqs;
  87. extern atomic_t irq_err_count;
  88. extern atomic_t irq_mis_count;
  89. #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
  90. #define __STR(x) #x
  91. #define STR(x) __STR(x)
  92. #include <asm/ptrace.h>
  93. #define IRQ_NAME2(nr) nr##_interrupt(void)
  94. #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
  95. /*
  96. * SMP has a few special interrupts for IPI messages
  97. */
  98. #define BUILD_IRQ(nr) \
  99. asmlinkage void IRQ_NAME(nr); \
  100. __asm__( \
  101. "\n.p2align\n" \
  102. "IRQ" #nr "_interrupt:\n\t" \
  103. "push $~(" #nr ") ; " \
  104. "jmp common_interrupt");
  105. #define platform_legacy_irq(irq) ((irq) < 16)
  106. #endif
  107. #endif /* _ASM_HW_IRQ_H */