[PATCH] Add rtems_board_support_package()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Feb 1 07:05:41 UTC 2019


---
 bsps/shared/rtems-version.c           | 6 ++++++
 cpukit/include/rtems/version.h        | 7 +++++++
 testsuites/sptests/spversion01/init.c | 1 +
 3 files changed, 14 insertions(+)

diff --git a/bsps/shared/rtems-version.c b/bsps/shared/rtems-version.c
index 16f74070bc..99b98966e6 100644
--- a/bsps/shared/rtems-version.c
+++ b/bsps/shared/rtems-version.c
@@ -7,6 +7,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#include <rtems/version.h>
 #include <rtems/system.h>
 
 #include <bspopts.h>
@@ -27,3 +28,8 @@
 const char _RTEMS_version[] =
   "rtems-" RTEMS_VERSION " (" CPU_NAME "/" CPU_MODEL_NAME "/"
   RTEMS_XSTRING( RTEMS_BSP ) ")";
+
+const char *rtems_board_support_package( void )
+{
+  return RTEMS_XSTRING( RTEMS_BSP );
+}
diff --git a/cpukit/include/rtems/version.h b/cpukit/include/rtems/version.h
index b806cb8c2f..9bee2e8d10 100644
--- a/cpukit/include/rtems/version.h
+++ b/cpukit/include/rtems/version.h
@@ -67,6 +67,13 @@ int rtems_version_revision( void );
  */
 const char *rtems_version_control_key( void );
 
+/**
+ * @brief Returns the board support package name.
+ *
+ * @return The board support package name.
+ */
+const char *rtems_board_support_package( void );
+
 /** @} */
 
 #ifdef __cplusplus
diff --git a/testsuites/sptests/spversion01/init.c b/testsuites/sptests/spversion01/init.c
index f4edcb2cdc..fc38577691 100644
--- a/testsuites/sptests/spversion01/init.c
+++ b/testsuites/sptests/spversion01/init.c
@@ -29,6 +29,7 @@ static rtems_task Init(
   printf("Minor    : %d\n", rtems_version_minor());
   printf("Revision : %d\n", rtems_version_revision());
   printf("VC Key   : %s\n", rtems_version_control_key());
+  printf("BSP      : %s\n", rtems_board_support_package());
 
   TEST_END();
 
-- 
2.16.4



More information about the devel mailing list