From d0c39838146c6a186ddda3d95dac71c3fa90f11e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 22 Sep 2015 16:21:12 +0200 Subject: Use linker set for system initialization Make rtems_initialize_data_structures(), rtems_initialize_before_drivers() and rtems_initialize_device_drivers() static. Rename rtems_initialize_start_multitasking() to rtems_initialize_executive() and call the registered system initialization handlers in this function. Add system initialization API available via #include . Update the documentation accordingly. This is no functional change, only the method to call the existing initialization routines changes. Instead of direct function calls a table of function pointers contained in the new RTEMS system initialization linker set is used. This table looks like this (the actual addresses depend on the target). nm *.exe | grep _Linker | sort 0201a2d0 D _Linker_set__Sysinit_begin 0201a2d0 D _Linker_set__Sysinit_bsp_work_area_initialize 0201a2d4 D _Linker_set__Sysinit_bsp_start 0201a2d8 D _Linker_set__Sysinit_rtems_initialize_data_structures 0201a2dc D _Linker_set__Sysinit_bsp_libc_init 0201a2e0 D _Linker_set__Sysinit_rtems_initialize_before_drivers 0201a2e4 D _Linker_set__Sysinit_bsp_predriver_hook 0201a2e8 D _Linker_set__Sysinit_rtems_initialize_device_drivers 0201a2ec D _Linker_set__Sysinit_bsp_postdriver_hook 0201a2f0 D _Linker_set__Sysinit_end Add test sptests/spsysinit01. Update #2408. --- c/src/lib/libbsp/shared/include/bootcard.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'c/src/lib/libbsp/shared/include/bootcard.h') diff --git a/c/src/lib/libbsp/shared/include/bootcard.h b/c/src/lib/libbsp/shared/include/bootcard.h index a0d0993e8e..8559b218d7 100644 --- a/c/src/lib/libbsp/shared/include/bootcard.h +++ b/c/src/lib/libbsp/shared/include/bootcard.h @@ -71,26 +71,8 @@ void bsp_reset(void); * assembly language initialization file usually called @c start.S which does * the basic CPU setup (stack, C runtime environment, zero BSS, load other * sections) and calls afterwards boot_card(). The boot card function provides - * the framework for the BSP initialization sequence. The basic flow of - * initialization is: - * - * - disable interrupts, interrupts will be enabled during the first context - * switch - * - bsp_work_area_initialize() - initialize the RTEMS Workspace and the C - * Program Heap - * - bsp_start() - more advanced initialization - * - rtems_initialize_data_structures() - * - initialize C Library - * - rtems_initialize_before_drivers() - * - bsp_predriver_hook() - * - rtems_initialize_device_drivers() - * - initialization of all device drivers - * - bsp_postdriver_hook() - * - rtems_initialize_start_multitasking() - * - 1st task executes C++ global constructors - * - .... application runs ... - * - exit - * - will not return to here + * the framework for the BSP initialization sequence. For the basic flow of + * initialization see RTEMS C User's Guide, Initialization Manager. * * This style of initialization ensures that the C++ global constructors are * executed after RTEMS is initialized. -- cgit v1.2.3