internals.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * IRQ subsystem internal functions and variables:
  3. */
  4. extern int noirqdebug;
  5. /* Set default functions for irq_chip structures: */
  6. extern void irq_chip_set_defaults(struct irq_chip *chip);
  7. /* Set default handler: */
  8. extern void compat_irq_chip_set_default_handler(struct irq_desc *desc);
  9. extern int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
  10. unsigned long flags);
  11. extern void __disable_irq(struct irq_desc *desc, unsigned int irq, bool susp);
  12. extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume);
  13. extern struct lock_class_key irq_desc_lock_class;
  14. extern void init_kstat_irqs(struct irq_desc *desc, int node, int nr);
  15. extern void clear_kstat_irqs(struct irq_desc *desc);
  16. extern raw_spinlock_t sparse_irq_lock;
  17. #ifdef CONFIG_SPARSE_IRQ
  18. void replace_irq_desc(unsigned int irq, struct irq_desc *desc);
  19. #endif
  20. #ifdef CONFIG_PROC_FS
  21. extern void register_irq_proc(unsigned int irq, struct irq_desc *desc);
  22. extern void register_handler_proc(unsigned int irq, struct irqaction *action);
  23. extern void unregister_handler_proc(unsigned int irq, struct irqaction *action);
  24. #else
  25. static inline void register_irq_proc(unsigned int irq, struct irq_desc *desc) { }
  26. static inline void register_handler_proc(unsigned int irq,
  27. struct irqaction *action) { }
  28. static inline void unregister_handler_proc(unsigned int irq,
  29. struct irqaction *action) { }
  30. #endif
  31. extern int irq_select_affinity_usr(unsigned int irq);
  32. extern void irq_set_thread_affinity(struct irq_desc *desc);
  33. /* Inline functions for support of irq chips on slow busses */
  34. static inline void chip_bus_lock(unsigned int irq, struct irq_desc *desc)
  35. {
  36. if (unlikely(desc->chip->bus_lock))
  37. desc->chip->bus_lock(irq);
  38. }
  39. static inline void chip_bus_sync_unlock(unsigned int irq, struct irq_desc *desc)
  40. {
  41. if (unlikely(desc->chip->bus_sync_unlock))
  42. desc->chip->bus_sync_unlock(irq);
  43. }
  44. /*
  45. * Debugging printout:
  46. */
  47. #include <linux/kallsyms.h>
  48. #define P(f) if (desc->status & f) printk("%14s set\n", #f)
  49. static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
  50. {
  51. printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
  52. irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
  53. printk("->handle_irq(): %p, ", desc->handle_irq);
  54. print_symbol("%s\n", (unsigned long)desc->handle_irq);
  55. printk("->chip(): %p, ", desc->chip);
  56. print_symbol("%s\n", (unsigned long)desc->chip);
  57. printk("->action(): %p\n", desc->action);
  58. if (desc->action) {
  59. printk("->action->handler(): %p, ", desc->action->handler);
  60. print_symbol("%s\n", (unsigned long)desc->action->handler);
  61. }
  62. P(IRQ_INPROGRESS);
  63. P(IRQ_DISABLED);
  64. P(IRQ_PENDING);
  65. P(IRQ_REPLAY);
  66. P(IRQ_AUTODETECT);
  67. P(IRQ_WAITING);
  68. P(IRQ_LEVEL);
  69. P(IRQ_MASKED);
  70. #ifdef CONFIG_IRQ_PER_CPU
  71. P(IRQ_PER_CPU);
  72. #endif
  73. P(IRQ_NOPROBE);
  74. P(IRQ_NOREQUEST);
  75. P(IRQ_NOAUTOEN);
  76. }
  77. #undef P