internals.h 2.1 KB

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