aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-03-14 00:03:35 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-03-14 00:03:35 -0400
commit3afb209a43a4216ad4f1411922d47a44252926c6 (patch)
tree8c91a9edad3b09181bd290f33f3e14e3d7c01e2c
parentffe1b4e9f436fd7bb784f3bf7ee963c149fbca5f (diff)
sh: Fix bogus regs pointer in do_IRQ().
SH-3 and SH-4 were trampling the register, and SH-2 wasn't even setting it in the first place. This ended up with some rather broken behaviour in the sysrq show_regs(). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/sh/kernel/cpu/sh2/entry.S1
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S5
-rw-r--r--arch/sh/kernel/irq.c15
-rw-r--r--include/asm-sh/irq.h5
4 files changed, 12 insertions, 14 deletions
diff --git a/arch/sh/kernel/cpu/sh2/entry.S b/arch/sh/kernel/cpu/sh2/entry.S
index 7f7d292f36e..c16dc8fec48 100644
--- a/arch/sh/kernel/cpu/sh2/entry.S
+++ b/arch/sh/kernel/cpu/sh2/entry.S
@@ -165,6 +165,7 @@ ENTRY(exception_handler)
165 165
166interrupt_entry: 166interrupt_entry:
167 mov r9,r4 167 mov r9,r4
168 mov r15,r5
168 mov.l 6f,r9 169 mov.l 6f,r9
169 mov.l 7f,r8 170 mov.l 7f,r8
170 jmp @r8 171 jmp @r8
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index c19205b0f2c..f3e827f29a4 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -514,13 +514,16 @@ skip_save:
514 514
515interrupt_exception: 515interrupt_exception:
516 mov.l 1f, r9 516 mov.l 1f, r9
517 mov.l 2f, r4
518 mov.l @r4, r4
517 jmp @r9 519 jmp @r9
518 nop 520 mov r15, r5
519 rts 521 rts
520 nop 522 nop
521 523
522 .align 2 524 .align 2
5231: .long do_IRQ 5251: .long do_IRQ
5262: .long INTEVT
524 527
525 .align 2 528 .align 2
526ENTRY(exception_none) 529ENTRY(exception_none)
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 67be2b6e8cd..9bdd8a00cd4 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -11,7 +11,6 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/kernel_stat.h> 12#include <linux/kernel_stat.h>
13#include <linux/seq_file.h> 13#include <linux/seq_file.h>
14#include <linux/io.h>
15#include <linux/irq.h> 14#include <linux/irq.h>
16#include <asm/processor.h> 15#include <asm/processor.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
@@ -82,13 +81,9 @@ static union irq_ctx *hardirq_ctx[NR_CPUS] __read_mostly;
82static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly; 81static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly;
83#endif 82#endif
84 83
85asmlinkage int do_IRQ(unsigned long r4, unsigned long r5, 84asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
86 unsigned long r6, unsigned long r7,
87 struct pt_regs __regs)
88{ 85{
89 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
90 struct pt_regs *old_regs = set_irq_regs(regs); 86 struct pt_regs *old_regs = set_irq_regs(regs);
91 int irq;
92#ifdef CONFIG_4KSTACKS 87#ifdef CONFIG_4KSTACKS
93 union irq_ctx *curctx, *irqctx; 88 union irq_ctx *curctx, *irqctx;
94#endif 89#endif
@@ -111,13 +106,7 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5,
111 } 106 }
112#endif 107#endif
113 108
114#ifdef CONFIG_CPU_HAS_INTEVT 109 irq = irq_demux(evt2irq(irq));
115 irq = evt2irq(ctrl_inl(INTEVT));
116#else
117 irq = r4;
118#endif
119
120 irq = irq_demux(irq);
121 110
122#ifdef CONFIG_4KSTACKS 111#ifdef CONFIG_4KSTACKS
123 curctx = (union irq_ctx *)current_thread_info(); 112 curctx = (union irq_ctx *)current_thread_info();
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index 8ccf7ae593e..afe188f0ad5 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -94,8 +94,13 @@
94/* 94/*
95 * Convert back and forth between INTEVT and IRQ values. 95 * Convert back and forth between INTEVT and IRQ values.
96 */ 96 */
97#ifdef CONFIG_CPU_HAS_INTEVT
97#define evt2irq(evt) (((evt) >> 5) - 16) 98#define evt2irq(evt) (((evt) >> 5) - 16)
98#define irq2evt(irq) (((irq) + 16) << 5) 99#define irq2evt(irq) (((irq) + 16) << 5)
100#else
101#define evt2irq(evt) (evt)
102#define irq2evt(irq) (irq)
103#endif
99 104
100/* 105/*
101 * Simple Mask Register Support 106 * Simple Mask Register Support