2011-07-13 Joel Sherrill <joel.sherrilL@OARcorp.com>

PR 1824/cpukit
	* bootcard.c, bspclean.c, include/bootcard.h: Return exit/shutdown
	status back to boot_card(). boot_card() propagates this to
	bsp_cleanup() and returns it to the assembly that started the
	application.
This commit is contained in:
Joel Sherrill
2011-07-13 18:35:04 +00:00
parent f58ef8ae7a
commit 1e1ee0c017
4 changed files with 26 additions and 13 deletions
+8
View File
@@ -1,3 +1,11 @@
2011-07-13 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1824/cpukit
* bootcard.c, bspclean.c, include/bootcard.h: Return exit/shutdown
status back to boot_card(). boot_card() propagates this to
bsp_cleanup() and returns it to the assembly that started the
application.
2011-03-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* console.c: Make device file optional.
+9 -8
View File
@@ -111,7 +111,7 @@ static void bootcard_bsp_libc_helper(
* the system while maximizing shared code and keeping BSP code in C
* as much as possible.
*/
int boot_card(
uint32_t boot_card(
const char *cmdline
)
{
@@ -121,6 +121,7 @@ int boot_card(
void *heap_start = NULL;
uintptr_t heap_size = 0;
uintptr_t sbrk_amount = 0;
uint32_t status;
/*
* Special case for PowerPC: The interrupt disable mask is stored in SPRG0.
@@ -170,8 +171,8 @@ int boot_card(
printk("Configuration error!\n"
"Application was configured with CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK\n"
"but BSP was configured w/o sbrk support\n");
bsp_cleanup();
return -1;
bsp_cleanup(1);
return 1;
}
#endif
@@ -181,8 +182,8 @@ int boot_card(
(void *) Configuration.work_space_size,
(void *) work_area_size
);
bsp_cleanup();
return -1;
bsp_cleanup(1);
return 1;
}
if ( rtems_unified_work_area ) {
@@ -265,7 +266,7 @@ int boot_card(
* Complete initialization of RTEMS and switch to the first task.
* Global C++ constructors will be executed in the context of that task.
*/
rtems_initialize_start_multitasking();
status = rtems_initialize_start_multitasking();
/***************************************************************
***************************************************************
@@ -277,10 +278,10 @@ int boot_card(
/*
* Perform any BSP specific shutdown actions which are written in C.
*/
bsp_cleanup();
bsp_cleanup( status );
/*
* Now return to the start code.
*/
return 0;
return status;
}
+3 -1
View File
@@ -17,7 +17,9 @@
#include <bspopts.h>
#include <bsp/bootcard.h>
void bsp_cleanup( void )
void bsp_cleanup(
uint32_t status
)
{
#if (BSP_PRESS_KEY_FOR_RESET)
printk( "\nEXECUTIVE SHUTDOWN! Any key to reboot..." );
+6 -4
View File
@@ -62,7 +62,7 @@ void bsp_predriver_hook(void);
void bsp_postdriver_hook(void);
void bsp_cleanup(void);
void bsp_cleanup(uint32_t status);
void bsp_reset(void);
@@ -118,9 +118,11 @@ uintptr_t bsp_sbrk_init(
* the framework for the BSP initialization sequence. The basic flow of
* initialization is:
*
* - disable interrupts, interrupts will be enabled during the first context switch
* - disable interrupts, interrupts will be enabled during the first context
* switch
* - bsp_start() - more advanced initialization
* - obtain information on BSP memory via bsp_get_work_area() and allocate RTEMS Workspace
* - obtain information on BSP memory via bsp_get_work_area() and allocate
* RTEMS Workspace
* - rtems_initialize_data_structures()
* - allocate memory for C Program Heap
* - initialize C Library and C Program Heap
@@ -144,7 +146,7 @@ uintptr_t bsp_sbrk_init(
* This style of initialization ensures that the C++ global constructors are
* executed after RTEMS is initialized.
*/
int boot_card(const char *cmdline);
uint32_t boot_card(const char *cmdline);
/** @} */