diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-10-08 12:24:23 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-10-09 18:20:46 -0400 |
commit | f431baa55abf8adeed0c718b51deacbc151f58f1 (patch) | |
tree | fe0383328c1d8bcb0fae7e266a437b980a05a7f9 /arch/mips/kernel | |
parent | 441ee341ad63572f39cb8074e31806b5b1471d0b (diff) |
[MIPS] ret_from_irq adjustment
Make sure that RA on top of interrupt stack is an address of ret_from_irq,
so that dump_stack etc. can trace info interrupted context.
Also this patch fixes except_vec_vi_handler and __smtc_ipi_vector which
seems broken.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/entry.S | 14 | ||||
-rw-r--r-- | arch/mips/kernel/genex.S | 8 | ||||
-rw-r--r-- | arch/mips/kernel/smtc-asm.S | 9 |
3 files changed, 15 insertions, 16 deletions
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index e93e43e1f42d..417c08ac76eb 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S | |||
@@ -20,10 +20,7 @@ | |||
20 | #include <asm/mipsmtregs.h> | 20 | #include <asm/mipsmtregs.h> |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #ifdef CONFIG_PREEMPT | 23 | #ifndef CONFIG_PREEMPT |
24 | .macro preempt_stop | ||
25 | .endm | ||
26 | #else | ||
27 | .macro preempt_stop | 24 | .macro preempt_stop |
28 | local_irq_disable | 25 | local_irq_disable |
29 | .endm | 26 | .endm |
@@ -32,9 +29,16 @@ | |||
32 | 29 | ||
33 | .text | 30 | .text |
34 | .align 5 | 31 | .align 5 |
32 | FEXPORT(ret_from_irq) | ||
33 | LONG_S s0, TI_REGS($28) | ||
34 | #ifdef CONFIG_PREEMPT | ||
35 | FEXPORT(ret_from_exception) | ||
36 | #else | ||
37 | b _ret_from_irq | ||
35 | FEXPORT(ret_from_exception) | 38 | FEXPORT(ret_from_exception) |
36 | preempt_stop | 39 | preempt_stop |
37 | FEXPORT(ret_from_irq) | 40 | #endif |
41 | FEXPORT(_ret_from_irq) | ||
38 | LONG_L t0, PT_STATUS(sp) # returning to kernel mode? | 42 | LONG_L t0, PT_STATUS(sp) # returning to kernel mode? |
39 | andi t0, t0, KU_USER | 43 | andi t0, t0, KU_USER |
40 | beqz t0, resume_kernel | 44 | beqz t0, resume_kernel |
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 50ed77297728..5baca16993d0 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S | |||
@@ -133,9 +133,8 @@ NESTED(handle_int, PT_SIZE, sp) | |||
133 | 133 | ||
134 | LONG_L s0, TI_REGS($28) | 134 | LONG_L s0, TI_REGS($28) |
135 | LONG_S sp, TI_REGS($28) | 135 | LONG_S sp, TI_REGS($28) |
136 | jal plat_irq_dispatch | 136 | PTR_LA ra, ret_from_irq |
137 | LONG_S s0, TI_REGS($28) | 137 | j plat_irq_dispatch |
138 | j ret_from_irq | ||
139 | END(handle_int) | 138 | END(handle_int) |
140 | 139 | ||
141 | __INIT | 140 | __INIT |
@@ -224,9 +223,8 @@ NESTED(except_vec_vi_handler, 0, sp) | |||
224 | 223 | ||
225 | LONG_L s0, TI_REGS($28) | 224 | LONG_L s0, TI_REGS($28) |
226 | LONG_S sp, TI_REGS($28) | 225 | LONG_S sp, TI_REGS($28) |
227 | jalr v0 | ||
228 | LONG_S s0, TI_REGS($28) | ||
229 | PTR_LA ra, ret_from_irq | 226 | PTR_LA ra, ret_from_irq |
227 | jr v0 | ||
230 | END(except_vec_vi_handler) | 228 | END(except_vec_vi_handler) |
231 | 229 | ||
232 | /* | 230 | /* |
diff --git a/arch/mips/kernel/smtc-asm.S b/arch/mips/kernel/smtc-asm.S index 76cb31d57482..1cb9441f1474 100644 --- a/arch/mips/kernel/smtc-asm.S +++ b/arch/mips/kernel/smtc-asm.S | |||
@@ -97,15 +97,12 @@ FEXPORT(__smtc_ipi_vector) | |||
97 | SAVE_ALL | 97 | SAVE_ALL |
98 | CLI | 98 | CLI |
99 | TRACE_IRQS_OFF | 99 | TRACE_IRQS_OFF |
100 | move a0,sp | ||
101 | /* Function to be invoked passed stack pad slot 5 */ | 100 | /* Function to be invoked passed stack pad slot 5 */ |
102 | lw t0,PT_PADSLOT5(sp) | 101 | lw t0,PT_PADSLOT5(sp) |
103 | /* Argument from sender passed in stack pad slot 4 */ | 102 | /* Argument from sender passed in stack pad slot 4 */ |
104 | lw a1,PT_PADSLOT4(sp) | 103 | lw a0,PT_PADSLOT4(sp) |
105 | jalr t0 | 104 | PTR_LA ra, _ret_from_irq |
106 | nop | 105 | jr t0 |
107 | j ret_from_irq | ||
108 | nop | ||
109 | 106 | ||
110 | /* | 107 | /* |
111 | * Called from idle loop to provoke processing of queued IPIs | 108 | * Called from idle loop to provoke processing of queued IPIs |