diff options
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/irq.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 4f5d6e751a65..a81dd74414bf 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -481,20 +481,42 @@ void do_softirq(void) | |||
481 | * IRQ controller and virtual interrupts | 481 | * IRQ controller and virtual interrupts |
482 | */ | 482 | */ |
483 | 483 | ||
484 | /* The main irq map itself is an array of NR_IRQ entries containing the | ||
485 | * associate host and irq number. An entry with a host of NULL is free. | ||
486 | * An entry can be allocated if it's free, the allocator always then sets | ||
487 | * hwirq first to the host's invalid irq number and then fills ops. | ||
488 | */ | ||
489 | struct irq_map_entry { | ||
490 | irq_hw_number_t hwirq; | ||
491 | struct irq_host *host; | ||
492 | }; | ||
493 | |||
484 | static LIST_HEAD(irq_hosts); | 494 | static LIST_HEAD(irq_hosts); |
485 | static DEFINE_RAW_SPINLOCK(irq_big_lock); | 495 | static DEFINE_RAW_SPINLOCK(irq_big_lock); |
486 | static unsigned int revmap_trees_allocated; | 496 | static unsigned int revmap_trees_allocated; |
487 | static DEFINE_MUTEX(revmap_trees_mutex); | 497 | static DEFINE_MUTEX(revmap_trees_mutex); |
488 | struct irq_map_entry irq_map[NR_IRQS]; | 498 | static struct irq_map_entry irq_map[NR_IRQS]; |
489 | static unsigned int irq_virq_count = NR_IRQS; | 499 | static unsigned int irq_virq_count = NR_IRQS; |
490 | static struct irq_host *irq_default_host; | 500 | static struct irq_host *irq_default_host; |
491 | 501 | ||
502 | irq_hw_number_t irqd_to_hwirq(struct irq_data *d) | ||
503 | { | ||
504 | return irq_map[d->irq].hwirq; | ||
505 | } | ||
506 | EXPORT_SYMBOL_GPL(irqd_to_hwirq); | ||
507 | |||
492 | irq_hw_number_t virq_to_hw(unsigned int virq) | 508 | irq_hw_number_t virq_to_hw(unsigned int virq) |
493 | { | 509 | { |
494 | return irq_map[virq].hwirq; | 510 | return irq_map[virq].hwirq; |
495 | } | 511 | } |
496 | EXPORT_SYMBOL_GPL(virq_to_hw); | 512 | EXPORT_SYMBOL_GPL(virq_to_hw); |
497 | 513 | ||
514 | struct irq_host *virq_to_host(unsigned int virq) | ||
515 | { | ||
516 | return irq_map[virq].host; | ||
517 | } | ||
518 | EXPORT_SYMBOL_GPL(virq_to_host); | ||
519 | |||
498 | static int default_irq_host_match(struct irq_host *h, struct device_node *np) | 520 | static int default_irq_host_match(struct irq_host *h, struct device_node *np) |
499 | { | 521 | { |
500 | return h->of_node != NULL && h->of_node == np; | 522 | return h->of_node != NULL && h->of_node == np; |
@@ -1103,7 +1125,7 @@ static int virq_debug_show(struct seq_file *m, void *private) | |||
1103 | struct irq_chip *chip; | 1125 | struct irq_chip *chip; |
1104 | 1126 | ||
1105 | seq_printf(m, "%5d ", i); | 1127 | seq_printf(m, "%5d ", i); |
1106 | seq_printf(m, "0x%05lx ", virq_to_hw(i)); | 1128 | seq_printf(m, "0x%05lx ", irq_map[i].hwirq); |
1107 | 1129 | ||
1108 | chip = irq_desc_get_chip(desc); | 1130 | chip = irq_desc_get_chip(desc); |
1109 | if (chip && chip->name) | 1131 | if (chip && chip->name) |