forked from Imagelibrary/rtems
Switch to using a shared main() for all of the embedded BSPs
based on the GNU tools. This usually involved correcting the type of bsp_start(), bsp_cleanup(), adjusting the start code to call the right start routine (the shared boot_card()), and then removing code from bsp_start() which was performed in the new boot_card()/main() path.
This commit is contained in:
@@ -109,8 +109,6 @@ void bsp_cleanup( void );
|
||||
extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
|
||||
extern rtems_cpu_table Cpu_table; /* owned by BSP */
|
||||
|
||||
extern rtems_unsigned32 bsp_isr_level;
|
||||
|
||||
extern int cpu_number; /* from 0; cpu number in a multi cpu system */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -20,7 +20,7 @@ _crt0_argv .WORD _progname, 0
|
||||
/*
|
||||
* stuff we need that is defined elsewhere.
|
||||
*/
|
||||
.IMPORT main, CODE
|
||||
.IMPORT boot_card, CODE
|
||||
.IMPORT _bss_start, DATA
|
||||
.IMPORT _bss_end, DATA
|
||||
.IMPORT environ, DATA
|
||||
@@ -75,8 +75,8 @@ bssloop
|
||||
ldi 1,%ret0
|
||||
|
||||
/*
|
||||
* Call the "main" routine from the application to get it going.
|
||||
* We call it as main(1, argv, 0)
|
||||
* Call the "boot_card" routine from the application to get it going.
|
||||
* We call it as boot_card(1, argv, 0)
|
||||
*/
|
||||
|
||||
copy %r0, %r24
|
||||
@@ -84,7 +84,7 @@ bssloop
|
||||
ldil L%_crt0_argv,%r25
|
||||
ldo R%_crt0_argv(%r25),%r25
|
||||
|
||||
bl main,%r2
|
||||
bl boot_card,%r2
|
||||
ldo 1(%r0), %r26
|
||||
|
||||
.PROCEND
|
||||
|
||||
@@ -11,23 +11,15 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspclean bspstart sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
CC_PIECES=rtems-ctor
|
||||
CC_FILES=$(CC_PIECES:%=%.cc)
|
||||
CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
H_FILES=
|
||||
|
||||
SRCS=$(C_FILES) $(H_FILES)
|
||||
OBJS=$(C_O_FILES)
|
||||
|
||||
# We install the RTEMS constructor as a separate .o
|
||||
# so it can be easily place correctly by the compiler config file.
|
||||
INSTALLED_O_FILES=$(ARCH)/rtems-ctor.o
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
@@ -56,7 +48,6 @@ CLOBBER_ADDITIONS +=
|
||||
${PGM}: ${SRCS} ${OBJS}
|
||||
$(make-rel)
|
||||
|
||||
all: ${ARCH} $(SRCS) $(INSTALLED_O_FILES) $(PGM)
|
||||
$(INSTALL_VARIANT) $(INSTALLED_O_FILES) ${PROJECT_RELEASE}/lib
|
||||
all: ${ARCH} $(SRCS) $(PGM)
|
||||
|
||||
# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
|
||||
|
||||
@@ -39,7 +39,6 @@ extern rtems_configuration_table Configuration;
|
||||
|
||||
rtems_configuration_table BSP_Configuration;
|
||||
rtems_cpu_table Cpu_table;
|
||||
rtems_unsigned32 bsp_isr_level;
|
||||
|
||||
int cpu_number;
|
||||
|
||||
@@ -284,9 +283,7 @@ bsp_postdriver_hook(void)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
bsp_start(void)
|
||||
void bsp_start(void)
|
||||
{
|
||||
/*
|
||||
* Set cpu_number to accurately reflect our cpu number
|
||||
@@ -426,14 +423,4 @@ bsp_start(void)
|
||||
|
||||
if (CPU_HPPA_CLICKS_PER_TICK == 0)
|
||||
CPU_HPPA_CLICKS_PER_TICK = 0x4000;
|
||||
|
||||
/*
|
||||
* Start most of RTEMS
|
||||
* main() will start the rest
|
||||
*/
|
||||
|
||||
bsp_isr_level = rtems_initialize_executive_early(
|
||||
&BSP_Configuration,
|
||||
&Cpu_table
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspstart sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -139,18 +139,9 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* FORCE documentation incorrectly states that the bus request
|
||||
* level is initialized to 3. It is actually initialized by
|
||||
@@ -217,9 +208,4 @@ int main(
|
||||
*/
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
/* no cleanup necessary for Force CPU-386 */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
# C_PIECES=bspstart sbrk setvec except i386-stub
|
||||
C_PIECES=bspstart sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -141,11 +141,7 @@ bsp_postdriver_hook(void)
|
||||
}
|
||||
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
|
||||
#ifdef PRINTON
|
||||
@@ -155,11 +151,6 @@ int main(
|
||||
outbyte ('S');
|
||||
#endif
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* we do not use the pretasking_hook.
|
||||
*/
|
||||
@@ -222,8 +213,4 @@ int main(
|
||||
BSP_Configuration.maximum_extensions++;
|
||||
#endif
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
/* no cleanup necessary for i386ex */
|
||||
for (;;); /* was return 0 to go to the debug monitor */
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ BEGIN_CODE
|
||||
|
||||
PUBLIC (start) # GNU default entry point
|
||||
|
||||
EXTERN (main)
|
||||
EXTERN (boot_card)
|
||||
EXTERN (load_segments)
|
||||
EXTERN (exit)
|
||||
|
||||
@@ -280,7 +280,7 @@ SYM (no_idt_load):
|
||||
pushl $0 # environp
|
||||
pushl $0 # argv
|
||||
pushl $0 # argc
|
||||
call SYM (main)
|
||||
call SYM (boot_card)
|
||||
addl $12, esp
|
||||
|
||||
/*---------------------------------------------------------------------+
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspstart exit irq sbrk
|
||||
C_PIECES=bspclean bspstart exit irq main sbrk
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -171,21 +171,16 @@ bsp_postdriver_hook(void)
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: main
|
||||
| Description: Called from bsp's startup code ('start.s').
|
||||
| Function: bsp_start
|
||||
| Description: Called before main is invoked.
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
int main(int argc, char **argv, char **environp)
|
||||
void bsp_start( void )
|
||||
{
|
||||
/* If we don't have command line arguments set default program name. */
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
|
||||
Cpu_table.predriver_hook = NULL; /* use system's */
|
||||
Cpu_table.postdriver_hook = bsp_postdriver_hook;
|
||||
@@ -226,6 +221,7 @@ int main(int argc, char **argv, char **environp)
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
#if 0
|
||||
rtems_initialize_executive(&BSP_Configuration, &Cpu_table);
|
||||
/* does not return */
|
||||
|
||||
@@ -240,4 +236,5 @@ int main(int argc, char **argv, char **environp)
|
||||
/* no cleanup necessary for PC386 */
|
||||
|
||||
return 0;
|
||||
} /* main */
|
||||
#endif
|
||||
} /* bsp_start */
|
||||
|
||||
@@ -114,8 +114,8 @@ static inline i960ca_PRCB *get_prcb( void )
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
BSP_EXTERN i960ca_PRCB *Prcb;
|
||||
BSP_EXTERN i960ca_control_table *Ctl_tbl;
|
||||
BSP_EXTERN i960ca_PRCB *Prcb;
|
||||
BSP_EXTERN i960ca_control_table *Ctl_tbl;
|
||||
|
||||
/*
|
||||
* Device Driver Table Entries
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspclean bspstart sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -141,17 +141,8 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/* set node number in SQSIO4 CTL REG */
|
||||
|
||||
*((rtems_unsigned32 *)0xc00000b0) =
|
||||
@@ -234,12 +225,4 @@ int main(
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspstart sbrk setvec vmeintr
|
||||
C_PIECES=bspclean bspstart main sbrk setvec vmeintr
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
21
c/src/lib/libbsp/m68k/dmv152/startup/bspclean.c
Normal file
21
c/src/lib/libbsp/m68k/dmv152/startup/bspclean.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* This routine performs final cleanup at exit time.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
void bsp_cleanup( void )
|
||||
{
|
||||
|
||||
VME_interrupt_Disable( 0xff );
|
||||
}
|
||||
@@ -139,21 +139,12 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
void *vbr;
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
monitors_vector_table = (m68k_isr_entry *)0; /* Monitor Vectors are at 0 */
|
||||
m68k_set_vbr( monitors_vector_table );
|
||||
|
||||
@@ -246,13 +237,5 @@ int main(
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
|
||||
/* Clock_exit is done as an atexit() function */
|
||||
|
||||
VME_interrupt_Disable( 0xff );
|
||||
|
||||
/* return like a "normal" subroutine to the monitor */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ m68k_isr_entry vectors[256];
|
||||
char * const __argv[]= {"main", ""};
|
||||
char * const __env[]= {""};
|
||||
|
||||
int main(const int argc, char * const argv[], char * const env[]);
|
||||
|
||||
/*
|
||||
* This prototype really should have the noreturn attribute but
|
||||
* that causes a warning since it appears that the routine does
|
||||
@@ -182,7 +180,9 @@ void dumby_start() {
|
||||
/*
|
||||
* Execute main with arguments argv and environment env
|
||||
*/
|
||||
main(1, __argv, __env);
|
||||
/* main(1, __argv, __env); */
|
||||
|
||||
boot_card();
|
||||
|
||||
reboot();
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ m68k_isr_entry vectors[256];
|
||||
char * const __argv[]= {"main", ""};
|
||||
char * const __env[]= {""};
|
||||
|
||||
int main(const int argc, char * const argv[], char * const env[]);
|
||||
|
||||
/*
|
||||
* This prototype really should have the noreturn attribute but
|
||||
* that causes a warning since it appears that the routine does
|
||||
@@ -182,7 +180,9 @@ void dumby_start() {
|
||||
/*
|
||||
* Execute main with arguments argv and environment env
|
||||
*/
|
||||
main(1, __argv, __env);
|
||||
/* main(1, __argv, __env); */
|
||||
|
||||
boot_card();
|
||||
|
||||
reboot();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspstart bspclean sbrk setvec
|
||||
C_PIECES=bspstart bspclean main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -147,11 +147,7 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
void *vbr;
|
||||
|
||||
@@ -213,15 +209,6 @@ int main(
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
|
||||
/* Clock_exit is done as an atexit() function */
|
||||
|
||||
/* configure peripherals for safe exit */
|
||||
bsp_cleanup();
|
||||
|
||||
/* return like a "normal" subroutine to the monitor */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ m68k_isr_entry vectors[256];
|
||||
char * const __argv[]= {"main", ""};
|
||||
char * const __env[]= {""};
|
||||
|
||||
int main(const int argc, char * const argv[], char * const env[]);
|
||||
|
||||
/*
|
||||
* This prototype really should have the noreturn attribute but
|
||||
* that causes a warning since it appears that the routine does
|
||||
@@ -65,7 +63,8 @@ void dumby_start() {
|
||||
/*
|
||||
* Execute main with arguments argv and environment env
|
||||
*/
|
||||
main(1, __argv, __env);
|
||||
/* main(1, __argv, __env); */
|
||||
boot_card();
|
||||
|
||||
reboot();
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ m68k_isr_entry vectors[256];
|
||||
char * const __argv[]= {"main", ""};
|
||||
char * const __env[]= {""};
|
||||
|
||||
int main(const int argc, char * const argv[], char * const env[]);
|
||||
|
||||
/*
|
||||
* This prototype really should have the noreturn attribute but
|
||||
* that causes a warning since it appears that the routine does
|
||||
@@ -65,7 +63,8 @@ void dumby_start() {
|
||||
/*
|
||||
* Execute main with arguments argv and environment env
|
||||
*/
|
||||
main(1, __argv, __env);
|
||||
/* main(1, __argv, __env); */
|
||||
boot_card();
|
||||
|
||||
reboot();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspstart bspclean efi68k_tcp efi68k_wd sbrk setvec
|
||||
C_PIECES=bspstart bspclean efi68k_tcp efi68k_wd main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -152,11 +152,7 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
void *vbr;
|
||||
|
||||
@@ -221,16 +217,6 @@ int main(
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
|
||||
/* Clock_exit is done as an atexit() function */
|
||||
|
||||
/* exit: */
|
||||
/* configure peripherals for safe exit */
|
||||
bsp_cleanup();
|
||||
|
||||
/* return like a "normal" subroutine to the monitor */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ loop: movel d0,a1@+ | to zero out uninitialized
|
||||
movel d0,a6 | set base pointer
|
||||
|
||||
/*
|
||||
* RTEMS should maintiain a separate interrupt stack on CPUs
|
||||
* 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.
|
||||
*/
|
||||
@@ -229,7 +229,7 @@ loop: movel d0,a1@+ | to zero out uninitialized
|
||||
move.l #0,a7@- | environp
|
||||
move.l #0,a7@- | argv
|
||||
move.l #0,a7@- | argc
|
||||
jsr SYM (main)
|
||||
jsr SYM (boot_card)
|
||||
|
||||
nop
|
||||
Bad: bra Bad
|
||||
|
||||
@@ -216,7 +216,7 @@ loop: movel d0,a1@+ | to zero out uninitialized
|
||||
movel d0,a6 | set base pointer
|
||||
|
||||
/*
|
||||
* RTEMS should maintiain a separate interrupt stack on CPUs
|
||||
* 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.
|
||||
*/
|
||||
@@ -229,7 +229,7 @@ loop: movel d0,a1@+ | to zero out uninitialized
|
||||
move.l #0,a7@- | environp
|
||||
move.l #0,a7@- | argv
|
||||
move.l #0,a7@- | argc
|
||||
jsr SYM (main)
|
||||
jsr SYM (boot_card)
|
||||
|
||||
nop
|
||||
Bad: bra Bad
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspstart bspclean sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -147,16 +147,8 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
@@ -239,13 +231,4 @@ int main(
|
||||
* Don't forget the other CPU Table entries.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Start RTEMS
|
||||
*/
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ ZEROLOOPTEST:
|
||||
movel d0,a7@- | environp
|
||||
movel d0,a7@- | argv
|
||||
movel d0,a7@- | argc
|
||||
jsr SYM(main) | Call C main
|
||||
jsr SYM(boot_card) | Call C main
|
||||
|
||||
PUBLIC (_mainDone)
|
||||
SYM(_mainDone):
|
||||
|
||||
@@ -401,7 +401,7 @@ ZEROLOOPTEST:
|
||||
movel d0,a7@- | environp
|
||||
movel d0,a7@- | argv
|
||||
movel d0,a7@- | argc
|
||||
jsr SYM(main) | Call C main
|
||||
jsr SYM(boot_card) | Call C main
|
||||
|
||||
PUBLIC (_mainDone)
|
||||
SYM(_mainDone):
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=alloc360 bspstart bspclean init68360 memcpy sbrk setvec
|
||||
C_PIECES=alloc360 bspclean bspstart init68360 main memcpy sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -143,17 +143,9 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
extern void *_WorkspaceBase;
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
@@ -234,14 +226,4 @@ int main(
|
||||
/*
|
||||
* Don't forget the other CPU Table entries.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Start RTEMS
|
||||
*/
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspstart sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -148,20 +148,11 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
duart_base = (unsigned char *)DUART_ADDR;
|
||||
|
||||
/*
|
||||
@@ -248,9 +239,6 @@ int main(
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
/* led_putnum('e'); * for debugging purposes only */
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );/* does not return */
|
||||
|
||||
/* Clock_exit is done as an atexit() function */
|
||||
|
||||
return 0;
|
||||
/* Clock_exit is done as an atexit() function */
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspclean bspstart sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -141,21 +141,11 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */
|
||||
m68k_set_vbr( monitors_vector_table );
|
||||
|
||||
@@ -229,11 +219,4 @@ int main(
|
||||
*/
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspclean bspstart sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -144,21 +144,11 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */
|
||||
m68k_set_vbr( monitors_vector_table );
|
||||
|
||||
@@ -235,11 +225,4 @@ int main(
|
||||
*/
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspclean bspstart sbrk setvec
|
||||
C_PIECES=bspclean bspstart main sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -144,22 +144,12 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
rtems_unsigned8 node_number;
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
monitors_vector_table = (m68k_isr_entry *)0; /* 147Bug Vectors are at 0 */
|
||||
m68k_set_vbr( monitors_vector_table );
|
||||
|
||||
@@ -295,11 +285,4 @@ int main(
|
||||
*/
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspclean bspstart page_table sbrk setvec
|
||||
C_PIECES=bspclean bspstart main page_table sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -148,20 +148,11 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* 162Bug Vectors are at 0xFFE00000
|
||||
* 162Bug Vectors on LX are at 0x00000000
|
||||
@@ -252,11 +243,4 @@ int main(
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
/* does not return */
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ void boot_phase_2(void)
|
||||
static constructors have not been called, and RTEMS is not initialised.
|
||||
*/
|
||||
|
||||
void boot_bsp();
|
||||
void boot_card();
|
||||
void set_debug_traps();
|
||||
void breakpoint();
|
||||
|
||||
@@ -127,7 +127,7 @@ void boot_phase_3(void)
|
||||
/* FIXME : add RAM and ROM checks */
|
||||
|
||||
/* boot the bsp, what ever this means */
|
||||
boot_bsp();
|
||||
boot_card();
|
||||
|
||||
WATCHDOG_TRIGGER();
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ void boot_phase_2(void)
|
||||
static constructors have not been called, and RTEMS is not initialised.
|
||||
*/
|
||||
|
||||
void boot_bsp();
|
||||
void boot_card();
|
||||
void set_debug_traps();
|
||||
void breakpoint();
|
||||
|
||||
@@ -127,7 +127,7 @@ void boot_phase_3(void)
|
||||
/* FIXME : add RAM and ROM checks */
|
||||
|
||||
/* boot the bsp, what ever this means */
|
||||
boot_bsp();
|
||||
boot_card();
|
||||
|
||||
WATCHDOG_TRIGGER();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=crc debugport gdb-hooks m68302scc m68k-stub memcheck trace \
|
||||
C_PIECES=crc debugport gdb-hooks main m68302scc m68k-stub memcheck trace \
|
||||
bspstart bspclean sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
@@ -148,7 +148,7 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
void bsp_start()
|
||||
void bsp_start( void )
|
||||
{
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
@@ -230,34 +230,4 @@ void bsp_start()
|
||||
/*
|
||||
* Don't forget the other CPU Table entries.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Start RTEMS
|
||||
*/
|
||||
|
||||
bsp_isr_level = rtems_initialize_executive_early( &BSP_Configuration, &Cpu_table );
|
||||
}
|
||||
|
||||
int main(int argc, char **argv, char **environ)
|
||||
{
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
rtems_initialize_executive_late( bsp_isr_level );
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void boot_bsp()
|
||||
{
|
||||
/* the atexit hook will be before the static destructor list's entry
|
||||
point */
|
||||
bsp_start();
|
||||
|
||||
exit(main(0, 0, 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ void boot_phase_2(void)
|
||||
static constructors have not been called, and RTEMS is not initialised.
|
||||
*/
|
||||
|
||||
void boot_bsp();
|
||||
void boot_card();
|
||||
void set_debug_traps();
|
||||
void breakpoint();
|
||||
|
||||
@@ -127,7 +127,7 @@ void boot_phase_3(void)
|
||||
/* FIXME : add RAM and ROM checks */
|
||||
|
||||
/* boot the bsp, what ever this means */
|
||||
boot_bsp();
|
||||
boot_card();
|
||||
|
||||
WATCHDOG_TRIGGER();
|
||||
}
|
||||
|
||||
@@ -110,14 +110,6 @@ extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
/* miscellaneous stuff assumed to exist */
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
);
|
||||
|
||||
void bsp_cleanup( void );
|
||||
|
||||
mips_isr_entry set_vector( /* returns old vector */
|
||||
rtems_isr_entry handler, /* isr routine */
|
||||
rtems_vector_number vector, /* vector number */
|
||||
|
||||
@@ -32,4 +32,5 @@
|
||||
|
||||
void bsp_cleanup( void )
|
||||
{
|
||||
idtsim__exit();
|
||||
}
|
||||
|
||||
@@ -161,17 +161,8 @@ bsp_postdriver_hook(void)
|
||||
|
||||
extern int end; /* defined by linker */
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
* a variety of places: hard coded address, malloc'ed from outside
|
||||
@@ -256,13 +247,4 @@ int bsp_start(
|
||||
* Don't forget the other CPU Table entries.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Start RTEMS
|
||||
*/
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -110,14 +110,6 @@ extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
/* miscellaneous stuff assumed to exist */
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
);
|
||||
|
||||
void bsp_cleanup( void );
|
||||
|
||||
mips_isr_entry set_vector( /* returns old vector */
|
||||
rtems_isr_entry handler, /* isr routine */
|
||||
rtems_vector_number vector, /* vector number */
|
||||
|
||||
@@ -32,4 +32,5 @@
|
||||
|
||||
void bsp_cleanup( void )
|
||||
{
|
||||
idtsim__exit();
|
||||
}
|
||||
|
||||
@@ -161,17 +161,8 @@ bsp_postdriver_hook(void)
|
||||
|
||||
extern int end; /* defined by linker */
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
* a variety of places: hard coded address, malloc'ed from outside
|
||||
@@ -256,13 +247,4 @@ int bsp_start(
|
||||
* Don't forget the other CPU Table entries.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Start RTEMS
|
||||
*/
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -223,8 +223,8 @@ bss_addr:
|
||||
stw r3, 4(r1)
|
||||
stw r3, 8(r1)
|
||||
stw r3, 12(r1)
|
||||
.extern SYM (main)
|
||||
b SYM (main) /* call the first C routine */
|
||||
.extern SYM (boot_card)
|
||||
b SYM (boot_card) /* call the first C routine */
|
||||
|
||||
/*-------------------------------------------------------------------------------
|
||||
* bssclr.
|
||||
|
||||
@@ -245,8 +245,8 @@ bss_addr:
|
||||
stw r3, 4(r1)
|
||||
stw r3, 8(r1)
|
||||
stw r3, 12(r1)
|
||||
.extern SYM (main)
|
||||
b SYM (main) /* call the first C routine */
|
||||
.extern SYM (boot_card)
|
||||
b SYM (boot_card) /* call the first C routine */
|
||||
|
||||
/*-------------------------------------------------------------------------------
|
||||
* Rom2ram.
|
||||
|
||||
@@ -131,14 +131,6 @@ extern rtems_cpu_table Cpu_table; /* owned by BSP */
|
||||
|
||||
/* functions */
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
);
|
||||
|
||||
void bsp_cleanup( void );
|
||||
|
||||
rtems_isr_entry set_vector( /* returns old vector */
|
||||
rtems_isr_entry handler, /* isr routine */
|
||||
rtems_vector_number vector, /* vector number */
|
||||
|
||||
@@ -166,17 +166,8 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start( void )
|
||||
{
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
* a variety of places: hard coded address, malloc'ed from outside
|
||||
@@ -265,12 +256,4 @@ int bsp_start(
|
||||
Cpu_table.timer_average_overhead = 2;
|
||||
|
||||
Cpu_table.timer_least_valid = 3;
|
||||
|
||||
/*
|
||||
* Start RTEMS
|
||||
*/
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
|
||||
bsp_cleanup();
|
||||
}
|
||||
|
||||
@@ -84,8 +84,6 @@ extern void *CPU_Interrupt_stack_high ;
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
extern int bsp_start( int argc, char **argv, char **env );
|
||||
|
||||
extern void bsp_cleanup( void );
|
||||
|
||||
/*
|
||||
|
||||
@@ -37,4 +37,5 @@
|
||||
|
||||
void bsp_cleanup( void )
|
||||
{
|
||||
rtems_fatal_error_occurred(0);
|
||||
}
|
||||
|
||||
@@ -151,11 +151,7 @@ bsp_postdriver_hook(void)
|
||||
rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
|
||||
}
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
char **argv,
|
||||
char **environp
|
||||
)
|
||||
void bsp_start(void)
|
||||
{
|
||||
/*
|
||||
For real boards you need to setup the hardware
|
||||
@@ -165,11 +161,6 @@ int bsp_start(
|
||||
startup code, rtems startup code or here.
|
||||
*/
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
* a variety of places: hard coded address, malloc'ed from outside
|
||||
@@ -265,14 +256,4 @@ int bsp_start(
|
||||
*/
|
||||
|
||||
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
|
||||
|
||||
/*
|
||||
* Start RTEMS
|
||||
*/
|
||||
|
||||
rtems_initialize_executive( &BSP_Configuration, &Cpu_table );
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
17
c/src/lib/libbsp/shared/bspclean.c
Normal file
17
c/src/lib/libbsp/shared/bspclean.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* This is a dummy bsp_cleanup routine.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
void bsp_cleanup( void )
|
||||
{
|
||||
}
|
||||
62
c/src/lib/libbsp/shared/main.c
Normal file
62
c/src/lib/libbsp/shared/main.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* A simple main which can be used on any embedded target.
|
||||
*
|
||||
* This style of initialization insures that the C++ global
|
||||
* constructors are executed after RTEMS is initialized.
|
||||
*
|
||||
* Thanks to Chris Johns <cjohns@plessey.com.au> for this idea.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1998.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
* Copyright assigned to U.S. Government, 1994.
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
char *rtems_progname;
|
||||
|
||||
extern void bsp_start( void );
|
||||
extern void bsp_cleanup( void );
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
extern rtems_cpu_table Cpu_table;
|
||||
|
||||
rtems_interrupt_level bsp_isr_level;
|
||||
|
||||
int main(int argc, char **argv, char **environ)
|
||||
{
|
||||
|
||||
if ((argc > 0) && argv && argv[0])
|
||||
rtems_progname = argv[0];
|
||||
else
|
||||
rtems_progname = "RTEMS";
|
||||
|
||||
rtems_initialize_executive_late( bsp_isr_level );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void boot_card(void)
|
||||
{
|
||||
int status;
|
||||
|
||||
/* the atexit hook will be before the static destructor list's entry
|
||||
point */
|
||||
bsp_start();
|
||||
|
||||
bsp_isr_level =
|
||||
rtems_initialize_executive_early( &BSP_Configuration, &Cpu_table );
|
||||
|
||||
status = main(0, 0, 0);
|
||||
|
||||
bsp_cleanup();
|
||||
|
||||
exit( status );
|
||||
}
|
||||
|
||||
@@ -171,8 +171,6 @@ extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
|
||||
|
||||
extern rtems_cpu_table Cpu_table; /* owned by BSP */
|
||||
|
||||
extern rtems_unsigned32 bsp_isr_level;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -289,8 +289,8 @@ zerobss:
|
||||
mov %0, %o2 ! environ
|
||||
mov %0, %o1 ! argv
|
||||
mov %0, %o0 ! argc
|
||||
call SYM(main)
|
||||
sub %sp, 0x60, %sp ! room for main to save args
|
||||
call SYM(boot_card)
|
||||
sub %sp, 0x60, %sp ! room for boot_card to save args
|
||||
nop
|
||||
|
||||
PUBLIC(BSP_fatal_return)
|
||||
|
||||
@@ -289,8 +289,8 @@ zerobss:
|
||||
mov %0, %o2 ! environ
|
||||
mov %0, %o1 ! argv
|
||||
mov %0, %o0 ! argc
|
||||
call SYM(main)
|
||||
sub %sp, 0x60, %sp ! room for main to save args
|
||||
call SYM(boot_card)
|
||||
sub %sp, 0x60, %sp ! room for boot_card to save args
|
||||
nop
|
||||
|
||||
PUBLIC(BSP_fatal_return)
|
||||
|
||||
@@ -11,14 +11,10 @@ PROJECT_ROOT = @PROJECT_ROOT@
|
||||
PGM=${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=bspclean bspstart sbrk setvec spurious
|
||||
C_PIECES=bspclean bspstart main sbrk setvec spurious
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
CC_PIECES=rtems-ctor
|
||||
CC_FILES=$(CC_PIECES:%=%.cc)
|
||||
CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
H_FILES=
|
||||
|
||||
# Assembly source names, if any, go here -- minus the .s
|
||||
@@ -29,10 +25,6 @@ S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
|
||||
SRCS=linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
|
||||
OBJS=$(C_O_FILES)
|
||||
|
||||
# We install the RTEMS constructor as a separate .o
|
||||
# so it can be easily place correctly by the compiler config file.
|
||||
INSTALLED_O_FILES=$(ARCH)/rtems-ctor.o
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
||||
include $(RTEMS_ROOT)/make/leaf.cfg
|
||||
|
||||
@@ -61,6 +53,5 @@ CLOBBER_ADDITIONS +=
|
||||
${PGM}: ${SRCS} ${OBJS}
|
||||
$(make-rel)
|
||||
|
||||
all: ${ARCH} $(SRCS) $(INSTALLED_O_FILES) $(PGM)
|
||||
all: ${ARCH} $(SRCS) $(PGM)
|
||||
$(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
|
||||
$(INSTALL_VARIANT) $(INSTALLED_O_FILES) ${PROJECT_RELEASE}/lib
|
||||
|
||||
@@ -372,9 +372,4 @@ void bsp_start( void )
|
||||
*/
|
||||
|
||||
rtems_libio_config( &BSP_Configuration, BSP_LIBIO_MAX_FDS );
|
||||
|
||||
bsp_isr_level = rtems_initialize_executive_early(
|
||||
&BSP_Configuration,
|
||||
&Cpu_table
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,14 +74,14 @@ init_frames:
|
||||
st fp, _start_frame
|
||||
|
||||
/*
|
||||
* Call application mainline.
|
||||
* Call application boot_card.
|
||||
* Someday, real values of argc and argv will be set up.
|
||||
* For now, they are set to 0.
|
||||
*/
|
||||
ldconst 0,g0
|
||||
ldconst 0,g1
|
||||
ldconst 0,g2
|
||||
call _main
|
||||
call _boot_card
|
||||
ret
|
||||
|
||||
END_CODE
|
||||
|
||||
@@ -87,7 +87,7 @@ loop: movel #0,a1@+ | to zero out uninitialized
|
||||
movel d0,a6 | set base pointer
|
||||
|
||||
/*
|
||||
* RTEMS should maintiain a separate interrupt stack on CPUs
|
||||
* 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.
|
||||
*/
|
||||
@@ -102,7 +102,7 @@ loop: movel #0,a1@+ | to zero out uninitialized
|
||||
movel #0,a7@- | push argv
|
||||
movel #0,a7@- | push argc
|
||||
|
||||
jsr SYM (main)
|
||||
jsr SYM (boot_card)
|
||||
addl #12,a7
|
||||
|
||||
#if ( M68K_HAS_SEPARATE_STACKS == 1 )
|
||||
|
||||
Reference in New Issue
Block a user