internals.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 struct lock_class_key irq_desc_lock_class;
  12. extern void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr);
  13. extern spinlock_t sparse_irq_lock;
  14. #ifdef CONFIG_SPARSE_IRQ
  15. /* irq_desc_ptrs allocated at boot time */
  16. extern struct irq_desc **irq_desc_ptrs;
  17. #else
  18. /* irq_desc_ptrs is a fixed size array */
  19. extern struct irq_desc *irq_desc_ptrs[NR_IRQS];
  20. #endif
  21. #ifdef CONFIG_PROC_FS
  22. extern void register_irq_proc(unsigned int irq, struct irq_desc *desc);
  23. extern void register_handler_proc(unsigned int irq, struct irqaction *action);
  24. extern void unregister_handler_proc(unsigned int irq, struct irqaction *action);
  25. #else
  26. static inline void register_irq_proc(unsigned int irq, struct irq_desc *desc) { }
  27. static inline void register_handler_proc(unsigned int irq,
  28. struct irqaction *action) { }
  29. static inline void unregister_handler_proc(unsigned int irq,
  30. struct irqaction *action) { }
  31. #endif
  32. extern int irq_select_affinity_usr(unsigned int irq);
  33. /*
  34. * Debugging printout:
  35. */
  36. #include <linux/kallsyms.h>
  37. #define P(f) if (desc->status & f) printk("%14s set\n", #f)
  38. static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
  39. {
  40. printk("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n",
  41. irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);
  42. printk("->handle_irq(): %p, ", desc->handle_irq);
  43. print_symbol("%s\n", (unsigned long)desc->handle_irq);
  44. printk("->chip(): %p, ", desc->chip);
  45. print_symbol("%s\n", (unsigned long)desc->chip);
  46. printk("->action(): %p\n", desc->action);
  47. if (desc->action) {
  48. printk("->action->handler(): %p, ", desc->action->handler);
  49. print_symbol("%s\n", (unsigned long)desc->action->handler);
  50. }
  51. P(IRQ_INPROGRESS);
  52. P(IRQ_DISABLED);
  53. P(IRQ_PENDING);
  54. P(IRQ_REPLAY);
  55. P(IRQ_AUTODETECT);
  56. P(IRQ_WAITING);
  57. P(IRQ_LEVEL);
  58. P(IRQ_MASKED);
  59. #ifdef CONFIG_IRQ_PER_CPU
  60. P(IRQ_PER_CPU);
  61. #endif
  62. P(IRQ_NOPROBE);
  63. P(IRQ_NOREQUEST);
  64. P(IRQ_NOAUTOEN);
  65. }
  66. #undef P