Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
######################################################################
#
# CMAKE build recipe for CFE Platform Support Package (PSP)
#
######################################################################

project(CFEPSP C)

if (NOT CFE_SYSTEM_PSPNAME)
message(FATAL_ERROR "CFE_SYSTEM_PSPNAME is not defined - do not know which to build")
endif()

set(CFE_PSP_TARGETNAME "${CFE_SYSTEM_PSPNAME}")
add_definitions(-D_CFE_PSP_)

include_directories(fsw/shared)

# Build the PSP implementation which lies in a system-specific subdirectory
include_directories(fsw/shared)
include_directories(fsw/${CFE_SYSTEM_PSPNAME}/inc)
add_subdirectory(fsw/${CFE_SYSTEM_PSPNAME} ${CFE_SYSTEM_PSPNAME})

# Build the "common" parts as a library
add_library(psp-${CFE_SYSTEM_PSPNAME} STATIC
fsw/shared/cfe_psp_configdata.c
fsw/shared/cfe_psp_eeprom.c
fsw/shared/cfe_psp_exceptionstorage.c
fsw/shared/cfe_psp_memrange.c
fsw/shared/cfe_psp_memutils.c
fsw/shared/cfe_psp_module.c
fsw/shared/cfe_psp_port.c
fsw/shared/cfe_psp_ram.c
$<TARGET_OBJECTS:psp-${CFE_SYSTEM_PSPNAME}-impl>)
# The PSP is currently built in two parts, consisting of a fully platform-specific
# module combined with a shared component which is built for multiple targets.
# The "shared" component is compiled using headers from the platform-specific module
# so it is still ultimately a platform-specific binary, and it all gets wrapped into
# a single PSP static library target.
include_directories(fsw/shared/inc)
add_subdirectory(fsw/${CFE_PSP_TARGETNAME} ${CFE_PSP_TARGETNAME}-impl)
add_subdirectory(fsw/shared ${CFE_PSP_TARGETNAME}-shared)

add_library(psp-${CFE_PSP_TARGETNAME} STATIC
$<TARGET_OBJECTS:psp-${CFE_PSP_TARGETNAME}-shared>
$<TARGET_OBJECTS:psp-${CFE_PSP_TARGETNAME}-impl>
)

if (ENABLE_UNIT_TESTS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/fsw/ut-stubs)
endif (ENABLE_UNIT_TESTS)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ This is a collection of APIs abstracting platform specific functionality to be l

## Version History

### Development Build: 1.4.0+dev71

- Restructure code to make more amicable for rebuilding in a unit test environment. No major changes, primarily just shifting code between locations/headers to support unit testing.
- Adds a char element `Version` to `CFE_PSP_VersionInfo_t` containing the version number expressed as a string. Defines new macros for the Build Number and the Build Baseline.
- See <https://github.com/nasa/PSP/pull/176>

### Development Build: 1.4.14

- Changes the PSP reference to be compatible with the change in nasa/osal#449 making the BSP modules more generic and changes the name.
Expand Down
2 changes: 2 additions & 0 deletions fsw/inc/cfe_psp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions fsw/inc/cfe_psp_configdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ typedef const struct
uint8 MinorVersion;
uint8 Revision;
uint8 MissionRev;
char Version[16];
} CFE_PSP_VersionInfo_t;


Expand Down
12 changes: 11 additions & 1 deletion fsw/mcp750-vxworks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
######################################################################
#
# CMAKE build recipe for mcp750-vxworks PSP component
#
######################################################################

# This contains the fully platform-specific code to
# run CFE on this target.

include_directories(inc)

# Build the mcp750-vxworks implementation as a library
add_library(psp-${CFE_SYSTEM_PSPNAME}-impl OBJECT
add_library(psp-${CFE_PSP_TARGETNAME}-impl OBJECT
src/cfe_psp_exception.c
src/cfe_psp_memory.c
src/cfe_psp_memtab.c
Expand Down
50 changes: 36 additions & 14 deletions fsw/mcp750-vxworks/inc/psp_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,46 @@
** limitations under the License.
*/

/*
** File: psp_version.h
**
** Purpose:
** Provide version identifiers for the cFE Platform Support Packages (PSP).
**
*/

/*! @file mcp750-vxworks/inc/psp_version.h
* @brief Purpose:
* @details Provide version identifiers for the cFE Platform Support Packages (PSP).
* See @ref cfsversions for version and build number and description
*/
#ifndef _psp_version_
#define _psp_version_

/*
* Development Build Macro Definitions
*/
#define CFE_PSP_IMPL_BUILD_NUMBER 71
#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
* Version Macro Definitions
*/
#define CFE_PSP_IMPL_MAJOR_VERSION 1 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */
#define CFE_PSP_IMPL_MINOR_VERSION 4 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */
#define CFE_PSP_IMPL_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision number. */
#define CFE_PSP_IMPL_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */

/*
* Tools to construct version string
*/
#define CFE_PSP_IMPL_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer */
#define CFE_PSP_IMPL_STR(x) CFE_PSP_IMPL_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer */

/*! @brief Development Build Version Number.
* @details Baseline git tag + Number of commits since baseline. @n
* See @ref cfsversions for format differences between development and release versions.
*/
#define CFE_PSP_IMPL_VERSION CFE_PSP_IMPL_BUILD_BASELINE CFE_PSP_IMPL_STR(CFE_PSP_IMPL_BUILD_NUMBER)

/*! @brief Development Build Version String.
* @details Reports the current development build's baseline, number, and name. Also includes a note about the latest official version. @n
* See @ref cfsversions for format differences between development and release versions.
*/
#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 */

#endif /* _psp_version_ */
5 changes: 3 additions & 2 deletions fsw/mcp750-vxworks/src/cfe_psp_exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@

#include "cfe_psp.h"
#include "cfe_psp_config.h"
#include "cfe_psp_exceptionstorage.h"
#include "cfe_psp_exceptionstorage_types.h"
#include "cfe_psp_exceptionstorage_api.h"
#include "cfe_psp_memory.h"

#include <target_config.h>
Expand Down Expand Up @@ -88,7 +89,7 @@ void CFE_PSP_ExceptionHook ( TASK_ID task_id, int vector, void* vpEsf );
void CFE_PSP_AttachExceptions(void)
{
excHookAdd( CFE_PSP_ExceptionHook );
OS_printf("CFE_PSP: Attached cFE Exception Handler. Context Size = %u bytes.\n",sizeof(CFE_PSP_Exception_ContextDataEntry_t));
OS_printf("CFE_PSP: Attached cFE Exception Handler. Context Size = %lu bytes.\n",(unsigned long)sizeof(CFE_PSP_Exception_ContextDataEntry_t));
CFE_PSP_Exception_Reset();
}

Expand Down
7 changes: 7 additions & 0 deletions fsw/mcp750-vxworks/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ void OS_Application_Startup(void)
/* note: use printf here, as OS_printf may not work */
printf("CFE_PSP: OS_API_Init() failure\n");
CFE_PSP_Panic(Status);

/*
* normally CFE_PSP_Panic() does not return, except
* during unit testing. This return avoids executing
* the rest of this function in that case.
*/
return;
}

/*
Expand Down
2 changes: 0 additions & 2 deletions fsw/mcp750-vxworks/src/cfe_psp_watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
#include "cfe_psp.h"
#include "cfe_psp_config.h"

IMPORT void sysPciRead32 (UINT32, UINT32 *);

/*
** Global data
*/
Expand Down
12 changes: 11 additions & 1 deletion fsw/pc-linux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
######################################################################
#
# CMAKE build recipe for pc-linux PSP component
#
######################################################################

# This contains the fully platform-specific code to
# run CFE on this target.

include_directories(inc)

# Build the pc-linux implementation as a library
add_library(psp-${CFE_SYSTEM_PSPNAME}-impl OBJECT
add_library(psp-${CFE_PSP_TARGETNAME}-impl OBJECT
src/cfe_psp_exception.c
src/cfe_psp_memory.c
src/cfe_psp_memtab.c
Expand Down
50 changes: 36 additions & 14 deletions fsw/pc-linux/inc/psp_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,46 @@
** limitations under the License.
*/

/*
** File: psp_version.h
**
** Purpose:
** Provide version identifiers for the cFE Platform Support Packages (PSP).
**
*/

/*! @file pc-linux/inc/psp_version.h
* @brief Purpose:
* @details Provide version identifiers for the cFE Platform Support Packages (PSP).
* See @ref cfsversions for version and build number and description
*/
#ifndef _psp_version_
#define _psp_version_

/*
* Development Build Macro Definitions
*/
#define CFE_PSP_IMPL_BUILD_NUMBER 71
#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
* Version Macro Definitions
*/
#define CFE_PSP_IMPL_MAJOR_VERSION 1 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */
#define CFE_PSP_IMPL_MINOR_VERSION 4 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */
#define CFE_PSP_IMPL_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision number. */
#define CFE_PSP_IMPL_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */

/*
* Tools to construct version string
*/
#define CFE_PSP_IMPL_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer */
#define CFE_PSP_IMPL_STR(x) CFE_PSP_IMPL_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer */

/*! @brief Development Build Version Number.
* @details Baseline git tag + Number of commits since baseline. @n
* See @ref cfsversions for format differences between development and release versions.
*/
#define CFE_PSP_IMPL_VERSION CFE_PSP_IMPL_BUILD_BASELINE CFE_PSP_IMPL_STR(CFE_PSP_IMPL_BUILD_NUMBER)

/*! @brief Development Build Version String.
* @details Reports the current development build's baseline, number, and name. Also includes a note about the latest official version. @n
* See @ref cfsversions for format differences between development and release versions.
*/
#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 */

#endif /* _psp_version_ */
3 changes: 2 additions & 1 deletion fsw/pc-linux/src/cfe_psp_exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ S
#include "osapi.h"
#include "cfe_psp.h"
#include "cfe_psp_config.h"
#include "cfe_psp_exceptionstorage.h"
#include "cfe_psp_exceptionstorage_types.h"
#include "cfe_psp_exceptionstorage_api.h"

#include <execinfo.h>
#include <signal.h>
Expand Down
12 changes: 11 additions & 1 deletion fsw/pc-rtems/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
######################################################################
#
# CMAKE build recipe for pc-rtems PSP component
#
######################################################################

# This contains the fully platform-specific code to
# run CFE on this target.

include_directories(inc)

# Build the pc-rtems implementation as a library
add_library(psp-${CFE_SYSTEM_PSPNAME}-impl OBJECT
add_library(psp-${CFE_PSP_TARGETNAME}-impl OBJECT
src/cfe_psp_exception.c
src/cfe_psp_memory.c
src/cfe_psp_memtab.c
Expand Down
50 changes: 36 additions & 14 deletions fsw/pc-rtems/inc/psp_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,46 @@
** limitations under the License.
*/

/*
** File: psp_version.h
**
** Purpose:
** Provide version identifiers for the cFE Platform Support Packages (PSP).
**
*/

/*! @file pc-rtems/inc/psp_version.h
* @brief Purpose:
* @details Provide version identifiers for the cFE Platform Support Packages (PSP).
* See @ref cfsversions for version and build number and description
*/
#ifndef _psp_version_
#define _psp_version_

/*
* Development Build Macro Definitions
*/
#define CFE_PSP_IMPL_BUILD_NUMBER 71
#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
* Version Macro Definitions
*/
#define CFE_PSP_IMPL_MAJOR_VERSION 1 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */
#define CFE_PSP_IMPL_MINOR_VERSION 4 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */
#define CFE_PSP_IMPL_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision number. */
#define CFE_PSP_IMPL_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */

/*
* Tools to construct version string
*/
#define CFE_PSP_IMPL_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer */
#define CFE_PSP_IMPL_STR(x) CFE_PSP_IMPL_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer */

/*! @brief Development Build Version Number.
* @details Baseline git tag + Number of commits since baseline. @n
* See @ref cfsversions for format differences between development and release versions.
*/
#define CFE_PSP_IMPL_VERSION CFE_PSP_IMPL_BUILD_BASELINE CFE_PSP_IMPL_STR(CFE_PSP_IMPL_BUILD_NUMBER)

/*! @brief Development Build Version String.
* @details Reports the current development build's baseline, number, and name. Also includes a note about the latest official version. @n
* See @ref cfsversions for format differences between development and release versions.
*/
#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 */

#endif /* _psp_version_ */
3 changes: 2 additions & 1 deletion fsw/pc-rtems/src/cfe_psp_exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
#include "cfe_psp.h"
#include "cfe_psp_config.h"
#include "cfe_psp_memory.h"
#include "cfe_psp_exceptionstorage.h"
#include "cfe_psp_exceptionstorage_types.h"
#include "cfe_psp_exceptionstorage_api.h"

/*
**
Expand Down
Loading