[rtems commit] bsp/realview-pbx-a9: Add NULL pointer protection

Sebastian Huber sebh at rtems.org
Thu Oct 31 15:36:46 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Sep 17 13:08:49 2013 +0200

bsp/realview-pbx-a9: Add NULL pointer protection

Qemu Git version 8641136c54d216edb5bb8ef723c754039b4c5cf3 or later is
required.

---

 c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am   |    6 +--
 c/src/lib/libbsp/arm/realview-pbx-a9/preinstall.am |    8 +++++
 .../startup/linkcmds.realview_pbx_a9_qemu          |    3 +-
 .../startup/linkcmds.realview_pbx_a9_qemu_smp      |   32 +-------------------
 4 files changed, 13 insertions(+), 36 deletions(-)

diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am b/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
index a472cc2..522efe9 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
@@ -62,10 +62,8 @@ libbspstart_a_SOURCES = ../shared/start/start.S
 project_lib_DATA = start.$(OBJEXT)
 
 project_lib_DATA += startup/linkcmds
-
-EXTRA_DIST =
-EXTRA_DIST += startup/linkcmds.realview_pbx_a9_qemu
-EXTRA_DIST += startup/linkcmds.realview_pbx_a9_qemu_smp
+project_lib_DATA += startup/linkcmds.realview_pbx_a9_qemu
+project_lib_DATA += startup/linkcmds.realview_pbx_a9_qemu_smp
 
 ###############################################################################
 #                  LibBSP                                                     #
diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/preinstall.am b/c/src/lib/libbsp/arm/realview-pbx-a9/preinstall.am
index 8d26e05..218730f 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/preinstall.am
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/preinstall.am
@@ -158,3 +158,11 @@ $(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
 TMPINSTALL_FILES += $(PROJECT_LIB)/linkcmds
 
+$(PROJECT_LIB)/linkcmds.realview_pbx_a9_qemu: startup/linkcmds.realview_pbx_a9_qemu $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.realview_pbx_a9_qemu
+TMPINSTALL_FILES += $(PROJECT_LIB)/linkcmds.realview_pbx_a9_qemu
+
+$(PROJECT_LIB)/linkcmds.realview_pbx_a9_qemu_smp: startup/linkcmds.realview_pbx_a9_qemu_smp $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.realview_pbx_a9_qemu_smp
+TMPINSTALL_FILES += $(PROJECT_LIB)/linkcmds.realview_pbx_a9_qemu_smp
+
diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/startup/linkcmds.realview_pbx_a9_qemu b/c/src/lib/libbsp/arm/realview-pbx-a9/startup/linkcmds.realview_pbx_a9_qemu
index 0b5e3e0..ce34d77 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/startup/linkcmds.realview_pbx_a9_qemu
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/startup/linkcmds.realview_pbx_a9_qemu
@@ -1,5 +1,6 @@
 MEMORY {
-	RAM : ORIGIN = 0x00000000, LENGTH = 256M - 16k
+	/* Waste the first 1MiB for NULL pointer protection */
+	RAM : ORIGIN = 0x00100000, LENGTH = 255M - 16k
 	RAM_MMU : ORIGIN = 0x0fffc000, LENGTH = 16k
 }
 
diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/startup/linkcmds.realview_pbx_a9_qemu_smp b/c/src/lib/libbsp/arm/realview-pbx-a9/startup/linkcmds.realview_pbx_a9_qemu_smp
index d76dd2e..d31c4f0 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/startup/linkcmds.realview_pbx_a9_qemu_smp
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/startup/linkcmds.realview_pbx_a9_qemu_smp
@@ -1,33 +1,3 @@
-MEMORY {
-	RAM : ORIGIN = 0x00000000, LENGTH = 256M - 16k
-	RAM_MMU : ORIGIN = 0x0fffc000, LENGTH = 16k
-}
-
-REGION_ALIAS ("REGION_START", RAM);
-REGION_ALIAS ("REGION_VECTOR", RAM);
-REGION_ALIAS ("REGION_TEXT", RAM);
-REGION_ALIAS ("REGION_TEXT_LOAD", RAM);
-REGION_ALIAS ("REGION_RODATA", RAM);
-REGION_ALIAS ("REGION_RODATA_LOAD", RAM);
-REGION_ALIAS ("REGION_DATA", RAM);
-REGION_ALIAS ("REGION_DATA_LOAD", RAM);
-REGION_ALIAS ("REGION_FAST_TEXT", RAM);
-REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM);
-REGION_ALIAS ("REGION_FAST_DATA", RAM);
-REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);
-REGION_ALIAS ("REGION_BSS", RAM);
-REGION_ALIAS ("REGION_WORK", RAM);
-REGION_ALIAS ("REGION_STACK", RAM);
-
-bsp_stack_irq_size = DEFINED (bsp_stack_irq_size) ? bsp_stack_irq_size : 4096;
-bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 1024;
-
-bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1M;
-
-bsp_vector_table_in_start_section = 1;
-
-bsp_translation_table_base = ORIGIN (RAM_MMU);
-
 bsp_processor_count = DEFINED (bsp_processor_count) ? bsp_processor_count : 8;
 
-INCLUDE linkcmds.armv4
+INCLUDE linkcmds.realview_pbx_a9_qemu




More information about the vc mailing list