From 9f3057fc0d3a543c51be3c766fc9adf63336d2ab Mon Sep 17 00:00:00 2001 From: Daniel Ramirez Date: Mon, 2 Dec 2013 23:11:39 -0600 Subject: m68k: refactored shared/start.S to shared/start/start.S --- c/src/lib/libbsp/m68k/Makefile.am | 4 +- c/src/lib/libbsp/m68k/idp/Makefile.am | 2 +- c/src/lib/libbsp/m68k/mvme136/Makefile.am | 2 +- c/src/lib/libbsp/m68k/mvme147/Makefile.am | 2 +- c/src/lib/libbsp/m68k/mvme147s/Makefile.am | 2 +- c/src/lib/libbsp/m68k/mvme162/Makefile.am | 2 +- c/src/lib/libbsp/m68k/mvme167/Makefile.am | 2 +- c/src/lib/libbsp/m68k/shared/start.S | 140 ----------------------------- c/src/lib/libbsp/m68k/shared/start/start.S | 140 +++++++++++++++++++++++++++++ 9 files changed, 149 insertions(+), 147 deletions(-) delete mode 100644 c/src/lib/libbsp/m68k/shared/start.S create mode 100644 c/src/lib/libbsp/m68k/shared/start/start.S diff --git a/c/src/lib/libbsp/m68k/Makefile.am b/c/src/lib/libbsp/m68k/Makefile.am index 0461d01a27..1544a09e88 100644 --- a/c/src/lib/libbsp/m68k/Makefile.am +++ b/c/src/lib/libbsp/m68k/Makefile.am @@ -3,7 +3,9 @@ ACLOCAL_AMFLAGS = -I ../../../aclocal ## Descend into the @RTEMS_BSP_FAMILY@ directory SUBDIRS = @RTEMS_BSP_FAMILY@ -EXTRA_DIST = shared/m68kpretaskinghook.c ../shared/setvec.c shared/start.S +EXTRA_DIST = shared/m68kpretaskinghook.c +EXTRA_DIST += ../shared/setvec.c +EXTRA_DIST += shared/start.S EXTRA_DIST += shared/bspspuriousinit.c shared/m68000spurious.c diff --git a/c/src/lib/libbsp/m68k/idp/Makefile.am b/c/src/lib/libbsp/m68k/idp/Makefile.am index f13f028768..35f873e7a3 100644 --- a/c/src/lib/libbsp/m68k/idp/Makefile.am +++ b/c/src/lib/libbsp/m68k/idp/Makefile.am @@ -17,7 +17,7 @@ include_HEADERS += include/leds.h nodist_include_HEADERS += ../../shared/include/coverhd.h noinst_LIBRARIES = libbspstart.a -libbspstart_a_SOURCES = ../../m68k/shared/start.S +libbspstart_a_SOURCES = ../../m68k/shared/start/start.S project_lib_DATA = start.$(OBJEXT) dist_project_lib_DATA += startup/linkcmds diff --git a/c/src/lib/libbsp/m68k/mvme136/Makefile.am b/c/src/lib/libbsp/m68k/mvme136/Makefile.am index a887fcccfe..262e82ec03 100644 --- a/c/src/lib/libbsp/m68k/mvme136/Makefile.am +++ b/c/src/lib/libbsp/m68k/mvme136/Makefile.am @@ -17,7 +17,7 @@ noinst_PROGRAMS = include_HEADERS += include/coverhd.h noinst_LIBRARIES = libbspstart.a -libbspstart_a_SOURCES = ../../m68k/shared/start.S +libbspstart_a_SOURCES = ../../m68k/shared/start/start.S project_lib_DATA = start.$(OBJEXT) dist_project_lib_DATA += startup/linkcmds diff --git a/c/src/lib/libbsp/m68k/mvme147/Makefile.am b/c/src/lib/libbsp/m68k/mvme147/Makefile.am index a9464f0f3c..07cf64697b 100644 --- a/c/src/lib/libbsp/m68k/mvme147/Makefile.am +++ b/c/src/lib/libbsp/m68k/mvme147/Makefile.am @@ -17,7 +17,7 @@ noinst_PROGRAMS = include_HEADERS += include/coverhd.h noinst_LIBRARIES = libbspstart.a -libbspstart_a_SOURCES = ../../m68k/shared/start.S +libbspstart_a_SOURCES = ../../m68k/shared/start/start.S project_lib_DATA = start.$(OBJEXT) dist_project_lib_DATA += startup/linkcmds diff --git a/c/src/lib/libbsp/m68k/mvme147s/Makefile.am b/c/src/lib/libbsp/m68k/mvme147s/Makefile.am index 8ca16d547c..933cf757d1 100644 --- a/c/src/lib/libbsp/m68k/mvme147s/Makefile.am +++ b/c/src/lib/libbsp/m68k/mvme147s/Makefile.am @@ -17,7 +17,7 @@ noinst_PROGRAMS = include_HEADERS += include/coverhd.h noinst_LIBRARIES = libbspstart.a -libbspstart_a_SOURCES = ../../m68k/shared/start.S +libbspstart_a_SOURCES = ../../m68k/shared/start/start.S project_lib_DATA = start.$(OBJEXT) dist_project_lib_DATA += startup/linkcmds diff --git a/c/src/lib/libbsp/m68k/mvme162/Makefile.am b/c/src/lib/libbsp/m68k/mvme162/Makefile.am index 5272bd4fc2..95c0864b3c 100644 --- a/c/src/lib/libbsp/m68k/mvme162/Makefile.am +++ b/c/src/lib/libbsp/m68k/mvme162/Makefile.am @@ -21,7 +21,7 @@ include_HEADERS += include/page_table.h nodist_include_HEADERS += $(top_srcdir)/../shared/mvme/mvme16x_hw.h noinst_LIBRARIES = libbspstart.a -libbspstart_a_SOURCES = ../../m68k/shared/start.S +libbspstart_a_SOURCES = ../../m68k/shared/start/start.S project_lib_DATA = start.$(OBJEXT) dist_project_lib_DATA += startup/linkcmds diff --git a/c/src/lib/libbsp/m68k/mvme167/Makefile.am b/c/src/lib/libbsp/m68k/mvme167/Makefile.am index d98aeca5fe..fa40876ee2 100644 --- a/c/src/lib/libbsp/m68k/mvme167/Makefile.am +++ b/c/src/lib/libbsp/m68k/mvme167/Makefile.am @@ -20,7 +20,7 @@ include_HEADERS += include/page_table.h nodist_include_HEADERS += $(top_srcdir)/../shared/mvme/mvme16x_hw.h noinst_LIBRARIES = libbspstart.a -libbspstart_a_SOURCES = ../../m68k/shared/start.S +libbspstart_a_SOURCES = ../../m68k/shared/start/start.S project_lib_DATA = start.$(OBJEXT) dist_project_lib_DATA += startup/linkcmds diff --git a/c/src/lib/libbsp/m68k/shared/start.S b/c/src/lib/libbsp/m68k/shared/start.S deleted file mode 100644 index d884bb5ab7..0000000000 --- a/c/src/lib/libbsp/m68k/shared/start.S +++ /dev/null @@ -1,140 +0,0 @@ -/* entry.s - * - * This file contains the entry point for the application. - * The name of this entry point is compiler dependent. - * It jumps to the BSP which is responsible for performing - * all initialization. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - -#include - -#if (M68K_COLDFIRE_ARCH == 0) /* All ColdFire BSPs must provide their own start vector */ - -BEGIN_CODE - | Default entry points for: - PUBLIC (start) | GNU - PUBLIC (M68Kvec) | Vector Table - -SYM (start): -SYM (M68Kvec): | standard location for vectors - nop | for linkers with problem - | location zero - jmp SYM (start_around) - - /* - * We can use the following space as our vector table - * if the CPU has a VBR or we can save vector table in it - * if the CPU does not. - */ - - .space 4088 | to avoid initial intr stack - | from 135BUG on MVME13? - | and start code at 0x4000 -SYM (vectors): - .space 1016 | reserve space for rest of vectors - -#if ( M68K_HAS_SEPARATE_STACKS == 1 ) -SYM (lowintstack): - .space 4092 | reserve for interrupt stack -SYM (hiintstack): - .space 4 | end of interrupt stack -#endif - - PUBLIC (start_around) -SYM (start_around): - move.w sr, SYM (initial_sr) - oriw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!! -#if ( M68K_HAS_SEPARATE_STACKS == 1 ) - movec isp,a0 - move.l a0, SYM (initial_isp) - movec usp,a0 - move.l a0, SYM (initial_usp) - movec msp,a0 - move.l a0, SYM (initial_msp) -#else - move.l a7, SYM (initial_msp) -#endif - - | - | zero out uninitialized data area - | -zerobss: - moveal # SYM (_clear_end),a0 | find end of .bss - moveal # SYM (_clear_start),a1 | find beginning of .bss - movel #0,d0 - -loop: movel #0,a1@+ | to zero out uninitialized - cmpal a0,a1 - jlt loop | loop until _end reached - - movel # SYM (_stack_init),d0 | d0 = stop of stack - movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!! - movel d0,a7 | set master stack pointer - movel d0,a6 | set base pointer - - /* - * RTEMS should maintain a separate interrupt stack on CPUs - * without one in hardware. This is currently not supported - * on versions of the m68k without a HW intr stack. - */ - -#if ( M68K_HAS_SEPARATE_STACKS == 1 ) - lea SYM (hiintstack),a0 | a0 = high end of intr stack - movec a0,isp | set interrupt stack -#endif - - movel #0,a7@- | push command line - jsr SYM (boot_card) - addl #12,a7 - -#if ( M68K_HAS_SEPARATE_STACKS == 1 ) - move.l SYM (initial_isp),a0 - movec a0,isp - move.l SYM (initial_usp),a0 - movec a0,usp - move.l SYM (initial_msp),a0 - movec a0,msp -#else - movea.l SYM (initial_msp),a7 -#endif - move.w SYM (initial_sr),sr - rts - -END_CODE - -BEGIN_DATA - - PUBLIC (start_frame) -SYM (start_frame): - .space 4,0 - -END_DATA - -BEGIN_BSS - - PUBLIC (initial_isp) -SYM (initial_isp): - .space 4 - - PUBLIC (initial_msp) -SYM (initial_msp): - .space 4 - - PUBLIC (initial_usp) -SYM (initial_usp): - .space 4 - - PUBLIC (initial_sr) -SYM (initial_sr): - .space 2 - -END_DATA -#endif -END diff --git a/c/src/lib/libbsp/m68k/shared/start/start.S b/c/src/lib/libbsp/m68k/shared/start/start.S new file mode 100644 index 0000000000..d884bb5ab7 --- /dev/null +++ b/c/src/lib/libbsp/m68k/shared/start/start.S @@ -0,0 +1,140 @@ +/* entry.s + * + * This file contains the entry point for the application. + * The name of this entry point is compiler dependent. + * It jumps to the BSP which is responsible for performing + * all initialization. + * + * COPYRIGHT (c) 1989-1999. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#include + +#if (M68K_COLDFIRE_ARCH == 0) /* All ColdFire BSPs must provide their own start vector */ + +BEGIN_CODE + | Default entry points for: + PUBLIC (start) | GNU + PUBLIC (M68Kvec) | Vector Table + +SYM (start): +SYM (M68Kvec): | standard location for vectors + nop | for linkers with problem + | location zero + jmp SYM (start_around) + + /* + * We can use the following space as our vector table + * if the CPU has a VBR or we can save vector table in it + * if the CPU does not. + */ + + .space 4088 | to avoid initial intr stack + | from 135BUG on MVME13? + | and start code at 0x4000 +SYM (vectors): + .space 1016 | reserve space for rest of vectors + +#if ( M68K_HAS_SEPARATE_STACKS == 1 ) +SYM (lowintstack): + .space 4092 | reserve for interrupt stack +SYM (hiintstack): + .space 4 | end of interrupt stack +#endif + + PUBLIC (start_around) +SYM (start_around): + move.w sr, SYM (initial_sr) + oriw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!! +#if ( M68K_HAS_SEPARATE_STACKS == 1 ) + movec isp,a0 + move.l a0, SYM (initial_isp) + movec usp,a0 + move.l a0, SYM (initial_usp) + movec msp,a0 + move.l a0, SYM (initial_msp) +#else + move.l a7, SYM (initial_msp) +#endif + + | + | zero out uninitialized data area + | +zerobss: + moveal # SYM (_clear_end),a0 | find end of .bss + moveal # SYM (_clear_start),a1 | find beginning of .bss + movel #0,d0 + +loop: movel #0,a1@+ | to zero out uninitialized + cmpal a0,a1 + jlt loop | loop until _end reached + + movel # SYM (_stack_init),d0 | d0 = stop of stack + movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!! + movel d0,a7 | set master stack pointer + movel d0,a6 | set base pointer + + /* + * RTEMS should maintain a separate interrupt stack on CPUs + * without one in hardware. This is currently not supported + * on versions of the m68k without a HW intr stack. + */ + +#if ( M68K_HAS_SEPARATE_STACKS == 1 ) + lea SYM (hiintstack),a0 | a0 = high end of intr stack + movec a0,isp | set interrupt stack +#endif + + movel #0,a7@- | push command line + jsr SYM (boot_card) + addl #12,a7 + +#if ( M68K_HAS_SEPARATE_STACKS == 1 ) + move.l SYM (initial_isp),a0 + movec a0,isp + move.l SYM (initial_usp),a0 + movec a0,usp + move.l SYM (initial_msp),a0 + movec a0,msp +#else + movea.l SYM (initial_msp),a7 +#endif + move.w SYM (initial_sr),sr + rts + +END_CODE + +BEGIN_DATA + + PUBLIC (start_frame) +SYM (start_frame): + .space 4,0 + +END_DATA + +BEGIN_BSS + + PUBLIC (initial_isp) +SYM (initial_isp): + .space 4 + + PUBLIC (initial_msp) +SYM (initial_msp): + .space 4 + + PUBLIC (initial_usp) +SYM (initial_usp): + .space 4 + + PUBLIC (initial_sr) +SYM (initial_sr): + .space 2 + +END_DATA +#endif +END -- cgit v1.2.3