linux-mips
[Top] [All Lists]

[PATCH] clean up ret_from_{irq,exception}

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH] clean up ret_from_{irq,exception}
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
Date: Tue, 06 Feb 2007 16:53:27 +0100
Cc: linux-mips <linux-mips@linux-mips.org>
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:content-type:content-transfer-encoding:from; b=KwHe7wK7c6sSKeF6pB/UVCQzAd6O6p8CC/mmdqOvXHQyeEh6m5TjcQtlaff/u3MwovHLGSJgK3ECWClZqm0Qq/trjYSBdg0peYq4vdSpf8R/hHOLOOfTtl4DoMJ074YxPVSeasuJPGI4V5RIBv18zUk11LrP/om3An4T1WdnsfQ=
Original-recipient: rfc822;linux-mips@linux-mips.org
Reply-to: Franck <vagabon.xyz@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 1.5.0.4 (X11/20060614)
From: Franck Bui-Huu <fbuihuu@gmail.com>

This patch makes these routines a lot more readable whatever
the value of CONFIG_PREEMPT.

It also moves one branch instruction from ret_from_irq()
to ret_from_exception(). Therefore we favour the return
from irq path which should be more common than the other
one.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
 arch/mips/kernel/entry.S |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index f10b6a1..571029b 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -21,23 +21,18 @@
 #endif
 
 #ifndef CONFIG_PREEMPT
-       .macro  preempt_stop
-       local_irq_disable
-       .endm
 #define resume_kernel  restore_all
 #endif
 
        .text
        .align  5
-FEXPORT(ret_from_irq)
-       LONG_S  s0, TI_REGS($28)
-#ifdef CONFIG_PREEMPT
-FEXPORT(ret_from_exception)
-#else
-       b       _ret_from_irq
 FEXPORT(ret_from_exception)
-       preempt_stop
+#ifndef CONFIG_PREEMPT
+       local_irq_disable                       # preempt stop
 #endif
+       b       _ret_from_irq
+FEXPORT(ret_from_irq)
+       LONG_S  s0, TI_REGS($28)
 FEXPORT(_ret_from_irq)
        LONG_L  t0, PT_STATUS(sp)               # returning to kernel mode?
        andi    t0, t0, KU_USER
-- 
1.4.4.3.ge6d4


<Prev in Thread] Current Thread [Next in Thread>