diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-05-04 01:02:15 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-05-04 01:02:15 -0400 |
commit | 476eb4912601a8c01e6702b9a029f476b4b131d2 (patch) | |
tree | 2ed0b8c166c7cb46174318fe187f5edc062829be /arch/powerpc/sysdev/mpic.c | |
parent | 65f47f1339dfcffcd5837a307172fb41aa39e479 (diff) |
powerpc/irq: Stop exporting irq_map
First step in eliminating irq_map[] table entirely
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/mpic.c')
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index f91c065bed5a..824a94fc413b 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -607,8 +607,6 @@ static int irq_choose_cpu(const struct cpumask *mask) | |||
607 | } | 607 | } |
608 | #endif | 608 | #endif |
609 | 609 | ||
610 | #define mpic_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) | ||
611 | |||
612 | /* Find an mpic associated with a given linux interrupt */ | 610 | /* Find an mpic associated with a given linux interrupt */ |
613 | static struct mpic *mpic_find(unsigned int irq) | 611 | static struct mpic *mpic_find(unsigned int irq) |
614 | { | 612 | { |
@@ -621,7 +619,7 @@ static struct mpic *mpic_find(unsigned int irq) | |||
621 | /* Determine if the linux irq is an IPI */ | 619 | /* Determine if the linux irq is an IPI */ |
622 | static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq) | 620 | static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq) |
623 | { | 621 | { |
624 | unsigned int src = mpic_irq_to_hw(irq); | 622 | unsigned int src = virq_to_hw(irq); |
625 | 623 | ||
626 | return (src >= mpic->ipi_vecs[0] && src <= mpic->ipi_vecs[3]); | 624 | return (src >= mpic->ipi_vecs[0] && src <= mpic->ipi_vecs[3]); |
627 | } | 625 | } |
@@ -674,7 +672,7 @@ void mpic_unmask_irq(struct irq_data *d) | |||
674 | { | 672 | { |
675 | unsigned int loops = 100000; | 673 | unsigned int loops = 100000; |
676 | struct mpic *mpic = mpic_from_irq_data(d); | 674 | struct mpic *mpic = mpic_from_irq_data(d); |
677 | unsigned int src = mpic_irq_to_hw(d->irq); | 675 | unsigned int src = irqd_to_hwirq(d); |
678 | 676 | ||
679 | DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, d->irq, src); | 677 | DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, d->irq, src); |
680 | 678 | ||
@@ -695,7 +693,7 @@ void mpic_mask_irq(struct irq_data *d) | |||
695 | { | 693 | { |
696 | unsigned int loops = 100000; | 694 | unsigned int loops = 100000; |
697 | struct mpic *mpic = mpic_from_irq_data(d); | 695 | struct mpic *mpic = mpic_from_irq_data(d); |
698 | unsigned int src = mpic_irq_to_hw(d->irq); | 696 | unsigned int src = irqd_to_hwirq(d); |
699 | 697 | ||
700 | DBG("%s: disable_irq: %d (src %d)\n", mpic->name, d->irq, src); | 698 | DBG("%s: disable_irq: %d (src %d)\n", mpic->name, d->irq, src); |
701 | 699 | ||
@@ -733,7 +731,7 @@ void mpic_end_irq(struct irq_data *d) | |||
733 | static void mpic_unmask_ht_irq(struct irq_data *d) | 731 | static void mpic_unmask_ht_irq(struct irq_data *d) |
734 | { | 732 | { |
735 | struct mpic *mpic = mpic_from_irq_data(d); | 733 | struct mpic *mpic = mpic_from_irq_data(d); |
736 | unsigned int src = mpic_irq_to_hw(d->irq); | 734 | unsigned int src = irqd_to_hwirq(d); |
737 | 735 | ||
738 | mpic_unmask_irq(d); | 736 | mpic_unmask_irq(d); |
739 | 737 | ||
@@ -744,7 +742,7 @@ static void mpic_unmask_ht_irq(struct irq_data *d) | |||
744 | static unsigned int mpic_startup_ht_irq(struct irq_data *d) | 742 | static unsigned int mpic_startup_ht_irq(struct irq_data *d) |
745 | { | 743 | { |
746 | struct mpic *mpic = mpic_from_irq_data(d); | 744 | struct mpic *mpic = mpic_from_irq_data(d); |
747 | unsigned int src = mpic_irq_to_hw(d->irq); | 745 | unsigned int src = irqd_to_hwirq(d); |
748 | 746 | ||
749 | mpic_unmask_irq(d); | 747 | mpic_unmask_irq(d); |
750 | mpic_startup_ht_interrupt(mpic, src, irqd_is_level_type(d)); | 748 | mpic_startup_ht_interrupt(mpic, src, irqd_is_level_type(d)); |
@@ -755,7 +753,7 @@ static unsigned int mpic_startup_ht_irq(struct irq_data *d) | |||
755 | static void mpic_shutdown_ht_irq(struct irq_data *d) | 753 | static void mpic_shutdown_ht_irq(struct irq_data *d) |
756 | { | 754 | { |
757 | struct mpic *mpic = mpic_from_irq_data(d); | 755 | struct mpic *mpic = mpic_from_irq_data(d); |
758 | unsigned int src = mpic_irq_to_hw(d->irq); | 756 | unsigned int src = irqd_to_hwirq(d); |
759 | 757 | ||
760 | mpic_shutdown_ht_interrupt(mpic, src); | 758 | mpic_shutdown_ht_interrupt(mpic, src); |
761 | mpic_mask_irq(d); | 759 | mpic_mask_irq(d); |
@@ -764,7 +762,7 @@ static void mpic_shutdown_ht_irq(struct irq_data *d) | |||
764 | static void mpic_end_ht_irq(struct irq_data *d) | 762 | static void mpic_end_ht_irq(struct irq_data *d) |
765 | { | 763 | { |
766 | struct mpic *mpic = mpic_from_irq_data(d); | 764 | struct mpic *mpic = mpic_from_irq_data(d); |
767 | unsigned int src = mpic_irq_to_hw(d->irq); | 765 | unsigned int src = irqd_to_hwirq(d); |
768 | 766 | ||
769 | #ifdef DEBUG_IRQ | 767 | #ifdef DEBUG_IRQ |
770 | DBG("%s: end_irq: %d\n", mpic->name, d->irq); | 768 | DBG("%s: end_irq: %d\n", mpic->name, d->irq); |
@@ -785,7 +783,7 @@ static void mpic_end_ht_irq(struct irq_data *d) | |||
785 | static void mpic_unmask_ipi(struct irq_data *d) | 783 | static void mpic_unmask_ipi(struct irq_data *d) |
786 | { | 784 | { |
787 | struct mpic *mpic = mpic_from_ipi(d); | 785 | struct mpic *mpic = mpic_from_ipi(d); |
788 | unsigned int src = mpic_irq_to_hw(d->irq) - mpic->ipi_vecs[0]; | 786 | unsigned int src = virq_to_hw(d->irq) - mpic->ipi_vecs[0]; |
789 | 787 | ||
790 | DBG("%s: enable_ipi: %d (ipi %d)\n", mpic->name, d->irq, src); | 788 | DBG("%s: enable_ipi: %d (ipi %d)\n", mpic->name, d->irq, src); |
791 | mpic_ipi_write(src, mpic_ipi_read(src) & ~MPIC_VECPRI_MASK); | 789 | mpic_ipi_write(src, mpic_ipi_read(src) & ~MPIC_VECPRI_MASK); |
@@ -816,7 +814,7 @@ int mpic_set_affinity(struct irq_data *d, const struct cpumask *cpumask, | |||
816 | bool force) | 814 | bool force) |
817 | { | 815 | { |
818 | struct mpic *mpic = mpic_from_irq_data(d); | 816 | struct mpic *mpic = mpic_from_irq_data(d); |
819 | unsigned int src = mpic_irq_to_hw(d->irq); | 817 | unsigned int src = irqd_to_hwirq(d); |
820 | 818 | ||
821 | if (mpic->flags & MPIC_SINGLE_DEST_CPU) { | 819 | if (mpic->flags & MPIC_SINGLE_DEST_CPU) { |
822 | int cpuid = irq_choose_cpu(cpumask); | 820 | int cpuid = irq_choose_cpu(cpumask); |
@@ -862,7 +860,7 @@ static unsigned int mpic_type_to_vecpri(struct mpic *mpic, unsigned int type) | |||
862 | int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type) | 860 | int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type) |
863 | { | 861 | { |
864 | struct mpic *mpic = mpic_from_irq_data(d); | 862 | struct mpic *mpic = mpic_from_irq_data(d); |
865 | unsigned int src = mpic_irq_to_hw(d->irq); | 863 | unsigned int src = irqd_to_hwirq(d); |
866 | unsigned int vecpri, vold, vnew; | 864 | unsigned int vecpri, vold, vnew; |
867 | 865 | ||
868 | DBG("mpic: set_irq_type(mpic:@%p,virq:%d,src:0x%x,type:0x%x)\n", | 866 | DBG("mpic: set_irq_type(mpic:@%p,virq:%d,src:0x%x,type:0x%x)\n", |
@@ -898,7 +896,7 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type) | |||
898 | void mpic_set_vector(unsigned int virq, unsigned int vector) | 896 | void mpic_set_vector(unsigned int virq, unsigned int vector) |
899 | { | 897 | { |
900 | struct mpic *mpic = mpic_from_irq(virq); | 898 | struct mpic *mpic = mpic_from_irq(virq); |
901 | unsigned int src = mpic_irq_to_hw(virq); | 899 | unsigned int src = virq_to_hw(virq); |
902 | unsigned int vecpri; | 900 | unsigned int vecpri; |
903 | 901 | ||
904 | DBG("mpic: set_vector(mpic:@%p,virq:%d,src:%d,vector:0x%x)\n", | 902 | DBG("mpic: set_vector(mpic:@%p,virq:%d,src:%d,vector:0x%x)\n", |
@@ -916,7 +914,7 @@ void mpic_set_vector(unsigned int virq, unsigned int vector) | |||
916 | void mpic_set_destination(unsigned int virq, unsigned int cpuid) | 914 | void mpic_set_destination(unsigned int virq, unsigned int cpuid) |
917 | { | 915 | { |
918 | struct mpic *mpic = mpic_from_irq(virq); | 916 | struct mpic *mpic = mpic_from_irq(virq); |
919 | unsigned int src = mpic_irq_to_hw(virq); | 917 | unsigned int src = virq_to_hw(virq); |
920 | 918 | ||
921 | DBG("mpic: set_destination(mpic:@%p,virq:%d,src:%d,cpuid:0x%x)\n", | 919 | DBG("mpic: set_destination(mpic:@%p,virq:%d,src:%d,cpuid:0x%x)\n", |
922 | mpic, virq, src, cpuid); | 920 | mpic, virq, src, cpuid); |
@@ -1427,7 +1425,7 @@ void __init mpic_set_serial_int(struct mpic *mpic, int enable) | |||
1427 | void mpic_irq_set_priority(unsigned int irq, unsigned int pri) | 1425 | void mpic_irq_set_priority(unsigned int irq, unsigned int pri) |
1428 | { | 1426 | { |
1429 | struct mpic *mpic = mpic_find(irq); | 1427 | struct mpic *mpic = mpic_find(irq); |
1430 | unsigned int src = mpic_irq_to_hw(irq); | 1428 | unsigned int src = virq_to_hw(irq); |
1431 | unsigned long flags; | 1429 | unsigned long flags; |
1432 | u32 reg; | 1430 | u32 reg; |
1433 | 1431 | ||