hw_irq.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #include <linux/config.h>
  14. #include <linux/profile.h>
  15. #include <asm/atomic.h>
  16. #include <asm/irq.h>
  17. #include <asm/sections.h>
  18. struct hw_interrupt_type;
  19. /*
  20. * Various low-level irq details needed by irq.c, process.c,
  21. * time.c, io_apic.c and smp.c
  22. *
  23. * Interrupt entry/exit code at both C and assembly level
  24. */
  25. extern u8 irq_vector[NR_IRQ_VECTORS];
  26. #define IO_APIC_VECTOR(irq) (irq_vector[irq])
  27. #define AUTO_ASSIGN -1
  28. extern void (*interrupt[NR_IRQS])(void);
  29. #ifdef CONFIG_SMP
  30. fastcall void reschedule_interrupt(void);
  31. fastcall void invalidate_interrupt(void);
  32. fastcall void call_function_interrupt(void);
  33. #endif
  34. #ifdef CONFIG_X86_LOCAL_APIC
  35. fastcall void apic_timer_interrupt(void);
  36. fastcall void error_interrupt(void);
  37. fastcall void spurious_interrupt(void);
  38. fastcall void thermal_interrupt(struct pt_regs *);
  39. #define platform_legacy_irq(irq) ((irq) < 16)
  40. #endif
  41. void disable_8259A_irq(unsigned int irq);
  42. void enable_8259A_irq(unsigned int irq);
  43. int i8259A_irq_pending(unsigned int irq);
  44. void make_8259A_irq(unsigned int irq);
  45. void init_8259A(int aeoi);
  46. void FASTCALL(send_IPI_self(int vector));
  47. void init_VISWS_APIC_irqs(void);
  48. void setup_IO_APIC(void);
  49. void disable_IO_APIC(void);
  50. void print_IO_APIC(void);
  51. int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
  52. void send_IPI(int dest, int vector);
  53. void setup_ioapic_dest(void);
  54. extern unsigned long io_apic_irqs;
  55. extern atomic_t irq_err_count;
  56. extern atomic_t irq_mis_count;
  57. #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
  58. #if defined(CONFIG_X86_IO_APIC)
  59. static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
  60. {
  61. if (IO_APIC_IRQ(i))
  62. send_IPI_self(IO_APIC_VECTOR(i));
  63. }
  64. #else
  65. static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
  66. #endif
  67. #endif /* _ASM_HW_IRQ_H */