: clean up and merge the MMU and non-MMU versions of entry.S
Subsystems (2)
v2 cover : clean up and merge the MMU and non-MMU versions of entry.S
With a little cleanup we can use much of the entry.S code on both the MMU and non-MMU m68k targets.
This is the second iteration of this patch set. I have limited the changes converting to use the ret_from_exception function entry point over the label. I have only changed those shared by both the MMU and non-MMU code. Andreas, does this look more acceptable?
--- arch/m68k/kernel/entry.S | 453 +++++++++++++++++++++++++++++++++++++++++++- arch/m68k/kernel/entry_mm.S | 423 ----------------------------------------- arch/m68k/kernel/entry_no.S | 130 ------------ 3 files changed, 452 insertions(+), 554 deletions(-)
PATCH v2 1/3 m68k: use some direct calls to ret_from_exception in entry code
From: Greg Ungerer <[email protected]>
The ret_from_excption code is referenced by its function name, or by a label set at the start of its code. The non-MMU code can share some of this code if we make direct calls to ret_from_exception instead of the associated label. The effected function paths are: buserr, trap and ret_from_fork. So change these to branch directly to ret_from_exception.
--- arch/m68k/kernel/entry_mm.S | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/m68k/kernel/entry_mm.S +3 -3
@@ -57,7 +57,7 @@ ENTRY(buserr) movel %sp,%sp@- | stack frame pointer argument bsrl buserr_c addql #4,%sp - jra .Lret_from_exception + jra ret_from_exception ENTRY(trap) SAVE_ALL_INT
@@ -65,7 +65,7 @@ ENTRY(trap) movel %sp,%sp@- | stack frame pointer argument bsrl trap_c addql #4,%sp - jra .Lret_from_exception + jra ret_from_exception | After a fork we jump here directly from resume, | so that %d1 contains the previous task
@@ -74,7 +74,7 @@ ENTRY(ret_from_fork) movel %d1,%sp@- jsr schedule_tail addql #4,%sp - jra .Lret_from_exception + jra ret_from_exception do_trace_entry: movel #-ENOSYS,%sp@(PT_OFF_D0)| needed for strace
Signature · 1 line
1.7.0.4
Re: [PATCH v2 1/3] m68k: use some direct calls to ret_from_exception in entry code
Quoted 9 lines · On Fri, May 18, 2012 at 6:22 AM, <[email protected]> wrote:
From: Greg Ungerer <[email protected]>
The
ret_from_excptioncode is referenced by its function name, or by a label set at the start of its code. The non-MMU code can share some of this code if we make direct calls toret_from_exceptioninstead of the associated label. The effected function paths are: buserr, trap andret_from_fork. So change these to branch directly toret_from_exception.Signed-off-by Greg Ungerer <[email protected]>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
PATCH v2 2/3 m68k: use jbsr to call functions instead of bsrl
In reply to [email protected]From: Greg Ungerer <[email protected]>
There is a few places that the m68k entry code uses the bsrl instruction to call other functions. That instruction is only supported on 68020 and higher CPU types. If we use jbsr instead the code will be clean for all 68k and ColdFire CPU types.
--- arch/m68k/kernel/entry_mm.S | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/m68k/kernel/entry_mm.S +2 -2
@@ -55,7 +55,7 @@ ENTRY(buserr) SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument - bsrl buserr_c + jbsr buserr_c addql #4,%sp jra ret_from_exception
@@ -63,7 +63,7 @@ ENTRY(trap) SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument - bsrl trap_c + jbsr trap_c addql #4,%sp jra ret_from_exception
Signature · 1 line
1.7.0.4
Re: [PATCH v2 2/3] m68k: use jbsr to call functions instead of bsrl
Quoted 8 lines · On Fri, May 18, 2012 at 6:22 AM, <[email protected]> wrote:
From: Greg Ungerer <[email protected]>
There is a few places that the m68k entry code uses the bsrl instruction to call other functions. That instruction is only supported on 68020 and higher CPU types. If we use jbsr instead the code will be clean for all 68k and ColdFire CPU types.
Signed-off-by Greg Ungerer <[email protected]>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
PATCH v2 3/3 m68k: merge the MMU and non-MMU versions of the entry.S code
In reply to [email protected]From: Greg Ungerer <[email protected]>
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.
---
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.Sarch/m68k/kernel/entry.S renamed from arch/m68k/kernel/entry_mm.S +69 -36
@@ -51,6 +51,42 @@ .globl user_irqvec_fixup .text +ENTRY(sys_fork) + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + jbsr m68k_fork + addql #4,%sp + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_clone) + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + jbsr m68k_clone + addql #4,%sp + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_vfork) + SAVE_SWITCH_STACK + pea %sp@(SWITCH_STACK_SIZE) + jbsr m68k_vfork + addql #4,%sp + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_sigreturn) + SAVE_SWITCH_STACK + jbsr do_sigreturn + RESTORE_SWITCH_STACK + rts + +ENTRY(sys_rt_sigreturn) + SAVE_SWITCH_STACK + jbsr do_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@ + jbsr set_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) - jbsr m68k_fork - addql #4,%sp - RESTORE_SWITCH_STACK - rts - -ENTRY(sys_clone) - SAVE_SWITCH_STACK - pea %sp@(SWITCH_STACK_SIZE) - jbsr m68k_clone - addql #4,%sp - RESTORE_SWITCH_STACK - rts - -ENTRY(sys_vfork) - SAVE_SWITCH_STACK - pea %sp@(SWITCH_STACK_SIZE) - jbsr m68k_vfork - addql #4,%sp - RESTORE_SWITCH_STACK - rts - -ENTRY(sys_sigreturn) - SAVE_SWITCH_STACK - jbsr do_sigreturn - RESTORE_SWITCH_STACK - rts - -ENTRY(sys_rt_sigreturn) - SAVE_SWITCH_STACK - jbsr do_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 */
arch/m68k/kernel/entry_no.S deleted +0 -130
130 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Re: [PATCH v2 3/3] m68k: merge the MMU and non-MMU versions of the entry.S code
Quoted 7 lines · On Fri, May 18, 2012 at 6:22 AM, <[email protected]> wrote:
From: Greg Ungerer <[email protected]>
Some of the
entry.Scode is common to both MMU and non-MMU builds. So merge theentry_no.Sandentry_mm.Sfiles back into a single file. With a little code movement we only need a single #ifdef.Signed-off-by Greg Ungerer <[email protected]>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev