From 48bff53b3dec885085b87db413329830110c9bb0 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 6 Dec 2012 17:47:30 +0100 Subject: score: rtems_initialize_start_multitasking() Do not return from rtems_initialize_start_multitasking() and call rtems_fatal() instead with a fatal source of RTEMS_FATAL_SOURCE_EXIT and a fatal code with the exit status. Remove all bsp_cleanup() functions. The boot_card() is now a no return function. --- c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c | 5 ---- c/src/lib/libbsp/m68k/mcf5225x/startup/bspclean.c | 9 ------- c/src/lib/libbsp/m68k/mrm332/misc/interr.c | 5 ---- c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c | 7 ------ c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c | 7 ------ c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c | 7 ------ c/src/lib/libbsp/m68k/mvme167/startup/bspclean.c | 29 +++++----------------- c/src/lib/libbsp/m68k/uC5282/startup/bspclean.c | 9 ------- .../lib/libbsp/powerpc/beatnik/startup/bspclean.c | 7 ------ .../lib/libbsp/powerpc/mvme5500/startup/bspclean.c | 7 ------ .../lib/libbsp/powerpc/virtex4/startup/bspclean.c | 8 +----- .../lib/libbsp/powerpc/virtex5/startup/bspclean.c | 8 +----- c/src/lib/libbsp/shared/bootcard.c | 23 ++++------------- c/src/lib/libbsp/shared/bspclean.c | 7 ------ c/src/lib/libbsp/shared/include/bootcard.h | 9 ++----- 15 files changed, 15 insertions(+), 132 deletions(-) (limited to 'c') diff --git a/c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c b/c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c index 6dcda18aad..b7136420b0 100644 --- a/c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c +++ b/c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c @@ -56,8 +56,3 @@ void bsp_fatal_extension( else reboot(); } - -void bsp_cleanup(uint32_t status) -{ - rtems_fatal(RTEMS_FATAL_SOURCE_EXIT, status); -} diff --git a/c/src/lib/libbsp/m68k/mcf5225x/startup/bspclean.c b/c/src/lib/libbsp/m68k/mcf5225x/startup/bspclean.c index e8c70c326f..15dd2443dd 100644 --- a/c/src/lib/libbsp/m68k/mcf5225x/startup/bspclean.c +++ b/c/src/lib/libbsp/m68k/mcf5225x/startup/bspclean.c @@ -1,6 +1,4 @@ /* - * SBC5206 bsp_cleanup - * * This routine returns control from RTEMS to the monitor. * * Author: @@ -27,10 +25,3 @@ void bsp_fatal_extension( { printk("\nRTEMS exited!\n"); } - -void __attribute__((weak)) bsp_cleanup( - uint32_t status -) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/m68k/mrm332/misc/interr.c b/c/src/lib/libbsp/m68k/mrm332/misc/interr.c index 356a247bc1..d96f909fba 100644 --- a/c/src/lib/libbsp/m68k/mrm332/misc/interr.c +++ b/c/src/lib/libbsp/m68k/mrm332/misc/interr.c @@ -48,8 +48,3 @@ void bsp_fatal_extension( outbyte( (char)(the_error & 0xff) ); RAW_PUTS(").\r\n"); } - -void bsp_cleanup( uint32_t status ) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c index 50feb5a52c..fa9fb554ef 100644 --- a/c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c +++ b/c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c @@ -44,10 +44,3 @@ void bsp_fatal_extension( M68Kvec[ 45 ] = bsp_return_to_monitor_trap; /* install handler */ __asm__ volatile( "trap #13" ); /* insures SUPV mode */ } - -void bsp_cleanup( - uint32_t status -) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c index 405d9262fd..e566c1d5b1 100644 --- a/c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c +++ b/c/src/lib/libbsp/m68k/mvme147/startup/bspclean.c @@ -43,10 +43,3 @@ void bsp_fatal_extension( M68Kvec[ 45 ] = bsp_return_to_monitor_trap; /* install handler */ __asm__ volatile( "trap #13" ); /* ensures SUPV mode */ } - -void bsp_cleanup( - uint32_t status -) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c index 3b275d98cd..ca5973923b 100644 --- a/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c +++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c @@ -55,10 +55,3 @@ void bsp_fatal_extension( M68Kvec[ 45 ] = bsp_return_to_monitor_trap; /* install handler */ __asm__ volatile( "trap #13" ); /* insures SUPV mode */ } - -void bsp_cleanup( - uint32_t status -) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme167/startup/bspclean.c index 68e127ff2c..820ffe89ed 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/bspclean.c +++ b/c/src/lib/libbsp/m68k/mvme167/startup/bspclean.c @@ -49,19 +49,7 @@ static void bsp_return_to_monitor_trap( void ) __asm__ volatile( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) ); } -void bsp_fatal_extension( - rtems_fatal_source source, - bool is_internal, - rtems_fatal_code error -) -{ - M68Kvec[ 45 ] = bsp_return_to_monitor_trap; - __asm__ volatile( "trap #13" ); -} - /* - * bsp_cleanup - * * This code was copied from other MC680x0 MVME BSPs. * Our guess is that someone was concerned about the CPU no longer being in * supervisor mode when they got here. This function forces the CPU back to @@ -73,18 +61,13 @@ void bsp_fatal_extension( * problems if 167Bug is invoked before we get to switch the VBR back to * 167Bug because trap 13 is documented as being reserved for the internal * use of the debugger. - * - * Prototyped in rtems/c/src/lib/libbsp/m68k/mvme167/include/bsp.h - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: DOES NOT RETURN */ -void bsp_cleanup( - uint32_t status +void bsp_fatal_extension( + rtems_fatal_source source, + bool is_internal, + rtems_fatal_code error ) { - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); + M68Kvec[ 45 ] = bsp_return_to_monitor_trap; + __asm__ volatile( "trap #13" ); } diff --git a/c/src/lib/libbsp/m68k/uC5282/startup/bspclean.c b/c/src/lib/libbsp/m68k/uC5282/startup/bspclean.c index dc17af738c..37aac9e1a4 100644 --- a/c/src/lib/libbsp/m68k/uC5282/startup/bspclean.c +++ b/c/src/lib/libbsp/m68k/uC5282/startup/bspclean.c @@ -1,6 +1,4 @@ /* - * SBC5206 bsp_cleanup - * * This routine returns control from RTEMS to the monitor. * * Author: W. Eric Norum @@ -24,10 +22,3 @@ void bsp_fatal_extension( { bsp_reset(); } - -void bsp_cleanup( - uint32_t status -) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/powerpc/beatnik/startup/bspclean.c b/c/src/lib/libbsp/powerpc/beatnik/startup/bspclean.c index 1539e44cf5..f4369b588c 100644 --- a/c/src/lib/libbsp/powerpc/beatnik/startup/bspclean.c +++ b/c/src/lib/libbsp/powerpc/beatnik/startup/bspclean.c @@ -17,10 +17,3 @@ void bsp_fatal_extension( ); bsp_reset(); } - -void bsp_cleanup( - uint32_t status -) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/powerpc/mvme5500/startup/bspclean.c b/c/src/lib/libbsp/powerpc/mvme5500/startup/bspclean.c index fc488eab29..0494696dec 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/startup/bspclean.c +++ b/c/src/lib/libbsp/powerpc/mvme5500/startup/bspclean.c @@ -24,10 +24,3 @@ void bsp_fatal_extension( printk("RTEMS terminated; Boot manually or turn on AUTO_BOOT.\n"); #endif } - -void bsp_cleanup( - uint32_t status -) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/powerpc/virtex4/startup/bspclean.c b/c/src/lib/libbsp/powerpc/virtex4/startup/bspclean.c index 3a2af5525b..5c7fe3d624 100644 --- a/c/src/lib/libbsp/powerpc/virtex4/startup/bspclean.c +++ b/c/src/lib/libbsp/powerpc/virtex4/startup/bspclean.c @@ -1,5 +1,4 @@ -/* bsp_cleanup() - * +/* * This routine normally is part of start.s and usually returns * control to a monitor. * @@ -53,8 +52,3 @@ void bsp_fatal_extension( /* All done. Hang out. */ BSP_ask_for_reset(); } - -void bsp_cleanup( uint32_t status ) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/powerpc/virtex5/startup/bspclean.c b/c/src/lib/libbsp/powerpc/virtex5/startup/bspclean.c index 3a2af5525b..5c7fe3d624 100644 --- a/c/src/lib/libbsp/powerpc/virtex5/startup/bspclean.c +++ b/c/src/lib/libbsp/powerpc/virtex5/startup/bspclean.c @@ -1,5 +1,4 @@ -/* bsp_cleanup() - * +/* * This routine normally is part of start.s and usually returns * control to a monitor. * @@ -53,8 +52,3 @@ void bsp_fatal_extension( /* All done. Hang out. */ BSP_ask_for_reset(); } - -void bsp_cleanup( uint32_t status ) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/shared/bootcard.c b/c/src/lib/libbsp/shared/bootcard.c index 33ad0ee128..a928bb2924 100644 --- a/c/src/lib/libbsp/shared/bootcard.c +++ b/c/src/lib/libbsp/shared/bootcard.c @@ -31,8 +31,7 @@ * - 1st task executes C++ global constructors * .... appplication runs ... * - exit - * + back to here eventually - * + bspclean.c: bsp_cleanup + * + will not return to here * * This style of initialization ensures that the C++ global * constructors are executed after RTEMS is initialized. @@ -69,12 +68,11 @@ const char *bsp_boot_cmdline; * the system while maximizing shared code and keeping BSP code in C * as much as possible. */ -uint32_t boot_card( +void boot_card( const char *cmdline ) { rtems_interrupt_level bsp_isr_level; - uint32_t status = 0; /* * Special case for PowerPC: The interrupt disable mask is stored in SPRG0. @@ -164,22 +162,11 @@ uint32_t boot_card( * Complete initialization of RTEMS and switch to the first task. * Global C++ constructors will be executed in the context of that task. */ - status = rtems_initialize_start_multitasking(); + rtems_initialize_start_multitasking(); /*************************************************************** *************************************************************** - * APPLICATION RUNS HERE!!! When it shuts down, we return!!! * + * APPLICATION RUNS NOW!!! We will not return to here!!! * *************************************************************** - *************************************************************** - */ - - /* - * Perform any BSP specific shutdown actions which are written in C. - */ - bsp_cleanup( status ); - - /* - * Now return to the start code. - */ - return status; + ***************************************************************/ } diff --git a/c/src/lib/libbsp/shared/bspclean.c b/c/src/lib/libbsp/shared/bspclean.c index 3e48c2993d..40955c685e 100644 --- a/c/src/lib/libbsp/shared/bspclean.c +++ b/c/src/lib/libbsp/shared/bspclean.c @@ -1,6 +1,4 @@ /* - * This is a dummy bsp_cleanup routine. - * * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * @@ -45,8 +43,3 @@ void bsp_fatal_extension( bsp_reset(); #endif } - -void bsp_cleanup( uint32_t status ) -{ - rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); -} diff --git a/c/src/lib/libbsp/shared/include/bootcard.h b/c/src/lib/libbsp/shared/include/bootcard.h index ff9235c3ed..f3de76036c 100644 --- a/c/src/lib/libbsp/shared/include/bootcard.h +++ b/c/src/lib/libbsp/shared/include/bootcard.h @@ -72,8 +72,6 @@ void bsp_predriver_hook(void); void bsp_postdriver_hook(void); -void bsp_cleanup(uint32_t status); - void bsp_reset(void); /** @@ -108,15 +106,12 @@ void bsp_reset(void); * - 1st task executes C++ global constructors * - .... application runs ... * - exit - * - back to here eventually - * - bsp_cleanup() - * - * If something goes wrong bsp_cleanup() will be called out of order. + * - will not return to here * * This style of initialization ensures that the C++ global constructors are * executed after RTEMS is initialized. */ -uint32_t boot_card(const char *cmdline); +void boot_card(const char *cmdline) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK /** -- cgit v1.2.3