Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Franck Bui-Huu and committed by
Ralf Baechle
7da8a581 6f3aa38e

+8 -11
+8 -11
arch/mips/kernel/entry.S
··· 21 21 #endif 22 22 23 23 #ifndef CONFIG_PREEMPT 24 - .macro preempt_stop 25 - local_irq_disable 26 - .endm 27 24 #define resume_kernel restore_all 25 + #else 26 + #define __ret_from_irq ret_from_exception 28 27 #endif 29 28 30 29 .text 31 30 .align 5 31 + #ifndef CONFIG_PREEMPT 32 + FEXPORT(ret_from_exception) 33 + local_irq_disable # preempt stop 34 + b __ret_from_irq 35 + #endif 32 36 FEXPORT(ret_from_irq) 33 37 LONG_S s0, TI_REGS($28) 34 - #ifdef CONFIG_PREEMPT 35 - FEXPORT(ret_from_exception) 36 - #else 37 - b _ret_from_irq 38 - FEXPORT(ret_from_exception) 39 - preempt_stop 40 - #endif 41 - FEXPORT(_ret_from_irq) 38 + FEXPORT(__ret_from_irq) 42 39 LONG_L t0, PT_STATUS(sp) # returning to kernel mode? 43 40 andi t0, t0, KU_USER 44 41 beqz t0, resume_kernel