summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2019-11-28 09:59:56 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2020-09-02 10:53:07 +0200
commit3410ed193ac9fb3b4dc504c03f79163c11d47c63 (patch)
tree257134fa01ee8e37154bb5267b670e97f7bd5e9a
parent6781ed349c2f7a6b814874fc63061643572f954e (diff)
rcc: add a RCC version string to LEON2/3 BSPs
-rw-r--r--bsps/shared/rcc-version.c21
-rw-r--r--bsps/shared/shared-sources.am1
-rw-r--r--bsps/sparc/shared/start/linkcmds.base1
-rw-r--r--c/src/lib/libbsp/sparc/leon2/configure.ac3
-rw-r--r--c/src/lib/libbsp/sparc/leon3/configure.ac4
-rw-r--r--cpukit/headers.am1
-rw-r--r--cpukit/include/rtems/rcc.h26
7 files changed, 57 insertions, 0 deletions
diff --git a/bsps/shared/rcc-version.c b/bsps/shared/rcc-version.c
new file mode 100644
index 0000000000..b4c62e16c9
--- /dev/null
+++ b/bsps/shared/rcc-version.c
@@ -0,0 +1,21 @@
+/*
+ * COPYRIGHT (c) 2019, Cobham Gaisler
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <bspopts.h>
+#include <rtems/rcc.h>
+
+#ifdef RCC_VERSION
+const char _RCC_version[] = "rcc-" RCC_VERSION;
+#else
+const char _RCC_version[] = "";
+#endif
+
+const char *rcc_version(void)
+{
+ return _RCC_version;
+}
diff --git a/bsps/shared/shared-sources.am b/bsps/shared/shared-sources.am
index 3c07770bb2..3ca6b58766 100644
--- a/bsps/shared/shared-sources.am
+++ b/bsps/shared/shared-sources.am
@@ -51,6 +51,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/net/open_eth.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/net/smc91111.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/net/sonic.c
endif
+librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/rcc-version.c
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/rtems-version.c
if HAS_MP
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/shmdr/shmdr-addlq.c
diff --git a/bsps/sparc/shared/start/linkcmds.base b/bsps/sparc/shared/start/linkcmds.base
index 7d5f86b23c..68506aa165 100644
--- a/bsps/sparc/shared/start/linkcmds.base
+++ b/bsps/sparc/shared/start/linkcmds.base
@@ -48,6 +48,7 @@ RAM_END = _RAM_END;
* SPARC monitor assumes this is present to provide proper RTEMS awareness.
*/
EXTERN(rtems_get_version_string);
+EXTERN(rcc_version);
STARTUP(start.o)
diff --git a/c/src/lib/libbsp/sparc/leon2/configure.ac b/c/src/lib/libbsp/sparc/leon2/configure.ac
index e310149168..1c8f3d918e 100644
--- a/c/src/lib/libbsp/sparc/leon2/configure.ac
+++ b/c/src/lib/libbsp/sparc/leon2/configure.ac
@@ -30,6 +30,9 @@ RTEMS_BSPOPTS_HELP([BSP_POWER_DOWN_AT_FATAL_HALT],
[If defined, CPU is spinning on fatal exit. Otherwise generate system
error which will hand over to debugger, simulator, etc.])
+## bsp-specific options
+RTEMS_BSPOPTS_SET([RCC_VERSION],[*],[""])
+RTEMS_BSPOPTS_HELP([RCC_VERSION],[Defines the version of RCC])
RTEMS_BSP_CLEANUP_OPTIONS
# Explicitly list all Makefiles here
diff --git a/c/src/lib/libbsp/sparc/leon3/configure.ac b/c/src/lib/libbsp/sparc/leon3/configure.ac
index fc66dcfe17..a3c318d6e3 100644
--- a/c/src/lib/libbsp/sparc/leon3/configure.ac
+++ b/c/src/lib/libbsp/sparc/leon3/configure.ac
@@ -32,6 +32,10 @@ RTEMS_BSPOPTS_HELP([BSP_POWER_DOWN_AT_FATAL_HALT],
[If defined, CPU is powered down on fatal exit. Otherwise generate system
error which will hand over to debugger, simulator, etc.])
+## bsp-specific options
+RTEMS_BSPOPTS_SET([RCC_VERSION],[*],[""])
+RTEMS_BSPOPTS_HELP([RCC_VERSION],[Defines the version of RCC])
+
RTEMS_BSP_CLEANUP_OPTIONS
# Explicitly list all Makefiles here
diff --git a/cpukit/headers.am b/cpukit/headers.am
index fcf679f09d..702713240d 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -136,6 +136,7 @@ include_rtems_HEADERS += include/rtems/qreslib.h
include_rtems_HEADERS += include/rtems/ramdisk.h
include_rtems_HEADERS += include/rtems/rbheap.h
include_rtems_HEADERS += include/rtems/rbtree.h
+include_rtems_HEADERS += include/rtems/rcc.h
include_rtems_HEADERS += include/rtems/record.h
include_rtems_HEADERS += include/rtems/recordclient.h
include_rtems_HEADERS += include/rtems/recorddata.h
diff --git a/cpukit/include/rtems/rcc.h b/cpukit/include/rtems/rcc.h
new file mode 100644
index 0000000000..fc78dbe261
--- /dev/null
+++ b/cpukit/include/rtems/rcc.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2019.
+ * Cobham Gaisler
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _RCC_VERSION_H
+#define _RCC_VERSION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Returns RCC version string
+ */
+const char *rcc_version(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif