[rtems commit] bsps/powerpc: Fix startup

Sebastian Huber sebh at rtems.org
Wed Jan 27 10:32:44 UTC 2016


Module:    rtems
Branch:    master
Commit:    ab8e821c9ee36dc5c3b429c2ca28e90b2c30432f
Changeset: http://git.rtems.org/rtems/commit/?id=ab8e821c9ee36dc5c3b429c2ca28e90b2c30432f

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jan 27 07:33:50 2016 +0100

bsps/powerpc: Fix startup

Do work area initialization after bsp_start() for BSPs using the shared
PowerPC work area initialization.

Close #2553.

---

 c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c b/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c
index 3e80663..3c86905 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c
+++ b/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c
@@ -9,10 +9,20 @@
 
 #include <libcpu/powerpc-utility.h>
 
+#include <rtems/sysinit.h>
+
 LINKER_SYMBOL(__rtems_end)
 
 void bsp_work_area_initialize(void)
 {
+  /*
+   * Cannot do work area initialization before bsp_start(), since BSP_mem_size
+   * and MMU is not set up.
+   */
+}
+
+static void bsp_work_area_initialize_later(void)
+{
   uintptr_t work_size;
   uintptr_t work_area;
 
@@ -22,3 +32,9 @@ void bsp_work_area_initialize(void)
 
   bsp_work_area_initialize_default((void *) work_area, work_size);
 }
+
+RTEMS_SYSINIT_ITEM(
+  bsp_work_area_initialize_later,
+  RTEMS_SYSINIT_BSP_START,
+  RTEMS_SYSINIT_ORDER_LAST
+);




More information about the vc mailing list