[rtems commit] arm/raspberrypi: propagate number of configured CPUs into linker script.

Pavel Pisa ppisa at rtems.org
Wed Sep 7 20:22:02 UTC 2016


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

Author:    Pavel Pisa <pisa at cmp.felk.cvut.cz>
Date:      Thu Sep  1 21:55:51 2016 +0200

arm/raspberrypi: propagate number of configured CPUs into linker script.

---

 c/src/lib/libbsp/arm/raspberrypi/configure.ac        | 14 ++++++++++++++
 c/src/lib/libbsp/arm/raspberrypi/startup/linkcmds.in |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/c/src/lib/libbsp/arm/raspberrypi/configure.ac b/c/src/lib/libbsp/arm/raspberrypi/configure.ac
index 48bd62c..b772d6e 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/configure.ac
+++ b/c/src/lib/libbsp/arm/raspberrypi/configure.ac
@@ -40,6 +40,20 @@ RTEMS_BSPOPTS_SET([BSP_IS_RPI2],[*],[0])
 RTEMS_BSPOPTS_HELP([BSP_IS_RPI2],[Set if the BSP variant is Raspberry Pi 2.])
 AM_CONDITIONAL(RTEMS_RPI2,[test "$BSP_IS_RPI2" = "1"])
 
+# Hom many CPUs are used?
+RASPBERRYPI_CPUS="1"
+RTEMS_CHECK_SMP
+AM_CONDITIONAL(HAS_SMP,[test "$rtems_cv_HAS_SMP" = "yes"])
+AS_IF([test "$rtems_cv_HAS_SMP" = "yes"],
+      [RASPBERRYPI_CPUS="4"])
+
+AC_DEFUN([RASPBERRYPI_LINKCMD],[
+AC_ARG_VAR([$1],[$2; default $3])dnl
+[$1]=[$]{[$1]:-[$3]}
+])
+
+RASPBERRYPI_LINKCMD([RASPBERRYPI_CPUS],[Number of active cores],[${RASPBERRYPI_CPUS}])
+
 RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
 
 AC_CONFIG_FILES([
diff --git a/c/src/lib/libbsp/arm/raspberrypi/startup/linkcmds.in b/c/src/lib/libbsp/arm/raspberrypi/startup/linkcmds.in
index fc72b5c..d88c6d7 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/startup/linkcmds.in
+++ b/c/src/lib/libbsp/arm/raspberrypi/startup/linkcmds.in
@@ -41,6 +41,8 @@ MEMORY {
         RAM            (AIW) : ORIGIN = 0x00008000, LENGTH = 128M - 32k
 }
 
+bsp_processor_count = DEFINED (bsp_processor_count) ? bsp_processor_count : @RASPBERRYPI_CPUS@;
+
 REGION_ALIAS ("REGION_START", RAM);
 REGION_ALIAS ("REGION_VECTOR", VECTOR_RAM);
 REGION_ALIAS ("REGION_TEXT", RAM);



More information about the vc mailing list