diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 05:03:34 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 05:03:34 -0400 |
commit | 8599cf059209de22dd3be16816b90f1aad10c74a (patch) | |
tree | 8cd5bdec25431a2797147c3eea11532ec71b6272 /arch/sh/kernel | |
parent | ba463937ef75bceaf3943edf01f849257c68623a (diff) |
sh: Cleanup IRQ disabling for hardirq handlers.
The generic hardirq layer already takes care of a lot of the
appropriate locking and disabling for us, no need to duplicate
it in the handlers..
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/irq/ipr.c | 8 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/irq/maskreg.c | 6 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/irq/pint.c | 8 |
3 files changed, 4 insertions, 18 deletions
diff --git a/arch/sh/kernel/cpu/irq/ipr.c b/arch/sh/kernel/cpu/irq/ipr.c index 00edee971bcb..4c4fd4118d1a 100644 --- a/arch/sh/kernel/cpu/irq/ipr.c +++ b/arch/sh/kernel/cpu/irq/ipr.c | |||
@@ -57,31 +57,27 @@ static struct hw_interrupt_type ipr_irq_type = { | |||
57 | 57 | ||
58 | static void disable_ipr_irq(unsigned int irq) | 58 | static void disable_ipr_irq(unsigned int irq) |
59 | { | 59 | { |
60 | unsigned long val, flags; | 60 | unsigned long val; |
61 | unsigned int addr = ipr_data[irq].addr; | 61 | unsigned int addr = ipr_data[irq].addr; |
62 | unsigned short mask = 0xffff ^ (0x0f << ipr_data[irq].shift); | 62 | unsigned short mask = 0xffff ^ (0x0f << ipr_data[irq].shift); |
63 | 63 | ||
64 | /* Set the priority in IPR to 0 */ | 64 | /* Set the priority in IPR to 0 */ |
65 | local_irq_save(flags); | ||
66 | val = ctrl_inw(addr); | 65 | val = ctrl_inw(addr); |
67 | val &= mask; | 66 | val &= mask; |
68 | ctrl_outw(val, addr); | 67 | ctrl_outw(val, addr); |
69 | local_irq_restore(flags); | ||
70 | } | 68 | } |
71 | 69 | ||
72 | static void enable_ipr_irq(unsigned int irq) | 70 | static void enable_ipr_irq(unsigned int irq) |
73 | { | 71 | { |
74 | unsigned long val, flags; | 72 | unsigned long val; |
75 | unsigned int addr = ipr_data[irq].addr; | 73 | unsigned int addr = ipr_data[irq].addr; |
76 | int priority = ipr_data[irq].priority; | 74 | int priority = ipr_data[irq].priority; |
77 | unsigned short value = (priority << ipr_data[irq].shift); | 75 | unsigned short value = (priority << ipr_data[irq].shift); |
78 | 76 | ||
79 | /* Set priority in IPR back to original value */ | 77 | /* Set priority in IPR back to original value */ |
80 | local_irq_save(flags); | ||
81 | val = ctrl_inw(addr); | 78 | val = ctrl_inw(addr); |
82 | val |= value; | 79 | val |= value; |
83 | ctrl_outw(val, addr); | 80 | ctrl_outw(val, addr); |
84 | local_irq_restore(flags); | ||
85 | } | 81 | } |
86 | 82 | ||
87 | static void mask_and_ack_ipr(unsigned int irq) | 83 | static void mask_and_ack_ipr(unsigned int irq) |
diff --git a/arch/sh/kernel/cpu/irq/maskreg.c b/arch/sh/kernel/cpu/irq/maskreg.c index 1cc0de15e4a6..492db31b3cab 100644 --- a/arch/sh/kernel/cpu/irq/maskreg.c +++ b/arch/sh/kernel/cpu/irq/maskreg.c | |||
@@ -52,32 +52,26 @@ static void shutdown_maskreg_irq(unsigned int irq) | |||
52 | 52 | ||
53 | static void disable_maskreg_irq(unsigned int irq) | 53 | static void disable_maskreg_irq(unsigned int irq) |
54 | { | 54 | { |
55 | unsigned long flags; | ||
56 | unsigned short val, mask = 0x01 << irq; | 55 | unsigned short val, mask = 0x01 << irq; |
57 | 56 | ||
58 | BUG_ON(!irq_mask_register); | 57 | BUG_ON(!irq_mask_register); |
59 | 58 | ||
60 | /* Set "irq"th bit */ | 59 | /* Set "irq"th bit */ |
61 | local_irq_save(flags); | ||
62 | val = ctrl_inw(irq_mask_register); | 60 | val = ctrl_inw(irq_mask_register); |
63 | val |= mask; | 61 | val |= mask; |
64 | ctrl_outw(val, irq_mask_register); | 62 | ctrl_outw(val, irq_mask_register); |
65 | local_irq_restore(flags); | ||
66 | } | 63 | } |
67 | 64 | ||
68 | static void enable_maskreg_irq(unsigned int irq) | 65 | static void enable_maskreg_irq(unsigned int irq) |
69 | { | 66 | { |
70 | unsigned long flags; | ||
71 | unsigned short val, mask = ~(0x01 << irq); | 67 | unsigned short val, mask = ~(0x01 << irq); |
72 | 68 | ||
73 | BUG_ON(!irq_mask_register); | 69 | BUG_ON(!irq_mask_register); |
74 | 70 | ||
75 | /* Clear "irq"th bit */ | 71 | /* Clear "irq"th bit */ |
76 | local_irq_save(flags); | ||
77 | val = ctrl_inw(irq_mask_register); | 72 | val = ctrl_inw(irq_mask_register); |
78 | val &= mask; | 73 | val &= mask; |
79 | ctrl_outw(val, irq_mask_register); | 74 | ctrl_outw(val, irq_mask_register); |
80 | local_irq_restore(flags); | ||
81 | } | 75 | } |
82 | 76 | ||
83 | static void mask_and_ack_maskreg(unsigned int irq) | 77 | static void mask_and_ack_maskreg(unsigned int irq) |
diff --git a/arch/sh/kernel/cpu/irq/pint.c b/arch/sh/kernel/cpu/irq/pint.c index 80cd8108d36a..17f47b373d6e 100644 --- a/arch/sh/kernel/cpu/irq/pint.c +++ b/arch/sh/kernel/cpu/irq/pint.c | |||
@@ -48,26 +48,22 @@ static struct hw_interrupt_type pint_irq_type = { | |||
48 | 48 | ||
49 | static void disable_pint_irq(unsigned int irq) | 49 | static void disable_pint_irq(unsigned int irq) |
50 | { | 50 | { |
51 | unsigned long val, flags; | 51 | unsigned long val; |
52 | 52 | ||
53 | local_irq_save(flags); | ||
54 | val = ctrl_inw(INTC_INTER); | 53 | val = ctrl_inw(INTC_INTER); |
55 | val &= ~(1 << (irq - PINT_IRQ_BASE)); | 54 | val &= ~(1 << (irq - PINT_IRQ_BASE)); |
56 | ctrl_outw(val, INTC_INTER); /* disable PINTn */ | 55 | ctrl_outw(val, INTC_INTER); /* disable PINTn */ |
57 | portcr_mask &= ~(3 << (irq - PINT_IRQ_BASE)*2); | 56 | portcr_mask &= ~(3 << (irq - PINT_IRQ_BASE)*2); |
58 | local_irq_restore(flags); | ||
59 | } | 57 | } |
60 | 58 | ||
61 | static void enable_pint_irq(unsigned int irq) | 59 | static void enable_pint_irq(unsigned int irq) |
62 | { | 60 | { |
63 | unsigned long val, flags; | 61 | unsigned long val; |
64 | 62 | ||
65 | local_irq_save(flags); | ||
66 | val = ctrl_inw(INTC_INTER); | 63 | val = ctrl_inw(INTC_INTER); |
67 | val |= 1 << (irq - PINT_IRQ_BASE); | 64 | val |= 1 << (irq - PINT_IRQ_BASE); |
68 | ctrl_outw(val, INTC_INTER); /* enable PINTn */ | 65 | ctrl_outw(val, INTC_INTER); /* enable PINTn */ |
69 | portcr_mask |= 3 << (irq - PINT_IRQ_BASE)*2; | 66 | portcr_mask |= 3 << (irq - PINT_IRQ_BASE)*2; |
70 | local_irq_restore(flags); | ||
71 | } | 67 | } |
72 | 68 | ||
73 | static void mask_and_ack_pint(unsigned int irq) | 69 | static void mask_and_ack_pint(unsigned int irq) |