Skip to content

Commit

Permalink
Fix #280, remove psp configdata global object
Browse files Browse the repository at this point in the history
This global config structure is not really necessary.  The original
intent was to allow dependents (e.g. CFE) to get vars at runtime but
keep them stored within PSP.  However for all those cases where CFE
needs PSP info, an API function is defined to get the info.  There
should not be any need to read this variable directly.
  • Loading branch information
jphickey committed Mar 31, 2021
1 parent 73366d4 commit a6c07e1
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 160 deletions.
7 changes: 0 additions & 7 deletions fsw/inc/cfe_psp.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@
#define CFE_PSP_RST_SUBTYPE_MAX 10
/** \} */

/* 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.VersionString)

/*
** Type Definitions
*/
Expand Down
86 changes: 0 additions & 86 deletions fsw/inc/cfe_psp_configdata.h

This file was deleted.

2 changes: 2 additions & 0 deletions fsw/mcp750-vxworks/inc/psp_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
99 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. A value of "99" indicates an unreleased \
development version. */

#define CFE_PSP_IMPL_CODENAME "Bootes"

/*
* Tools to construct version string
*/
Expand Down
2 changes: 2 additions & 0 deletions fsw/pc-linux/inc/psp_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
99 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. A value of "99" indicates an unreleased \
development version. */

#define CFE_PSP_IMPL_CODENAME "Bootes"

/*
* Tools to construct version string
*/
Expand Down
2 changes: 2 additions & 0 deletions fsw/pc-rtems/inc/psp_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
99 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. A value of "99" indicates an unreleased \
development version. */

#define CFE_PSP_IMPL_CODENAME "Bootes"

/*
* Tools to construct version string
*/
Expand Down
1 change: 0 additions & 1 deletion fsw/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

# Build the shared implementation as a library
add_library(psp-${CFE_PSP_TARGETNAME}-shared OBJECT
src/cfe_psp_configdata.c
src/cfe_psp_exceptionstorage.c
src/cfe_psp_memrange.c
src/cfe_psp_memutils.c
Expand Down
52 changes: 0 additions & 52 deletions fsw/shared/src/cfe_psp_configdata.c

This file was deleted.

1 change: 0 additions & 1 deletion fsw/shared/src/cfe_psp_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <string.h>
#include "osapi.h"

#include "cfe_psp_configdata.h"
#include "cfe_psp_module.h"

/*
Expand Down
16 changes: 8 additions & 8 deletions fsw/shared/src/cfe_psp_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

#include "cfe_psp.h"
#include "cfe_psp_configdata.h"
#include "psp_version.h"

/*----------------------------------------------------------------
*
Expand All @@ -37,7 +37,7 @@
*-----------------------------------------------------------------*/
const char *CFE_PSP_GetVersionString(void)
{
return GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.VersionString;
return CFE_PSP_IMPL_VERSION;
}

/*----------------------------------------------------------------
Expand All @@ -50,7 +50,7 @@ const char *CFE_PSP_GetVersionString(void)
*-----------------------------------------------------------------*/
const char *CFE_PSP_GetVersionCodeName(void)
{
return GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.VersionCodeName;
return CFE_PSP_IMPL_CODENAME;
}

/*----------------------------------------------------------------
Expand All @@ -63,10 +63,10 @@ const char *CFE_PSP_GetVersionCodeName(void)
*-----------------------------------------------------------------*/
void CFE_PSP_GetVersionNumber(uint8 VersionNumbers[4])
{
VersionNumbers[0] = GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.MajorVersion;
VersionNumbers[1] = GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.MinorVersion;
VersionNumbers[2] = GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.Revision;
VersionNumbers[3] = GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.MissionRev;
VersionNumbers[0] = CFE_PSP_IMPL_MAJOR_VERSION;
VersionNumbers[1] = CFE_PSP_IMPL_MINOR_VERSION;
VersionNumbers[2] = CFE_PSP_IMPL_REVISION;
VersionNumbers[3] = CFE_PSP_IMPL_MISSION_REV;
}

/*----------------------------------------------------------------
Expand All @@ -79,5 +79,5 @@ void CFE_PSP_GetVersionNumber(uint8 VersionNumbers[4])
*-----------------------------------------------------------------*/
uint32 CFE_PSP_GetBuildNumber(void)
{
return GLOBAL_PSP_CONFIGDATA.PSP_VersionInfo.BuildNumber;
return CFE_PSP_IMPL_BUILD_NUMBER;
}
3 changes: 1 addition & 2 deletions unit-test-coverage/ut-stubs/src/cfe-configdata-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ Target_ConfigData GLOBAL_CONFIGDATA = {.MissionVersion = PCS_CONFIG_MISSIO
.Default_CpuName = PCS_CONFIG_CPUNAME,
.Default_CpuId = PCS_CONFIG_CPUNUMBER,
.Default_SpacecraftId = PCS_CONFIG_SPACECRAFT,
.CfeConfig = &GLOBAL_CFE_CONFIGDATA,
.PspConfig = &GLOBAL_PSP_CONFIGDATA};
.CfeConfig = &GLOBAL_CFE_CONFIGDATA};

/**
* Stub for the main system entry function implemented in CFE ES
Expand Down
4 changes: 1 addition & 3 deletions ut-stubs/ut_psp_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#include "target_config.h"

Target_PspConfigData GLOBAL_PSP_CONFIGDATA = {0};
Target_CfeConfigData GLOBAL_CFE_CONFIGDATA = {0};

/**
Expand All @@ -57,8 +56,7 @@ Target_ConfigData GLOBAL_CONFIGDATA = {.MissionVersion = "MissionUnitTest"
.Default_CpuName = "UnitTestCpu",
.Default_CpuId = 1,
.Default_SpacecraftId = 0x42,
.CfeConfig = &GLOBAL_CFE_CONFIGDATA,
.PspConfig = &GLOBAL_PSP_CONFIGDATA};
.CfeConfig = &GLOBAL_CFE_CONFIGDATA};

/*
** Functions
Expand Down

0 comments on commit a6c07e1

Please sign in to comment.