aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/entry.S
diff options
context:
space:
mode:
authorFranck Bui-Huu <vagabon.xyz@gmail.com>2007-02-13 08:50:18 -0500
committerRalf Baechle <ralf@linux-mips.org>2007-02-13 17:40:51 -0500
commit7da8a581f5ec0ecac5f0afc9ec26ce13b780d48d (patch)
treea94025dbba3d4c1f5a10440872d08287cf991570 /arch/mips/kernel/entry.S
parent6f3aa38e191326a82d5dcae1f6cdc88b1d9a8d32 (diff)
[MIPS] Make entry.S a little more readable.
When CONFIG_PREEMPT is not set, it also moves one branch instruction from ret_from_irq() to ret_from_exception(). Therefore we favour the return from irq case which should be more common than the other one. Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com> Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/entry.S')
-rw-r--r--arch/mips/kernel/entry.S19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index f10b6a19f8bf..0b78fcbf044a 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -21,24 +21,21 @@
21#endif 21#endif
22 22
23#ifndef CONFIG_PREEMPT 23#ifndef CONFIG_PREEMPT
24 .macro preempt_stop
25 local_irq_disable
26 .endm
27#define resume_kernel restore_all 24#define resume_kernel restore_all
25#else
26#define __ret_from_irq ret_from_exception
28#endif 27#endif
29 28
30 .text 29 .text
31 .align 5 30 .align 5
32FEXPORT(ret_from_irq) 31#ifndef CONFIG_PREEMPT
33 LONG_S s0, TI_REGS($28)
34#ifdef CONFIG_PREEMPT
35FEXPORT(ret_from_exception)
36#else
37 b _ret_from_irq
38FEXPORT(ret_from_exception) 32FEXPORT(ret_from_exception)
39 preempt_stop 33 local_irq_disable # preempt stop
34 b __ret_from_irq
40#endif 35#endif
41FEXPORT(_ret_from_irq) 36FEXPORT(ret_from_irq)
37 LONG_S s0, TI_REGS($28)
38FEXPORT(__ret_from_irq)
42 LONG_L t0, PT_STATUS(sp) # returning to kernel mode? 39 LONG_L t0, PT_STATUS(sp) # returning to kernel mode?
43 andi t0, t0, KU_USER 40 andi t0, t0, KU_USER
44 beqz t0, resume_kernel 41 beqz t0, resume_kernel