summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/shared/include/start.h
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2016-07-04 11:05:55 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2016-10-02 10:40:34 +0200
commitf9c1e1172e9adb2616e761f2e3d671361c7971ba (patch)
treeef16ac634fc8a1f70d194e18559156685eeef0c1 /c/src/lib/libbsp/arm/shared/include/start.h
parentlibbsp/arm: Fix ARM BSPs missing the bsp_translation_table_end symbol. (diff)
downloadrtems-f9c1e1172e9adb2616e761f2e3d671361c7971ba.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 Updates #2783
Diffstat (limited to 'c/src/lib/libbsp/arm/shared/include/start.h')
-rw-r--r--c/src/lib/libbsp/arm/shared/include/start.h13
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 9df6df4f3f..d5e69c318c 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().