[rtems commit] bsp/riscv: Add BSP options to define RAM region
Sebastian Huber
sebh at rtems.org
Fri Jun 29 09:55:21 UTC 2018
Module: rtems
Branch: master
Commit: 16d905f289d69b4c1b5b72130a2d132f947c1f63
Changeset: http://git.rtems.org/rtems/commit/?id=16d905f289d69b4c1b5b72130a2d132f947c1f63
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Jun 22 07:51:08 2018 +0200
bsp/riscv: Add BSP options to define RAM region
Update #3433.
---
bsps/riscv/riscv/start/{linkcmds => linkcmds.in} | 2 +-
c/src/lib/libbsp/riscv/riscv/configure.ac | 26 ++++++++++++++++++++++--
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/bsps/riscv/riscv/start/linkcmds b/bsps/riscv/riscv/start/linkcmds.in
similarity index 96%
rename from bsps/riscv/riscv/start/linkcmds
rename to bsps/riscv/riscv/start/linkcmds.in
index 7bcf657..80e2f5e 100644
--- a/bsps/riscv/riscv/start/linkcmds
+++ b/bsps/riscv/riscv/start/linkcmds.in
@@ -26,7 +26,7 @@
MEMORY
{
- RAM : ORIGIN = 0x0000000010000000, LENGTH = 0x10000000
+ RAM : ORIGIN = @RISCV_RAM_REGION_BEGIN@, LENGTH = @RISCV_RAM_REGION_SIZE@
}
REGION_ALIAS ("REGION_START", RAM);
diff --git a/c/src/lib/libbsp/riscv/riscv/configure.ac b/c/src/lib/libbsp/riscv/riscv/configure.ac
index 4f8b625..b699a8b 100644
--- a/c/src/lib/libbsp/riscv/riscv/configure.ac
+++ b/c/src/lib/libbsp/riscv/riscv/configure.ac
@@ -10,7 +10,6 @@ AC_INIT([rtems-c-src-lib-libbsp-riscv],[_RTEMS_VERSION],[http://www.rtems.org/bu
RTEMS_TOP(../../../../../..)
RTEMS_SOURCE_TOP
RTEMS_BUILD_TOP
-RTEMS_BSP_LINKCMDS
RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.12.2])
@@ -18,5 +17,28 @@ RTEMS_BSP_CONFIGURE
RTEMS_BSP_CLEANUP_OPTIONS
-AC_CONFIG_FILES([Makefile])
+case "${RTEMS_BSP}" in
+ rv64*medany)
+ RISCV_RAM_REGION_BEGIN_DEFAULT=0x80000000
+ ;;
+ rv64*)
+ RISCV_RAM_REGION_BEGIN_DEFAULT=0x70000000
+ ;;
+ *)
+ RISCV_RAM_REGION_BEGIN_DEFAULT=0x80000000
+ ;;
+esac
+
+AC_DEFUN([RISCV_LINKCMD],[
+AC_ARG_VAR([$1],[$2])dnl
+[$1]=[$]{[$1]:-[$3]}
+])
+
+RISCV_LINKCMD([RISCV_RAM_REGION_BEGIN],[begin of the RAM region for linker command file (default is 0x70000000 for 64-bit with -mcmodel=medlow and 0x80000000 for all other)],[${RISCV_RAM_REGION_BEGIN_DEFAULT}])
+RISCV_LINKCMD([RISCV_RAM_REGION_SIZE],[size of the RAM region for linker command file (default 64MiB)],[0x04000000])
+
+AC_CONFIG_FILES([
+Makefile
+linkcmds:../../../../../../bsps/riscv/riscv/start/linkcmds.in
+])
AC_OUTPUT
More information about the vc
mailing list