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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ name: "CodeQL Analysis"

on:
push:
branches:
- dev
- main
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
codeql:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Format Check

# Run on all push and pull requests
on:
push:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
format-check:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ name: Static Analysis
# Run on all push and pull requests
on:
push:
branches:
- dev
- main
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
static-analysis:
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore macOS generated files types
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
.fuse_hidden*
37 changes: 37 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,34 @@ endif()
set(CFE_PSP_TARGETNAME "${CFE_SYSTEM_PSPNAME}")
add_definitions(-D_CFE_PSP_) # macro to indicate PSP scope

# Read the default compile-time configuration, and update with
# any mission/project specific options in the PSP_CONFIGURATION_FILE
include("${CFEPSP_SOURCE_DIR}/default_config.cmake")

# The user-specified file is optional, but in case the value is defined but the
# file does not exist, this should be treated as an error.
foreach(CONFIG ${PSP_CONFIGURATION_FILE})
include(${CONFIG})
endforeach(CONFIG PSP_CONFIGURATION_FILE)

# Use the supplied configuration to generate the pspconfig.h file
# which can be referenced by the code. This will be stored in the top level
# "inc" directory of the binary output directory
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inc")
configure_file(
"${CFEPSP_SOURCE_DIR}/pspconfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/pspconfig.gen"
@ONLY
)

# Only copy the pspconfig.h into place if different from the existing file
# This avoids unnecessarily rebuilding all code in case cmake was re-run
# and but generated the same file.
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_BINARY_DIR}/pspconfig.gen"
"${CMAKE_CURRENT_BINARY_DIR}/inc/pspconfig.h"
)

# The "psp_module_api" defines the interface between internal PSP components
add_library(psp_module_api INTERFACE)
target_compile_definitions(psp_module_api INTERFACE
Expand All @@ -23,9 +51,17 @@ target_include_directories(psp_module_api INTERFACE
fsw/shared/inc # all PSP shared headers
fsw/${CFE_PSP_TARGETNAME}/inc # all impl headers
${CFE_SOURCE_DIR}/cmake/target/inc # for sysconfig
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/inc> # for pspconfig.h
$<TARGET_PROPERTY:osal,INTERFACE_INCLUDE_DIRECTORIES> # use headers from OSAL
)

# Include definition of cfe_psp_backtrace.h referenced by cfe_psp_config.h for QNX PSP
if (QNX_SDP_VERSION EQUAL 800)
target_include_directories(psp_module_api INTERFACE $<TARGET_PROPERTY:backtrace_libunwind,INTERFACE_INCLUDE_DIRECTORIES>)
elseif (QNX_SDP_VERSION EQUAL 710)
target_include_directories(psp_module_api INTERFACE $<TARGET_PROPERTY:backtrace_qnx,INTERFACE_INCLUDE_DIRECTORIES>)
endif()

# Translate the CFE_PSP_TARGETNAME to a set of additional modules to build
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/fsw/${CFE_PSP_TARGETNAME}/psp_module_list.cmake" PSP_TARGET_MODULE_LIST REGEX "^[a-zA-Z]")
include("${CMAKE_CURRENT_LIST_DIR}/fsw/${CFE_PSP_TARGETNAME}/psp_conditional_modules.cmake" OPTIONAL)
Expand Down Expand Up @@ -66,6 +102,7 @@ target_link_libraries(psp-${CFE_PSP_TARGETNAME} PRIVATE

target_include_directories(psp-${CFE_PSP_TARGETNAME} INTERFACE
fsw/inc
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/inc> # for pspconfig.h
)


Expand Down
68 changes: 43 additions & 25 deletions cmake/Modules/Platform/VxWorks-CFE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,66 @@
#
# The cmake distribution by default may contain a module for VxWorks,
# but different link rules are needed in order to build loadable CFE apps.
#
# This supports VxWorks Downloadable Kernel Module (DKM) and
# VxWorks Real Time Process (RTP) builds.
#
# For RTP builds, use set(VXWORKS_RTP TRUE), otherwise
# this file will default to the DKM rules
# -----------------------------------------------------------------

# Note - this is not building "shared libs" in the traditional sense,
# This property is set true which allows one to use the CMake shared library logic
# But the code is otherwise built as static -- no PIC flags
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
set(CMAKE_EXECUTABLE_SUFFIX ".exe")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".o")
set(CMAKE_SHARED_MODULE_SUFFIX ".o")

# Setting all these to empty string defeats the default behavior
# of adding an -fPIC option to shared library/module code.
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "")
set(CMAKE_CXX_COMPILE_OPTIONS_PIC "")
if(VXWORKS_RTP)
# RTP Specific rules
set(CMAKE_EXECUTABLE_SUFFIX ".vxe")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
set(CMAKE_SHARED_MODULE_SUFFIX ".so")

set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")

set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
set(CMAKE_SHARED_MODULE_C_FLAGS "-fPIC")
set(CMAKE_SHARED_MODULE_CXX_FLAGS "")

set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
set(CMAKE_SHARED_MODULE_C_FLAGS "")
set(CMAKE_SHARED_MODULE_CXX_FLAGS "")
set(CMAKE_SHARED_OBJECT_LINKER_FLAGS -shared)
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <LINK_FLAGS> -o <TARGET> -rdynamic <OBJECTS> <LINK_LIBRARIES>")
else()
# DKM Specific rules
set(CMAKE_EXECUTABLE_SUFFIX ".exe")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".o")
set(CMAKE_SHARED_MODULE_SUFFIX ".o")

# Setting all these to empty string defeats the default behavior
# of adding an -fPIC option to shared library/module code.
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "")
set(CMAKE_CXX_COMPILE_OPTIONS_PIC "")

set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
set(CMAKE_SHARED_MODULE_C_FLAGS "")
set(CMAKE_SHARED_MODULE_CXX_FLAGS "")

set(CMAKE_SHARED_OBJECT_LINKER_FLAGS -r)
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <LINK_FLAGS> -o <TARGET> ${CMAKE_SHARED_OBJECT_LINKER_FLAGS} <OBJECTS> <LINK_LIBRARIES>")
endif()

# This creates a simple relocatable object file, not a shared library
set(CMAKE_SHARED_OBJECT_LINKER_FLAGS -r)
set(CMAKE_C_CREATE_SHARED_MODULE "<CMAKE_LINKER> <LINK_FLAGS> -o <TARGET> ${CMAKE_SHARED_OBJECT_LINKER_FLAGS} <OBJECTS> <LINK_LIBRARIES>")
set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_MODULE})
set(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_MODULE})
set(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_MODULE})
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <LINK_FLAGS> -o <TARGET> ${CMAKE_SHARED_OBJECT_LINKER_FLAGS} <OBJECTS> <LINK_LIBRARIES>")

set(VXWORKS_TARGET_PATH "${WIND_HOME}/vxworks-${CMAKE_SYSTEM_VERSION}/target")

set(CMAKE_FIND_ROOT_PATH "${VXWORKS_TARGET_PATH}")

set(CMAKE_SYSTEM_PREFIX_PATH "${VXWORKS_TARGET_PATH}")
set(CMAKE_SYSTEM_INCLUDE_PATH "${VXWORKS_TARGET_PATH}/h")

set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_SYSTEM_INCLUDE_PATH})
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_SYSTEM_INCLUDE_PATH})
#set(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${VXWORKS_TARGET_PATH}/lib")
#set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES})

#set(CMAKE_C_FLAGS_INIT "${VXWORKS_BSP_C_FLAGS}")
#set(CMAKE_CXX_FLAGS_INIT "${VXWORKS_BSP_CXX_FLAGS}")

71 changes: 71 additions & 0 deletions default_config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
##########################################################################
#
# Default configuration options for PSP
#
# This file specifies the default values for various compile-time options
# supported by PSP.
#
# NOTE:
# The defaults in this file should _not_ be directly modified for tuning.
#
# Instead, use the "PSP_CONFIGURATION_FILE" CMake variable to define
# a custom file which can override/modify the configuration for the items
# which require tuning.
#
##########################################################################

##############################################################
# Code/Feature Selection Options for the PSP implementation
##############################################################


#
# PSP_CONFIG_DEBUG_PRINTF
# ----------------------------------
#
# Controls inclusion of PSP_DEBUG statements in the code
#
# If set FALSE, all PSP_DEBUG statements are compiled out.
#
# If set TRUE, all the "PSP_DEBUG" statements will be compiled in and displayed
# on the debug console. The statements may still be suppressed at runtime.
#
set(PSP_CONFIG_DEBUG_PRINTF FALSE
CACHE BOOL "Controls inclusion of PSP_DEBUG statements in the code"
)

#############################################
# Resource Limits for the PSP
#############################################

# The default value of debug level for PSP_DEBUG statements
set(PSP_CONFIG_DEBUG_LEVEL 1
CACHE STRING "Default value of Debug level for PSP_DEBUG"
)

##############################################################
# FS Mapping for the PSP implementation
##############################################################


# The default virtual FS mapping for the "/cf" directory, typically used for Linux and QNX
set(PSP_CONFIG_CF_VIRTUAL_MAPPING "./cf"
CACHE STRING "Default virtual FS mapping for the /cf directory"
)

# The default virtual FS mapping for the EEPROM "/cf" directory, typically used for RTEMS
set(PSP_CONFIG_CF_EEPROM_VIRTUAL_MAPPING "/mnt/eeprom"
CACHE STRING "Default virtual FS mapping for the EEPROM /cf directory"
)

# The default virtual FS mapping for the ROMFS "/cf" directory, typically used for VxWorks 7.x
set(PSP_CONFIG_CF_ROMFS_VIRTUAL_MAPPING "/romfs/cpu1/cf"
CACHE STRING "Default virtual FS mapping for the ROMFS /cf directory"
)

# The default virtual FS mapping for the physical device "/cf" directory, typically used for VxWorks 6.9 (MCP750)
set(PSP_CONFIG_CF_PHY_DEV_VIRTUAL_MAPPING "CF:0"
CACHE STRING "Default virtual FS mapping for the physical device /cf directory"
)


39 changes: 39 additions & 0 deletions fsw/generic-qnx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
######################################################################
#
# CMAKE build recipe for generic-qnx PSP component
#
######################################################################

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

# Build the pc-linux implementation as a library
add_library(psp-${CFE_PSP_TARGETNAME}-impl OBJECT
src/cfe_psp_exception.c
src/cfe_psp_memory.c
src/cfe_psp_ssr.c
src/cfe_psp_start.c
src/cfe_psp_support.c
src/cfe_psp_watchdog.c
)

# The _GNU_SOURCE directive is required to call non-posix APIs
# that are specific to the Linux/glibc environment.
# Code outside the pc-linux PSP should _not_ depend on this.
target_compile_definitions(psp-${CFE_SYSTEM_PSPNAME}-impl PRIVATE
_GNU_SOURCE
$<TARGET_PROPERTY:psp_module_api,INTERFACE_COMPILE_DEFINITIONS>
)

target_include_directories(psp-${CFE_PSP_TARGETNAME}-impl PRIVATE
inc
$<TARGET_PROPERTY:psp_module_api,INTERFACE_INCLUDE_DIRECTORIES>
)

# Include definition of cfe_psp_backtrace.h referenced by cfe_psp_config.h
if (QNX_SDP_VERSION EQUAL 800)
target_include_directories(psp-${CFE_PSP_TARGETNAME}-impl PRIVATE $<TARGET_PROPERTY:backtrace_libunwind,INTERFACE_INCLUDE_DIRECTORIES>)
elseif (QNX_SDP_VERSION EQUAL 710)
target_include_directories(psp-${CFE_PSP_TARGETNAME}-impl PRIVATE $<TARGET_PROPERTY:backtrace_qnx,INTERFACE_INCLUDE_DIRECTORIES>)
endif()

Empty file added fsw/generic-qnx/doc/.gitignore
Empty file.
Loading
Loading