aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/irq.c26
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 */
489struct irq_map_entry {
490 irq_hw_number_t hwirq;
491 struct irq_host *host;
492};
493
484static LIST_HEAD(irq_hosts); 494static LIST_HEAD(irq_hosts);
485static DEFINE_RAW_SPINLOCK(irq_big_lock); 495static DEFINE_RAW_SPINLOCK(irq_big_lock);
486static unsigned int revmap_trees_allocated; 496static unsigned int revmap_trees_allocated;
487static DEFINE_MUTEX(revmap_trees_mutex); 497static DEFINE_MUTEX(revmap_trees_mutex);
488struct irq_map_entry irq_map[NR_IRQS]; 498static struct irq_map_entry irq_map[NR_IRQS];
489static unsigned int irq_virq_count = NR_IRQS; 499static unsigned int irq_virq_count = NR_IRQS;
490static struct irq_host *irq_default_host; 500static struct irq_host *irq_default_host;
491 501
502irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
503{
504 return irq_map[d->irq].hwirq;
505}
506EXPORT_SYMBOL_GPL(irqd_to_hwirq);
507
492irq_hw_number_t virq_to_hw(unsigned int virq) 508irq_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}
496EXPORT_SYMBOL_GPL(virq_to_hw); 512EXPORT_SYMBOL_GPL(virq_to_hw);
497 513
514struct irq_host *virq_to_host(unsigned int virq)
515{
516 return irq_map[virq].host;
517}
518EXPORT_SYMBOL_GPL(virq_to_host);
519
498static int default_irq_host_match(struct irq_host *h, struct device_node *np) 520static 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)