[PATCH 07/10] arm/raspberrypi: propagate number of configured CPUs into linker script.

pisa at cmp.felk.cvut.cz pisa at cmp.felk.cvut.cz
Sat Sep 3 12:31:23 UTC 2016


From: Pavel Pisa <pisa at cmp.felk.cvut.cz>

---
 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);
-- 
1.9.1




More information about the devel mailing list