internals.h 2.6 KB

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