internals.h 2.2 KB

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