irq-routing.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* irq-routing.h: multiplexed IRQ routing
  2. *
  3. * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_IRQ_ROUTING_H
  12. #define _ASM_IRQ_ROUTING_H
  13. #ifndef __ASSEMBLY__
  14. #include <linux/spinlock.h>
  15. #include <asm/irq.h>
  16. struct irq_source;
  17. struct irq_level;
  18. /*
  19. * IRQ action distribution sets
  20. */
  21. struct irq_group {
  22. int first_irq; /* first IRQ distributed here */
  23. void (*control)(struct irq_group *group, int index, int on);
  24. struct irqaction *actions[NR_IRQ_ACTIONS_PER_GROUP]; /* IRQ action chains */
  25. struct irq_source *sources[NR_IRQ_ACTIONS_PER_GROUP]; /* IRQ sources */
  26. int disable_cnt[NR_IRQ_ACTIONS_PER_GROUP]; /* disable counts */
  27. };
  28. /*
  29. * IRQ source manager
  30. */
  31. struct irq_source {
  32. struct irq_source *next;
  33. struct irq_level *level;
  34. const char *muxname;
  35. volatile void __iomem *muxdata;
  36. unsigned long irqmask;
  37. void (*doirq)(struct irq_source *source);
  38. };
  39. /*
  40. * IRQ level management (per CPU IRQ priority / entry vector)
  41. */
  42. struct irq_level {
  43. int usage;
  44. int disable_count;
  45. unsigned long flags; /* current SA_INTERRUPT and SA_SHIRQ settings */
  46. spinlock_t lock;
  47. struct irq_source *sources;
  48. };
  49. extern struct irq_level frv_irq_levels[16];
  50. extern struct irq_group *irq_groups[NR_IRQ_GROUPS];
  51. extern void frv_irq_route(struct irq_source *source, int irqlevel);
  52. extern void frv_irq_route_external(struct irq_source *source, int irq);
  53. extern void frv_irq_set_group(struct irq_group *group);
  54. extern void distribute_irqs(struct irq_group *group, unsigned long irqmask);
  55. extern void route_cpu_irqs(void);
  56. #endif /* !__ASSEMBLY__ */
  57. #endif /* _ASM_IRQ_ROUTING_H */