diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2016-07-04 11:05:55 +0200 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2016-07-04 15:55:56 +0200 |
commit | 5812df8f5270b5a31a12dd2c9c15003339e94a77 (patch) | |
tree | f4e73d2da3e47ec6a9cfa0b5bed44a66e788e8fc /c/src/lib/libbsp/arm/shared/include/start.h | |
parent | arm/score and shared: define ARM hypervisor mode and alternate vector table b... (diff) | |
download | rtems-5812df8f5270b5a31a12dd2c9c15003339e94a77.tar.bz2 |
bsps/arm: Support recent bootloaders starting kernel in HYP mode
When HYP mode is detected at startup then setup HYP mode
vectors table (for future extensions) clean exceptions
switching to HYP mode and switch CPU to ARM SVC mode.
BSPs which want to use this support need to include next option
in their configure.ac
RTEMS_BSPOPTS_SET([BSP_START_IN_HYP_SUPPORT],[*],[1])
RTEMS_BSPOPTS_HELP([BSP_START_IN_HYP_SUPPORT], [Support start of BSP in ARM HYP mode])
AM_CONDITIONAL(BSP_START_IN_HYP_SUPPORT,test "$BSP_START_IN_HYP_SUPPORT" = "1")
and need to include next lines in corresponding Makefile.am
if BSP_START_IN_HYP_SUPPORT
libbsp_a_SOURCES += ../shared/startup/bsp-start-in-hyp-support.S
endif
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/arm/shared/include/start.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/arm/shared/include/start.h b/c/src/lib/libbsp/arm/shared/include/start.h index f61eed398e..bf8eed4433 100644 --- a/c/src/lib/libbsp/arm/shared/include/start.h +++ b/c/src/lib/libbsp/arm/shared/include/start.h @@ -45,6 +45,15 @@ extern "C" { #define BSP_START_DATA_SECTION __attribute__((section(".bsp_start_data"))) +/* +* Many ARM boot loaders pass arguments to loaded OS kernel +*/ +#ifdef BSP_START_HOOKS_WITH_LOADER_ARGS +#define BSP_START_HOOKS_LOADER_ARGS int saved_psr, int saved_machid, int saved_dtb_adr +#else +#define BSP_START_HOOKS_LOADER_ARGS void +#endif + /** * @brief System start entry. */ @@ -57,7 +66,7 @@ void _start(void); * stack pointers are initialized but before the copying of the exception * vectors. */ -void bsp_start_hook_0(void); +void bsp_start_hook_0(BSP_START_HOOKS_LOADER_ARGS); /** * @brief Start entry hook 1. @@ -65,7 +74,7 @@ void bsp_start_hook_0(void); * This hook will be called from the start entry code after copying of the * exception vectors but before the call to boot_card(). */ -void bsp_start_hook_1(void); +void bsp_start_hook_1(BSP_START_HOOKS_LOADER_ARGS); /** * @brief Similar to standard memcpy(). |