[rtems commit] bsp/mpc55xx: Add MPC55XX_NULL_POINTER_PROTECTION

Sebastian Huber sebh at rtems.org
Wed Jul 18 07:44:02 UTC 2012


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jul 18 09:20:46 2012 +0200

bsp/mpc55xx: Add MPC55XX_NULL_POINTER_PROTECTION

---

 c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac   |    5 +++++
 .../libbsp/powerpc/mpc55xxevb/include/bspopts.h.in |    3 +++
 .../libbsp/powerpc/mpc55xxevb/startup/bspstart.c   |    2 +-
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
index ccfa105..68b90e2 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
@@ -79,6 +79,11 @@ RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[*]     ,[1])
 RTEMS_BSPOPTS_HELP([MPC55XX_EMIOS_PRESCALER],
 [Must be defined to set the EMIOS prescaler])
 
+RTEMS_BSPOPTS_SET([MPC55XX_NULL_POINTER_PROTECTION],[mpc5566*],[1])
+RTEMS_BSPOPTS_SET([MPC55XX_NULL_POINTER_PROTECTION],[mpc5674f*],[1])
+RTEMS_BSPOPTS_HELP([MPC55XX_NULL_POINTER_PROTECTION],
+[enable NULL pointer protection])
+
 RTEMS_BSPOPTS_SET([HAS_SMC91111],[phycore_mpc5554],[1])
 RTEMS_BSPOPTS_HELP([HAS_SMC91111],
 [If defined the board has the SMC91111 networking chip.])
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in b/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in
index 124a222..1be8513 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in
@@ -76,6 +76,9 @@
 /* if defined, do low level initialization */
 #undef MPC55XX_NEEDS_LOW_LEVEL_INIT
 
+/* enable NULL pointer protection */
+#undef MPC55XX_NULL_POINTER_PROTECTION
+
 /* Must be defined to be the external reference clock (in Hz) for clock
    generation */
 #undef MPC55XX_REFERENCE_CLOCK
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
index 405d2d0..d511a43 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
@@ -78,7 +78,7 @@ void _BSP_Fatal_error( unsigned n)
 
 static void null_pointer_protection(void)
 {
-#if defined(MPC55XX_BOARD_MPC5674FEVB) || defined(MPC55XX_BOARD_MPC5566EVB)
+#ifdef MPC55XX_NULL_POINTER_PROTECTION
 	struct MMU_tag mmu = { .MAS0 = { .B = { .TLBSEL = 1, .ESEL = 1 } } };
 
 	PPC_SET_SPECIAL_PURPOSE_REGISTER(FSL_EIS_MAS0, mmu.MAS0.R);




More information about the vc mailing list