diff options
-rw-r--r-- | cpukit/ChangeLog | 12 | ||||
-rw-r--r-- | cpukit/sapi/include/rtems/init.h | 50 | ||||
-rw-r--r-- | cpukit/sapi/src/exinit.c | 45 |
3 files changed, 56 insertions, 51 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 0d7097bb90..88b5dc0c19 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,15 @@ +2008-05-12 Joel Sherrill <joel.sherrill@OARcorp.com> + + * sapi/include/rtems/init.h, sapi/src/exinit.c: Refactored and renamed + initialization routines to rtems_initialize_data_structures, + rtems_initialize_before_drivers, rtems_initialize_device_drivers, and + rtems_initialize_start_multitasking. This opened the sequence up so + that bootcard() could provide a more robust and flexible framework + which is easier to explain and understand. This also lays the + groundwork for sharing the division of available memory between the + RTEMS workspace and heap and the C library initialization across all + BSPs. + 2008-05-06 Joel Sherrill <joel.sherrill@oarcorp.com> * sapi/src/exinit.c, score/src/threadstartmultitasking.c: Improve diff --git a/cpukit/sapi/include/rtems/init.h b/cpukit/sapi/include/rtems/init.h index a3e604fc80..bf0fb7fa6a 100644 --- a/cpukit/sapi/include/rtems/init.h +++ b/cpukit/sapi/include/rtems/init.h @@ -37,47 +37,52 @@ extern "C" { #include <rtems/rtems/intr.h> #if defined(RTEMS_MULTIPROCESSING) -/* +/** * The following defines the default Multiprocessing Configuration * Table. This table is used in a single processor system. */ - extern const rtems_multiprocessing_table _Initialization_Default_multiprocessing_table; #endif -/* - * rtems_initialize_executive_early - * - * DESCRIPTION: +/** + * @brief rtems_initialize_data_structures * - * This routine implements the early portion of rtems_initialize_executive - * directive up to the pretasking hook. This directive is invoked at system - * startup to initialize the RTEMS multitasking environment. + * This routine implements the portion of the RTEMS initializatin process + * that involves initializing data structures to a state that scheduling + * can occur in a consistent manner. */ - -rtems_interrupt_level rtems_initialize_executive_early( +void rtems_initialize_data_structures( rtems_configuration_table *configuration_table ); -/* - * rtems_initialize_executive_late +/** + * @brief rtems_initialize_before_drivers * - * DESCRIPTION: + * This routine implements the portion of RTEMS initialization that + * is done immediately before device drivers are initialized. + */ +void rtems_initialize_before_drivers(void); + +/** + * @brief rtems_initialize_device_drivers + * + * This routine implements the portion of RTEMS initialization that + * initializes all device drivers. + */ +void rtems_initialize_device_drivers(void); + +/** + * @brief rtems_initialize_start_multitasking * * This routine implements the early portion of rtems_initialize_executive * directive up to the pretasking hook. This directive is invoked at system * startup to initialize the RTEMS multitasking environment. */ +void rtems_initialize_start_multitasking(void); -void rtems_initialize_executive_late( - rtems_interrupt_level bsp_level -); - -/* - * rtems_shutdown_executive - * - * DESCRIPTION: +/** + * @brief rtems_shutdown_executive * * This routine implements the rtems_shutdown_executive directive. The * invocation of this directive results in the RTEMS environment being @@ -85,7 +90,6 @@ void rtems_initialize_executive_late( * invocation of this directive results in the rtems_initialize_executive * directive exitting to the startup code which invoked it. */ - void rtems_shutdown_executive( uint32_t result ); diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c index 45390c9a2d..1b41ed2bb4 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -1,7 +1,7 @@ /* * Initialization Manager * - * COPYRIGHT (c) 1989-2007. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -61,7 +61,7 @@ Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; -rtems_interrupt_level rtems_initialize_executive_early( +void rtems_initialize_data_structures( rtems_configuration_table *configuration_table ) { @@ -213,11 +213,10 @@ rtems_interrupt_level rtems_initialize_executive_early( /* * Scheduling can properly occur now as long as we avoid dispatching. */ +} - { - extern void bsp_pretasking_hook(void); - bsp_pretasking_hook(); - } +void rtems_initialize_before_drivers(void) +{ #if defined(RTEMS_MULTIPROCESSING) _MPCI_Create_server(); @@ -229,11 +228,10 @@ rtems_interrupt_level rtems_initialize_executive_early( _API_extensions_Run_predriver(); - { - extern void bsp_predriver_hook(void); - bsp_predriver_hook(); - } +} +void rtems_initialize_device_drivers(void) +{ /* * Initialize all the device drivers and initialize the MPCI layer. * @@ -258,30 +256,21 @@ rtems_interrupt_level rtems_initialize_executive_early( */ _API_extensions_Run_postdriver(); - - { - extern void bsp_postdriver_hook(void); - bsp_postdriver_hook(); - } - - return bsp_level; } -void rtems_initialize_executive_late( - rtems_interrupt_level bsp_level -) +void rtems_initialize_start_multitasking(void) { _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING ); _Thread_Start_multitasking(); - /* - * Restore the interrupt level to what the BSP had. Technically, - * this is unnecessary since the BSP should have all interrupts - * disabled when rtems_initialize_executive is invoked. But this keeps - * the ISR Disable/Enable calls paired. - */ - - _ISR_Enable( bsp_level ); + /******************************************************************* + ******************************************************************* + ******************************************************************* + ****** APPLICATION RUNS HERE ****** + ****** RETURNS WHEN SYSTEM IS SHUT DOWN ****** + ******************************************************************* + ******************************************************************* + *******************************************************************/ } |