Re: [uClinux-dev] [PATCH v2 3/3] m68k: merge the MMU and non-MMU versions of the entry.S code

2012-05-20 Thread Geert Uytterhoeven
On Fri, May 18, 2012 at 6:22 AM,   wrote:
> From: Greg Ungerer 
>
> Some of the entry.S code is common to both MMU and non-MMU builds.
> So merge the entry_no.S and entry_mm.S files back into a single file.
> With a little code movement we only need a single #ifdef.
>
> Signed-off-by: Greg Ungerer 

Acked-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

[uClinux-dev] [PATCH v2 3/3] m68k: merge the MMU and non-MMU versions of the entry.S code

2012-05-17 Thread gerg
From: Greg Ungerer 

Some of the entry.S code is common to both MMU and non-MMU builds.
So merge the entry_no.S and entry_mm.S files back into a single file.
With a little code movement we only need a single #ifdef.

Signed-off-by: Greg Ungerer 
---
 arch/m68k/kernel/{entry_mm.S => entry.S} |  105 
 arch/m68k/kernel/entry_no.S  |  130 --
 2 files changed, 69 insertions(+), 166 deletions(-)
 rename arch/m68k/kernel/{entry_mm.S => entry.S} (94%)
 delete mode 100644 arch/m68k/kernel/entry_no.S

diff --git a/arch/m68k/kernel/entry_mm.S b/arch/m68k/kernel/entry.S
similarity index 94%
rename from arch/m68k/kernel/entry_mm.S
rename to arch/m68k/kernel/entry.S
index 2385539..e871701 100644
--- a/arch/m68k/kernel/entry_mm.S
+++ b/arch/m68k/kernel/entry.S
@@ -51,6 +51,42 @@
 .globl user_irqvec_fixup
 
 .text
+ENTRY(sys_fork)
+   SAVE_SWITCH_STACK
+   pea %sp@(SWITCH_STACK_SIZE)
+   jbsrm68k_fork
+   addql   #4,%sp
+   RESTORE_SWITCH_STACK
+   rts
+
+ENTRY(sys_clone)
+   SAVE_SWITCH_STACK
+   pea %sp@(SWITCH_STACK_SIZE)
+   jbsrm68k_clone
+   addql   #4,%sp
+   RESTORE_SWITCH_STACK
+   rts
+
+ENTRY(sys_vfork)
+   SAVE_SWITCH_STACK
+   pea %sp@(SWITCH_STACK_SIZE)
+   jbsrm68k_vfork
+   addql   #4,%sp
+   RESTORE_SWITCH_STACK
+   rts
+
+ENTRY(sys_sigreturn)
+   SAVE_SWITCH_STACK
+   jbsrdo_sigreturn
+   RESTORE_SWITCH_STACK
+   rts
+
+ENTRY(sys_rt_sigreturn)
+   SAVE_SWITCH_STACK
+   jbsrdo_rt_sigreturn
+   RESTORE_SWITCH_STACK
+   rts
+
 ENTRY(buserr)
SAVE_ALL_INT
GET_CURRENT(%d0)
@@ -76,6 +112,38 @@ ENTRY(ret_from_fork)
addql   #4,%sp
jra ret_from_exception
 
+#if defined(CONFIG_COLDFIRE) || !defined(CONFIG_MMU)
+
+#ifdef TRAP_DBG_INTERRUPT
+
+.globl dbginterrupt
+ENTRY(dbginterrupt)
+   SAVE_ALL_INT
+   GET_CURRENT(%d0)
+   movel   %sp,%sp@-   /* stack frame pointer argument */
+   jsr dbginterrupt_c
+   addql   #4,%sp
+   jra ret_from_exception
+#endif
+
+ENTRY(reschedule)
+   /* save top of frame */
+   pea %sp@
+   jbsrset_esp0
+   addql   #4,%sp
+   pea ret_from_exception
+   jmp schedule
+
+ENTRY(ret_from_user_signal)
+   moveq #__NR_sigreturn,%d0
+   trap #0
+
+ENTRY(ret_from_user_rt_signal)
+   movel #__NR_rt_sigreturn,%d0
+   trap #0
+
+#else
+
 do_trace_entry:
movel   #-ENOSYS,%sp@(PT_OFF_D0)| needed for strace
subql   #4,%sp
@@ -274,42 +342,6 @@ ENTRY(bad_inthandler)
RESTORE_ALL
 
 
-ENTRY(sys_fork)
-   SAVE_SWITCH_STACK
-   pea %sp@(SWITCH_STACK_SIZE)
-   jbsrm68k_fork
-   addql   #4,%sp
-   RESTORE_SWITCH_STACK
-   rts
-
-ENTRY(sys_clone)
-   SAVE_SWITCH_STACK
-   pea %sp@(SWITCH_STACK_SIZE)
-   jbsrm68k_clone
-   addql   #4,%sp
-   RESTORE_SWITCH_STACK
-   rts
-
-ENTRY(sys_vfork)
-   SAVE_SWITCH_STACK
-   pea %sp@(SWITCH_STACK_SIZE)
-   jbsrm68k_vfork
-   addql   #4,%sp
-   RESTORE_SWITCH_STACK
-   rts
-
-ENTRY(sys_sigreturn)
-   SAVE_SWITCH_STACK
-   jbsrdo_sigreturn
-   RESTORE_SWITCH_STACK
-   rts
-
-ENTRY(sys_rt_sigreturn)
-   SAVE_SWITCH_STACK
-   jbsrdo_rt_sigreturn
-   RESTORE_SWITCH_STACK
-   rts
-
 resume:
/*
 * Beware - when entering resume, prev (the current task) is
@@ -417,3 +449,4 @@ resume:
 
rts
 
+#endif /* CONFIG_MMU && !CONFIG_COLDFIRE */
diff --git a/arch/m68k/kernel/entry_no.S b/arch/m68k/kernel/entry_no.S
deleted file mode 100644
index d80cba4..000
--- a/arch/m68k/kernel/entry_no.S
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *  linux/arch/m68knommu/kernel/entry.S
- *
- *  Copyright (C) 1999-2002, Greg Ungerer (g...@snapgear.com)
- *  Copyright (C) 1998  D. Jeff Dionne ,
- *  Kenneth Albanowski ,
- *  Copyright (C) 2000  Lineo Inc. (www.lineo.com) 
- *
- * Based on:
- *
- *  linux/arch/m68k/kernel/entry.S
- *
- *  Copyright (C) 1991, 1992  Linus Torvalds
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file README.legal in the main directory of this archive
- * for more details.
- *
- * Linux/m68k support by Hamish Macdonald
- *
- * 68060 fixes by Jesper Skov
- * ColdFire support by Greg Ungerer (g...@snapgear.com)
- * 5307 fixes by David W. Miller
- * linux 2.4 support David McCullough 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-.text
-
-.globl buserr
-.globl trap
-.globl ret_from_exception
-.globl ret_from_signal
-.globl sys_fork
-.globl sys_clone
-.globl sys_vfork
-
-ENTRY(buserr)
-   SAVE_ALL_INT
-   GET_CURRENT(%d0)
-   movel   %sp,%sp@-   /* stack frame pointer argument */
-   jsr buserr_c
-   addql   #4,%sp
-