From 1e1ee0c01796a12e6f6b2019334455555223deab Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 13 Jul 2011 18:35:04 +0000 Subject: 2011-07-13 Joel Sherrill 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. --- c/src/lib/libbsp/shared/bootcard.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'c/src/lib/libbsp/shared/bootcard.c') diff --git a/c/src/lib/libbsp/shared/bootcard.c b/c/src/lib/libbsp/shared/bootcard.c index 939a2069fa..fd7bd22fb9 100644 --- a/c/src/lib/libbsp/shared/bootcard.c +++ b/c/src/lib/libbsp/shared/bootcard.c @@ -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; } -- cgit v1.2.3