From d7f1b49019179a05d4eb6f200a022e09a833d168 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Wed, 8 Jul 2020 12:23:15 -0400 Subject: [PATCH] Resolve #177, Add baseline and build to version.h Add new macros for build baseline and number to psp_version.h files Add new element to PSP configuration structure. Add new macro CFE_PSP_VERSION in cfe_psp.h --- fsw/inc/cfe_psp.h | 2 + fsw/inc/cfe_psp_configdata.h | 1 + fsw/mcp750-vxworks/inc/psp_version.h | 61 +++++++++++++++++++++++----- fsw/pc-linux/inc/psp_version.h | 57 ++++++++++++++++++++------ fsw/pc-rtems/inc/psp_version.h | 58 ++++++++++++++++++++------ fsw/shared/src/cfe_psp_configdata.c | 3 +- 6 files changed, 146 insertions(+), 36 deletions(-) diff --git a/fsw/inc/cfe_psp.h b/fsw/inc/cfe_psp.h index b4f190a3..34f7be85 100644 --- a/fsw/inc/cfe_psp.h +++ b/fsw/inc/cfe_psp.h @@ -137,11 +137,13 @@ #define CFE_PSP_RST_SUBTYPE_MAX 10 /**< \brief Placeholder to indicate 1+ the maximum value that the PSP will ever use. */ /** \} */ + /* Implement the "version" macros */ #define CFE_PSP_MAJOR_VERSION (GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.MajorVersion) #define CFE_PSP_MINOR_VERSION (GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.MinorVersion) #define CFE_PSP_REVISION (GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.Revision) #define CFE_PSP_MISSION_REV (GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.MissionRev) +#define CFE_PSP_VERSION (GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.Version) /* ** Type Definitions diff --git a/fsw/inc/cfe_psp_configdata.h b/fsw/inc/cfe_psp_configdata.h index 096356df..05b6424b 100644 --- a/fsw/inc/cfe_psp_configdata.h +++ b/fsw/inc/cfe_psp_configdata.h @@ -43,6 +43,7 @@ typedef const struct uint8 MinorVersion; uint8 Revision; uint8 MissionRev; + char Version[16]; } CFE_PSP_VersionInfo_t; diff --git a/fsw/mcp750-vxworks/inc/psp_version.h b/fsw/mcp750-vxworks/inc/psp_version.h index 7c9233bf..8c786cee 100644 --- a/fsw/mcp750-vxworks/inc/psp_version.h +++ b/fsw/mcp750-vxworks/inc/psp_version.h @@ -19,23 +19,62 @@ */ /* -** File: psp_version.h -** -** Purpose: -** Provide version identifiers for the cFE Platform Support Packages (PSP). -** -*/ + * File: psp_version.h + * + * Purpose: + * Provide version identifiers for the cFE Platform Support Packages (PSP). + * See cfe documentation for version and build number descriptions + * + */ #ifndef _psp_version_ #define _psp_version_ +/* Development Build Macro Definitions */ +#define CFE_PSP_IMPL_BUILD_NUMBER 68 +#define CFE_PSP_IMPL_BUILD_BASELINE "v1.4.0+dev" /* -** Macro Definitions + * Macro Definitions + * ONLY APPLY for OFFICIAL releases + */ +#define CFE_PSP_IMPL_MAJOR_VERSION 1 +#define CFE_PSP_IMPL_MINOR_VERSION 4 +#define CFE_PSP_IMPL_REVISION 0 +#define CFE_PSP_IMPL_MISSION_REV 0 + +#define CFE_PSP_IMPL_STR_HELPER(x) #x +#define CFE_PSP_IMPL_STR(x) CFE_PSP_IMPL_STR_HELPER(x) + +/* Baseling git tag + Number of commits since baseline */ +#define CFE_PSP_IMPL_VERSION CFE_PSP_IMPL_BUILD_BASELINE CFE_PSP_IMPL_STR(CFE_PSP_IMPL_BUILD_NUMBER) + +#define CFE_PSP_IMPL_VERSION_STRING \ + " PSP Development Build\n " CFE_PSP_IMPL_VERSION " (Codename: Bootes)" /* Codename for current development */ \ + "\n Last Official Release: psp v1.4.0" /* For full support please use this version */ + +/* Use the following templates for Official Releases ONLY */ + +/* Official Release format for CFE_PSP_IMPLVERSION */ + /* + #define CFE_PSP_IMPL_VERSION "v" \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MAJOR_VERSION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MINOR_VERSION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_REVISION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MISSION_REV) + */ + +/* Official Release CFE_PSP_IMPLVERSION_STRING Format */ +/* +#define CFE_PSP_IMPL_VERSION_STRING " PSP " CFE_PSP_IMPL_VERSION */ -#define CFE_PSP_IMPL_MAJOR_VERSION 1 -#define CFE_PSP_IMPL_MINOR_VERSION 4 -#define CFE_PSP_IMPL_REVISION 14 -#define CFE_PSP_IMPL_MISSION_REV 0 + + /* Official Release CFE_PSP_IMPLVERSION_STRING Format */ + /* + #define CFE_PSP_IMPL_VERSION_STRING " PSP " CFE_PSP_IMPLVERSION + */ + +/* END TEMPLATES */ + #endif /* _psp_version_ */ diff --git a/fsw/pc-linux/inc/psp_version.h b/fsw/pc-linux/inc/psp_version.h index 7c9233bf..1f06d6cf 100644 --- a/fsw/pc-linux/inc/psp_version.h +++ b/fsw/pc-linux/inc/psp_version.h @@ -19,23 +19,56 @@ */ /* -** File: psp_version.h -** -** Purpose: -** Provide version identifiers for the cFE Platform Support Packages (PSP). -** -*/ + * File: psp_version.h + * + * Purpose: + * Provide version identifiers for the cFE Platform Support Packages (PSP). + * See cfe documentation for version and build number descriptions + * + */ #ifndef _psp_version_ #define _psp_version_ +/* Development Build Macro Definitions */ +#define CFE_PSP_IMPL_BUILD_NUMBER 68 +#define CFE_PSP_IMPL_BUILD_BASELINE "v1.4.0+dev" /* -** Macro Definitions -*/ -#define CFE_PSP_IMPL_MAJOR_VERSION 1 -#define CFE_PSP_IMPL_MINOR_VERSION 4 -#define CFE_PSP_IMPL_REVISION 14 -#define CFE_PSP_IMPL_MISSION_REV 0 + * Macro Definitions + * ONLY APPLY for OFFICIAL releases + */ +#define CFE_PSP_IMPL_MAJOR_VERSION 1 +#define CFE_PSP_IMPL_MINOR_VERSION 4 +#define CFE_PSP_IMPL_REVISION 0 +#define CFE_PSP_IMPL_MISSION_REV 0 + +#define CFE_PSP_IMPL_STR_HELPER(x) #x +#define CFE_PSP_IMPL_STR(x) CFE_PSP_IMPL_STR_HELPER(x) + +/* Baseling git tag + Number of commits since baseline */ +#define CFE_PSP_IMPL_VERSION CFE_PSP_IMPL_BUILD_BASELINE CFE_PSP_IMPL_STR(CFE_PSP_IMPL_BUILD_NUMBER) + +#define CFE_PSP_IMPL_VERSION_STRING \ + " PSP Development Build\n " CFE_PSP_IMPL_VERSION " (Codename: Bootes)" /* Codename for current development */ \ + "\n Last Official Release: psp v1.4.0" /* For full support please use this version */ + +/* Use the following templates for Official Releases ONLY */ + +/* Official Release format for CFE_PSP_IMPLVERSION */ + /* + #define CFE_PSP_IMPL_VERSION "v" \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MAJOR_VERSION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MINOR_VERSION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_REVISION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MISSION_REV) + */ + + /* Official Release CFE_PSP_IMPLVERSION_STRING Format */ + /* + #define CFE_PSP_IMPL_VERSION_STRING " PSP " CFE_PSP_IMPL_VERSION + */ + +/* END TEMPLATES */ #endif /* _psp_version_ */ diff --git a/fsw/pc-rtems/inc/psp_version.h b/fsw/pc-rtems/inc/psp_version.h index 7c9233bf..fa2b52fe 100644 --- a/fsw/pc-rtems/inc/psp_version.h +++ b/fsw/pc-rtems/inc/psp_version.h @@ -19,23 +19,57 @@ */ /* -** File: psp_version.h -** -** Purpose: -** Provide version identifiers for the cFE Platform Support Packages (PSP). -** -*/ + * File: psp_version.h + * + * Purpose: + * Provide version identifiers for the cFE Platform Support Packages (PSP). + * See cfe documentation for version and build number descriptions + * + */ #ifndef _psp_version_ #define _psp_version_ +/* Development Build Macro Definitions */ +#define CFE_PSP_IMPL_BUILD_NUMBER 68 +#define CFE_PSP_IMPL_BUILD_BASELINE "v1.4.0+dev" /* -** Macro Definitions -*/ -#define CFE_PSP_IMPL_MAJOR_VERSION 1 -#define CFE_PSP_IMPL_MINOR_VERSION 4 -#define CFE_PSP_IMPL_REVISION 14 -#define CFE_PSP_IMPL_MISSION_REV 0 + * Macro Definitions + * ONLY APPLY for OFFICIAL releases + */ +#define CFE_PSP_IMPL_MAJOR_VERSION 1 +#define CFE_PSP_IMPL_MINOR_VERSION 4 +#define CFE_PSP_IMPL_REVISION 0 +#define CFE_PSP_IMPL_MISSION_REV 0 + +#define CFE_PSP_IMPL_STR_HELPER(x) #x +#define CFE_PSP_IMPL_STR(x) CFE_PSP_IMPL_STR_HELPER(x) + +/* Baseling git tag + Number of commits since baseline */ +#define CFE_PSP_IMPL_VERSION CFE_PSP_IMPL_BUILD_BASELINE CFE_PSP_IMPL_STR(CFE_PSP_IMPL_BUILD_NUMBER) + +#define CFE_PSP_IMPL_VERSION_STRING \ + " PSP Development Build\n " CFE_PSP_IMPL_VERSION " (Codename: Bootes)" /* Codename for current development */ \ + "\n Last Official Release: psp v1.4.0" /* For full support please use this version */ + +/* Use the following templates for Official Releases ONLY */ + +/* Official Release format for CFE_PSP_IMPLVERSION */ + /* + #define CFE_PSP_IMPL_VERSION "v" \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MAJOR_VERSION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MINOR_VERSION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_REVISION) "." \ + CFE_PSP_IMPL_STR(CFE_PSP_IMPL_MISSION_REV) + */ + + /* Official Release CFE_PSP_IMPLVERSION_STRING Format */ + /* + #define CFE_PSP_IMPL_VERSION_STRING " PSP " CFE_PSP_IMPL_VERSION + */ + +/* END TEMPLATES */ + #endif /* _psp_version_ */ diff --git a/fsw/shared/src/cfe_psp_configdata.c b/fsw/shared/src/cfe_psp_configdata.c index 56112216..d7aba840 100644 --- a/fsw/shared/src/cfe_psp_configdata.c +++ b/fsw/shared/src/cfe_psp_configdata.c @@ -52,6 +52,7 @@ Target_PspConfigData GLOBAL_PSP_CONFIGDATA = .MajorVersion = CFE_PSP_IMPL_MAJOR_VERSION, .MinorVersion = CFE_PSP_IMPL_MINOR_VERSION, .Revision = CFE_PSP_IMPL_REVISION, - .MissionRev = CFE_PSP_IMPL_MISSION_REV + .MissionRev = CFE_PSP_IMPL_MISSION_REV, + .Version = CFE_PSP_IMPL_VERSION } };