diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 28015abda..1f9571b3b 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -48,9 +48,7 @@ jobs: # Build the code - name: Build run: | - make cfe-core - make native/default_cpu1/cfe-core/unit-test/ - make native/default_cpu1/cfe-core/ut-stubs/ + make -C build/native/default_cpu1 core_api core_private es evs fs msg resourceid sb sbr tbl time - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/run_fsw_cppcheck.sh b/.github/workflows/run_fsw_cppcheck.sh new file mode 100755 index 000000000..6f6af4b6c --- /dev/null +++ b/.github/workflows/run_fsw_cppcheck.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +cppcheck_common_opts="--force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive" + +# When checking time, only the "server" config option is enabled for now. +# Otherwise cppcheck attempts to check with both branches enabled and generates false errors +cppcheck_time_opts="-UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER" + +for mod in ${*} +do + cppcheck ${cppcheck_common_opts} $(eval echo \$cppcheck_${mod}_opts) ./modules/${mod}/fsw +done + diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 5e792f3aa..14b2c16e2 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -38,7 +38,8 @@ jobs: - name: cfe strict cppcheck if: ${{matrix.cppcheck =='cfe'}} run: | - cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./fsw/cfe-core/src ./modules 2> ./${{matrix.cppcheck}}_cppcheck_err.txt + all_fsw_modules="core_api core_private es evs fs msg resourceid sb sbr tbl time" + /bin/bash ./.github/workflows/run_fsw_cppcheck.sh ${all_fsw_modules} 2> ${{matrix.cppcheck}}_cppcheck_err.txt - name: Archive Static Analysis Artifacts uses: actions/upload-artifact@v2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 69218c849..4e1348424 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,9 +51,10 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) # (this is not required, and the directory can be empty/nonexistent) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../psp/cmake/Modules" ${CMAKE_MODULE_PATH}) -# The minimum CMake version is chosen because 2.6.4 is what is -# included by default with RHEL/Centos 5.x -cmake_minimum_required(VERSION 2.6.4) +# The minimum CMake version is chosen because v3.5.1 is what is +# available by default with Ubuntu 16.04 LTS at the time of development +# RHEL/CentOS users should install the "cmake3" package from EPEL repo +cmake_minimum_required(VERSION 3.5) # This top-level file does not define ANY targets directly but we know # that the subdirectories will at least use the "C" language, so diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index 2287261c8..b8355c174 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -70,12 +70,13 @@ endfunction(initialize_globals) # function(add_psp_module MOD_NAME MOD_SRC_FILES) - # Include the PSP shared directory so it can get to cfe_psp_module.h - include_directories(${MISSION_SOURCE_DIR}/psp/fsw/shared/inc) - add_definitions(-D_CFE_PSP_MODULE_) - # Create the module add_library(${MOD_NAME} STATIC ${MOD_SRC_FILES} ${ARGN}) + target_link_libraries(${MOD_NAME} PRIVATE psp_module_api) + + target_compile_definitions(${MOD_NAME} PRIVATE + _CFE_PSP_MODULE_ + ) endfunction(add_psp_module) @@ -98,6 +99,7 @@ function(add_cfe_app APP_NAME APP_SRC_FILES) # Create the app module add_library(${APP_NAME} ${APPTYPE} ${APP_SRC_FILES} ${ARGN}) + target_link_libraries(${APP_NAME} core_api) # An "install" step is only needed for dynamic/runtime loaded apps if (APP_DYNAMIC_TARGET_LIST) @@ -149,7 +151,6 @@ function(add_cfe_tables APP_NAME TBL_SRC_FILES) # The table source must be compiled using the same "include_directories" # as any other target, but it uses the "add_custom_command" so there is # no automatic way to do this (at least in the older cmakes) - get_current_cflags(TBL_CFLAGS ${CMAKE_C_FLAGS}) # Create the intermediate table objects using the target compiler, # then use "elf2cfetbl" to convert to a .tbl file @@ -189,6 +190,9 @@ function(add_cfe_tables APP_NAME TBL_SRC_FILES) message("NOTE: Selected ${TBL_SRC} as source for ${TBLWE}") endif() + add_library(${TGT}_${TBLWE}-obj OBJECT ${TBL_SRC}) + target_link_libraries(${TGT}_${TBLWE}-obj PRIVATE core_api) + # IMPORTANT: This rule assumes that the output filename of elf2cfetbl matches # the input file name but with a different extension (.o -> .tbl) # The actual output filename is embedded in the source file (.c), however @@ -197,9 +201,8 @@ function(add_cfe_tables APP_NAME TBL_SRC_FILES) # current content of a dependency (rightfully so). add_custom_command( OUTPUT "${TABLE_DESTDIR}/${TBLWE}.tbl" - COMMAND ${CMAKE_C_COMPILER} ${TBL_CFLAGS} -c -o ${TBLWE}.o ${TBL_SRC} - COMMAND ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl ${TBLWE}.o - DEPENDS ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl ${TBL_SRC} + COMMAND ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl $ + DEPENDS ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl ${TGT}_${TBLWE}-obj WORKING_DIRECTORY ${TABLE_DESTDIR} ) # Create the install targets for all the tables @@ -308,7 +311,7 @@ function(add_cfe_coverage_test MODULE_NAME UNIT_NAME TESTCASE_SRC UT_SRCS) # as well as the UT assert framework target_link_libraries(${RUNNER_TARGET} ${UT_COVERAGE_LINK_FLAGS} - ut_cfe-core_stubs + ut_core_api_stubs ut_assert ) @@ -442,6 +445,38 @@ function(cfs_app_do_install APP_NAME) endfunction(cfs_app_do_install) +################################################################## +# +# FUNCTION: cfs_app_check_intf +# +# Adds a special target that checks the structure of header files +# in the public interface for this module. A synthetic .c source file +# is created which has a "#include" of each individual header, which +# then compiled as part of the validation. The intent is to confirm +# that each header is valid in a standalone fashion and have no +# implicit prerequisites. +# +function(cfs_app_check_intf MODULE_NAME) + set(${MODULE_NAME}_hdrcheck_SOURCES) + foreach(HDR ${ARGN}) + configure_file(${CFE_SOURCE_DIR}/cmake/check_header.c.in ${CMAKE_CURRENT_BINARY_DIR}/src/check_${HDR}.c) + list(APPEND ${MODULE_NAME}_hdrcheck_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/src/check_${HDR}.c) + endforeach(HDR ${ARGN}) + add_library(${MODULE_NAME}_headercheck OBJECT ${${MODULE_NAME}_hdrcheck_SOURCES}) + + # This causes the check to compile with the same set of defines and include dirs as specified + # in the "INTERFACE" properties of the actual module + target_link_libraries(${MODULE_NAME}_headercheck PRIVATE + core_api + ${DEP} + ) + + # Build this as part of the synthetic "check-headers" target + add_dependencies(check-headers ${MODULE_NAME}_headercheck) +endfunction(cfs_app_check_intf) + + + ################################################################## # @@ -538,6 +573,10 @@ function(process_arch SYSVAR) include_directories(${MISSION_BINARY_DIR}/inc) include_directories(${CMAKE_BINARY_DIR}/inc) + # Add a custom target for "headercheck" - this is a special target confirms that + # checks the sanity of headers within the public interface of modules + add_custom_target(check-headers) + # Configure OSAL target first, as it also determines important compiler flags add_subdirectory("${osal_MISSION_DIR}" osal) @@ -545,26 +584,6 @@ function(process_arch SYSVAR) # This can help with debugging if things go wrong. message(STATUS "PSP Selection: ${CFE_SYSTEM_PSPNAME}") - # Add all widely-used public headers to the include path chain - include_directories(${MISSION_SOURCE_DIR}/osal/src/os/inc) - include_directories(${MISSION_SOURCE_DIR}/psp/fsw/inc) - include_directories(${MISSION_SOURCE_DIR}/cfe/fsw/cfe-core/src/inc) - include_directories(${MISSION_SOURCE_DIR}/cfe/cmake/target/inc) - - # propagate any OSAL interface compile definitions and include directories to this build - # This is set as a directory property here at the top level so it will apply to all code. - # This includes MODULE libraries that do not directly/statically link with OSAL but still - # should be compiled with these flags. - get_target_property(OSAL_COMPILE_DEFINITIONS osal INTERFACE_COMPILE_DEFINITIONS) - get_target_property(OSAL_INCLUDE_DIRECTORIES osal INTERFACE_INCLUDE_DIRECTORIES) - - if (OSAL_COMPILE_DEFINITIONS) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "${OSAL_COMPILE_DEFINITIONS}") - endif (OSAL_COMPILE_DEFINITIONS) - if (OSAL_INCLUDE_DIRECTORIES) - include_directories(${OSAL_INCLUDE_DIRECTORIES}) - endif (OSAL_INCLUDE_DIRECTORIES) - # Append the PSP and OSAL selections to the Doxyfile so it will be included # in the generated documentation automatically. # Also extract the "-D" options within CFLAGS and inform Doxygen about these diff --git a/cmake/check_header.c.in b/cmake/check_header.c.in new file mode 100644 index 000000000..a3a9d8031 --- /dev/null +++ b/cmake/check_header.c.in @@ -0,0 +1,4 @@ +#include "@HDR@" + +/* A no-op function so this compilation unit is not empty */ +void CheckHeader(void) {} diff --git a/cmake/global_functions.cmake b/cmake/global_functions.cmake index 6c5b437f2..0571b06b7 100644 --- a/cmake/global_functions.cmake +++ b/cmake/global_functions.cmake @@ -264,39 +264,3 @@ function(read_targetconfig) endforeach(SYSVAR ${TGTSYS_LIST}) endfunction(read_targetconfig) - -################################################################## -# -# FUNCTION: get_current_cflags -# -# Convert the input string, which is a simple text string of compiler flags such -# as CMAKE_C_FLAGS or CMAKE_CXX_FLAGS, and convert it to a list of individual options -# -# In addition, the "-I" options from include_directories() and -D options from -# add_definitions() will be added to the output list. The contents of these will be -# obtained via the properities of the current source directory. -# -function(get_current_cflags OUTPUT_LIST) - - # Start by converting the supplied string to a list - set(FLAGLIST) - foreach (FLGSTR ${ARGN}) - string(REGEX REPLACE " +" ";" TEMPFLG ${FLGSTR}) - list(APPEND FLAGLIST ${TEMPFLG}) - endforeach (FLGSTR ${ARGN}) - - # Append any compile definitions from the directory properties - get_directory_property(CURRENT_DEFS COMPILE_DEFINITIONS) - foreach(DEF ${CURRENT_DEFS}) - list(APPEND FLAGLIST "-D${DEF}") - endforeach(DEF ${CURRENT_DEFS}) - - # Append any include directories from the directory properties - get_directory_property(CURRENT_INCDIRS INCLUDE_DIRECTORIES) - foreach(INC ${CURRENT_INCDIRS}) - list(APPEND FLAGLIST "-I${INC}") - endforeach(INC ${CURRENT_INCDIRS}) - - set(${OUTPUT_LIST} ${FLAGLIST} PARENT_SCOPE) - -endfunction(get_current_cflags OUTPUT_LIST INPUT_FLAGS) diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 7920af487..c8961a293 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -161,7 +161,6 @@ function(generate_build_version_templates) endfunction(generate_build_version_templates) - ################################################################## # # FUNCTION: prepare @@ -249,7 +248,7 @@ function(prepare) foreach(APP ${MISSION_DEPS}) # OSAL is handled specially, as only part of it is used - if (NOT APP STREQUAL "osal" AND NOT APP STREQUAL "cfe-core") + if (NOT APP STREQUAL "osal") if (EXISTS "${${APP}_MISSION_DIR}/docs/${APP}.doxyfile.in") # If the module provides its own doxyfile, then include it directly # This allows for app-specific fine-tuning of the sources, based on its own source tree @@ -281,13 +280,22 @@ function(prepare) # have the documentation associated with each macro definition. configure_file("${osal_MISSION_DIR}/osconfig.h.in" "${CMAKE_BINARY_DIR}/doc/osconfig-example.h") - + # The user guide should include the doxygen from the _public_ API files from CFE + OSAL - file(GLOB MISSION_USERGUIDE_HEADERFILES - "${cfe-core_MISSION_DIR}/src/inc/*.h" + # NOTE: the userguide is built against the headers of the default core apps. Even if + # an alternate version of the module is in use, it should adhere to the same interface. + set(SUBMODULE_HEADER_PATHS "${osal_MISSION_DIR}/src/os/inc/*.h" + "${psp_MISSION_DIR}/psp/fsw/inc/*.h" + ) + foreach(MODULE core_api es evs fs msg sb tbl time) + list(APPEND SUBMODULE_HEADER_PATHS "${${MODULE}_MISSION_DIR}/fsw/inc/*.h") + endforeach() + file(GLOB MISSION_USERGUIDE_HEADERFILES + ${SUBMODULE_HEADER_PATHS} "${CMAKE_BINARY_DIR}/doc/osconfig-example.h" - "${MISSION_SOURCE_DIR}/psp/fsw/inc/*.h") + ) + string(REPLACE ";" " \\\n" MISSION_USERGUIDE_HEADERFILES "${MISSION_USERGUIDE_HEADERFILES}") # OSAL API GUIDE include PUBLIC API @@ -312,7 +320,7 @@ function(prepare) add_custom_target(osalguide doxygen osalguide.doxyfile - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/doc") + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/doc") # Pull in any application-specific mission-scope configuration # This may include user configuration files such as cfe_mission_cfg.h, @@ -360,6 +368,18 @@ function(prepare) generate_build_version_templates() # Generate the tools for the native (host) arch + # Add all public include dirs for core components to include path for tools + include_directories( + ${core_api_MISSION_DIR}/fsw/inc + #${es_MISSION_DIR}/fsw/inc + #${evs_MISSION_DIR}/fsw/inc + #${fs_MISSION_DIR}/fsw/inc + #${sb_MISSION_DIR}/fsw/inc + #${tbl_MISSION_DIR}/fsw/inc + #${time_MISSION_DIR}/fsw/inc + ${osal_MISSION_DIR}/src/os/inc + ${psp_MISSION_DIR}/psp/fsw/inc + ) add_subdirectory(${MISSION_SOURCE_DIR}/tools tools) # Add a dependency on the table generator tool as this is required for table builds diff --git a/cmake/mission_defaults.cmake b/cmake/mission_defaults.cmake index 2f7ee42c1..67242c16c 100644 --- a/cmake/mission_defaults.cmake +++ b/cmake/mission_defaults.cmake @@ -10,8 +10,16 @@ # The "MISSION_CORE_MODULES" will be built and statically linked as part # of the CFE core executable on every target. These can be used to amend # or override parts of the CFE core on a mission-specific basis. +# The "intf" modules are headers only, and define the interface(s) between components set(MISSION_CORE_MODULES - "cfe-core" + "core_api" + "core_private" + "es" + "evs" + "fs" + "sb" + "tbl" + "time" "osal" "psp" "msg" @@ -45,7 +53,6 @@ set(MISSION_MODULE_SEARCH_PATH # a variable named "_SEARCH_PATH". This is # used for locating cfe-core and osal which are not part # of the standard search path. -set(cfe-core_SEARCH_PATH "cfe/fsw") set(osal_SEARCH_PATH ".") set(psp_SEARCH_PATH ".") diff --git a/cmake/target/CMakeLists.txt b/cmake/target/CMakeLists.txt index 4af3de9c8..10e935ef8 100644 --- a/cmake/target/CMakeLists.txt +++ b/cmake/target/CMakeLists.txt @@ -34,7 +34,7 @@ string(CONCAT GENERATED_FILE_TRAILER set(GENERATED_EXTERNS) set(GENERATED_KEYVALS) foreach(PSPMOD ${${TGTNAME}_PSP_MODULELIST}) - list(APPEND GENERATED_EXTERNS "extern char CFE_PSP_${PSPMOD}_API;\n") + list(APPEND GENERATED_EXTERNS "extern char CFE_PSP_${PSPMOD}_API\;\n") list(APPEND GENERATED_KEYVALS "{ .Name = \"${PSPMOD}\", .Api = &CFE_PSP_${PSPMOD}_API },\n") endforeach(PSPMOD ${${TGTNAME}_PSP_MODULELIST}) diff --git a/cmake/target/src/target_config.c b/cmake/target/src/target_config.c index 6bda3825c..d9d95f88b 100644 --- a/cmake/target/src/target_config.c +++ b/cmake/target/src/target_config.c @@ -37,7 +37,7 @@ #include "cfe_platform_cfg.h" #include "cfe_es.h" #include "cfe_time.h" -#include "private/cfe_es_resetdata_typedef.h" +#include "cfe_es_resetdata_typedef.h" #include "cfe_version.h" /* for CFE_VERSION_STRING */ #include "osapi-version.h" /* for OS_VERSION_STRING */ diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index 749935a04..7af4c8ab3 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -121,7 +121,7 @@ Table of Contents # 1. Introduction -#### 1.1 Scope +## 1.1 Scope The purpose of this document is to provide guidelines and conventions for flight code development using the Core Flight Executive (cFE) @@ -149,7 +149,7 @@ The weighting can be determined by the use of the following words: statements designate examples of an acceptable implementation but do not require the developer to follow the example precisely. -#### 1.2 Background +## 1.2 Background The cFE provides a project-independent Flight Software (FSW) operational environment with a set of services that are the functional building @@ -177,7 +177,7 @@ software interface. ![](.//media/cFE_Application_Developers_Guide_image3.png) -#### 1.3 Applicable Documents +## 1.3 Applicable Documents | **Location** | **Documents** | **Description** | |:---------------------------------------------|:----------------------|:-------------------| @@ -185,7 +185,7 @@ software interface. | TBD | PSP API (TBD) | Describes PSP API | -#### 1.4 Acronyms +## 1.4 Acronyms | **Acronym** | **Description** | |:------------|:---------------------------------------------------| @@ -236,7 +236,7 @@ software interface. | TLM | Telemetry | | UTC | Coordinated Universal Time | -#### 1.5 Glossary of Terms +## 1.5 Glossary of Terms The following table defines the terms used throughout this document. These terms are identified as proper nouns and are capitalized. @@ -301,7 +301,7 @@ development environment in which the Developer writes and integrates their Application code. Each Mission could have, for their own reasons, a variation on this standard. -#### 2.1 Directory Tree +## 2.1 Directory Tree The following diagrams show the standard development and build directory tree or mission tree as it is often referred to. The purpose of each @@ -313,6 +313,36 @@ directory is described as a note under each folder. ![](.//media/cFE_Application_Developers_Guide_image6.png) +Each cFE core component is itself a modular entity, all of which work together to form the +complete cFE core executive. These modules are all contained under the `modules` subdirectory: + +| **Directory** | **Content** | +|:------------------------|:------------------------------------------------------------------------------------------------------------------ | +| `modules/core_api/` | Contains the public interface definition of the complete CFE core - public API/headers only, no implementation | +| `modules/core_private/` | Contains the inter-module interface definition of the CFE core - internal API/headers only, no implementation | +| `modules/es/` | Implementation of the Executive Services (ES) core module - provides app and task management | +| `modules/evs/` | Implementation of the Event Services (EVS) core module - manages sending of events on behalf of other apps | +| `modules/fs/` | Implementation of the File Services (FS) core module - defines file-related functions | +| `modules/msg/` | Implementation of the Message (MSG) core module - defines message header manipulation/access routines | +| `modules/resourceid/` | Implementation of the Resource ID core module - maniplation/access of system resource IDs (AppID, PipeID, etc.) | +| `modules/sb/` | Implementation of the Software Bus (SB) core module - sends messages between applications | +| `modules/tbl/` | Implementation of the Table Services (TBL) core module - manages runtime tables | +| `modules/time/` | Implementation of the Time Services (TIME) core module - manages timing and synchronization | + +**NOTE**: The modules contained here constitute the "reference" implementation of each module. The CMake build system also permits advanced users +with special use cases to add, remove, or override entire core modules as necessary to support their particular mission requirements. + +Each module directory is in turn divided into subdirectories as follows: + +| **Subdirectory** | **Content** | +|:------------------------|:-------------------------------------------------------------------------------------------------------------| +| _module_`/fsw/` | All components which are used on/deployed to the actual target or define the interface to those components | +| _module_`/fsw/inc/` | Public/Interface headers for the component | +| _module_`/fsw/src/` | Source files and private headers for the component | +| _module_`/ut-stubs/` | Stubs to support coverage testing of other components (correlates with API defined in `fsw/inc`) | +| _module_`/ut-coverage/` | Coverage tests to provide line/branch testing (correlates with internal implementation in `fsw/src`) | +| _module_`/eds/` | Command & Telemetry interface description as a CCSDS book 876.0 Electronic Data Sheet | + ![](.//media/cFE_Application_Developers_Guide_image7.png) ![](.//media/cFE_Application_Developers_Guide_image8.png) @@ -323,33 +353,62 @@ directory is described as a note under each folder. ![](.//media/cFE_Application_Developers_Guide_image11.png) -#### 2.2 Header Files +## 2.2 Header Files In order for applications to use and call cFE service functions, the -Developer must include the appropriate header files in their source -code. The cFE can be easily incorporated by including the following -line: +developer must include the appropriate header files in their source +code. + +The cFE header files are split into several parts/sections, allowing +application/libraries to individually select the parts they need. The +naming convention is as follows: + +| **Filename Pattern** | **Contents** | +|:-----------------------------|:----------------------------------------------------------------------------------------------| +| _module_`_extern_typedefs.h` | Macros and Data Types shared between CMD/TLM messages, data files, and API functions | +| _module_`_msg.h` | Command and Telemetry message definitions, including command code (`_CC`) number assignments | +| _module_`_events.h` | Event id (`_EID`) number assignments for events generated via Event Services | +| _module_`_api_typedefs.h` | Macros and Data Types used by the component API, no function prototypes | + +In general the files are scoped such that an application/library should only need to include the information it +actually needs to use for the task it performs. For instance, if a tool needs to interpret a data file generated +by CFE ES, only the `cfe_es_extern_typedefs.h` file should be required. To send commands or interpret telemetry, the +`cfe_es_msg.h` may be used. If a library builds upon data types or extends functions from the ES API, then the +`cfe_es_api_typedefs.h` header may be used. + +An "unqualified" header file (with no extra suffix) provides the complete runtime API definition for the component. +This includes all API function prototypes and is intended for use in C source files. The following API header files +are provided by cFE: + +| **Filename** | **Contents** | +|:-----------------|:-------------------------------------| +| cfe_es.h | cFE Executive Service Interface | +| cfe_evs.h | cFE Event Service Interface | +| cfe_fs.h | cFE File Service Interface | +| cfe_msg.h | cFE Message Interface | +| cfe_resourceid.h | cFE Resource ID Interface | +| cfe_sb.h | cFE Software Bus Interface | +| cfe_tbl.h | cFE Table Service Interface | +| cfe_time.h | cFE Time Service Interface | + + +**NOTE**: The files listed above provide function prototypes and are intended to be used by C source files +that contain code which needs to invoke the function(s) prototyped within them. When referencing the +data types or macros from another header file, the targeted/qualified header should be used instead. + +As a rule of thumb, files listed in the first table (with suffix) should be included from within other +headers, while files listed in the second table (without suffix) should be used by source files. + +Finally, to simplify application headers, a single "all-inclusive" cFE header is also provided: ``` #include "cfe.h" /* Define cFE API prototypes and data types */ ``` -However, if the Developer is interested in viewing the API prototype -declarations or data type definitions, they must look for them in the -header file for the particular cFE Service. These header files are named -as follows: +This encompasses the interface definitions from all CFE core components (ES, EVS, etc.) as well as +OSAL, PSP, and the global-scope mission configuration (`cfe_mission_cfg.h`). -| **Filename** | **Contents** | -| ------------:| ------------------------------------:| -| cfe_es.h | cFE Executive Service interface | -| cfe_evs.h | cFE Event Service Interface | -| cfe_fs.h | cFE File Service Interface | -| cfe_sb.h | cFE Software Bus Interface | -| cfe_tbl.h | cFE Table Service Interface | -| cfe_time.h | cFE Time Service Interface | - -All of these header files can be found in the **"\.../cfe-core/inc/"** -directory. +All of these header files can be found in the `modules/core_api/fsw/inc` directory. # 3. cFE Deployment Environment @@ -357,7 +416,7 @@ The cFE core makes some assumptions about the target platform. Modifications to these assumptions would require modification to the cFE core source code. -#### 3.1 Assumed On-Board Directory Structure +## 3.1 Assumed On-Board Directory Structure Portions of the cFE are capable of generating/overwriting files in response to commands (e.g. -- log files, registry contents, etc). The @@ -373,9 +432,9 @@ of the frameworks described below has been designed to minimize code modification when the code is ported to either another platform and/or another mission. -#### 4.1 Application Models +## 4.1 Application Models -##### 4.1.1 "Software Only" Application +### 4.1.1 "Software Only" Application A "Software Only" Application is a cFE Application that does not require communication with hardware directly. It is an Application that receives @@ -392,7 +451,7 @@ hardware or the underlying operating system. The Developer should ensure that all function calls to functions outside of the Application code are either to the cFE APIs or to the OS Abstraction Layer. -##### 4.1.2 "Hardware Servicing" Application +### 4.1.2 "Hardware Servicing" Application A "Hardware Servicing" Application is a cFE Application that communicates directly with a piece of hardware. This could be mission specific @@ -419,7 +478,7 @@ sending messages, events, performing memory allocation, etc. For further details on this design, see section 5.6 and the device management API reference in Appendix A. -##### 4.1.3 Multi-threaded Applications +### 4.1.3 Multi-threaded Applications The cFE supports the concept of multiple threads within an Application. Each thread is referred to as a Task. The first Task that executes when @@ -439,12 +498,21 @@ in mind these facts: Child Tasks can be useful in both "Software Only" and "Hardware Servicing" applications. -#### 4.2 Best Practices -##### 4.2.1 cFS Application Template +## 4.2 Best Practices +### 4.2.1 cFS Application Template Applications designed to interface with the cFE should follow standard templates. Reference sample_app on Github for “live” example. +| **Directory** | **Descriptions** | +|:--------------------------------------|:-------------------------------------------------------------------------------------------------------------| +| fsw/ | All components which are used on/deployed to the actual target or define the interface to those components | +| fsw/inc/ | Public/Interface headers for the component | +| fsw/src/ | Source files and private headers for the component | +| tables/ | Example/Initial table definitions | + + + | **Files** | **Descriptions** | |:--------------------------------------|:-------------------------------------------------------------------------------------------------------------| | fsw/src/sample_app.c | Main source code for sample_app. Located in src directory. | @@ -459,7 +527,7 @@ In addition to showing the standard structure of a cFS application, the sample_app also demonstrates how to interface with cFS libraries and table services. -##### 4.2.2 Avoid "Endian-ness" Dependencies +### 4.2.2 Avoid "Endian-ness" Dependencies To ensure Application portability, Developers should be aware of code designs that can be affected by the "Endian-ness" of the processor. An @@ -477,7 +545,7 @@ types. Clearly, if the code is ported from a little-endian machine to a big-endian machine or vice-versa, the ground system telemetry database would be required to change. -##### 4.2.3 Avoid Inter-Task Dependencies +### 4.2.3 Avoid Inter-Task Dependencies The Developer must separate those items that represent interface controlled data structures and values from other aspects of their software into unique header files. These files are then available to @@ -496,7 +564,7 @@ Examples of items that do not need to be shared with other Applications include Table IDs, Table data structures, Event IDs and Pipe IDs. Tables are not intended to be used as inter-application communication mechanisms. -##### 4.2.4 Consolidate Resource Allocations +### 4.2.4 Consolidate Resource Allocations It is generally recommended to consolidate resource allocations to the application initialization function(s). Allocations and setup of resources such as memory pools and child tasks should happen once during initialization in @@ -525,13 +593,13 @@ and the other is a "CFE_ES_" function, the Developer should use the "CFE_ES_" function. Additional information about the OS API can be found in the OSAL Library API documentation. -#### 5.1 Application Registration +## 5.1 Application Registration All cFE Applications must register immediately with ES when started. This is accomplished with the CFE_ES_RegisterApp function and it should be the first function called by a cFE Application's main task. -#### 5.2 Application Names and IDs +## 5.2 Application Names and IDs The Executive Services maps Application names to numeric Application IDs. This simplifies the identification of Applications within the processor @@ -548,7 +616,7 @@ to be the same Application. Therefore, no matter whether the call is made from the Main Task or one of the Child Tasks, the Application ID returned is the same. -#### 5.3 Child Task Control +## 5.3 Child Task Control As mentioned in section 4.3, cFE Applications can be multi-threaded. Each thread is referred to as a Task. The thread that is started when @@ -566,7 +634,7 @@ by the CFE_ES_CreateChildTask function in order to identify the Child Task. Note that Child Tasks can only be created from an Application's Main Task. -#### 5.4 Application Start-Up Types +## 5.4 Application Start-Up Types Upon startup, an Application may need to know which type of restart it is undergoing. As part of its initialization, an Application should call @@ -579,14 +647,14 @@ return value of this function can be one of the following values: Reference cFE API documentation for more detail on reset types. -#### 5.5 Shared Libraries +## 5.5 Shared Libraries The cFE contains support for shared libraries. For the current version of the cFE, the shared libraries must be loaded on cFE startup. Reference sample_lib on Github for a “live” example. -#### 5.6 Obtaining OS and Platform Information +## 5.6 Obtaining OS and Platform Information There are numerous functions related to obtaining OS and platform information. A number of these functions are not necessary for the cFE @@ -624,9 +692,9 @@ uint32 ConvertSecs2Ticks(uint32 Seconds) } ``` -#### 5.7 OS Queues, Semaphores and Mutexes +## 5.7 OS Queues, Semaphores and Mutexes -##### 5.7.1 Queues +### 5.7.1 Queues Developers are discouraged from using the OS_QueueCreate, OS_QueueGet, OS_QueuePut, and OS_QueueDelete functions. These functions are a lower level @@ -636,7 +704,7 @@ would also impose a requirement that two Applications must reside on the same processor. The only exception to this rule might be communication between a Main Task and its Child Task(s). -##### 5.7.2 Binary Semaphores +### 5.7.2 Binary Semaphores Binary semaphores can be used for Application synchronization. A binary semaphore is essentially a flag that is available or unavailable. When @@ -663,7 +731,7 @@ header file osids.h by a macro of the form xxx_SEM_ID. To add a new semaphore to a processor, one must modify the osids.h file and osobjtab.c file for the processor. -##### 5.7.2.1 Binary Semaphore Functions +### 5.7.2.1 Binary Semaphore Functions A binary semaphore can be created using the OS_BinSemCreate function. Upon success, the OS_BinSemCreate function sets the sem_id parameter to the ID of @@ -699,7 +767,7 @@ int32 OS_BinSemGive( uint32 xxx_SEM_ID ); For more detail on these functions (including arguments and return codes, refer to the OSAL Library API). -##### 5.7.3 Counting Semaphores +### 5.7.3 Counting Semaphores Counting semaphores are similar to binary semaphores except that they indicate more than a simple "available" or "unavailable" status. Counting semaphores @@ -710,7 +778,7 @@ useful method of synchronization between main tasks and child tasks. As an example, the File Manager (FM) application uses a counting semaphore to implement a kind of handshake between its main task and its child task. -##### 5.7.3.1 Counting Semaphore Functions +### 5.7.3.1 Counting Semaphore Functions A counting semaphore can be created using the OS_CountSemCreate function. Upon success, the OS_CountSemCreate function sets the sem_id parameter to the @@ -742,7 +810,7 @@ int32 OS_CountSemGive( uint32 xxx_SEM_ID ); For more detail on these functions (including arguments and return codes, refer to the OSAL Library API). -##### 5.7.4 Mutex Semaphores +### 5.7.4 Mutex Semaphores Mutex semaphores are used to provide "mutual exclusion" for a shared resource in order to protect against several Applications using the @@ -792,7 +860,7 @@ software design that involves pending in a protected region must be reviewed by the entire development group since it can affect the timing of the entire system. -##### 5.7.4.1 Mutex Functions +### 5.7.4.1 Mutex Functions An application creates a mutex by calling: @@ -825,7 +893,7 @@ For more detail on these functions (including arguments and return codes, refer to the OSAL Library API). -#### 5.8 Interrupt Handling +## 5.8 Interrupt Handling OSAL interrupt handling functions have been deprecated due to platform dependencies, incomplete testing, and incomplete implementaion @@ -834,7 +902,7 @@ No longer supporting abstracted interrupt handling API from OSAL. Could consider at the PSP layer as future work but current dependencies should revert to native interrupt handling. -#### 5.9 Exceptions +## 5.9 Exceptions Similar to interrupt service routines, handlers can be associated with specific exceptions. The following function specifies a handler for an @@ -860,7 +928,7 @@ OS_ExcEnable( uint32 ExceptionNumber ); OS_ExcDisable( uint32 ExceptionNumber ); ``` -##### 5.9.1 Floating Point Processor Exceptions +### 5.9.1 Floating Point Processor Exceptions In addition to the exception handlers identified above, a similar paradigm exists for handling floating point processor exceptions. The @@ -886,9 +954,9 @@ OS_FPUExcEnable( uint32 ExceptionNumber ); OS_FPUExcDisable( uint32 ExceptionNumber ); ``` -#### 5.10 Memory Utilities +## 5.10 Memory Utilities -##### 5.10.1 Memory Pool +### 5.10.1 Memory Pool The Executive Services mempool library provides simple block memory management API's and functions for pseudo dynamic memory allocations @@ -943,7 +1011,7 @@ and the allocation and deallocation of one request for 12 bytes. Figure 5.2 Example mempool allocations -##### 5.10.2 Memory Read/Write Functions +### 5.10.2 Memory Read/Write Functions CFE provides a set of functions that read and write values of fixed sizes at specified physical addresses. These functions are intended for accessing h @@ -953,7 +1021,7 @@ of EEPROM and then verify that the modification was successful. Reference “PSP API Documentation”. -##### 5.10.3 Critical Data Store +### 5.10.3 Critical Data Store When an Application needs to store a small amount of data that will survive a cFE Reset, the cFE provides an area of memory called a @@ -1095,7 +1163,7 @@ void SAMPLE_TaskMain(void) } /* End of SAMPLE_TaskMain() */ ``` -##### 5.10.4 Standard CRC Calculations +### 5.10.4 Standard CRC Calculations There are many Applications that require a validation of received data or of data in memory. This is usually done by a Cyclic Redundancy Check (CRC). There are many different ways to calculate a CRC. To help ensure that the @@ -1123,7 +1191,7 @@ CFE_MISSION_ES_DEFAULT_CRC – the mission specified default CRC calculation Unless there is a specific interface with a specified CRC calculation, Applications must use the CFE_MISSION_ES_DEFAULT_CRC type. -#### 5.11 File System Functions +## 5.11 File System Functions The OSAL API provides a POSIX.1 standard interface for performing file system activities. These functions break down into the following three @@ -1131,7 +1199,7 @@ categories: Device, Directory and File routines. Specific details of the API are not covered here. Refer to the OSAL Library API documentation for details. -##### 5.11.1 Device Functions +### 5.11.1 Device Functions | **OS API File System Function** | **Brief Description** | |:--------------------------------|:-----------------------------------------------| @@ -1140,7 +1208,7 @@ details. | OS_unmount | Unmounts a previously mounted file system | | OS_chkfs | Checks file system to ensure links are correct | -##### 5.11.2 Directory Functions +### 5.11.2 Directory Functions | **OS API File System Function** | **Brief Description** | |:--------------------------------|:------------------------------------------------------------| @@ -1151,7 +1219,7 @@ details. | OS_rewinddir | Resets a file pointer for a directory back to the beginning | | OS_rmdir | Deletes a directory | -##### 5.11.3 File Functions +### 5.11.3 File Functions | **OS API File System Function** | **Brief Description** | |:--------------------------------|:------------------------------------------------------------------------------| @@ -1166,7 +1234,7 @@ details. | OS_remove | Deletes a file | | OS_rename | Renames a file | -#### 5.12 System Log +## 5.12 System Log The Executive Services provide a System Log. A System Log provides a mechanism of recording Events that cannot be issued as Event Messages @@ -1188,7 +1256,7 @@ the ASCII string to a buffer that is preserved during resets. At minimum, the CFE_ES_WriteToSysLog function is generally used if the call to CFE_EVS_Register fails or if the Application is about to exit. -#### 5.13 Software Performance Analysis +## 5.13 Software Performance Analysis cFE provides utilities to track the performance of an application. Two functions are provided to configure regions for performance tracking: @@ -1300,9 +1368,9 @@ present or it may Pend (blocking) on a pipe and have its execution suspended until an SB Message arrives. An application may specify a Pend with timeout as well. -#### 6.1 Software Bus Terminology +## 6.1 Software Bus Terminology -##### 6.1.1 Software Bus Messages +### 6.1.1 Software Bus Messages A Software Bus Message (SB Message) is a collection of data treated as a single entity. The format and the definition of the content is uniquely @@ -1325,7 +1393,7 @@ on the Software Bus. Depending on the implementation, different ranges and values are supported, and the values effect the message header differently. -##### 6.1.2 Pipes +### 6.1.2 Pipes The destinations to which SB Messages are sent are called *pipes*. These are queues that can hold SB Messages until they are read out and @@ -1336,7 +1404,7 @@ perform a simple check on their pipes to determine if an SB Message has arrived. Applications call the SB API to create their pipes and to access the data arriving on those pipes. -###### 6.1.2.1 Software Bus Message Limits and Overflows +#### 6.1.2.1 Software Bus Message Limits and Overflows The SB software places a limit on how many SB Messages may be present at each pipe. There are two types of limits: pipe depth and message limit. @@ -1360,7 +1428,7 @@ this is a limitation on top of the Pipe depth. The choice of buffer limits depends on the timing of both the sending and receiving applications. -##### 6.1.3 Routing of Software Bus Messages +### 6.1.3 Routing of Software Bus Messages On a spacecraft using the cFE as the backbone of inter-Application communication, the routing of SB Messages between Applications occurs @@ -1370,14 +1438,14 @@ performs the operations necessary to transfer the SB Message to the target pipe(s). Applications call the SB API to request specified SB Message IDs to be routed to their previously created pipes. -###### 6.1.3.1 Sending Applications +#### 6.1.3.1 Sending Applications Any software application is capable of sending SB Messages. However, interrupt and exception handlers shall not send SB Messages since the SB service uses operating system calls that may be prohibited (i.e. -- they may be blocking calls) in such circumstances. -###### 6.1.3.2 Receiving Applications +#### 6.1.3.2 Receiving Applications Any software application is capable of receiving SB messages. However, interrupt and exception handlers shall not receive packets since the SB @@ -1391,7 +1459,7 @@ it can process it as needed. The SB Message remains accessible to the application until the application starts to receive a new SB Message from the pipe, at which point the old SB Message is discarded. -#### 6.2 Creating Software Bus Pipes +## 6.2 Creating Software Bus Pipes During the initialization of an Application, the Application must notify the cFE of pipes that it requires to receive data. The Application @@ -1454,7 +1522,7 @@ receive data from the created pipe. If multiple threads require access to messages, each thread needs to create their own pipe and make their own message subscriptions. -#### 6.2.1 Deleting Software Bus Pipes +## 6.2.1 Deleting Software Bus Pipes If an Application no longer requires a Pipe, it can delete the Pipe by calling the CFE_SB_DeletePipe API. This API is demonstrated as @@ -1482,7 +1550,7 @@ merely provides a mechanism for Applications that may only need a Pipe temporarily. -#### 6.3 Software Bus Message Subscription +## 6.3 Software Bus Message Subscription Once an Application has created a Pipe, it can begin to request data be put into that Pipe. This process is referred to a SB Message @@ -1559,7 +1627,7 @@ Applications that need to specify something other than the default QoS or Messages Limit, the SB API provides an additional function, CFE_SB_SubscribeEx that allows those parameters to be specified. -#### 6.4 Unsubscribing from Receiving Software Bus Messages +## 6.4 Unsubscribing from Receiving Software Bus Messages If an Application no longer wishes to receive an SB Message that it had previously subscribed to, it can selectively unsubscribe to specified SB @@ -1580,7 +1648,7 @@ The first parameter identifies the SB Message ID that is to be unsubscribed and the second parameter identifies which Pipe the message is currently subscribed to. -#### 6.5 Creating Software Bus Messages +## 6.5 Creating Software Bus Messages For an Application to send an SB Message, it must first create it. The Application shall define the data structure of the SB Message, allocate @@ -1664,7 +1732,7 @@ of the Application's interface. This makes it much simpler to port the Application to another mission where SB Message IDs may need to be renumbered. -##### 6.5.1 Message Header Types +### 6.5.1 Message Header Types The Message module supports two main types of headers: command headers and telemetry headers. In the CCSDS implementation, the command and telemetry @@ -1704,7 +1772,7 @@ It is important to note that some API calls require the presence of a particular header type and will return an error if the other header type is present instead. The following section provides more detail. -##### 6.5.2 Setting Message Header Information +### 6.5.2 Setting Message Header Information Before sending a Message to the SB, the Application can set fields in the Message Header. The following table summarizes the functions that @@ -1733,14 +1801,14 @@ really just a best guess since the packet structure is dependent on implementati The preference is to use CFE_MSG_SetSize and actual packet structure information when available. -##### 6.5.2.1 Modifying Command Message Header Information +### 6.5.2.1 Modifying Command Message Header Information The most common update for command messages is to set the command code. This is done through the CFE_MSG_SetFcnCode() API call. This code is used to distinguish between multiple commands that share a Message ID. It is common practice for an application to have a single "CMD_MID" to capture all commands and then to differentiate those commands using a command code. -##### 6.5.2.2 Modifying Telemetry Message Header Information +### 6.5.2.2 Modifying Telemetry Message Header Information The most common update for telemetry messages is to put the current time in the Message. This is accomplished with one of two API functions. The most commonly used function would be CFE_SB_TimeStampMsg(). This API would @@ -1751,7 +1819,7 @@ time in the Message Header to the time specified during the call. This is useful when the Application wishes to time tag a series of Messages with the same time. -##### 6.5.3 Reading Message Header Information +### 6.5.3 Reading Message Header Information There are several APIs available for extracting the Message Header Fields. These APIs shall always be used by Applications to ensure the @@ -1779,7 +1847,7 @@ they are based on assumptions about the defintion of "User Data" and are really just a best guess since the packet structure is dependent on implementation. The preference is to use the actual packet structure when available. -#### 6.6 Sending Software Bus Messages +## 6.6 Sending Software Bus Messages After an SB message has been created (see Section 6.5) and its contents have been set to the appropriate values, the application can then @@ -1807,7 +1875,7 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ ... } ``` -#### 6.7 Receiving Software Bus Messages +## 6.7 Receiving Software Bus Messages To receive a SB Message, an application calls CFE_SB_ReceiveBuffer. Since most applications are message-driven, this typically occurs in an application's @@ -1869,7 +1937,7 @@ described in Section 6.5.3) should be used to identify the message so that the application can react to it appropriately. -#### 6.8 Improving Message Transfer Performance for Large Messages +## 6.8 Improving Message Transfer Performance for Large Messages Occasionally, there is a need for large quantities of data to be passed between Applications that are on the same processor (e.g.- Science data @@ -1967,7 +2035,7 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ } ``` -#### 6.9 Best Practices for using Software Bus +## 6.9 Best Practices for using Software Bus The following are recommended "best practices" for applications using EVS. 1. Applications should use the Software Bus for all communication with other @@ -1985,7 +2053,7 @@ The following are recommended "best practices" for applications using EVS. # 7. Event Service Interface -#### 7.1 Event Messages +## 7.1 Event Messages Event messages are descriptive notices generated by an application in response to commands, software errors, hardware errors, @@ -2003,7 +2071,7 @@ for developers to note that Event Messages are not automatically sent as telemetry. A Telemetry Output (or equivalent) application must be configured to downlink event messages if they need to be sent as telemetry. -#### 7.2 Event Types +## 7.2 Event Types Event Messages are classified within the cFE and on the ground by an Event Type. Event Types defined within the cFE are: @@ -2049,7 +2117,7 @@ events from a particular Application or even all of the events of a particular Event Type from one specific Application. The Developer should consider these filter options when categorizing their events. -#### 7.3 Event Format +## 7.3 Event Format Event services provides two formats for event messages: long and short. The format is selected with the CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE @@ -2060,7 +2128,7 @@ across an Application, including all Child Tasks. Unique message IDs will allow a message to be understood even in "short format" when the text string is unavailable to provide supplemental information. -#### 7.4 Event Service Registration +## 7.4 Event Service Registration Applications must register with the EVS in order to use cFE event services. If an application has registered with EVS, then all of its @@ -2089,7 +2157,7 @@ via command. See the cFE User's Guide for more information on the cFE EVS ground interface. For an example of how to register an Application with the Event Services, see section 7.4.1 below. -##### 7.4.1 Binary Filtering Scheme +### 7.4.1 Binary Filtering Scheme Currently there exists only one supported filtering scheme within the EVS. The filtering scheme is based upon a binary filtering algorithm @@ -2219,7 +2287,7 @@ FILE: sample_app.c } ``` -#### 7.5 Sending an Event Message +## 7.5 Sending an Event Message Event messages are sent using either the CFE_EVS_SendEvent() function or the CFE_EVS_SendTimedEvent() function, which are both analogous to @@ -2261,7 +2329,7 @@ with the EVS. The EVS will ignore all function calls from unregistered applications. If an application fails to register with the EVS, a call to the CFE_EVS_SendEvent function will have no effect. -##### 7.5.1 Event Message Text +### 7.5.1 Event Message Text An event message is a text string with at most 122 characters. Although there is no fixed format for the text, it should follow these @@ -2297,7 +2365,7 @@ consistent style of writing in all messages. One should consult, if possible, with members of the Flight Operations team and scientists to find what kind of messages are required and how they should be worded. -#### 7.6 Event Service Un-registration +## 7.6 Event Service Un-registration Applications that have registered with the EVS can un-register themselves. The cFE, however, will automatically un-register an @@ -2309,7 +2377,7 @@ shown below: CFE_EVS_Unregister (); ``` -#### 7.7 Best Practices for using Event Services +## 7.7 Best Practices for using Event Services The following are recommended "best practices" for applications using EVS. 1. Event Message IDs should be unique across an application so that an @@ -2347,9 +2415,9 @@ ground-flight interface for modifying Tables is consistent across all Applications and any change in the interface will only require a change to the cFE Table Services rather than modifying each Application. -#### 8.1 Table Terminology +## 8.1 Table Terminology -##### 8.1.1 Tables +### 8.1.1 Tables A Table is a contiguous block of memory that contains, typically, static parameters that an Application requires. These parameters are items that @@ -2362,7 +2430,7 @@ for a particular mission. Examples of data contained in Tables are: 3. attitude control gains and biases for different control laws or control modes, etc. -##### 8.1.2 Active vs. Inactive Tables +### 8.1.2 Active vs. Inactive Tables Logically, each Table has an Active and an Inactive image. The Active Table is the Table that an Application can obtain a pointer to and can @@ -2372,7 +2440,7 @@ stored commands. Once desired modifications have been made to an Inactive Table, the Table Service can, upon command, switch the contents of the Active Table with the Inactive Table. -##### 8.1.3 Single vs. Double Buffered Tables +### 8.1.3 Single vs. Double Buffered Tables When a Table is registered, an Application can decide whether to implement the Table as a Single Buffered Table or as a Double Buffered @@ -2390,7 +2458,7 @@ Inactive to Active is deterministic, quick and never blocking. This makes Double Buffered Tables ideal for providing data to time critical operations and Interrupt Service Routines. -##### 8.1.4 Loading/Activating a Table +### 8.1.4 Loading/Activating a Table An Operator and an Application have the ability to Load the contents of a Table Image with values specified in a file. Applications also have @@ -2405,7 +2473,7 @@ convinced that the Table is configured correctly, the Table is "Activated" which causes the contents of the Active Table Image to be replaced by the contents of the Inactive Table Image. -##### 8.1.5 Dumping a Table +### 8.1.5 Dumping a Table An Operator has the ability to command Table Services to make a Table Dump File. The current contents of the Active Table Image are written to @@ -2417,7 +2485,7 @@ data structure as a dump only table, when registering the table. No buffers are allocated for this capability. This capability was added to support heritage flight software. -##### 8.1.6 Validating a Table +### 8.1.6 Validating a Table An Operator can validate the contents of a table. When the operator chooses a Table Image, either the Active or the Inactive, as a Table to @@ -2431,7 +2499,7 @@ bounds and are logically coherent. The result of this check is combined with the Data Integrity Check Value calculated earlier and reported to the ground in the Table Services Housekeeping Telemetry Packet. -#### 8.2 Registering Tables +## 8.2 Registering Tables In order for an Application to make use of the features of a Table, it must first request that a Table Image be created. This is done through @@ -2473,9 +2541,9 @@ because tables are not intended to serve as a communication mechanism between applications - table sharing increases the coupling between applications and should only be done when necessary. -#### 8.3 Accessing Table Data +## 8.3 Accessing Table Data -##### 8.3.1 Acquiring Table Data +### 8.3.1 Acquiring Table Data Once an Application has acquired the Table Handle for a particular Table (either via the CFE_TBL_Register API or the CFE_TBL_Share API), the @@ -2522,7 +2590,7 @@ CFE_TBL_GetAddresses call is that an error in any one table will return an error code that will be difficult to associate with a particular table. -##### 8.3.2 Releasing Table Data +### 8.3.2 Releasing Table Data Once an Application is done accessing its Table Data, it must release the pointers it obtained with the CFE_TBL_ReleaseAddress or @@ -2533,7 +2601,7 @@ Application does not release its allocated pointers. For an example of acquiring and releasing Table pointers, see the example above in Section 8.3.1. -#### 8.4 Managing a Table +## 8.4 Managing a Table Each Application is required to perform some activities to allow the operators an opportunity to validate the table's contents and to change @@ -2542,7 +2610,7 @@ are used by an Application to perform these management duties. These APIs are CFE_TBL_GetStatus, CFE_TBL_Validate, CFE_TBL_Update and CFE_TBL_Manage. -##### 8.4.1 Validating Table Data +### 8.4.1 Validating Table Data When an outside entity loads a new image for a table, they may wish to validate the table contents prior to activating the table for usage. The @@ -2615,7 +2683,7 @@ Table Validation Request has been made as shown below: } ``` -##### 8.4.2 Loading/Updating Table Data +### 8.4.2 Loading/Updating Table Data An Application has control of when the contents of the Table are updated within its execution cycle. If an Application wishes to change the @@ -2678,7 +2746,7 @@ Table Image waiting to be activated. The Application performs this update when it feels the time is right by calling the CFE_TBL_Update API. -##### 8.4.3 Simplifying Table Management +### 8.4.3 Simplifying Table Management The example shown in Section 8.4.1 can be tedious to implement for every table an Application has created. Therefore, the Table Services API has @@ -2696,7 +2764,7 @@ Telemetry Request cycle, for example, to keep the management at a reasonable level with a reasonable amount of lag in its response to Operation requests for table validations and activations. -#### 8.5 Typical File Organization for Tables +## 8.5 Typical File Organization for Tables A typical layout of table-related files within an application (xx) is shown below. Note that this does not show all of an application's files, just those @@ -2732,7 +2800,7 @@ The xx_table1.c file is the source code for a table itself. The xx_platform_cfg.h file contains configuration parameters for applications, and there are typically several configuration parameters associated with tables. -##### 8.5.1 Table Files Example +### 8.5.1 Table Files Example ``` FILE: xx_app.h @@ -2868,7 +2936,7 @@ FILE: xx_platform_cfg.h #define XX_TABLE_ENTRY_COUNT 3 ``` -#### 8.6 Building Tables +## 8.6 Building Tables In order to build application tables with the CMake build system, the "add_cfe_tables" command needs to be added to the CMakeLists.txt file. If the @@ -2884,7 +2952,7 @@ add_cfe_tables(xx ${APP_TABLE_FILES}) ``` -#### 8.7 Best Practices for using Table Services +## 8.7 Best Practices for using Table Services The following are recommended "best practices" for applications using table services. @@ -2906,7 +2974,7 @@ writing data to a file, reference the *OS Abstraction Layer Library* document. The File Service API is concerned mostly with handling of the cFE File Service standard file header. -#### 9.1 Standard File Header +## 9.1 Standard File Header The structure of the standard file header is as follows: @@ -2956,7 +3024,7 @@ when the header was created. The Description field provides a brief ASCII description of the contents of the file. -#### 9.2 Accessing and Modifying the Standard File Header +## 9.2 Accessing and Modifying the Standard File Header File Services provides a few functions for accessing and modifying the contents of the standard file header. The first of these is the @@ -2986,7 +3054,7 @@ CFE_TIME_SysTime_t data format. This function may be useful when time tagging experiment data with the time the data was acquired rather than the time the file was created. -#### 9.3 Other File Service Utility Functions +## 9.3 Other File Service Utility Functions The File Service provides a utility function that can move the file pointer associated with a specified file to the first byte of data @@ -3012,7 +3080,7 @@ The cFE Time Service is an API that allows Applications the ability to access, convert and manipulate the current time. The definitions for the TIME API are found in cfe_time.h. -#### 10.1 Time Formats +## 10.1 Time Formats The cFE Time Service manages time as two 32-bit integers. The first integer represents the number of seconds and the second integer @@ -3032,7 +3100,7 @@ simply a single integer or floating point number, the Time Service provides a collection of functions for converting and manipulating time in these formats. These functions are described in the sections below. -#### 10.2 Time Values +## 10.2 Time Values The cFE Time Service allows each mission to define an Epoch. This is a mission's time reference to which a derived number of seconds is added. @@ -3097,7 +3165,7 @@ Service time values are summarized below. - UTC (Coordinated Universal Time): TAI - Leap Seconds. -#### 10.3 Basic Time Functions +## 10.3 Basic Time Functions The following Time Service API functions are available for obtaining time information. Most Developer's will only need one time function, @@ -3159,7 +3227,7 @@ is CFE_TIME_INVALID, then the Application knows that the CFE_TIME_Get... functions are returning a local time that has never been synchronized to the primary onboard time base. -#### 10.4 Time Conversion Functions +## 10.4 Time Conversion Functions Since working with subseconds as an integer of 2^-32 seconds is sometimes cumbersome, the cFE Time Services provides two functions to @@ -3171,7 +3239,7 @@ The second function, CFE_TIME_Micro2SubSecs, reverses this process and can convert an integer within the range of 0 to 999,999 into the appropriate number of 2^-32 seconds. -#### 10.5 Time Manipulation Functions +## 10.5 Time Manipulation Functions In order to understand what is involved in performing arithmetic on time, one must understand that time is represented in the computer in a @@ -3281,7 +3349,7 @@ standard so as to not cause confusion when a status code is reported. By using the standard defined below, each mission should be able to generate a unique status code for each condition to be reported. -#### 11.1 Standard Error Codes +## 11.1 Standard Error Codes The status code is designed to have the following bit format: diff --git a/fsw/cfe-core/CMakeLists.txt b/fsw/cfe-core/CMakeLists.txt deleted file mode 100644 index 4aa275555..000000000 --- a/fsw/cfe-core/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -################################################################## -# -# cFE core module CMake build recipe -# -# This CMakeLists.txt file contains recipes for building the 6 -# core applications included in the cFE distribution. The entire -# set of source code is built into a static library that in turn -# is linked into the final executable. -# -# Note this is different than applications which are dynamically -# linked to support runtime loading. The core applications all -# use static linkage. -# -################################################################## - -project(CFECORE C) - -# Define the "_CFE_CORE_" macro during compilation of all CFE core sources -add_definitions(-D_CFE_CORE_) - -set(CFE_CORE_MODULES es sb evs tbl time fs) -set(CFE_ALL_MODULE_SRCS) - -foreach(MODULE ${CFE_CORE_MODULES}) - aux_source_directory(src/${MODULE} CFE_ALL_MODULE_SRCS) -endforeach(MODULE ${CFE_CORE_MODULES}) - -add_library(cfe-core STATIC ${CFE_ALL_MODULE_SRCS}) - -if (ENABLE_UNIT_TESTS) - add_subdirectory(ut-stubs) - add_subdirectory(unit-test) -endif (ENABLE_UNIT_TESTS) - diff --git a/fsw/cfe-core/src/inc/private/README.txt b/fsw/cfe-core/src/inc/private/README.txt deleted file mode 100644 index e5e32ba57..000000000 --- a/fsw/cfe-core/src/inc/private/README.txt +++ /dev/null @@ -1,22 +0,0 @@ -About the "private" cFE include directory ------------------------------------------ - -This directory is for include files that are used within the cFE core library -only, including types and definitions that are shared between more than one -cFE module. - -External libraries and applications should *NOT* include anything from this -directory. Doing so may cause the build to break. The reason is because -directly using definitions in here at compile-time will cause the external -entity (lib or app) to become hard-linked to the same specific cFE config -used to build the cFE - and it will surely break if that app is used with -a cFE instance that has been built with a different config (and probably -in a non-obvious way). - -Instead, the external app or lib should use the configuration exported from -the cFE library via the proper external ABI. - -Include files in here should check that _CFE_CORE_ is defined to prevent -accidental usage by external entities. - - diff --git a/fsw/cfe-core/src/inc/private/cfe_private.h b/fsw/cfe-core/src/inc/private/cfe_private.h deleted file mode 100644 index e3738e493..000000000 --- a/fsw/cfe-core/src/inc/private/cfe_private.h +++ /dev/null @@ -1,338 +0,0 @@ -/* -** GSC-18128-1, "Core Flight Executive Version 6.7" -** -** Copyright (c) 2006-2019 United States Government as represented by -** the Administrator of the National Aeronautics and Space Administration. -** All Rights Reserved. -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -/* - * cfe_private.h - * - * Created on: Dec 3, 2013 - * Author: jphickey - */ - -#ifndef CFE_PRIVATE_H_ -#define CFE_PRIVATE_H_ - -#include "common_types.h" -#include "cfe.h" - -#include "cfe_platform_cfg.h" /* Define platform configuration parameters */ - - -/*****************************************************************************/ -/** cFE Core task entry point prototypes *************************************/ -/*****************************************************************************/ -/* - * All cFE core apps should define an entry point and the prototype should be here - * These may also be called from the unit test - */ - -/*****************************************************************************/ -/** -** \brief Entry Point for cFE Core Application -** -** \par Description -** This is the entry point to the cFE TIME Core Application. -** -** \par Assumptions, External Events, and Notes: -** None -** -** -******************************************************************************/ -extern void CFE_TIME_TaskMain(void); - -/*****************************************************************************/ -/** -** \brief Entry Point for cFE Core Application -** -** \par Description -** This is the entry point to the cFE SB Core Application. -** -** \par Assumptions, External Events, and Notes: -** None -** -** -******************************************************************************/ -extern void CFE_SB_TaskMain(void); - -/*****************************************************************************/ -/** -** \brief Entry Point for cFE Core Application -** -** \par Description -** This is the entry point to the cFE EVS Core Application. -** -** \par Assumptions, External Events, and Notes: -** None -** -** -******************************************************************************/ -extern void CFE_EVS_TaskMain(void); - -/*****************************************************************************/ -/** -** \brief Entry Point for cFE Core Application -** -** \par Description -** This is the entry point to the cFE ES Core Application. -** -** \par Assumptions, External Events, and Notes: -** None -** -** -******************************************************************************/ -extern void CFE_ES_TaskMain(void); - -/*****************************************************************************/ -/** -** \brief Entry Point for cFE Table Services Core Application -** -** \par Description -** This is the entry point to the cFE Table Services Core Application. -** This Application provides the ground interface to the cFE Table -** Services. -** -** \par Assumptions, External Events, and Notes: -** None -** -** -******************************************************************************/ -extern void CFE_TBL_TaskMain(void); - - - - -/*****************************************************************************/ -/** cFE Core task early init prototypes **************************************/ -/*****************************************************************************/ -/* - * cFE core apps may define an early init function and the prototype should be here - * These may also be called from the unit test - */ - -/*****************************************************************************/ -/** -** \brief Initializes the cFE core module API Library -** -** \par Description -** Initializes the cFE core module API Library -** -** \par Assumptions, External Events, and Notes: -** -# This function MUST be called before any module API's are called. -** -******************************************************************************/ -extern int32 CFE_EVS_EarlyInit(void); - -/*****************************************************************************/ -/** -** \brief Initializes the cFE core module API Library -** -** \par Description -** Initializes the cFE core module API Library -** -** \par Assumptions, External Events, and Notes: -** -# This function MUST be called before any module API's are called. -** -******************************************************************************/ -extern int32 CFE_SB_EarlyInit(void); - -/*****************************************************************************/ -/** -** \brief Initializes the cFE core module API Library -** -** \par Description -** Initializes the cFE core module API Library -** -** \par Assumptions, External Events, and Notes: -** -# This function MUST be called before any module API's are called. -** -******************************************************************************/ -extern int32 CFE_TIME_EarlyInit(void); - -/*****************************************************************************/ -/** -** \brief Initializes the Table Services API Library -** -** \par Description -** Initializes the Table Services API Library -** -** \par Assumptions, External Events, and Notes: -** -# This function MUST be called before any TBL API's are called. -** -******************************************************************************/ -extern int32 CFE_TBL_EarlyInit(void); - -/*****************************************************************************/ -/** -** \brief Initializes the cFE core module API Library -** -** \par Description -** Initializes the cFE core module API Library -** -** \par Assumptions, External Events, and Notes: -** -# This function MUST be called before any module API's are called. -** -******************************************************************************/ -extern int32 CFE_ES_CDS_EarlyInit(void); - -/*****************************************************************************/ -/** -** \brief Initializes the cFE core module API Library -** -** \par Description -** Initializes the cFE core module API Library -** -** \par Assumptions, External Events, and Notes: -** -# This function MUST be called before any module API's are called. -** -******************************************************************************/ -extern int32 CFE_FS_EarlyInit(void); - - - -/*****************************************************************************/ -/** cFE Core task clean up prototypes ****************************************/ -/*****************************************************************************/ -/* - * cFE core apps may define a clean up function and the prototype should be here - * These may also be called from the unit test - */ -/*****************************************************************************/ -/** -** \brief Removes TBL resources associated with specified Application -** -** \par Description -** This function is called by cFE Executive Services to cleanup after -** an Application has been terminated. It frees TBL services resources -** that have been allocated to the specified Application. -** -** \par Assumptions, External Events, and Notes: -** -# This function DOES NOT remove any critical tables associated with -** the specified application from the Critical Data Store. -** -******************************************************************************/ -extern int32 CFE_TBL_CleanUpApp(CFE_ES_AppId_t AppId); - -/*****************************************************************************/ -/** -** \brief Removes SB resources associated with specified Application -** -** \par Description -** This function is called by cFE Executive Services to cleanup after -** an Application has been terminated. It frees resources -** that have been allocated to the specified Application. -** -******************************************************************************/ -extern int32 CFE_SB_CleanUpApp(CFE_ES_AppId_t AppId); - -/*****************************************************************************/ -/** -** \brief Removes EVS resources associated with specified Application -** -** \par Description -** This function is called by cFE Executive Services to cleanup after -** an Application has been terminated. It frees resources -** that have been allocated to the specified Application. -** -******************************************************************************/ -extern int32 CFE_EVS_CleanUpApp(CFE_ES_AppId_t AppId); - -/*****************************************************************************/ -/** -** \brief Removes TIME resources associated with specified Application -** -** \par Description -** This function is called by cFE Executive Services to cleanup after -** an Application has been terminated. It frees resources -** that have been allocated to the specified Application. -** -******************************************************************************/ -extern int32 CFE_TIME_CleanUpApp(CFE_ES_AppId_t AppId); - - -/*****************************************************************************/ -/** cFE Core task other function call prototypes *****************************/ -/*****************************************************************************/ -/* - * Functions that are used in a cFE core module other than the module that - * actually defines the function should be prototyped here. - * - * Including the prototype here allows the function to be called properly - * without redefining it at the point of use. - */ - -/*****************************************************************************/ -/** -** \brief Reserve space (or re-obtain previously reserved space) in the Critical Data Store (CDS) -** -** \par Description -** This routine is identical to #CFE_ES_RegisterCDS except it identifies the contents -** of the CDS as a critical table. This is crucial because a critical table CDS must -** only be deleted by cFE Table Services, not via an ES delete CDS command. Otherwise, -** Table Services may be out of sync with the contents of the CDS. -** -** \par Assumptions, External Events, and Notes: -** -# This function assumes input parameters are error free and have met size/value restrictions. -** -# The calling function is responsible for issuing any event messages associated with errors. -** -** \param[in, out] HandlePtr Pointer Application's variable that will contain the CDS Memory Block Handle. *HandlePtr is the handle of the CDS block that can be used in #CFE_ES_CopyToCDS and #CFE_ES_RestoreFromCDS. -** -** \param[in] UserBlockSize The number of bytes needed in the CDS. -** -** \param[in] Name Pointer to character string containing the Application's local name for -** the CDS. -** -** \param[in] CriticalTbl Indicates whether the CDS is to be used as a Critical Table or not -** -** -** \return See return codes for #CFE_ES_RegisterCDS -** -******************************************************************************/ -int32 CFE_ES_RegisterCDSEx(CFE_ES_CDSHandle_t *HandlePtr, size_t UserBlockSize, const char *Name, bool CriticalTbl); - -/*****************************************************************************/ -/** -** \brief Deletes the specified CDS from the CDS Registry and frees CDS Memory -** -** \par Description -** Removes the record of the specified CDS from the CDS Registry and -** frees the associated CDS memory for future use. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \param[in] CDSName - Pointer to character string containing complete -** CDS Name (of the format "AppName.CDSName"). -** -** \param[in] CalledByTblServices - Flag that identifies whether the CDS is supposed to -** be a Critical Table Image or not. -** -** \return #CFE_SUCCESS \copydoc CFE_SUCCESS -** \return #CFE_ES_CDS_WRONG_TYPE_ERR \copydoc CFE_ES_CDS_WRONG_TYPE_ERR -** \return #CFE_ES_CDS_OWNER_ACTIVE_ERR \copydoc CFE_ES_CDS_OWNER_ACTIVE_ERR -** \return #CFE_ES_ERR_NAME_NOT_FOUND \copydoc CFE_ES_ERR_NAME_NOT_FOUND -** \return Any of the return values from #CFE_ES_UpdateCDSRegistry -** \return Any of the return values from #CFE_ES_GenPoolPutBlock -** -******************************************************************************/ -int32 CFE_ES_DeleteCDS(const char *CDSName, bool CalledByTblServices); - - - - -#endif /* CFE_PRIVATE_H_ */ diff --git a/fsw/cfe-core/unit-test/CMakeLists.txt b/fsw/cfe-core/unit-test/CMakeLists.txt deleted file mode 100644 index 9df8b60af..000000000 --- a/fsw/cfe-core/unit-test/CMakeLists.txt +++ /dev/null @@ -1,88 +0,0 @@ -################################################################## -# -# cFE unit test build recipe -# -# This CMake file contains the recipe for building the cFE unit tests. -# It is invoked from the parent directory when unit tests are enabled. -# -################################################################## - -include_directories(${osal_MISSION_DIR}/ut_assert/inc) - -# allow direct inclusion of module-private header files by UT code -# NOTE: this should be minimized and moved to a more targeted -# approach, where only each specific UT module does this. -include_directories( - ${cfe-core_MISSION_DIR}/src/es - ${cfe-core_MISSION_DIR}/src/evs - ${cfe-core_MISSION_DIR}/src/sb - ${cfe-core_MISSION_DIR}/src/tbl - ${cfe-core_MISSION_DIR}/src/time - ${cfe-core_MISSION_DIR}/src/fs -) - -# CFE needs a supplemental test support hook library -add_library(ut_cfe-core_support STATIC - ut_support.c - ut_osprintf_stubs.c -) -target_include_directories(ut_cfe-core_support PUBLIC - ${cfe-core_MISSION_DIR}/src/es - ${cfe-core_MISSION_DIR}/src/evs - ${cfe-core_MISSION_DIR}/src/time - ${CMAKE_CURRENT_SOURCE_DIR}) - -# For each core module, generate the associated unit test -# This is done by linking the stubs of every OTHER module with the -# UT version of the real module (compiled with coverage flags) -foreach(MODULE ${CFE_CORE_MODULES}) - - # The "UT_TARGET_NAME" is a concatenation of the configuration name with the current module - # This avoids target name duplication in case more than one configuration is used - # (All targets should be based on this name) - set(UT_TARGET_NAME "cfe-core_${MODULE}") - - set(CFE_MODULE_FILES) - aux_source_directory(${cfe-core_MISSION_DIR}/src/${MODULE} CFE_MODULE_FILES) - - # Compile the unit(s) under test as an object library - # this allows easy configuration of special flags and include paths - # in particular this should use the UT_COVERAGE_COMPILE_FLAGS for coverage instrumentation - add_library(ut_${UT_TARGET_NAME}_object OBJECT - ${CFE_MODULE_FILES}) - - # Apply the UT_COVERAGE_COMPILE_FLAGS to the units under test - # This should enable coverage analysis on platforms that support this - target_compile_options(ut_${UT_TARGET_NAME}_object PRIVATE ${UT_COVERAGE_COMPILE_FLAGS}) - - # For this object target only, the "override" includes should be injected - # into the include path BEFORE any other include path. This is so the - # override will take precedence over any system-provided version. - target_include_directories(ut_${UT_TARGET_NAME}_object BEFORE PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/modules/inc/overrides) - - add_executable(${UT_TARGET_NAME}_UT - ${MODULE}_UT.c - $) - - # Also add the UT_COVERAGE_LINK_FLAGS to the link command - # This should enable coverage analysis on platforms that support this - target_link_libraries(${UT_TARGET_NAME}_UT - ${UT_COVERAGE_LINK_FLAGS} - ut_cfe-core_support - ut_cfe-core_stubs - sbr # Will be removed when sbr stubs are implemented - ut_assert) - - add_test(${UT_TARGET_NAME}_UT ${UT_TARGET_NAME}_UT) - foreach(TGTNAME ${INSTALL_TARGET_LIST}) - install(TARGETS ${UT_TARGET_NAME}_UT DESTINATION ${TGTNAME}/${UT_INSTALL_SUBDIR}) - endforeach(TGTNAME ${INSTALL_TARGET_LIST}) -endforeach(MODULE ${CFE_CORE_MODULES}) - -# Generate the FS test input files -# As these are just arbitrary data, they only have to be present - they do not need to be updated -execute_process(COMMAND gzip -c ${CMAKE_CURRENT_SOURCE_DIR}/fs_UT.c OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/fs_test.gz) -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/fs_test.nongz "This is an ordinary file\n") - - diff --git a/fsw/cfe-core/unit-test/HowToRunCFEUnitTests.txt b/fsw/cfe-core/unit-test/HowToRunCFEUnitTests.txt deleted file mode 100644 index 0a08226fc..000000000 --- a/fsw/cfe-core/unit-test/HowToRunCFEUnitTests.txt +++ /dev/null @@ -1,104 +0,0 @@ - -Running the cFE Unit tests - ------- Classic Build Instructions --------------- -The cFE Core unit tests are run from the mission/build/"cpuX" directory, where -cpuX is either cpu1 or the name of the mission specific cpu set by the user. The -unit test source code resides in the mission/cfe/fsw/cfe-core/unit-test directory. -The mission/build/cpuX directory contains a script, make_cfe_ut, for building and -executing these tests. The default script uses pc-linux for the baseline platform. -The script may be modified accordingly for running the tests on alternate platforms -(i.e.,ARINC653). This script allows for running a subset of the tests by service -(ES,EVS,etc.). The usage is make_cfe_ut , where service is es, evs, fs, -sb,tbl or time. If no service is specified, all tests are compiled and executed. -In addition, there are several cFE Unit Test Compiler Flags that may be set to -display/log various test results. These flags are defined and set in the -make_cfe_ut script file and may be modified in accordance with the users -needs. - -1. Setup the Mission Build environment -2. Edit the mission/build/cpuX/cfe/cfe-config.mak for the linux platform -3. Go to the mission/build/cpuX directory -4. Run the desired unit test(s) using the make_cfe_ut script as described above -5. View Results -6. Check-in results (if applicable) - ------- Details ------------------------------------ - -1. Setup the Mission Build environment by going to the mission/ directory. Edit -the setvars.sh file and make sure that the environment variables specify the -proper directories. Make any updates as needed. After verifying the contents of -the setvars.sh file, type ". ./setvars.sh" to execute and set these variables. -This sets up the required environment variables used to build and execute the -cFE Unit Tests. - -2. Edit the mission/build/cpuX/cfe/cfe-config.mak for the linux platform. The OS -setting should be "posix" and the PSP setting should be "pc-linux" for the -default platform. NOTE: the cfe-config.mak file identifies additional settings -for supported OS and platforms. - -3. Go to the mission/build/cpuX directory - -4. Run the desired unit test(s) by typing "./make_cfe_ut " - where service is es,evs,fs,sb,tbl or time. If no service is specified, all - tests are compiled and executed. - -5. View results -Pass/Fail/Informational and coverage results will be displayed in the terminal where it -has run. It is recommended to capture these results to a ut_cfe_xx_log.txt file. -see mission/build/cpuX/cfe/unit-test/xx/cfe_xx_???.c.gcov for detailed coverage results. - ##### in file means the line has not been executed. - -see mission/cfe/fsw/cfe-core/unit-test/xxResults/ut_cfe_xx_log.txt for the baselined unit -test output. - -see mission/cfe/fsw/cfe-core/unit-test/xxResults/README.txt for the details on the expected -coverage - -6. To check-in results (if applicable) -Each subsystem should have a ut_cfe_XX_log.txt file that contains the expected baselined -results captured from the console output. All pass/fail/info/coverage results are printed to -the console when the test is executed. - -If any file is not covered 100%, we need to check in the corresponding *.gcov file to show -exactly what lines have not been covered. In most cases, at a minimum this should be the -cfe_xx_task.c.gov file since the forever loop will not have coverage. - -All files specifying results should be checked into the corresponding subproject -under the unit-test subproject. (i.e., SbResults subproject in -mission/cfe/fsw/cfe-core/unit-test/) - - - ------- CMake Build Instructions ----------------------- - -While the The cFE Core unit tests are run from the mission/build/"cpuX" directory -for the classic build, the unit tests for the CMake build are run from -mission/build/cpuX/cfe_core_default_cpuX/unit-tests, -where cpuX is either cpu1 or the name of the mission specific cpu set by the user. The -unit test source code resides in the mission/cfe/fsw/cfe-core/unit-test directory. - - -1. Setup the Mission Build environment via the CMake build instructions with - the additions: - - a. Set 'ENABLE_UNIT_TESTS' to 'TRUE' - b. Optionally set OSAL_USER_C_FLAGS to capture code coverage results during make prep stage. - - e.g. "make ENABLE_UNIT_TESTS=TRUE OSAL_USER_C_FLAGS='-fprofile-arcs -ftest-coverage' prep" - -2. Go to build/cpuX/cfe_core_default_cpuX/unit-tests -3. Run 'make' to build the cFE unit tests -4. Run 'make test' to run the unit tests -5. Results are in Testing/Temporary/LastTest.log -6. Results of failed tests are in Testing/Temporary/LastTest.log - - -If OSAL_USER_C_FLAGS was set up to capture the code coverage, the results may be obtained -via the following steps: - -1. From the top level run 'make lcov' -2. Results will be under - mission/build/cpu1/lcov/index.html - and viewable locally via a web browser - diff --git a/fsw/cfe-core/unit-test/cFE_UT_Doxyfile b/fsw/cfe-core/unit-test/cFE_UT_Doxyfile deleted file mode 100644 index 501b10d00..000000000 --- a/fsw/cfe-core/unit-test/cFE_UT_Doxyfile +++ /dev/null @@ -1,1781 +0,0 @@ -# Doxyfile 1.7.6.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = "cFE Unit Tests" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = docs - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields will be shown inline in the documentation -# of the scope in which they are defined (i.e. file, namespace, or group -# documentation), provided this scope is documented. If set to NO (the default), -# structs, classes, and unions are shown on a separate page (for HTML and Man -# pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -SYMBOL_CACHE_SIZE = 0 - -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# style sheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the -# mathjax.org site, so you can quickly see the result without installing -# MathJax, but it is strongly recommended to install a local copy of MathJax -# before deployment. - -MATHJAX_RELPATH = http://www.mathjax.org/mathjax - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/fsw/cfe-core/version_info.cmake b/fsw/cfe-core/version_info.cmake deleted file mode 100644 index d0367a5fa..000000000 --- a/fsw/cfe-core/version_info.cmake +++ /dev/null @@ -1,3 +0,0 @@ -# This indicates the git tag/branch name in the repository that corresponds to this module -# this will be supplied to commands such as "git describe" to get a user-friendly version string. -set(NAME "cfe") diff --git a/modules/core_api/CMakeLists.txt b/modules/core_api/CMakeLists.txt new file mode 100644 index 000000000..6a2014234 --- /dev/null +++ b/modules/core_api/CMakeLists.txt @@ -0,0 +1,54 @@ +################################################################## +# +# cFE Global/Public Application Interface +# +################################################################## + +# NOTE: This module is shared headers and configuration only, it has has no +# source files of its own. It just defines the intefaces betwen the CFE core +# modules and other private headers that define CFE internal shared data objects. +add_library(core_api INTERFACE) + +# The fsw/inc here defines global/shared structures and interfaces +target_include_directories(core_api INTERFACE fsw/inc) + +# The list of modules that comprise the "CFE app interface" +# This is the set of APIs that applications and libraries may call directly +# The include path to all of them is +set(core_api_MODULES es evs fs msg resourceid sb tbl time osal psp) + +# Propagate any INTERFACE-level include dirs and compile defintions from +# the modules into this abstract interface target +foreach(MOD ${core_api_MODULES}) + target_include_directories(core_api INTERFACE + $ + ) + target_compile_definitions(core_api INTERFACE + $ + ) +endforeach(MOD ${core_api_MODULES}) + +# Add unit test coverage subdirectory +# This provides stubs for functions declared in fsw/inc +if (ENABLE_UNIT_TESTS) + add_subdirectory(ut-stubs) +endif (ENABLE_UNIT_TESTS) + +cfs_app_check_intf(${DEP} + cfe_resourceid.h + cfe_endian.h + cfe_msg.h + cfe_error.h + cfe.h + cfe_version.h + + cfe_es_extern_typedefs.h + cfe_evs_extern_typedefs.h + cfe_fs_extern_typedefs.h + cfe_sb_extern_typedefs.h + cfe_tbl_extern_typedefs.h + cfe_time_extern_typedefs.h + + cfe_tbl_filedef.h +) + diff --git a/modules/core_api/arch_build.cmake b/modules/core_api/arch_build.cmake new file mode 100644 index 000000000..053fbc40f --- /dev/null +++ b/modules/core_api/arch_build.cmake @@ -0,0 +1,19 @@ +########################################################### +# +# CFE arch/platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# Generate the "cfe_platform_cfg.h" and "cfe_msgids.h" header files +# these must come from mission config + +generate_config_includefile( + FILE_NAME "cfe_msgids.h" + MATCH_SUFFIX "msgids.h" + PREFIXES ${BUILD_CONFIG} +) + diff --git a/fsw/cfe-core/eds/base_types.xml b/modules/core_api/eds/base_types.xml similarity index 100% rename from fsw/cfe-core/eds/base_types.xml rename to modules/core_api/eds/base_types.xml diff --git a/fsw/cfe-core/eds/ccsds_spacepacket.xml b/modules/core_api/eds/ccsds_spacepacket.xml similarity index 100% rename from fsw/cfe-core/eds/ccsds_spacepacket.xml rename to modules/core_api/eds/ccsds_spacepacket.xml diff --git a/fsw/cfe-core/eds/cfe_fs.xml b/modules/core_api/eds/cfe_fs.xml similarity index 100% rename from fsw/cfe-core/eds/cfe_fs.xml rename to modules/core_api/eds/cfe_fs.xml diff --git a/fsw/cfe-core/eds/config.xml b/modules/core_api/eds/config.xml similarity index 100% rename from fsw/cfe-core/eds/config.xml rename to modules/core_api/eds/config.xml diff --git a/fsw/cfe-core/src/inc/cfe.h b/modules/core_api/fsw/inc/cfe.h similarity index 92% rename from fsw/cfe-core/src/inc/cfe.h rename to modules/core_api/fsw/inc/cfe.h index b58931d00..d3a62f206 100644 --- a/fsw/cfe-core/src/inc/cfe.h +++ b/modules/core_api/fsw/inc/cfe.h @@ -36,8 +36,8 @@ /* ** Ensure that header is included only once... */ -#ifndef _cfe_ -#define _cfe_ +#ifndef CFE_H +#define CFE_H #include "common_types.h" /* Define basic data types */ @@ -54,8 +54,9 @@ #include "cfe_time.h" /* Define Time Service API */ #include "cfe_tbl.h" /* Define Table Service API */ -#include "cfe_msg_api.h" /* Define Message API */ +#include "cfe_msg.h" /* Define Message API */ +#include "cfe_resourceid.h" /* Define ResourceID API */ #include "cfe_psp.h" /* Define Platform Support Package API */ -#endif /* _cfe_ */ +#endif /* CFE_H */ diff --git a/fsw/cfe-core/src/inc/ccsds.h b/modules/core_api/fsw/inc/cfe_endian.h similarity index 88% rename from fsw/cfe-core/src/inc/ccsds.h rename to modules/core_api/fsw/inc/cfe_endian.h index b928062f5..b43af6cbb 100644 --- a/fsw/cfe-core/src/inc/ccsds.h +++ b/modules/core_api/fsw/inc/cfe_endian.h @@ -19,22 +19,20 @@ */ /****************************************************************************** -** File: ccsds.h +** File: cfe_endian.h ** ** Purpose: -** Define typedefs and macros for CCSDS packet headers. +** Define macros to enforce big-endian/network byte order for 16 and 32 bit integers ** ******************************************************************************/ -#ifndef _ccsds_ -#define _ccsds_ +#ifndef CFE_ENDIAN_H +#define CFE_ENDIAN_H /* ** Include Files */ #include "common_types.h" -#include "cfe_mission_cfg.h" -#include "cfe_msg_hdr.h" /* Macro to convert 16/32 bit types from platform "endianness" to Big Endian */ @@ -46,4 +44,4 @@ #define CFE_MAKE_BIG32(n) ( (((n) << 24) & 0xFF000000) | (((n) << 8) & 0x00FF0000) | (((n) >> 8) & 0x0000FF00) | (((n) >> 24) & 0x000000FF) ) #endif -#endif /* _ccsds_ */ +#endif /* CFE_ENDIAN_H */ diff --git a/fsw/cfe-core/src/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_error.h rename to modules/core_api/fsw/inc/cfe_error.h diff --git a/fsw/cfe-core/src/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h similarity index 92% rename from fsw/cfe-core/src/inc/cfe_es.h rename to modules/core_api/fsw/inc/cfe_es.h index 0da600fc7..ed4df5b3d 100644 --- a/fsw/cfe-core/src/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -32,24 +32,16 @@ ** */ -#ifndef _cfe_es_ -#define _cfe_es_ +#ifndef CFE_ES_API_H +#define CFE_ES_API_H /* ** Includes */ -#include "cfe_es_extern_typedefs.h" -#include "cfe_es_msg.h" -#include "cfe_mission_cfg.h" -#include "cfe_perfids.h" +#include "common_types.h" #include "cfe_error.h" -#include "cfe_resourceid_api.h" +#include "cfe_es_api_typedefs.h" -/*****************************************************************************/ - -/* -** Macro Definitions -*/ /* ** The OS_PRINTF macro may be defined by OSAL to enable @@ -60,156 +52,14 @@ #define OS_PRINTF(m,n) #endif -#define CFE_ES_DBIT(x) (1L << (x)) /* Places a one at bit positions 0 thru 31 */ -#define CFE_ES_DTEST(i,x) (((i) & CFE_ES_DBIT(x)) != 0) /* true iff bit x of i is set */ -#define CFE_ES_TEST_LONG_MASK(m,s) (CFE_ES_DTEST(m[(s)/32],(s)%32)) /* Test a bit within an array of 32-bit integers. */ - - -/* -** Note about reset type and subtypes: -** -** These values come from the PSP so the actual definition of these enumerations -** was moved to the PSP header file . -** -** In the future the Electronic Data sheets (EDS) for PSP/ES -** will define the exact values to use in telemetry messages. -*/ - -/* -** Reset types -*/ -/** \name Reset Type extensions */ -/** \{ */ -#define CFE_ES_APP_RESTART CFE_PSP_RST_TYPE_MAX /**< Application only was reset (extend the PSP enumeration here) */ -/** \} */ - -/** \name Conversions for ES resource IDs */ -/** \{ */ - -/* - * Conversion macros for each ES resource ID subtype - * - * These accept a generic/non-specific CFE_ResourceId_t value - * and convert it to the corresponding resource-specific type. - * - * These should only be used when with the resource ID constants, - * or where the code has confirmed or is determining the generic - * identifier does correspond to a resource of that type. - */ -#define CFE_ES_APPID_C(val) ((CFE_ES_AppId_t)CFE_RESOURCEID_WRAP(val)) -#define CFE_ES_TASKID_C(val) ((CFE_ES_TaskId_t)CFE_RESOURCEID_WRAP(val)) -#define CFE_ES_LIBID_C(val) ((CFE_ES_LibId_t)CFE_RESOURCEID_WRAP(val)) -#define CFE_ES_COUNTERID_C(val) ((CFE_ES_CounterId_t)CFE_RESOURCEID_WRAP(val)) -#define CFE_ES_MEMHANDLE_C(val) ((CFE_ES_MemHandle_t)CFE_RESOURCEID_WRAP(val)) -#define CFE_ES_CDSHANDLE_C(val) ((CFE_ES_CDSHandle_t)CFE_RESOURCEID_WRAP(val)) - -/** \} */ - -/** \name Type-specific initalizers for "undefined" resource IDs */ -/** \{ */ - -#define CFE_ES_APPID_UNDEFINED CFE_ES_APPID_C(CFE_RESOURCEID_UNDEFINED) -#define CFE_ES_TASKID_UNDEFINED CFE_ES_TASKID_C(CFE_RESOURCEID_UNDEFINED) -#define CFE_ES_LIBID_UNDEFINED CFE_ES_LIBID_C(CFE_RESOURCEID_UNDEFINED) -#define CFE_ES_COUNTERID_UNDEFINED CFE_ES_COUNTERID_C(CFE_RESOURCEID_UNDEFINED) -#define CFE_ES_MEMHANDLE_UNDEFINED CFE_ES_MEMHANDLE_C(CFE_RESOURCEID_UNDEFINED) -#define CFE_ES_CDS_BAD_HANDLE CFE_ES_CDSHANDLE_C(CFE_RESOURCEID_UNDEFINED) -/** \} */ - -#define CFE_ES_NO_MUTEX false /**< \brief Indicates that the memory pool selection will not use a semaphore */ -#define CFE_ES_USE_MUTEX true /**< \brief Indicates that the memory pool selection will use a semaphore */ - -/** \name Task Stack Constants */ -/** \{ */ - -/** - * \brief Indicates that the stack for the child task should be dynamically allocated. - * - * This value may be supplied as the Stack Pointer argument to CFE_ES_ChildTaskCreate() - * to indicate that the stack should be dynamically allocated. - */ -#define CFE_ES_TASK_STACK_ALLOCATE NULL /* aka OS_TASK_STACK_ALLOCATE in proposed OSAL change */ -/** \} */ - - - - -/*****************************************************************************/ /* -** Type Definitions -*/ - -/* -** Entry Function Prototypes +** Macro Definitions */ -typedef void (*CFE_ES_TaskEntryFuncPtr_t)(void); /**< \brief Required Prototype of Task Main Functions */ -typedef int32 (*CFE_ES_LibraryEntryFuncPtr_t)(CFE_ES_LibId_t LibId); /**< \brief Required Prototype of Library Initialization Functions */ - -/** - * \brief Compatible typedef for ES child task entry point. - * - * All ES task functions (main + child) use the same entry point type. - */ -typedef CFE_ES_TaskEntryFuncPtr_t CFE_ES_ChildTaskMainFuncPtr_t; - -/** - * @brief Type for the stack pointer of tasks. - * - * This type is used in the CFE ES task API. - */ -typedef void* CFE_ES_StackPointer_t; /* aka osal_stackptr_t in proposed OSAL change */ - -/** - * \brief Pool Alignement - * - * Union that can be used for minimum memory alignment of ES memory pools on the target. - * It contains the longest native data types such that the alignment of this structure - * should reflect the largest possible alignment requirements for any data on this processor. - */ -typedef union CFE_ES_PoolAlign -{ - void *Ptr; /**< \brief Aligned pointer */ - /* note -- native types (int/double) are intentional here */ - long long int LongInt; /**< \brief Aligned Long Integer */ - long double LongDouble; /**< \brief Aligned Long Double */ -} CFE_ES_PoolAlign_t; - -/** - * \brief Static Pool Type - * - * A macro to help instantiate static memory pools that are correctly aligned. - * This resolves to a union type that contains a member called "Data" that will - * be correctly aligned to be a memory pool and sized according to the argument. - */ -#define CFE_ES_STATIC_POOL_TYPE(size) union { CFE_ES_PoolAlign_t Align; uint8 Data[size]; } -/** - * @brief Pointer type used for memory pool API - * - * This is used in the Get/Put API calls to refer to a pool buffer. - * - * This pointer is expected to be type cast to the real object - * type after getting a new buffer. Using void* allows this - * type conversion to occur easily. - * - * @note Older versions of CFE implemented the API using a uint32*, - * which required explicit type casting everywhere it was called. - * Although the API type is now void* to make usage easier, the - * pool buffers are aligned to machine requirements - typically 64 bits. - */ -typedef void* CFE_ES_MemPoolBuf_t; +#define CFE_ES_DBIT(x) (1L << (x)) /* Places a one at bit positions 0 thru 31 */ +#define CFE_ES_DTEST(i,x) (((i) & CFE_ES_DBIT(x)) != 0) /* true iff bit x of i is set */ +#define CFE_ES_TEST_LONG_MASK(m,s) (CFE_ES_DTEST(m[(s)/32],(s)%32)) /* Test a bit within an array of 32-bit integers. */ -/** - * @brief Conversion macro to create buffer pointer from another type - * - * In cases where the actual buffer pointer is computed, this macro - * aids in converting the computed address (typically an OSAL "cpuaddr" - * type) into a buffer pointer. - * - * @note Any address calculation needs to take machine alignment - * requirements into account. - */ -#define CFE_ES_MEMPOOLBUF_C(x) ((CFE_ES_MemPoolBuf_t)(x)) /*****************************************************************************/ /* @@ -1822,4 +1672,4 @@ CFE_Status_t CFE_ES_GetGenCounterName(char *CounterName, CFE_ES_CounterId_t Coun /**@}*/ -#endif /* _cfe_es_ */ +#endif /* CFE_ES_API_H */ diff --git a/modules/core_api/fsw/inc/cfe_es_api_typedefs.h b/modules/core_api/fsw/inc/cfe_es_api_typedefs.h new file mode 100644 index 000000000..4912aa70c --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_es_api_typedefs.h @@ -0,0 +1,193 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_es_api_typedefs.h +** +** Purpose: +** Unit specification for Executive Services library functions and macros. +** +** References: +** Flight Software Branch C Coding Standard Version 1.0a +** cFE Flight Software Application Developers Guide +** +** Notes: +** +*/ + +#ifndef CFE_ES_ABSTRACT_TYPES_H +#define CFE_ES_ABSTRACT_TYPES_H + +/* +** Includes +*/ +#include "common_types.h" +#include "cfe_es_extern_typedefs.h" + + + +/* +** Note about reset type and subtypes: +** +** These values come from the PSP so the actual definition of these enumerations +** was moved to the PSP header file . +** +** In the future the Electronic Data sheets (EDS) for PSP/ES +** will define the exact values to use in telemetry messages. +*/ + +/* +** Reset types +*/ +/** \name Reset Type extensions */ +/** \{ */ +#define CFE_ES_APP_RESTART CFE_PSP_RST_TYPE_MAX /**< Application only was reset (extend the PSP enumeration here) */ +/** \} */ + + +/*****************************************************************************/ +/* +** Type Definitions +*/ + +/* +** Entry Function Prototypes +*/ +typedef void (*CFE_ES_TaskEntryFuncPtr_t)(void); /**< \brief Required Prototype of Task Main Functions */ +typedef int32 (*CFE_ES_LibraryEntryFuncPtr_t)(CFE_ES_LibId_t LibId); /**< \brief Required Prototype of Library Initialization Functions */ + +/** + * \brief Compatible typedef for ES child task entry point. + * + * All ES task functions (main + child) use the same entry point type. + */ +typedef CFE_ES_TaskEntryFuncPtr_t CFE_ES_ChildTaskMainFuncPtr_t; + +/** + * @brief Type for the stack pointer of tasks. + * + * This type is used in the CFE ES task API. + */ +typedef void* CFE_ES_StackPointer_t; /* aka osal_stackptr_t in proposed OSAL change */ + +/** + * \brief Pool Alignement + * + * Union that can be used for minimum memory alignment of ES memory pools on the target. + * It contains the longest native data types such that the alignment of this structure + * should reflect the largest possible alignment requirements for any data on this processor. + */ +typedef union CFE_ES_PoolAlign +{ + void *Ptr; /**< \brief Aligned pointer */ + /* note -- native types (int/double) are intentional here */ + long long int LongInt; /**< \brief Aligned Long Integer */ + long double LongDouble; /**< \brief Aligned Long Double */ +} CFE_ES_PoolAlign_t; + +/** + * \brief Static Pool Type + * + * A macro to help instantiate static memory pools that are correctly aligned. + * This resolves to a union type that contains a member called "Data" that will + * be correctly aligned to be a memory pool and sized according to the argument. + */ +#define CFE_ES_STATIC_POOL_TYPE(size) union { CFE_ES_PoolAlign_t Align; uint8 Data[size]; } + + +/** + * @brief Pointer type used for memory pool API + * + * This is used in the Get/Put API calls to refer to a pool buffer. + * + * This pointer is expected to be type cast to the real object + * type after getting a new buffer. Using void* allows this + * type conversion to occur easily. + * + * @note Older versions of CFE implemented the API using a uint32*, + * which required explicit type casting everywhere it was called. + * Although the API type is now void* to make usage easier, the + * pool buffers are aligned to machine requirements - typically 64 bits. + */ +typedef void* CFE_ES_MemPoolBuf_t; + +/** + * @brief Conversion macro to create buffer pointer from another type + * + * In cases where the actual buffer pointer is computed, this macro + * aids in converting the computed address (typically an OSAL "cpuaddr" + * type) into a buffer pointer. + * + * @note Any address calculation needs to take machine alignment + * requirements into account. + */ +#define CFE_ES_MEMPOOLBUF_C(x) ((CFE_ES_MemPoolBuf_t)(x)) + +/** \name Conversions for ES resource IDs */ +/** \{ */ + +/* + * Conversion macros for each ES resource ID subtype + * + * These accept a generic/non-specific CFE_ResourceId_t value + * and convert it to the corresponding resource-specific type. + * + * These should only be used when with the resource ID constants, + * or where the code has confirmed or is determining the generic + * identifier does correspond to a resource of that type. + */ +#define CFE_ES_APPID_C(val) ((CFE_ES_AppId_t)CFE_RESOURCEID_WRAP(val)) +#define CFE_ES_TASKID_C(val) ((CFE_ES_TaskId_t)CFE_RESOURCEID_WRAP(val)) +#define CFE_ES_LIBID_C(val) ((CFE_ES_LibId_t)CFE_RESOURCEID_WRAP(val)) +#define CFE_ES_COUNTERID_C(val) ((CFE_ES_CounterId_t)CFE_RESOURCEID_WRAP(val)) +#define CFE_ES_MEMHANDLE_C(val) ((CFE_ES_MemHandle_t)CFE_RESOURCEID_WRAP(val)) +#define CFE_ES_CDSHANDLE_C(val) ((CFE_ES_CDSHandle_t)CFE_RESOURCEID_WRAP(val)) + +/** \} */ + +/** \name Type-specific initalizers for "undefined" resource IDs */ +/** \{ */ + +#define CFE_ES_APPID_UNDEFINED CFE_ES_APPID_C(CFE_RESOURCEID_UNDEFINED) +#define CFE_ES_TASKID_UNDEFINED CFE_ES_TASKID_C(CFE_RESOURCEID_UNDEFINED) +#define CFE_ES_LIBID_UNDEFINED CFE_ES_LIBID_C(CFE_RESOURCEID_UNDEFINED) +#define CFE_ES_COUNTERID_UNDEFINED CFE_ES_COUNTERID_C(CFE_RESOURCEID_UNDEFINED) +#define CFE_ES_MEMHANDLE_UNDEFINED CFE_ES_MEMHANDLE_C(CFE_RESOURCEID_UNDEFINED) +#define CFE_ES_CDS_BAD_HANDLE CFE_ES_CDSHANDLE_C(CFE_RESOURCEID_UNDEFINED) +/** \} */ + +/** \name Task Stack Constants */ +/** \{ */ + +/** + * \brief Indicates that the stack for the child task should be dynamically allocated. + * + * This value may be supplied as the Stack Pointer argument to CFE_ES_ChildTaskCreate() + * to indicate that the stack should be dynamically allocated. + */ +#define CFE_ES_TASK_STACK_ALLOCATE NULL /* aka OS_TASK_STACK_ALLOCATE in proposed OSAL change */ +/** \} */ + +#define CFE_ES_NO_MUTEX false /**< \brief Indicates that the memory pool selection will not use a semaphore */ +#define CFE_ES_USE_MUTEX true /**< \brief Indicates that the memory pool selection will use a semaphore */ + + + +#endif /* CFE_ES_ABSTRACT_TYPES_H */ diff --git a/modules/core_api/fsw/inc/cfe_es_core_internal.h b/modules/core_api/fsw/inc/cfe_es_core_internal.h new file mode 100644 index 000000000..2bc22d2c4 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_es_core_internal.h @@ -0,0 +1,141 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_es.h +** +** Purpose: +** Unit specification for Executive Services library functions and macros. +** +** References: +** Flight Software Branch C Coding Standard Version 1.0a +** cFE Flight Software Application Developers Guide +** +** Notes: +** +*/ + +#ifndef CFE_ES_CORE_INTERNAL_H +#define CFE_ES_CORE_INTERNAL_H + +#include "common_types.h" +#include "cfe_es_extern_typedefs.h" + +/* + * The internal APIs prototyped within this block are only intended to be invoked from + * other CFE core apps. They still need to be prototyped in the shared header such that + * they can be called from other core modules, but applications should not call these. + */ + +/** @defgroup CFEAPIESCoreInternal cFE Internal Executive Service APIs, internal to CFE core + * @{ + */ + + +/*****************************************************************************/ +/** +** \brief Entry Point for cFE Core Application +** +** \par Description +** This is the entry point to the cFE ES Core Application. +** +** \par Assumptions, External Events, and Notes: +** None +** +** +******************************************************************************/ +extern void CFE_ES_TaskMain(void); + + +/*****************************************************************************/ +/** +** \brief Initializes the cFE core module API Library +** +** \par Description +** Initializes the cFE core module API Library +** +** \par Assumptions, External Events, and Notes: +** -# This function MUST be called before any module API's are called. +** +******************************************************************************/ +extern int32 CFE_ES_CDS_EarlyInit(void); + + +/*****************************************************************************/ +/** +** \brief Reserve space (or re-obtain previously reserved space) in the Critical Data Store (CDS) +** +** \par Description +** This routine is identical to #CFE_ES_RegisterCDS except it identifies the contents +** of the CDS as a critical table. This is crucial because a critical table CDS must +** only be deleted by cFE Table Services, not via an ES delete CDS command. Otherwise, +** Table Services may be out of sync with the contents of the CDS. +** +** \par Assumptions, External Events, and Notes: +** -# This function assumes input parameters are error free and have met size/value restrictions. +** -# The calling function is responsible for issuing any event messages associated with errors. +** +** \param[in, out] HandlePtr Pointer Application's variable that will contain the CDS Memory Block Handle. *HandlePtr is the handle of the CDS block that can be used in #CFE_ES_CopyToCDS and #CFE_ES_RestoreFromCDS. +** +** \param[in] UserBlockSize The number of bytes needed in the CDS. +** +** \param[in] Name Pointer to character string containing the Application's local name for +** the CDS. +** +** \param[in] CriticalTbl Indicates whether the CDS is to be used as a Critical Table or not +** +** +** \return See return codes for #CFE_ES_RegisterCDS +** +******************************************************************************/ +int32 CFE_ES_RegisterCDSEx(CFE_ES_CDSHandle_t *HandlePtr, size_t UserBlockSize, const char *Name, bool CriticalTbl); + +/*****************************************************************************/ +/** +** \brief Deletes the specified CDS from the CDS Registry and frees CDS Memory +** +** \par Description +** Removes the record of the specified CDS from the CDS Registry and +** frees the associated CDS memory for future use. +** +** \par Assumptions, External Events, and Notes: +** None +** +** \param[in] CDSName - Pointer to character string containing complete +** CDS Name (of the format "AppName.CDSName"). +** +** \param[in] CalledByTblServices - Flag that identifies whether the CDS is supposed to +** be a Critical Table Image or not. +** +** \return #CFE_SUCCESS \copydoc CFE_SUCCESS +** \return #CFE_ES_CDS_WRONG_TYPE_ERR \copydoc CFE_ES_CDS_WRONG_TYPE_ERR +** \return #CFE_ES_CDS_OWNER_ACTIVE_ERR \copydoc CFE_ES_CDS_OWNER_ACTIVE_ERR +** \return #CFE_ES_ERR_NAME_NOT_FOUND \copydoc CFE_ES_ERR_NAME_NOT_FOUND +** \return Any of the return values from #CFE_ES_UpdateCDSRegistry +** \return Any of the return values from #CFE_ES_GenPoolPutBlock +** +******************************************************************************/ +int32 CFE_ES_DeleteCDS(const char *CDSName, bool CalledByTblServices); + + +/**@}*/ + + +#endif /* CFE_ES_CORE_INTERNAL_H */ diff --git a/fsw/cfe-core/src/inc/cfe_es_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h similarity index 57% rename from fsw/cfe-core/src/inc/cfe_es_extern_typedefs.h rename to modules/core_api/fsw/inc/cfe_es_extern_typedefs.h index 36c2d1ee3..9bc37a8c9 100644 --- a/fsw/cfe-core/src/inc/cfe_es_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h @@ -33,6 +33,7 @@ #include "common_types.h" #include "cfe_resourceid_typedef.h" +#include "cfe_mission_cfg.h" /** * @brief Label definitions associated with CFE_ES_LogMode_Enum_t @@ -436,6 +437,151 @@ typedef uint32 CFE_ES_MemAddress_t; */ #define CFE_ES_MEMADDRESS_C(x) ((CFE_ES_MemAddress_t)((cpuaddr)(x) & 0xFFFFFFFF)) + +/* + * Data Sructures shared between API and Message (CMD/TLM) interfaces + */ + + +/** + * \brief Application Information + * + * Structure that is used to provide information about an app. + * It is primarily used for the QueryOne and QueryAll Commands. + * + * While this structure is primarily intended for Application info, + * it can also represent Library information where only a subset of + * the information applies. + */ +typedef struct CFE_ES_AppInfo +{ + CFE_ResourceId_t ResourceId; /**< \cfetlmmnemonic \ES_APP_ID + \brief Application or Library ID for this resource */ + uint32 Type; /**< \cfetlmmnemonic \ES_APPTYPE + \brief The type of App: CORE or EXTERNAL */ + + char Name[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \ES_APPNAME + \brief The Registered Name of the Application */ + char EntryPoint[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \ES_APPENTRYPT + \brief The Entry Point label for the Application */ + char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \cfetlmmnemonic \ES_APPFILENAME + \brief The Filename of the file containing the Application */ + + CFE_ES_MemOffset_t StackSize; /**< \cfetlmmnemonic \ES_STACKSIZE + \brief The Stack Size of the Application */ + uint32 AddressesAreValid; /**< \cfetlmmnemonic \ES_ADDRVALID + \brief Indicates that the Code, Data, and BSS addresses/sizes are valid */ + CFE_ES_MemAddress_t CodeAddress; /**< \cfetlmmnemonic \ES_CODEADDR + \brief The Address of the Application Code Segment*/ + CFE_ES_MemOffset_t CodeSize; /**< \cfetlmmnemonic \ES_CODESIZE + \brief The Code Size of the Application */ + CFE_ES_MemAddress_t DataAddress; /**< \cfetlmmnemonic \ES_DATAADDR + \brief The Address of the Application Data Segment*/ + CFE_ES_MemOffset_t DataSize; /**< \cfetlmmnemonic \ES_DATASIZE + \brief The Data Size of the Application */ + CFE_ES_MemAddress_t BSSAddress; /**< \cfetlmmnemonic \ES_BSSADDR + \brief The Address of the Application BSS Segment*/ + CFE_ES_MemOffset_t BSSSize; /**< \cfetlmmnemonic \ES_BSSSIZE + \brief The BSS Size of the Application */ + CFE_ES_MemAddress_t StartAddress; /**< \cfetlmmnemonic \ES_STARTADDR + \brief The Start Address of the Application */ + CFE_ES_ExceptionAction_Enum_t ExceptionAction; /**< \cfetlmmnemonic \ES_EXCEPTNACTN + \brief What should occur if Application has an exception + (Restart Application OR Restart Processor) */ + CFE_ES_TaskPriority_Atom_t Priority; /**< \cfetlmmnemonic \ES_PRIORITY + \brief The Priority of the Application */ + CFE_ES_TaskId_t MainTaskId; /**< \cfetlmmnemonic \ES_MAINTASKID + \brief The Application's Main Task ID */ + uint32 ExecutionCounter; /**< \cfetlmmnemonic \ES_MAINTASKEXECNT + \brief The Application's Main Task Execution Counter */ + char MainTaskName[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \ES_MAINTASKNAME + \brief The Application's Main Task ID */ + uint32 NumOfChildTasks; /**< \cfetlmmnemonic \ES_CHILDTASKS + \brief Number of Child tasks for an App */ + +} CFE_ES_AppInfo_t; + +/** + * \brief Task Information + * + * Structure that is used to provide information about a task. It is primarily + * used for the Query All Tasks (#CFE_ES_QUERY_ALL_TASKS_CC) command. + * + * \note There is not currently a telemetry message directly containing this + * data structure, but it does define the format of the data file generated + * by the Query All Tasks command. Therefore it should be considered + * part of the overall telemetry interface. + */ +typedef struct CFE_ES_TaskInfo +{ + CFE_ES_TaskId_t TaskId; /**< \brief Task Id */ + uint32 ExecutionCounter; /**< \brief Task Execution Counter */ + char TaskName[CFE_MISSION_MAX_API_LEN]; /**< \brief Task Name */ + CFE_ES_AppId_t AppId; /**< \brief Parent Application ID */ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Parent Application Name */ + CFE_ES_MemOffset_t StackSize; /**< Size of task stack */ + CFE_ES_TaskPriority_Atom_t Priority; /**< Priority of task */ + uint8 Spare[2]; /**< Spare bytes for alignment */ +} CFE_ES_TaskInfo_t; + +/** + * \brief CDS Register Dump Record + * + * Structure that is used to provide information about a critical data store. + * It is primarily used for the Dump CDS registry (#CFE_ES_DUMP_CDS_REGISTRY_CC) + * command. + * + * \note There is not currently a telemetry message directly containing this + * data structure, but it does define the format of the data file generated + * by the Dump CDS registry command. Therefore it should be considered + * part of the overall telemetry interface. + */ +typedef struct CFE_ES_CDSRegDumpRec +{ + CFE_ES_CDSHandle_t Handle; /**< \brief Handle of CDS */ + CFE_ES_MemOffset_t Size; /**< \brief Size, in bytes, of the CDS memory block */ + bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */ + char Name[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief Processor Unique Name of CDS */ + uint8 ByteAlignSpare[3]; /**< \brief Spare bytes to ensure structure size is multiple of 4 bytes */ +} CFE_ES_CDSRegDumpRec_t; + +/** + * \brief Block statistics + * + * Sub-Structure that is used to provide information about a specific + * block size/bucket within a memory pool. + */ +typedef struct CFE_ES_BlockStats +{ + CFE_ES_MemOffset_t BlockSize; /**< \brief Number of bytes in each of these blocks */ + uint32 NumCreated; /**< \brief Number of Memory Blocks of this size created */ + uint32 NumFree; /**< \brief Number of Memory Blocks of this size that are free */ +} CFE_ES_BlockStats_t; + +/** + * \brief Memory Pool Statistics + * + * Structure that is used to provide information about a memory + * pool. Used by the Memory Pool Stats telemetry message. + * + * \sa #CFE_ES_SEND_MEM_POOL_STATS_CC + */ +typedef struct CFE_ES_MemPoolStats +{ + CFE_ES_MemOffset_t PoolSize; /**< \cfetlmmnemonic \ES_POOLSIZE + \brief Size of Memory Pool (in bytes) */ + uint32 NumBlocksRequested; /**< \cfetlmmnemonic \ES_BLKSREQ + \brief Number of times a memory block has been allocated */ + uint32 CheckErrCtr; /**< \cfetlmmnemonic \ES_BLKERRCTR + \brief Number of errors detected when freeing a memory block */ + CFE_ES_MemOffset_t NumFreeBytes; /**< \cfetlmmnemonic \ES_FREEBYTES + \brief Number of bytes never allocated to a block */ + CFE_ES_BlockStats_t BlockStats[CFE_MISSION_ES_POOL_MAX_BUCKETS]; /**< \cfetlmmnemonic \ES_BLKSTATS + \brief Contains stats on each block size */ +} CFE_ES_MemPoolStats_t; + + + #endif /* CFE_EDS_ENABLED_BUILD */ #endif /* _CFE_ES_EXTERN_TYPEDEFS_H_ */ diff --git a/fsw/cfe-core/src/inc/cfe_evs.h b/modules/core_api/fsw/inc/cfe_evs.h similarity index 88% rename from fsw/cfe-core/src/inc/cfe_evs.h rename to modules/core_api/fsw/inc/cfe_evs.h index 104fc05d6..9546562c3 100644 --- a/fsw/cfe-core/src/inc/cfe_evs.h +++ b/modules/core_api/fsw/inc/cfe_evs.h @@ -32,33 +32,16 @@ ** Flight Software Branch C Coding Standard Version 1.0a **/ -#ifndef _cfe_evs_ -#define _cfe_evs_ +#ifndef CFE_EVS_API_H +#define CFE_EVS_API_H /********************************** Include Files ************************************/ -#include "cfe_evs_extern_typedefs.h" -#include "cfe_error.h" #include "common_types.h" /* Basic data types */ -#include "cfe_time.h" /* Time library function definitions */ -#include "cfe_evs_msg.h" /* EVS command codes and data structures*/ -#include "osapi.h" -#include "cfe_sb.h" - - - - - +#include "cfe_error.h" +#include "cfe_evs_api_typedefs.h" +#include "cfe_es_api_typedefs.h" +#include "cfe_time_api_typedefs.h" -/******************* Macro Definitions ***********************/ - -/* -** The OS_PRINTF macro may be defined by OSAL to enable -** printf-style argument checking. If using a version of OSAL -** that does not define this then define it as a no-op. -*/ -#ifndef OS_PRINTF -#define OS_PRINTF(m,n) -#endif /* ** Utility macros to make for simpler/more compact/readable code. @@ -69,32 +52,6 @@ #define CFE_EVS_SendErr(E,...) CFE_EVS_Send(E, ERROR, __VA_ARGS__) #define CFE_EVS_SendCrit(E,...) CFE_EVS_Send(E, CRITICAL, __VA_ARGS__) -/** \name Common Event Filter Mask Values */ -/** \{ */ -#define CFE_EVS_NO_FILTER 0x0000 /**< \brief Stops any filtering. All messages are sent. */ -#define CFE_EVS_FIRST_ONE_STOP 0xFFFF /**< \brief Sends the first event. All remaining messages are filtered. */ -#define CFE_EVS_FIRST_TWO_STOP 0xFFFE /**< \brief Sends the first 2 events. All remaining messages are filtered. */ -#define CFE_EVS_FIRST_4_STOP 0xFFFC /**< \brief Sends the first 4 events. All remaining messages are filtered. */ -#define CFE_EVS_FIRST_8_STOP 0xFFF8 /**< \brief Sends the first 8 events. All remaining messages are filtered. */ -#define CFE_EVS_FIRST_16_STOP 0xFFF0 /**< \brief Sends the first 16 events. All remaining messages are filtered. */ -#define CFE_EVS_FIRST_32_STOP 0xFFE0 /**< \brief Sends the first 32 events. All remaining messages are filtered. */ -#define CFE_EVS_FIRST_64_STOP 0xFFC0 /**< \brief Sends the first 64 events. All remaining messages are filtered. */ -#define CFE_EVS_EVERY_OTHER_ONE 0x0001 /**< \brief Sends every other event. */ -#define CFE_EVS_EVERY_OTHER_TWO 0x0002 /**< \brief Sends two, filters one, sends two, filters one, etc */ -#define CFE_EVS_EVERY_FOURTH_ONE 0x0003 /**< \brief Sends every fourth event message. All others are filtered. */ -/** \} */ - -/****************** Structure Definitions *********************/ - -/** \brief Event message filter defintion structure */ -typedef struct CFE_EVS_BinFilter { - uint16 EventID; /**< \brief Numerical event identifier */ - uint16 Mask; /**< \brief Binary filter mask value */ - -} CFE_EVS_BinFilter_t; - -/* Command packet structures */ - /****************** Function Prototypes **********************/ @@ -380,5 +337,4 @@ CFE_Status_t CFE_EVS_ResetFilter (int16 EventID); CFE_Status_t CFE_EVS_ResetAllFilters ( void ); /**@}*/ - -#endif /* _cfe_evs_ */ +#endif /* CFE_EVS_API_H */ diff --git a/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h b/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h new file mode 100644 index 000000000..427505193 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h @@ -0,0 +1,70 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** Filename: cfe_evs.h +** +** Title: Event Services API Application Library Header File +** +** Purpose: +** Unit specification for Event services library functions and macros. +** +** Design Notes: +** +** References: +** Flight Software Branch C Coding Standard Version 1.0a +**/ + +#ifndef CFE_EVS_ABSTRACT_TYPES_H +#define CFE_EVS_ABSTRACT_TYPES_H + +/********************************** Include Files ************************************/ +#include "common_types.h" /* Basic data types */ +#include "cfe_evs_extern_typedefs.h" + +/** \name Common Event Filter Mask Values */ +/** \{ */ +#define CFE_EVS_NO_FILTER 0x0000 /**< \brief Stops any filtering. All messages are sent. */ +#define CFE_EVS_FIRST_ONE_STOP 0xFFFF /**< \brief Sends the first event. All remaining messages are filtered. */ +#define CFE_EVS_FIRST_TWO_STOP 0xFFFE /**< \brief Sends the first 2 events. All remaining messages are filtered. */ +#define CFE_EVS_FIRST_4_STOP 0xFFFC /**< \brief Sends the first 4 events. All remaining messages are filtered. */ +#define CFE_EVS_FIRST_8_STOP 0xFFF8 /**< \brief Sends the first 8 events. All remaining messages are filtered. */ +#define CFE_EVS_FIRST_16_STOP 0xFFF0 /**< \brief Sends the first 16 events. All remaining messages are filtered. */ +#define CFE_EVS_FIRST_32_STOP 0xFFE0 /**< \brief Sends the first 32 events. All remaining messages are filtered. */ +#define CFE_EVS_FIRST_64_STOP 0xFFC0 /**< \brief Sends the first 64 events. All remaining messages are filtered. */ +#define CFE_EVS_EVERY_OTHER_ONE 0x0001 /**< \brief Sends every other event. */ +#define CFE_EVS_EVERY_OTHER_TWO 0x0002 /**< \brief Sends two, filters one, sends two, filters one, etc */ +#define CFE_EVS_EVERY_FOURTH_ONE 0x0003 /**< \brief Sends every fourth event message. All others are filtered. */ +/** \} */ + + + +/****************** Structure Definitions *********************/ + +/** \brief Event message filter defintion structure */ +typedef struct CFE_EVS_BinFilter { + uint16 EventID; /**< \brief Numerical event identifier */ + uint16 Mask; /**< \brief Binary filter mask value */ + +} CFE_EVS_BinFilter_t; + + + +#endif /* CFE_EVS_ABSTRACT_TYPES_H */ diff --git a/modules/core_api/fsw/inc/cfe_evs_core_internal.h b/modules/core_api/fsw/inc/cfe_evs_core_internal.h new file mode 100644 index 000000000..1c5cce4fc --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_evs_core_internal.h @@ -0,0 +1,95 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** Filename: cfe_evs.h +** +** Title: Event Services API Application Library Header File +** +** Purpose: +** Unit specification for Event services library functions and macros. +** +** Design Notes: +** +** References: +** Flight Software Branch C Coding Standard Version 1.0a +**/ + +#ifndef CFE_EVS_CORE_INTERNAL_H +#define CFE_EVS_CORE_INTERNAL_H + + +#include "common_types.h" +#include "cfe_es_extern_typedefs.h" + +/* + * The internal APIs prototyped within this block are only intended to be invoked from + * other CFE core apps. They still need to be prototyped in the shared header such that + * they can be called from other core modules, but applications should not call these. + */ + +/** @defgroup CFEAPIEVSCoreInternal cFE Internal Event Services APIs, internal to CFE core + * @{ + */ + +/*****************************************************************************/ +/** +** \brief Entry Point for cFE Core Application +** +** \par Description +** This is the entry point to the cFE EVS Core Application. +** +** \par Assumptions, External Events, and Notes: +** None +** +** +******************************************************************************/ +extern void CFE_EVS_TaskMain(void); + +/*****************************************************************************/ +/** +** \brief Initializes the cFE core module API Library +** +** \par Description +** Initializes the cFE core module API Library +** +** \par Assumptions, External Events, and Notes: +** -# This function MUST be called before any module API's are called. +** +******************************************************************************/ +extern int32 CFE_EVS_EarlyInit(void); + +/*****************************************************************************/ +/** +** \brief Removes EVS resources associated with specified Application +** +** \par Description +** This function is called by cFE Executive Services to cleanup after +** an Application has been terminated. It frees resources +** that have been allocated to the specified Application. +** +******************************************************************************/ +extern int32 CFE_EVS_CleanUpApp(CFE_ES_AppId_t AppId); + + +/**@}*/ + + +#endif /* CFE_EVS_CORE_INTERNAL_H */ diff --git a/fsw/cfe-core/src/inc/cfe_evs_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_evs_extern_typedefs.h rename to modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h diff --git a/fsw/cfe-core/src/inc/cfe_fs.h b/modules/core_api/fsw/inc/cfe_fs.h similarity index 80% rename from fsw/cfe-core/src/inc/cfe_fs.h rename to modules/core_api/fsw/inc/cfe_fs.h index 13be4d0c3..dd7f8dcdc 100644 --- a/fsw/cfe-core/src/inc/cfe_fs.h +++ b/modules/core_api/fsw/inc/cfe_fs.h @@ -37,91 +37,12 @@ /* ** Required header files... */ -#include "cfe_fs_extern_typedefs.h" -#include "cfe_error.h" #include "common_types.h" -#include "cfe_time.h" - -/** - * \brief Generalized file types/categories known to FS - * - * This defines different categories of files, where they - * may reside in different default locations of the virtualized file system. - * - * This is different from, and should not be confused with, the "SubType" - * field in the FS header. This value is only used at runtime for FS APIs - * and should not actually appear in any output file or message. - */ -typedef enum -{ - CFE_FS_FileCategory_UNKNOWN, /**< Placeholder, unknown file category */ - CFE_FS_FileCategory_DYNAMIC_MODULE, /**< Dynamically loadable apps/libraries (e.g. .so, .o, .dll, etc) */ - CFE_FS_FileCategory_BINARY_DATA_DUMP, /**< Binary log file generated by various data dump commands */ - CFE_FS_FileCategory_TEXT_LOG, /**< Text-based log file generated by various commands */ - CFE_FS_FileCategory_SCRIPT, /**< Text-based Script files (e.g. ES startup script) */ - CFE_FS_FileCategory_TEMP, /**< Temporary/Ephemeral files */ - CFE_FS_FileCategory_MAX /**< Placeholder, keep last */ -} CFE_FS_FileCategory_t; - -/* - * Because FS is a library not an app, it does not have its own context or - * event IDs. The file writer runs in the context of the ES background task - * on behalf of whatever App requested the file write. - * - * This is a list of abstract events associated with background file write jobs. - * An app requesting the file write must supply a callback function to translate - * these into its own event IDs for feedback (i.e. file complete, error conditions, etc). - */ -typedef enum -{ - CFE_FS_FileWriteEvent_UNDEFINED, /* placeholder, no-op, keep as 0 */ - - CFE_FS_FileWriteEvent_COMPLETE, /**< File is completed successfully */ - CFE_FS_FileWriteEvent_CREATE_ERROR, /**< Unable to create/open file */ - CFE_FS_FileWriteEvent_HEADER_WRITE_ERROR, /**< Unable to write FS header */ - CFE_FS_FileWriteEvent_RECORD_WRITE_ERROR, /**< Unable to write data record */ - - CFE_FS_FileWriteEvent_MAX /* placeholder, no-op, keep last */ - -} CFE_FS_FileWriteEvent_t; - - -/** - * Data Getter routine provided by requester - * - * Outputs a data block. Should return true if the file is complete (last record/EOF), otherwise return false. - */ -typedef bool (*CFE_FS_FileWriteGetData_t)(void *Meta, uint32 RecordNum, void **Buffer, size_t *BufSize); - -/** - * Event generator routine provided by requester - * - * Invoked from certain points in the file write process. Implementation may invoke CFE_EVS_SendEvent() appropriately - * to inform of progress. - */ -typedef void (*CFE_FS_FileWriteOnEvent_t)(void *Meta, CFE_FS_FileWriteEvent_t Event, int32 Status, uint32 RecordNum, size_t BlockSize, size_t Position); - -/** - * \brief External Metadata/State object associated with background file writes - * - * Applications intending to schedule background file write jobs should instantiate - * this object in static/global data memory. This keeps track of the state of the - * file write request(s). - */ -typedef struct CFE_FS_FileWriteMetaData -{ - volatile bool IsPending; /**< Whether request is pending (volatile as it may be checked outside lock) */ - - char FileName[OS_MAX_PATH_LEN]; /**< Name of file to write */ - - /* Data for FS header */ - uint32 FileSubType; /**< Type of file to write (for FS header) */ - char Description[CFE_FS_HDR_DESC_MAX_LEN]; /**< Description of file (for FS header) */ - - CFE_FS_FileWriteGetData_t GetData; /**< Application callback to get a data record */ - CFE_FS_FileWriteOnEvent_t OnEvent; /**< Application callback for abstract event processing */ - -} CFE_FS_FileWriteMetaData_t; +#include "osconfig.h" +#include "cfe_platform_cfg.h" +#include "cfe_error.h" +#include "cfe_fs_api_typedefs.h" +#include "cfe_fs_extern_typedefs.h" /** @defgroup CFEAPIFSHeader cFE File Header Management APIs diff --git a/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h b/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h new file mode 100644 index 000000000..0349ab5a9 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h @@ -0,0 +1,132 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_fs_api_typedefs.h +** +** Purpose: cFE File Services (FS) library API header file +** +** Author: S.Walling/Microtel +** +*/ + +/* +** Ensure that header is included only once... +*/ +#ifndef CFE_FS_ABSTRACT_TYPES_H +#define CFE_FS_ABSTRACT_TYPES_H + + +/* +** Required header files... +*/ +#include "common_types.h" +#include "osconfig.h" +#include "cfe_fs_extern_typedefs.h" + +/** + * \brief Generalized file types/categories known to FS + * + * This defines different categories of files, where they + * may reside in different default locations of the virtualized file system. + * + * This is different from, and should not be confused with, the "SubType" + * field in the FS header. This value is only used at runtime for FS APIs + * and should not actually appear in any output file or message. + */ +typedef enum +{ + CFE_FS_FileCategory_UNKNOWN, /**< Placeholder, unknown file category */ + CFE_FS_FileCategory_DYNAMIC_MODULE, /**< Dynamically loadable apps/libraries (e.g. .so, .o, .dll, etc) */ + CFE_FS_FileCategory_BINARY_DATA_DUMP, /**< Binary log file generated by various data dump commands */ + CFE_FS_FileCategory_TEXT_LOG, /**< Text-based log file generated by various commands */ + CFE_FS_FileCategory_SCRIPT, /**< Text-based Script files (e.g. ES startup script) */ + CFE_FS_FileCategory_TEMP, /**< Temporary/Ephemeral files */ + CFE_FS_FileCategory_MAX /**< Placeholder, keep last */ +} CFE_FS_FileCategory_t; + +/* + * Because FS is a library not an app, it does not have its own context or + * event IDs. The file writer runs in the context of the ES background task + * on behalf of whatever App requested the file write. + * + * This is a list of abstract events associated with background file write jobs. + * An app requesting the file write must supply a callback function to translate + * these into its own event IDs for feedback (i.e. file complete, error conditions, etc). + */ +typedef enum +{ + CFE_FS_FileWriteEvent_UNDEFINED, /* placeholder, no-op, keep as 0 */ + + CFE_FS_FileWriteEvent_COMPLETE, /**< File is completed successfully */ + CFE_FS_FileWriteEvent_CREATE_ERROR, /**< Unable to create/open file */ + CFE_FS_FileWriteEvent_HEADER_WRITE_ERROR, /**< Unable to write FS header */ + CFE_FS_FileWriteEvent_RECORD_WRITE_ERROR, /**< Unable to write data record */ + + CFE_FS_FileWriteEvent_MAX /* placeholder, no-op, keep last */ + +} CFE_FS_FileWriteEvent_t; + + + +/** + * Data Getter routine provided by requester + * + * Outputs a data block. Should return true if the file is complete (last record/EOF), otherwise return false. + */ +typedef bool (*CFE_FS_FileWriteGetData_t)(void *Meta, uint32 RecordNum, void **Buffer, size_t *BufSize); + +/** + * Event generator routine provided by requester + * + * Invoked from certain points in the file write process. Implementation may invoke CFE_EVS_SendEvent() appropriately + * to inform of progress. + */ +typedef void (*CFE_FS_FileWriteOnEvent_t)(void *Meta, CFE_FS_FileWriteEvent_t Event, int32 Status, uint32 RecordNum, size_t BlockSize, size_t Position); + +/** + * \brief External Metadata/State object associated with background file writes + * + * Applications intending to schedule background file write jobs should instantiate + * this object in static/global data memory. This keeps track of the state of the + * file write request(s). + */ +typedef struct CFE_FS_FileWriteMetaData +{ + volatile bool IsPending; /**< Whether request is pending (volatile as it may be checked outside lock) */ + + char FileName[OS_MAX_PATH_LEN]; /**< Name of file to write */ + + /* Data for FS header */ + uint32 FileSubType; /**< Type of file to write (for FS header) */ + char Description[CFE_FS_HDR_DESC_MAX_LEN]; /**< Description of file (for FS header) */ + + CFE_FS_FileWriteGetData_t GetData; /**< Application callback to get a data record */ + CFE_FS_FileWriteOnEvent_t OnEvent; /**< Application callback for abstract event processing */ + +} CFE_FS_FileWriteMetaData_t; + + + +#endif /* CFE_FS_ABSTRACT_TYPES_H */ + +/************************/ +/* End of File Comment */ +/************************/ diff --git a/modules/core_api/fsw/inc/cfe_fs_core_internal.h b/modules/core_api/fsw/inc/cfe_fs_core_internal.h new file mode 100644 index 000000000..66130226c --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_fs_core_internal.h @@ -0,0 +1,69 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_fs.h +** +** Purpose: cFE File Services (FS) library API header file +** +** Author: S.Walling/Microtel +** +*/ + +/* +** Ensure that header is included only once... +*/ +#ifndef CFE_FS_CORE_INTERNAL_H +#define CFE_FS_CORE_INTERNAL_H + +#include "common_types.h" + +/* + * The internal APIs prototyped within this block are only intended to be invoked from + * other CFE core apps. They still need to be prototyped in the shared header such that + * they can be called from other core modules, but applications should not call these. + */ + +/** @defgroup CFEAPIFSCoreInternal cFE Internal File Service APIs, internal to CFE core + * @{ + */ + +/*****************************************************************************/ +/** +** \brief Initializes the cFE core module API Library +** +** \par Description +** Initializes the cFE core module API Library +** +** \par Assumptions, External Events, and Notes: +** -# This function MUST be called before any module API's are called. +** +******************************************************************************/ +extern int32 CFE_FS_EarlyInit(void); + + +/**@}*/ + + +#endif /* CFE_FS_CORE_INTERNAL_H */ + +/************************/ +/* End of File Comment */ +/************************/ diff --git a/fsw/cfe-core/src/inc/cfe_fs_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_fs_extern_typedefs.h rename to modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h diff --git a/fsw/cfe-core/src/inc/cfe_msg_api.h b/modules/core_api/fsw/inc/cfe_msg.h similarity index 99% rename from fsw/cfe-core/src/inc/cfe_msg_api.h rename to modules/core_api/fsw/inc/cfe_msg.h index 3dfe24b4f..ba84ecaf9 100644 --- a/fsw/cfe-core/src/inc/cfe_msg_api.h +++ b/modules/core_api/fsw/inc/cfe_msg.h @@ -31,9 +31,11 @@ #include "common_types.h" #include "cfe_error.h" #include "cfe_msg_hdr.h" -#include "cfe_msg_typedefs.h" -#include "cfe_time.h" -#include "cfe_sb.h" +#include "cfe_msg_api_typedefs.h" + +#include "cfe_es_api_typedefs.h" +#include "cfe_sb_api_typedefs.h" +#include "cfe_time_api_typedefs.h" /** \defgroup CFEAPIMSGHeader cFE Message header APIs * \{ diff --git a/fsw/cfe-core/src/inc/cfe_msg_typedefs.h b/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h similarity index 84% rename from fsw/cfe-core/src/inc/cfe_msg_typedefs.h rename to modules/core_api/fsw/inc/cfe_msg_api_typedefs.h index 4df7bfd41..a2c5ee543 100644 --- a/fsw/cfe-core/src/inc/cfe_msg_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h @@ -87,4 +87,29 @@ typedef enum CFE_MSG_PlaybackFlag CFE_MSG_PlayFlag_Playback /**< \brief Playback */ } CFE_MSG_PlaybackFlag_t; +/* + * Abstract Message Base Types + * + * The concrete definition of these is provided by "cfe_msg_hdr.h" which is + * user-selectable depending on the actual desired message defintion. These + * abstract types are used in the API definition; the API is defined based + * on these abstract types, independent of the actual message definition. + */ + +/** + * \brief cFS generic base message + */ +typedef union CFE_MSG_Message CFE_MSG_Message_t; + +/** + * \brief cFS command header + */ +typedef struct CFE_MSG_CommandHeader CFE_MSG_CommandHeader_t; + +/** + * \brief cFS telemetry header + */ +typedef struct CFE_MSG_TelemetryHeader CFE_MSG_TelemetryHeader_t; + + #endif /* _cfe_msg_typedefs_ */ diff --git a/fsw/cfe-core/src/inc/cfe_resourceid_api.h b/modules/core_api/fsw/inc/cfe_resourceid.h similarity index 87% rename from fsw/cfe-core/src/inc/cfe_resourceid_api.h rename to modules/core_api/fsw/inc/cfe_resourceid.h index 6a1ef4d18..12f2fef27 100644 --- a/fsw/cfe-core/src/inc/cfe_resourceid_api.h +++ b/modules/core_api/fsw/inc/cfe_resourceid.h @@ -19,7 +19,7 @@ */ /** - * \file cfe_resourceid_api.h + * \file cfe_resourceid.h * * Contains global prototypes and definitions related to resource * management and related CFE resource IDs. @@ -40,43 +40,10 @@ #define CFE_RESOURCEID_API_H /* - * The basic resource ID typedef - * - * This is provided via the external resourceid library - * and may be customized by the user/mission preferences. + * The basic resource ID API definitions */ -#include "cfe_resourceid_typedef.h" +#include "cfe_resourceid_api_typedefs.h" -/* -** Defines -*/ - -/** \name Resource ID predefined values */ -/** \{ */ - - -/** - * @brief A resource ID value that represents an undefined/unused resource - * - * This constant may be used to initialize local variables of the - * CFE_ResourceId_t type to a safe value that will not alias a valid ID. - * - * By design, this value is also the result of zeroing a CFE_ResourceId_t - * type via standard functions like memset(), such that objects initialized - * using this method will also be set to safe values. - */ -#define CFE_RESOURCEID_UNDEFINED ((CFE_ResourceId_t) CFE_RESOURCEID_WRAP(0)) - -/** - * @brief A resource ID value that represents a reserved entry - * - * This is not a valid value for any resource type, but is used to mark - * table entries that are not available for use. For instance, this may - * be used while setting up an entry initially. - */ -#define CFE_RESOURCEID_RESERVED ((CFE_ResourceId_t) CFE_RESOURCEID_WRAP(0xFFFFFFFF)) - -/** \} */ /** \name Resource ID test/conversion macros and inline functions */ /** \{ */ diff --git a/modules/core_api/fsw/inc/cfe_resourceid_api_typedefs.h b/modules/core_api/fsw/inc/cfe_resourceid_api_typedefs.h new file mode 100644 index 000000000..89a03bf3e --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_resourceid_api_typedefs.h @@ -0,0 +1,82 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * \file cfe_resourceid_api_typedefs.h + * + * Contains global prototypes and definitions related to resource + * management and related CFE resource IDs. + * + * A CFE ES Resource ID is a common way to identify CFE-managed resources such + * as apps, tasks, counters, memory pools, CDS blocks, and other entities. + * + * Simple operations are provided as inline functions, which + * should alleviate the need to do direct manipulation of resource IDs: + * + * - Check for undefined ID value + * - Check for equality of two ID values + * - Convert ID to simple integer (typically for printing/logging) + * - Convert simple integer to ID (inverse of above) + */ + +#ifndef CFE_RESOURCEID_API_TYPEDEFS_H +#define CFE_RESOURCEID_API_TYPEDEFS_H + +/* + * The basic resource ID typedef + * + * This is provided via the external resourceid library + * and may be customized by the user/mission preferences. + */ +#include "cfe_resourceid_typedef.h" + +/* +** Defines +*/ + +/** \name Resource ID predefined values */ +/** \{ */ + + +/** + * @brief A resource ID value that represents an undefined/unused resource + * + * This constant may be used to initialize local variables of the + * CFE_ResourceId_t type to a safe value that will not alias a valid ID. + * + * By design, this value is also the result of zeroing a CFE_ResourceId_t + * type via standard functions like memset(), such that objects initialized + * using this method will also be set to safe values. + */ +#define CFE_RESOURCEID_UNDEFINED ((CFE_ResourceId_t) CFE_RESOURCEID_WRAP(0)) + +/** + * @brief A resource ID value that represents a reserved entry + * + * This is not a valid value for any resource type, but is used to mark + * table entries that are not available for use. For instance, this may + * be used while setting up an entry initially. + */ +#define CFE_RESOURCEID_RESERVED ((CFE_ResourceId_t) CFE_RESOURCEID_WRAP(0xFFFFFFFF)) + +/** \} */ + + +#endif /* CFE_RESOURCEID_API_TYPEDEFS_H */ diff --git a/fsw/cfe-core/src/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h similarity index 90% rename from fsw/cfe-core/src/inc/cfe_sb.h rename to modules/core_api/fsw/inc/cfe_sb.h index aa7862e37..7c5d99af3 100644 --- a/fsw/cfe-core/src/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -29,90 +29,21 @@ ** ******************************************************************************/ -#ifndef _cfe_sb_ -#define _cfe_sb_ +#ifndef CFE_SB_API_H +#define CFE_SB_API_H /* ** Includes */ -#include "cfe_sb_extern_typedefs.h" -#include "cfe_error.h" -#include "osconfig.h" -#include "cfe_psp.h" #include "common_types.h" -#include "cfe_mission_cfg.h" -#include "ccsds.h" -#include "cfe_time.h" - - -/* -** Defines -*/ -#define CFE_SB_POLL 0 /**< \brief Option used with #CFE_SB_ReceiveBuffer to request immediate pipe status */ -#define CFE_SB_PEND_FOREVER -1 /**< \brief Option used with #CFE_SB_ReceiveBuffer to force a wait for next message */ -#define CFE_SB_SUB_ENTRIES_PER_PKT 20 /**< \brief Configuration parameter used by SBN App */ -#define CFE_SB_SUBSCRIPTION 0 /**< \brief Subtype specifier used in #CFE_SB_SingleSubscriptionTlm_t by SBN App */ -#define CFE_SB_UNSUBSCRIPTION 1 /**< \brief Subtype specified used in #CFE_SB_SingleSubscriptionTlm_t by SBN App */ - -/* ------------------------------------------------------ */ -/* Macro Constants for use with the CFE_SB_MsgId_t type */ -/* ------------------------------------------------------ */ - -/** - * \brief Translation macro to convert from MsgId integer values to opaque/abstract API values - * - * This conversion exists in macro form to allow compile-time evaluation for constants, and - * should not be used directly in application code. - * - * For applications, use the CFE_SB_ValueToMsgId() inline function instead. - * - * \sa CFE_SB_ValueToMsgId() - */ -#define CFE_SB_MSGID_WRAP_VALUE(val) ((CFE_SB_MsgId_t)(val)) - -/** - * \brief Translation macro to convert to MsgId integer values from opaque/abstract API values - * - * This conversion exists in macro form to allow compile-time evaluation for constants, and - * should not be used directly in application code. - * - * For applications, use the CFE_SB_MsgIdToValue() inline function instead. - * - * \sa CFE_SB_MsgIdToValue() - */ -#define CFE_SB_MSGID_UNWRAP_VALUE(mid) ((CFE_SB_MsgId_Atom_t)(mid)) - -/** - * \brief Reserved value for CFE_SB_MsgId_t that will not match any valid MsgId - * - * This rvalue macro can be used for static/compile-time data initialization to ensure that - * the initialized value does not alias to a valid MsgId object. - */ -#define CFE_SB_MSGID_RESERVED CFE_SB_MSGID_WRAP_VALUE(-1) - -/** - * \brief A literal of the CFE_SB_MsgId_t type representing an invalid ID - * - * This value should be used for runtime initialization of CFE_SB_MsgId_t values. - * - * \note This may be a compound literal in a future revision. Per C99, compound - * literals are lvalues, not rvalues, so this value should not be used in - * static/compile-time data initialization. For static data initialization - * purposes (rvalue), #CFE_SB_MSGID_RESERVED should be used instead. - * However, in the current implementation, they are equivalent. - */ -#define CFE_SB_INVALID_MSG_ID CFE_SB_MSGID_RESERVED +#include "cfe_error.h" +#include "cfe_sb_api_typedefs.h" +#include "cfe_es_api_typedefs.h" #ifndef CFE_OMIT_DEPRECATED_6_8 -/** - * \defgroup CFESBPktTypeDefs cFE SB Packet Type Defines - * \{ - */ -#define CFE_SB_PKTTYPE_INVALID CFE_MSG_Type_Invalid /**< \brief #CFE_SB_GetPktType response if message type can not be determined */ -#define CFE_SB_PKTTYPE_CMD CFE_MSG_Type_Cmd /**< \brief #CFE_SB_GetPktType response for command packets */ -#define CFE_SB_PKTTYPE_TLM CFE_MSG_Type_Tlm /**< \brief #CFE_SB_GetPktType response for telemetry packets */ -/** \} */ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ +/* only deprecated functions depend on TIME types */ +#include "cfe_time_api_typedefs.h" +#endif /* ** Macro Definitions @@ -122,80 +53,6 @@ #define CFE_CLR(i,x) ((i) &= ~CFE_BIT(x)) /**< \brief Clears bit x of i */ #define CFE_TST(i,x) (((i) & CFE_BIT(x)) != 0)/**< \brief true(non zero) if bit x of i is set */ -/** - * \brief Cast/Convert a generic CFE_ResourceId_t to a CFE_SB_PipeId_t - */ -#define CFE_SB_PIPEID_C(val) ((CFE_SB_PipeId_t)CFE_RESOURCEID_WRAP(val)) - - -/** - * \brief A CFE_SB_PipeId_t value which is always invalid - * - * This may be used as a safe initializer for CFE_SB_PipeId_t values - */ -#define CFE_SB_INVALID_PIPE CFE_SB_PIPEID_C(CFE_RESOURCEID_UNDEFINED) - -/* -** Pipe option bit fields. -*/ -#define CFE_SB_PIPEOPTS_IGNOREMINE 0x00000001 /**< \brief Messages sent by the app that owns this pipe will not be sent to this pipe. */ - -/* -** Type Definitions -*/ - -/** \brief Software Bus generic message */ -typedef union CFE_SB_Msg { - CFE_MSG_Message_t Msg; /**< \brief Base message type without enforced alignment */ - long long int LongInt; /**< \brief Align to support Long Integer */ - long double LongDouble; /**< \brief Align to support Long Double */ -} CFE_SB_Buffer_t; - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/** \brief Deperecated type to minimize required changes */ -typedef CFE_SB_Buffer_t CFE_SB_Msg_t; - -/** \brief Deperecated type to minimize required changes */ -typedef CFE_MSG_CommandHeader_t CFE_SB_CmdHdr_t; - -/** \brief Deperecated type to minimize required changes */ -typedef CFE_MSG_TelemetryHeader_t CFE_SB_TlmHdr_t; - -#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t))/**< \brief Size of command header */ -#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_MSG_TelemetryHeader_t))/**< \brief Size of telemetry header */ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/** \brief Pointer to an SB Message */ -typedef CFE_MSG_Message_t *CFE_SB_MsgPtr_t; - -/** \brief CFE_SB_MsgPayloadPtr_t defined as an opaque pointer to a message Payload portion */ -typedef uint8 *CFE_SB_MsgPayloadPtr_t; -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - -/** \brief CFE_SB_ZeroCopyHandle_t to primitive type definition -** -** Software Zero Copy handle used in many SB APIs -*/ -typedef struct -{ - struct CFE_SB_BufferD* BufDscPtr; /* abstract descriptor reference (internal use) */ -} CFE_SB_ZeroCopyHandle_t; - -/** \brief Quality Of Service Type Definition -** -** Currently an unused parameter in #CFE_SB_SubscribeEx -** Intended to be used for interprocessor communication only -**/ -typedef struct { - uint8 Priority;/**< \brief Specify high(1) or low(0) message priority for off-board routing, currently unused */ - uint8 Reliability;/**< \brief Specify high(1) or low(0) message transfer reliability for off-board routing, currently unused */ -}CFE_SB_Qos_t; - -#define CFE_SB_DEFAULT_QOS ((CFE_SB_Qos_t) {0}) /**< \brief Default Qos macro */ -#ifndef CFE_OMIT_DEPRECATED_6_8 -#define CFE_SB_Default_Qos CFE_SB_DEFAULT_QOS /**< \deprecated use CFE_SB_DEFAULT_QOS */ -#endif /****************** Function Prototypes **********************/ @@ -1460,5 +1317,5 @@ uint32 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId); /**@}*/ -#endif /* _cfe_sb_ */ +#endif /* CFE_SB_API_H */ /*****************************************************************************/ diff --git a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h new file mode 100644 index 000000000..942931395 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -0,0 +1,190 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/****************************************************************************** +** File: cfe_sb.h +** +** Purpose: +** This header file contains all definitions for the cFE Software Bus +** Application Programmer's Interface. +** +** Author: R.McGraw/SSI +** +******************************************************************************/ + +#ifndef CFE_SB_API_TYPEDEFS_H +#define CFE_SB_API_TYPEDEFS_H + +/* +** Includes +*/ +#include "common_types.h" +#include "cfe_sb_extern_typedefs.h" +#include "cfe_msg_api_typedefs.h" +#include "cfe_resourceid_api_typedefs.h" +#include "cfe_msg_hdr.h" + +/* +** Defines +*/ +#define CFE_SB_POLL 0 /**< \brief Option used with #CFE_SB_ReceiveBuffer to request immediate pipe status */ +#define CFE_SB_PEND_FOREVER -1 /**< \brief Option used with #CFE_SB_ReceiveBuffer to force a wait for next message */ +#define CFE_SB_SUBSCRIPTION 0 /**< \brief Subtype specifier used in #CFE_SB_SingleSubscriptionTlm_t by SBN App */ +#define CFE_SB_UNSUBSCRIPTION 1 /**< \brief Subtype specified used in #CFE_SB_SingleSubscriptionTlm_t by SBN App */ + +/* ------------------------------------------------------ */ +/* Macro Constants for use with the CFE_SB_MsgId_t type */ +/* ------------------------------------------------------ */ + +/** + * \brief Translation macro to convert from MsgId integer values to opaque/abstract API values + * + * This conversion exists in macro form to allow compile-time evaluation for constants, and + * should not be used directly in application code. + * + * For applications, use the CFE_SB_ValueToMsgId() inline function instead. + * + * \sa CFE_SB_ValueToMsgId() + */ +#define CFE_SB_MSGID_WRAP_VALUE(val) ((CFE_SB_MsgId_t)(val)) + +/** + * \brief Translation macro to convert to MsgId integer values from opaque/abstract API values + * + * This conversion exists in macro form to allow compile-time evaluation for constants, and + * should not be used directly in application code. + * + * For applications, use the CFE_SB_MsgIdToValue() inline function instead. + * + * \sa CFE_SB_MsgIdToValue() + */ +#define CFE_SB_MSGID_UNWRAP_VALUE(mid) ((CFE_SB_MsgId_Atom_t)(mid)) + +/** + * \brief Reserved value for CFE_SB_MsgId_t that will not match any valid MsgId + * + * This rvalue macro can be used for static/compile-time data initialization to ensure that + * the initialized value does not alias to a valid MsgId object. + */ +#define CFE_SB_MSGID_RESERVED CFE_SB_MSGID_WRAP_VALUE(-1) + +/** + * \brief A literal of the CFE_SB_MsgId_t type representing an invalid ID + * + * This value should be used for runtime initialization of CFE_SB_MsgId_t values. + * + * \note This may be a compound literal in a future revision. Per C99, compound + * literals are lvalues, not rvalues, so this value should not be used in + * static/compile-time data initialization. For static data initialization + * purposes (rvalue), #CFE_SB_MSGID_RESERVED should be used instead. + * However, in the current implementation, they are equivalent. + */ +#define CFE_SB_INVALID_MSG_ID CFE_SB_MSGID_RESERVED + +#ifndef CFE_OMIT_DEPRECATED_6_8 +/** + * \defgroup CFESBPktTypeDefs cFE SB Packet Type Defines + * \{ + */ +#define CFE_SB_PKTTYPE_INVALID CFE_MSG_Type_Invalid /**< \brief #CFE_SB_GetPktType response if message type can not be determined */ +#define CFE_SB_PKTTYPE_CMD CFE_MSG_Type_Cmd /**< \brief #CFE_SB_GetPktType response for command packets */ +#define CFE_SB_PKTTYPE_TLM CFE_MSG_Type_Tlm /**< \brief #CFE_SB_GetPktType response for telemetry packets */ +/** \} */ +#endif /* CFE_OMIT_DEPRECATED_6_8 */ + +/** + * \brief Cast/Convert a generic CFE_ResourceId_t to a CFE_SB_PipeId_t + */ +#define CFE_SB_PIPEID_C(val) ((CFE_SB_PipeId_t)CFE_RESOURCEID_WRAP(val)) + + +/** + * \brief A CFE_SB_PipeId_t value which is always invalid + * + * This may be used as a safe initializer for CFE_SB_PipeId_t values + */ +#define CFE_SB_INVALID_PIPE CFE_SB_PIPEID_C(CFE_RESOURCEID_UNDEFINED) + +/* +** Pipe option bit fields. +*/ +#define CFE_SB_PIPEOPTS_IGNOREMINE 0x00000001 /**< \brief Messages sent by the app that owns this pipe will not be sent to this pipe. */ + + +#define CFE_SB_DEFAULT_QOS ((CFE_SB_Qos_t) {0}) /**< \brief Default Qos macro */ + + +/* +** Type Definitions +*/ + +/** \brief Software Bus generic message */ +typedef union CFE_SB_Msg { + CFE_MSG_Message_t Msg; /**< \brief Base message type without enforced alignment */ + long long int LongInt; /**< \brief Align to support Long Integer */ + long double LongDouble; /**< \brief Align to support Long Double */ +} CFE_SB_Buffer_t; + +#ifndef CFE_OMIT_DEPRECATED_6_8 + +/** \brief Deperecated type to minimize required changes */ +typedef CFE_SB_Buffer_t CFE_SB_Msg_t; + +/** \brief Deperecated type to minimize required changes */ +typedef CFE_MSG_CommandHeader_t CFE_SB_CmdHdr_t; + +/** \brief Deperecated type to minimize required changes */ +typedef CFE_MSG_TelemetryHeader_t CFE_SB_TlmHdr_t; + +#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t))/**< \brief Size of command header */ +#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_MSG_TelemetryHeader_t))/**< \brief Size of telemetry header */ + +/** \brief Pointer to an SB Message */ +typedef CFE_MSG_Message_t *CFE_SB_MsgPtr_t; + +/** \brief CFE_SB_MsgPayloadPtr_t defined as an opaque pointer to a message Payload portion */ +typedef uint8 *CFE_SB_MsgPayloadPtr_t; + +#endif /* CFE_OMIT_DEPRECATED_6_8 */ + +/** \brief CFE_SB_ZeroCopyHandle_t to primitive type definition +** +** Software Zero Copy handle used in many SB APIs +*/ +typedef struct +{ + struct CFE_SB_BufferD* BufDscPtr; /* abstract descriptor reference (internal use) */ +} CFE_SB_ZeroCopyHandle_t; + + +#ifndef CFE_OMIT_DEPRECATED_6_8 + +#define CFE_SB_Default_Qos CFE_SB_DEFAULT_QOS /**< \deprecated use CFE_SB_DEFAULT_QOS */ + +#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t))/**< \brief Size of command header */ +#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_MSG_TelemetryHeader_t))/**< \brief Size of telemetry header */ + +#endif /* CFE_OMIT_DEPRECATED_6_8 */ + + + + +#endif /* CFE_SB_API_TYPEDEFS_H */ +/*****************************************************************************/ diff --git a/modules/core_api/fsw/inc/cfe_sb_core_internal.h b/modules/core_api/fsw/inc/cfe_sb_core_internal.h new file mode 100644 index 000000000..ac2e48e48 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_sb_core_internal.h @@ -0,0 +1,93 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/****************************************************************************** +** File: cfe_sb.h +** +** Purpose: +** This header file contains all definitions for the cFE Software Bus +** Application Programmer's Interface. +** +** Author: R.McGraw/SSI +** +******************************************************************************/ + +#ifndef CFE_SB_CORE_INTERNAL_H +#define CFE_SB_CORE_INTERNAL_H + + +#include "common_types.h" +#include "cfe_es_extern_typedefs.h" + +/* + * The internal APIs prototyped within this block are only intended to be invoked from + * other CFE core apps. They still need to be prototyped in the shared header such that + * they can be called from other core modules, but applications should not call these. + */ + +/** @defgroup CFEAPISBCoreInternal cFE Internal Software Bus APIs, internal to CFE core + * @{ + */ + +/*****************************************************************************/ +/** +** \brief Entry Point for cFE Core Application +** +** \par Description +** This is the entry point to the cFE SB Core Application. +** +** \par Assumptions, External Events, and Notes: +** None +** +** +******************************************************************************/ +extern void CFE_SB_TaskMain(void); + +/*****************************************************************************/ +/** +** \brief Initializes the cFE core module API Library +** +** \par Description +** Initializes the cFE core module API Library +** +** \par Assumptions, External Events, and Notes: +** -# This function MUST be called before any module API's are called. +** +******************************************************************************/ +extern int32 CFE_SB_EarlyInit(void); + + +/*****************************************************************************/ +/** +** \brief Removes SB resources associated with specified Application +** +** \par Description +** This function is called by cFE Executive Services to cleanup after +** an Application has been terminated. It frees resources +** that have been allocated to the specified Application. +** +******************************************************************************/ +extern int32 CFE_SB_CleanUpApp(CFE_ES_AppId_t AppId); + + +/**@}*/ + +#endif /* CFE_SB_CORE_INTERNAL_H */ +/*****************************************************************************/ diff --git a/fsw/cfe-core/src/inc/cfe_sb_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h similarity index 86% rename from fsw/cfe-core/src/inc/cfe_sb_extern_typedefs.h rename to modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h index ae0b7fb3a..4db2ada5f 100644 --- a/fsw/cfe-core/src/inc/cfe_sb_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h @@ -35,6 +35,9 @@ #include "cfe_mission_cfg.h" #include "cfe_resourceid_typedef.h" + +#define CFE_SB_SUB_ENTRIES_PER_PKT 20 /**< \brief Configuration parameter used by SBN App */ + /** * @brief Label definitions associated with CFE_SB_QosPriority_Enum_t */ @@ -119,6 +122,16 @@ typedef CFE_SB_MsgId_Atom_t CFE_SB_MsgId_t; */ typedef CFE_RESOURCEID_BASE_TYPE CFE_SB_PipeId_t; +/** \brief Quality Of Service Type Definition +** +** Currently an unused parameter in #CFE_SB_SubscribeEx +** Intended to be used for interprocessor communication only +**/ +typedef struct { + uint8 Priority;/**< \brief Specify high(1) or low(0) message priority for off-board routing, currently unused */ + uint8 Reliability;/**< \brief Specify high(1) or low(0) message transfer reliability for off-board routing, currently unused */ +}CFE_SB_Qos_t; + #endif /* CFE_EDS_ENABLED_BUILD */ diff --git a/fsw/cfe-core/src/inc/cfe_tbl.h b/modules/core_api/fsw/inc/cfe_tbl.h similarity index 90% rename from fsw/cfe-core/src/inc/cfe_tbl.h rename to modules/core_api/fsw/inc/cfe_tbl.h index 653d57be1..8952f21ed 100644 --- a/fsw/cfe-core/src/inc/cfe_tbl.h +++ b/modules/core_api/fsw/inc/cfe_tbl.h @@ -35,101 +35,15 @@ ** **/ -#ifndef _cfe_tbl_ -#define _cfe_tbl_ +#ifndef CFE_TBL_API_H +#define CFE_TBL_API_H /********************* Include Files ************************/ -#include "cfe_tbl_extern_typedefs.h" -#include "cfe_sb_extern_typedefs.h" -#include "cfe_error.h" #include "common_types.h" /* Basic Data Types */ -#include "cfe_time.h" -#include "osconfig.h" -#include "cfe_msg_typedefs.h" - -/******************* Macro Definitions ***********************/ - -/** @defgroup CFETBLTypeOptions cFE Table Type Defines - * @{ - */ -#define CFE_TBL_OPT_BUFFER_MSK (0x0001) /**< \brief Table buffer mask */ -#define CFE_TBL_OPT_SNGL_BUFFER (0x0000) /**< \brief Single buffer table */ -#define CFE_TBL_OPT_DBL_BUFFER (0x0001) /**< \brief Double buffer table */ - -#define CFE_TBL_OPT_LD_DMP_MSK (0x0002) /**< \brief Table load/dump mask */ -#define CFE_TBL_OPT_LOAD_DUMP (0x0000) /**< \brief Load/Dump table */ -#define CFE_TBL_OPT_DUMP_ONLY (0x0002) /**< \brief Dump only table */ - -#define CFE_TBL_OPT_USR_DEF_MSK (0x0004) /**< \brief Table user defined mask */ -#define CFE_TBL_OPT_NOT_USR_DEF (0x0000) /**< \brief Not user defined table */ -#define CFE_TBL_OPT_USR_DEF_ADDR (0x0006) /**< \brief User Defined table, @note Automatically includes #CFE_TBL_OPT_DUMP_ONLY option */ - -#define CFE_TBL_OPT_CRITICAL_MSK (0x0008) /**< \brief Table critical mask */ -#define CFE_TBL_OPT_NOT_CRITICAL (0x0000) /**< \brief Not critical table */ -#define CFE_TBL_OPT_CRITICAL (0x0008) /**< \brief Critical table */ - -/** @brief Default table options */ -#define CFE_TBL_OPT_DEFAULT (CFE_TBL_OPT_SNGL_BUFFER | CFE_TBL_OPT_LOAD_DUMP) -/**@}*/ - -/** - * \brief Table maximum full name length - * - * The full length of table names is defined at the mission scope. - * This is defined here to support applications that depend on cfe_tbl.h - * providing this value. - */ -#define CFE_TBL_MAX_FULL_NAME_LEN (CFE_MISSION_TBL_MAX_FULL_NAME_LEN) - -/** \brief Bad table handle */ -#define CFE_TBL_BAD_TABLE_HANDLE (CFE_TBL_Handle_t) 0xFFFF - - - - -/****************** Data Type Definitions *********************/ - -/** \brief Table Callback Function */ -typedef int32 (*CFE_TBL_CallbackFuncPtr_t)(void *TblPtr); - -/** \brief Table Handle primitive */ -typedef int16 CFE_TBL_Handle_t; - -/** \brief Table Source */ -typedef enum CFE_TBL_SrcEnum -{ - CFE_TBL_SRC_FILE = 0, /**< \brief File source - When this option is selected, the \c SrcDataPtr - will be interpreted as a pointer to a null - terminated character string. The string should - specify the full path and filename of the file - containing the initial data contents of the table. */ - CFE_TBL_SRC_ADDRESS /**< \brief Address source - When this option is selected, the \c SrcDataPtr will - be interpreted as a pointer to a memory location - that is the beginning of the initialization data - for loading the table OR, in the case of a "user defined" - dump only table, the address of the active table itself. - The block of memory is assumed to be of the same size - specified in the #CFE_TBL_Register function Size parameter. */ -} CFE_TBL_SrcEnum_t; +#include "cfe_error.h" +#include "cfe_tbl_api_typedefs.h" +#include "cfe_sb_api_typedefs.h" -/** \brief Table Info */ -typedef struct CFE_TBL_Info -{ - size_t Size; /**< \brief Size, in bytes, of Table */ - uint32 NumUsers; /**< \brief Number of Apps with access to the table */ - uint32 FileCreateTimeSecs; /**< \brief File creation time from last file loaded into table */ - uint32 FileCreateTimeSubSecs; /**< \brief File creation time from last file loaded into table */ - uint32 Crc; /**< \brief Most recently calculated CRC by TBL services on table contents */ - CFE_TIME_SysTime_t TimeOfLastUpdate; /**< \brief Time when Table was last updated */ - bool TableLoadedOnce; /**< \brief Flag indicating whether table has been loaded once or not */ - bool DumpOnly; /**< \brief Flag indicating Table is NOT to be loaded */ - bool DoubleBuffered; /**< \brief Flag indicating Table has a dedicated inactive buffer */ - bool UserDefAddr; /**< \brief Flag indicating Table address was defined by Owner Application */ - bool Critical; /**< \brief Flag indicating Table contents are maintained in a CDS */ - char LastFileLoaded[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename of last file loaded into table */ -} CFE_TBL_Info_t; /*************************** Function Prototypes ******************************/ @@ -816,4 +730,5 @@ CFE_Status_t CFE_TBL_GetInfo(CFE_TBL_Info_t *TblInfoPtr, const char *TblName); CFE_Status_t CFE_TBL_NotifyByMessage(CFE_TBL_Handle_t TblHandle, CFE_SB_MsgId_t MsgId, CFE_MSG_FcnCode_t CommandCode, uint32 Parameter); /**@}*/ -#endif /* _cfe_tbl_ */ + +#endif /* CFE_TBL_API_H */ diff --git a/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h b/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h new file mode 100644 index 000000000..6707c6791 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h @@ -0,0 +1,127 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_tbl.h +** +** Title: Table Services API Application Library Header File +** +** Purpose: +** Unit specification for Table services library functions and macros. +** +** Design Notes: +** +** References: +** Flight Software Branch C Coding Standard Version 1.0a +** +** Notes: +** +**/ + +#ifndef CFE_TBL_ABSTRACT_TYPES_H +#define CFE_TBL_ABSTRACT_TYPES_H + +/********************* Include Files ************************/ +#include "common_types.h" /* Basic Data Types */ +#include "cfe_tbl_extern_typedefs.h" +#include "cfe_time_extern_typedefs.h" + +/** @defgroup CFETBLTypeOptions cFE Table Type Defines + * @{ + */ +#define CFE_TBL_OPT_BUFFER_MSK (0x0001) /**< \brief Table buffer mask */ +#define CFE_TBL_OPT_SNGL_BUFFER (0x0000) /**< \brief Single buffer table */ +#define CFE_TBL_OPT_DBL_BUFFER (0x0001) /**< \brief Double buffer table */ + +#define CFE_TBL_OPT_LD_DMP_MSK (0x0002) /**< \brief Table load/dump mask */ +#define CFE_TBL_OPT_LOAD_DUMP (0x0000) /**< \brief Load/Dump table */ +#define CFE_TBL_OPT_DUMP_ONLY (0x0002) /**< \brief Dump only table */ + +#define CFE_TBL_OPT_USR_DEF_MSK (0x0004) /**< \brief Table user defined mask */ +#define CFE_TBL_OPT_NOT_USR_DEF (0x0000) /**< \brief Not user defined table */ +#define CFE_TBL_OPT_USR_DEF_ADDR (0x0006) /**< \brief User Defined table, @note Automatically includes #CFE_TBL_OPT_DUMP_ONLY option */ + +#define CFE_TBL_OPT_CRITICAL_MSK (0x0008) /**< \brief Table critical mask */ +#define CFE_TBL_OPT_NOT_CRITICAL (0x0000) /**< \brief Not critical table */ +#define CFE_TBL_OPT_CRITICAL (0x0008) /**< \brief Critical table */ + +/** @brief Default table options */ +#define CFE_TBL_OPT_DEFAULT (CFE_TBL_OPT_SNGL_BUFFER | CFE_TBL_OPT_LOAD_DUMP) +/**@}*/ + +/** + * \brief Table maximum full name length + * + * The full length of table names is defined at the mission scope. + * This is defined here to support applications that depend on cfe_tbl.h + * providing this value. + */ +#define CFE_TBL_MAX_FULL_NAME_LEN (CFE_MISSION_TBL_MAX_FULL_NAME_LEN) + +/** \brief Bad table handle */ +#define CFE_TBL_BAD_TABLE_HANDLE (CFE_TBL_Handle_t) 0xFFFF + + +/****************** Data Type Definitions *********************/ + +/** \brief Table Callback Function */ +typedef int32 (*CFE_TBL_CallbackFuncPtr_t)(void *TblPtr); + +/** \brief Table Handle primitive */ +typedef int16 CFE_TBL_Handle_t; + +/** \brief Table Source */ +typedef enum CFE_TBL_SrcEnum +{ + CFE_TBL_SRC_FILE = 0, /**< \brief File source + When this option is selected, the \c SrcDataPtr + will be interpreted as a pointer to a null + terminated character string. The string should + specify the full path and filename of the file + containing the initial data contents of the table. */ + CFE_TBL_SRC_ADDRESS /**< \brief Address source + When this option is selected, the \c SrcDataPtr will + be interpreted as a pointer to a memory location + that is the beginning of the initialization data + for loading the table OR, in the case of a "user defined" + dump only table, the address of the active table itself. + The block of memory is assumed to be of the same size + specified in the #CFE_TBL_Register function Size parameter. */ +} CFE_TBL_SrcEnum_t; + +/** \brief Table Info */ +typedef struct CFE_TBL_Info +{ + size_t Size; /**< \brief Size, in bytes, of Table */ + uint32 NumUsers; /**< \brief Number of Apps with access to the table */ + uint32 FileCreateTimeSecs; /**< \brief File creation time from last file loaded into table */ + uint32 FileCreateTimeSubSecs; /**< \brief File creation time from last file loaded into table */ + uint32 Crc; /**< \brief Most recently calculated CRC by TBL services on table contents */ + CFE_TIME_SysTime_t TimeOfLastUpdate; /**< \brief Time when Table was last updated */ + bool TableLoadedOnce; /**< \brief Flag indicating whether table has been loaded once or not */ + bool DumpOnly; /**< \brief Flag indicating Table is NOT to be loaded */ + bool DoubleBuffered; /**< \brief Flag indicating Table has a dedicated inactive buffer */ + bool UserDefAddr; /**< \brief Flag indicating Table address was defined by Owner Application */ + bool Critical; /**< \brief Flag indicating Table contents are maintained in a CDS */ + char LastFileLoaded[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename of last file loaded into table */ +} CFE_TBL_Info_t; + + +#endif /* CFE_TBL_ABSTRACT_TYPES_H */ diff --git a/modules/core_api/fsw/inc/cfe_tbl_core_internal.h b/modules/core_api/fsw/inc/cfe_tbl_core_internal.h new file mode 100644 index 000000000..6e3c6f8ed --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_tbl_core_internal.h @@ -0,0 +1,104 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_tbl.h +** +** Title: Table Services API Application Library Header File +** +** Purpose: +** Unit specification for Table services library functions and macros. +** +** Design Notes: +** +** References: +** Flight Software Branch C Coding Standard Version 1.0a +** +** Notes: +** +**/ + +#ifndef CFE_TBL_CORE_INTERNAL_H +#define CFE_TBL_CORE_INTERNAL_H + +#include "common_types.h" +#include "cfe_es_extern_typedefs.h" + + +/* + * The internal APIs prototyped within this block are only intended to be invoked from + * other CFE core apps. They still need to be prototyped in the shared header such that + * they can be called from other core modules, but applications should not call these. + */ + +/** @defgroup CFEAPITBLCoreInternal cFE Internal Table Service APIs, internal to CFE core + * @{ + */ + +/*****************************************************************************/ +/** +** \brief Entry Point for cFE Table Services Core Application +** +** \par Description +** This is the entry point to the cFE Table Services Core Application. +** This Application provides the ground interface to the cFE Table +** Services. +** +** \par Assumptions, External Events, and Notes: +** None +** +** +******************************************************************************/ +extern void CFE_TBL_TaskMain(void); + +/*****************************************************************************/ +/** +** \brief Initializes the Table Services API Library +** +** \par Description +** Initializes the Table Services API Library +** +** \par Assumptions, External Events, and Notes: +** -# This function MUST be called before any TBL API's are called. +** +******************************************************************************/ +extern int32 CFE_TBL_EarlyInit(void); + +/*****************************************************************************/ +/** +** \brief Removes TBL resources associated with specified Application +** +** \par Description +** This function is called by cFE Executive Services to cleanup after +** an Application has been terminated. It frees TBL services resources +** that have been allocated to the specified Application. +** +** \par Assumptions, External Events, and Notes: +** -# This function DOES NOT remove any critical tables associated with +** the specified application from the Critical Data Store. +** +******************************************************************************/ +extern int32 CFE_TBL_CleanUpApp(CFE_ES_AppId_t AppId); + + +/**@}*/ + + +#endif /* CFE_TBL_CORE_INTERNAL_H */ diff --git a/fsw/cfe-core/src/inc/cfe_tbl_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h similarity index 97% rename from fsw/cfe-core/src/inc/cfe_tbl_extern_typedefs.h rename to modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h index 10c05fa7b..0a8300426 100644 --- a/fsw/cfe-core/src/inc/cfe_tbl_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h @@ -33,7 +33,7 @@ #include "common_types.h" #include "cfe_es_extern_typedefs.h" -#include /* for CFE_MISSION_TBL_MAX_FULL_NAME_LEN */ +#include "cfe_mission_cfg.h" /* for CFE_MISSION_TBL_MAX_FULL_NAME_LEN */ /** * @brief Label definitions associated with CFE_TBL_BufferSelect_Enum_t diff --git a/fsw/cfe-core/src/inc/cfe_tbl_filedef.h b/modules/core_api/fsw/inc/cfe_tbl_filedef.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_tbl_filedef.h rename to modules/core_api/fsw/inc/cfe_tbl_filedef.h diff --git a/fsw/cfe-core/src/inc/cfe_time.h b/modules/core_api/fsw/inc/cfe_time.h similarity index 90% rename from fsw/cfe-core/src/inc/cfe_time.h rename to modules/core_api/fsw/inc/cfe_time.h index 71ddc162f..a447a15da 100644 --- a/fsw/cfe-core/src/inc/cfe_time.h +++ b/modules/core_api/fsw/inc/cfe_time.h @@ -39,39 +39,11 @@ /* ** Includes */ -#include "cfe_time_extern_typedefs.h" -#include "cfe_error.h" #include "common_types.h" +#include "cfe_error.h" +#include "cfe_time_api_typedefs.h" +#include "cfe_es_api_typedefs.h" -/*****************************************************************************/ -/* -** Macro Definitions -*/ - -#define CFE_TIME_PRINTED_STRING_SIZE 24 /**< \brief Required size of buffer to be passed into #CFE_TIME_Print (includes null terminator) */ - - -/*****************************************************************************/ -/* -** Type Definitions -*/ - -/** -** \brief Data structure used to hold system time values -** -** \par Description -** The #CFE_TIME_SysTime_t data structure is used to hold time -** values. Time is referred to as the elapsed time (in seconds -** and subseconds) since a specified epoch time. The subseconds -** field contains the number of 2^(-32) second intervals that have -** elapsed since the epoch. -** -*/ -typedef struct CFE_TIME_SysTime -{ - uint32 Seconds; /**< \brief Number of seconds since epoch */ - uint32 Subseconds; /**< \brief Number of subseconds since epoch (LSB = 2^(-32) seconds) */ -} CFE_TIME_SysTime_t; /** ** \brief Time Copy @@ -82,49 +54,6 @@ typedef struct CFE_TIME_SysTime */ #define CFE_TIME_Copy(m,t) { (m)->Seconds = (t)->Seconds; (m)->Subseconds = (t)->Subseconds; } -/** -** \brief Enumerated types identifying the relative relationships of two times -** -** \par Description -** Since time fields contain numbers that are relative to an epoch time, then it is possible for a time value -** to be "negative". This can lead to some confusion about what relationship exists between two time values. -** To resolve this confusion, the cFE provides the API #CFE_TIME_Compare which returns these enumerated values. -*/ -typedef enum CFE_TIME_Compare -{ - CFE_TIME_A_LT_B = -1, /**< \brief The first specified time is considered to be before the second specified time */ - CFE_TIME_EQUAL = 0, /**< \brief The two specified times are considered to be equal */ - CFE_TIME_A_GT_B = 1 /**< \brief The first specified time is considered to be after the second specified time */ -} CFE_TIME_Compare_t; - -/** -** \brief Time related variables that are maintained through a Processor Reset -** -** \par Description -** The #CFE_TIME_ResetVars_t data structure contains those variables that are maintained -** in an area of memory that is not cleared during a Processor Reset. This allows the -** cFE Time Service to maintain time to the best of its ability after a Processor Reset. -*/ -typedef struct CFE_TIME_ResetVars -{ - uint32 Signature; /**< \brief Data validation signature used to verify data structure contents*/ - int16 LeapSeconds; /**< \brief Leap seconds value */ - uint16 ClockSignal; /**< \brief Current clock signal selection */ - CFE_TIME_SysTime_t CurrentMET; /**< \brief Current Mission Elapsed Time (MET) */ - CFE_TIME_SysTime_t CurrentSTCF; /**< \brief Current Spacecraft Time Correlation Factor (STCF) */ - CFE_TIME_SysTime_t CurrentDelay; /**< \brief Current time client delay value */ - -} CFE_TIME_ResetVars_t; - -/** -** \brief Time Synchronization Callback Function Ptr Type -** -** \par Description -** Applications that wish to get direct notification of the receipt of the cFE Time Synchronization signal -** (typically a 1 Hz signal), must register a callback function with the following prototype via the -** #CFE_TIME_RegisterSynchCallback API. -*/ -typedef int32 (*CFE_TIME_SynchCallbackPtr_t)(void); /*****************************************************************************/ /* @@ -795,6 +724,7 @@ void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint); void CFE_TIME_Local1HzISR(void); /**@}*/ + #endif /* _cfe_time_ */ /************************/ diff --git a/modules/core_api/fsw/inc/cfe_time_api_typedefs.h b/modules/core_api/fsw/inc/cfe_time_api_typedefs.h new file mode 100644 index 000000000..dafe8f511 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_time_api_typedefs.h @@ -0,0 +1,88 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_time.h +** +** Purpose: cFE Time Services (TIME) library API header file +** +** Author: S.Walling/Microtel +** +** Notes: +** +*/ + +/* +** Ensure that header is included only once... +*/ +#ifndef CFE_TIME_API_TYPES_H +#define CFE_TIME_API_TYPES_H + + +/* +** Includes +*/ +#include "common_types.h" +#include "cfe_time_extern_typedefs.h" + +/*****************************************************************************/ +/* +** Macro Definitions +*/ + +#define CFE_TIME_PRINTED_STRING_SIZE 24 /**< \brief Required size of buffer to be passed into #CFE_TIME_Print (includes null terminator) */ + + +/*****************************************************************************/ +/* +** Type Definitions +*/ + +/** +** \brief Enumerated types identifying the relative relationships of two times +** +** \par Description +** Since time fields contain numbers that are relative to an epoch time, then it is possible for a time value +** to be "negative". This can lead to some confusion about what relationship exists between two time values. +** To resolve this confusion, the cFE provides the API #CFE_TIME_Compare which returns these enumerated values. +*/ +typedef enum CFE_TIME_Compare +{ + CFE_TIME_A_LT_B = -1, /**< \brief The first specified time is considered to be before the second specified time */ + CFE_TIME_EQUAL = 0, /**< \brief The two specified times are considered to be equal */ + CFE_TIME_A_GT_B = 1 /**< \brief The first specified time is considered to be after the second specified time */ +} CFE_TIME_Compare_t; + +/** +** \brief Time Synchronization Callback Function Ptr Type +** +** \par Description +** Applications that wish to get direct notification of the receipt of the cFE Time Synchronization signal +** (typically a 1 Hz signal), must register a callback function with the following prototype via the +** #CFE_TIME_RegisterSynchCallback API. +*/ +typedef int32 (*CFE_TIME_SynchCallbackPtr_t)(void); + + +#endif /* CFE_TIME_API_TYPES_H */ + +/************************/ +/* End of File Comment */ +/************************/ diff --git a/modules/core_api/fsw/inc/cfe_time_core_internal.h b/modules/core_api/fsw/inc/cfe_time_core_internal.h new file mode 100644 index 000000000..96e3dc7e1 --- /dev/null +++ b/modules/core_api/fsw/inc/cfe_time_core_internal.h @@ -0,0 +1,98 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_time_core_internal.h +** +** Purpose: cFE Time Services (TIME) library API header file +** +** Author: S.Walling/Microtel +** +** Notes: +** +*/ + +/* +** Ensure that header is included only once... +*/ +#ifndef CFE_TIME_CORE_INTERNAL_H +#define CFE_TIME_CORE_INTERNAL_H + +#include "common_types.h" +#include "cfe_es_extern_typedefs.h" + +/* + * The internal APIs prototyped within this block are only intended to be invoked from + * other CFE core apps. They still need to be prototyped in the shared header such that + * they can be called from other core modules, but applications should not call these. + */ + +/** @defgroup CFEAPITIMECoreInternal cFE Internal Time APIs, internal to CFE core + * @{ + */ + +/*****************************************************************************/ +/** +** \brief Entry Point for cFE Core Application +** +** \par Description +** This is the entry point to the cFE TIME Core Application. +** +** \par Assumptions, External Events, and Notes: +** None +** +** +******************************************************************************/ +extern void CFE_TIME_TaskMain(void); + +/*****************************************************************************/ +/** +** \brief Initializes the cFE core module API Library +** +** \par Description +** Initializes the cFE core module API Library +** +** \par Assumptions, External Events, and Notes: +** -# This function MUST be called before any module API's are called. +** +******************************************************************************/ +extern int32 CFE_TIME_EarlyInit(void); + +/*****************************************************************************/ +/** +** \brief Removes TIME resources associated with specified Application +** +** \par Description +** This function is called by cFE Executive Services to cleanup after +** an Application has been terminated. It frees resources +** that have been allocated to the specified Application. +** +******************************************************************************/ +extern int32 CFE_TIME_CleanUpApp(CFE_ES_AppId_t AppId); + + +/**@}*/ + + +#endif /* CFE_TIME_CORE_INTERNAL_H */ + +/************************/ +/* End of File Comment */ +/************************/ diff --git a/fsw/cfe-core/src/inc/cfe_time_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h similarity index 92% rename from fsw/cfe-core/src/inc/cfe_time_extern_typedefs.h rename to modules/core_api/fsw/inc/cfe_time_extern_typedefs.h index cd8feff4d..2fc4e943d 100644 --- a/fsw/cfe-core/src/inc/cfe_time_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h @@ -33,6 +33,23 @@ #include "common_types.h" +/** +** \brief Data structure used to hold system time values +** +** \par Description +** The #CFE_TIME_SysTime_t data structure is used to hold time +** values. Time is referred to as the elapsed time (in seconds +** and subseconds) since a specified epoch time. The subseconds +** field contains the number of 2^(-32) second intervals that have +** elapsed since the epoch. +** +*/ +typedef struct CFE_TIME_SysTime +{ + uint32 Seconds; /**< \brief Number of seconds since epoch */ + uint32 Subseconds; /**< \brief Number of subseconds since epoch (LSB = 2^(-32) seconds) */ +} CFE_TIME_SysTime_t; + /** * @brief Label definitions associated with CFE_TIME_FlagBit_Enum_t */ diff --git a/fsw/cfe-core/src/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h similarity index 81% rename from fsw/cfe-core/src/inc/cfe_version.h rename to modules/core_api/fsw/inc/cfe_version.h index 20ba2f593..5c614d848 100644 --- a/fsw/cfe-core/src/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -30,8 +30,6 @@ * git to determine the most recent tag and commit id. * */ -#include - /* Development Build Macro Definitions */ @@ -63,23 +61,4 @@ ", Last Official Release: cfe v6.7.0" /* For full support please use this version */ -/*! @brief OSAL Version Definitions. - * @details Allows for backwards compatibility. @n - * This will be defined by osal in the future - */ -#ifndef OS_VERSION -#define OS_VERSION \ - CFE_STR(OS_MAJOR_VERSION) "." \ - CFE_STR(OS_MINOR_VERSION) "." \ - CFE_STR(OS_REVISION) "." \ - CFE_STR(OS_MISSION_REV) -#endif - -/*! @brief Combined string with formatted combination of all cFS component versions */ -#define CFS_VERSIONS \ -"cFS Versions:" \ - " cfe " CFE_SRC_VERSION \ - ", osal " OS_VERSION \ - ", psp " /* CFE_PSP_VERSION is defined at runtime */ - #endif /* _cfe_version_ */ diff --git a/fsw/cfe-core/mission_build.cmake b/modules/core_api/mission_build.cmake similarity index 100% rename from fsw/cfe-core/mission_build.cmake rename to modules/core_api/mission_build.cmake diff --git a/modules/core_api/ut-stubs/CMakeLists.txt b/modules/core_api/ut-stubs/CMakeLists.txt new file mode 100644 index 000000000..362778b9d --- /dev/null +++ b/modules/core_api/ut-stubs/CMakeLists.txt @@ -0,0 +1,41 @@ +################################################################## +# +# cFE stub function build recipe +# +# This CMake file contains the recipe for building the stub function +# libraries that correlate with the CFE public API. This library supports +# unit testing of OTHER modules, where the test cases for those modules +# are linked with the stubs supplied here, rather than the normal CFE. +# +################################################################## + +# Reference the UT assert include directory +include_directories(${osal_MISSION_DIR}/ut_assert/inc) + +# +# Create the generic stubs library +# +add_library(ut_${DEP}_stubs STATIC + src/ut_es_stubs.c + src/ut_evs_stubs.c + src/ut_msg_stubs.c + src/ut_resourceid_stubs.c + src/ut_sb_stubs.c + src/ut_tbl_stubs.c + src/ut_time_stubs.c + src/ut_fs_stubs.c +) + +# Define _CFE_CORE_ within stubs to also reveal internal APIs in header +target_compile_definitions(ut_${DEP}_stubs PRIVATE _CFE_CORE_) + +# linking with the CFE stubs implies also linking +# with the OSAL and PSP stubs. This is in line with +# how the real application is linked, in that cfe-core +# executable also provides OSAL and PSP functions. +target_link_libraries(ut_${DEP}_stubs + core_api + ut_psp-${CFE_SYSTEM_PSPNAME}_stubs + ut_osapi_stubs + ut_assert +) diff --git a/fsw/cfe-core/ut-stubs/ut_es_stubs.c b/modules/core_api/ut-stubs/src/ut_es_stubs.c similarity index 98% rename from fsw/cfe-core/ut-stubs/ut_es_stubs.c rename to modules/core_api/ut-stubs/src/ut_es_stubs.c index 57b1bd105..122a366d6 100644 --- a/fsw/cfe-core/ut-stubs/ut_es_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_es_stubs.c @@ -33,12 +33,27 @@ ** Includes */ #include -#include "cfe.h" -#include "private/cfe_private.h" -#include "private/cfe_core_resourceid_basevalues.h" +#include "cfe_es.h" +#include "cfe_resourceid.h" +#include "cfe_resourceid_basevalue.h" + #include "utstubs.h" #include "utassert.h" +/* + * Assign ID base values for UT + */ +enum +{ + UT_CFE_ES_TASKID_BASE = CFE_RESOURCEID_MAKE_BASE(0x21), + UT_CFE_ES_APPID_BASE = CFE_RESOURCEID_MAKE_BASE(0x22), + UT_CFE_ES_LIBID_BASE = CFE_RESOURCEID_MAKE_BASE(0x23), + UT_CFE_ES_COUNTID_BASE = CFE_RESOURCEID_MAKE_BASE(0x24), + UT_CFE_ES_POOLID_BASE = CFE_RESOURCEID_MAKE_BASE(0x25), + UT_CFE_ES_CDSBLOCKID_BASE = CFE_RESOURCEID_MAKE_BASE(0x26) +}; + + /* * Unit-test stub definitions/limits * @@ -65,19 +80,19 @@ * Default value to return from calls that output an App ID, if the * test case does not provide a value */ -#define CFE_UT_ES_DEFAULT_APPID CFE_ES_APPID_C(CFE_ResourceId_FromInteger(CFE_ES_APPID_BASE + 1)) +#define CFE_UT_ES_DEFAULT_APPID CFE_ES_APPID_C(CFE_ResourceId_FromInteger(UT_CFE_ES_APPID_BASE + 1)) /* * Default value to return from calls that output a Task ID, if the * test case does not provide a value */ -#define CFE_UT_ES_DEFAULT_TASKID CFE_ES_TASKID_C(CFE_ResourceId_FromInteger(CFE_ES_TASKID_BASE + 1)) +#define CFE_UT_ES_DEFAULT_TASKID CFE_ES_TASKID_C(CFE_ResourceId_FromInteger(UT_CFE_ES_TASKID_BASE + 1)) /* * Default value to return from calls that output a CDS ID, if the * test case does not provide a value */ -#define CFE_UT_ES_DEFAULT_CDSID CFE_ES_CDSHANDLE_C(CFE_ResourceId_FromInteger(CFE_ES_CDSBLOCKID_BASE + 1)) +#define CFE_UT_ES_DEFAULT_CDSID CFE_ES_CDSHANDLE_C(CFE_ResourceId_FromInteger(UT_CFE_ES_CDSBLOCKID_BASE + 1)) /* * Invalid value to output from calls as resource ID for the diff --git a/fsw/cfe-core/ut-stubs/ut_evs_stubs.c b/modules/core_api/ut-stubs/src/ut_evs_stubs.c similarity index 99% rename from fsw/cfe-core/ut-stubs/ut_evs_stubs.c rename to modules/core_api/ut-stubs/src/ut_evs_stubs.c index 737c37b22..5e8b2233e 100644 --- a/fsw/cfe-core/ut-stubs/ut_evs_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_evs_stubs.c @@ -33,8 +33,8 @@ ** Includes */ #include -#include "cfe.h" -#include "private/cfe_private.h" +#include "cfe_evs.h" + #include "utstubs.h" #include "uttools.h" diff --git a/fsw/cfe-core/ut-stubs/ut_fs_stubs.c b/modules/core_api/ut-stubs/src/ut_fs_stubs.c similarity index 100% rename from fsw/cfe-core/ut-stubs/ut_fs_stubs.c rename to modules/core_api/ut-stubs/src/ut_fs_stubs.c diff --git a/fsw/cfe-core/ut-stubs/ut_msg_stubs.c b/modules/core_api/ut-stubs/src/ut_msg_stubs.c similarity index 100% rename from fsw/cfe-core/ut-stubs/ut_msg_stubs.c rename to modules/core_api/ut-stubs/src/ut_msg_stubs.c diff --git a/fsw/cfe-core/ut-stubs/ut_resourceid_stubs.c b/modules/core_api/ut-stubs/src/ut_resourceid_stubs.c similarity index 99% rename from fsw/cfe-core/ut-stubs/ut_resourceid_stubs.c rename to modules/core_api/ut-stubs/src/ut_resourceid_stubs.c index 8a540f4fe..403c89735 100644 --- a/fsw/cfe-core/ut-stubs/ut_resourceid_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_resourceid_stubs.c @@ -24,7 +24,7 @@ #include "osapi.h" #include "cfe.h" #include "utstubs.h" -#include "cfe_resourceid_api.h" +#include "cfe_resourceid.h" #include "cfe_resourceid_basevalue.h" diff --git a/fsw/cfe-core/ut-stubs/ut_sb_stubs.c b/modules/core_api/ut-stubs/src/ut_sb_stubs.c similarity index 99% rename from fsw/cfe-core/ut-stubs/ut_sb_stubs.c rename to modules/core_api/ut-stubs/src/ut_sb_stubs.c index 30742c081..7c351f71e 100644 --- a/fsw/cfe-core/ut-stubs/ut_sb_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_sb_stubs.c @@ -33,8 +33,9 @@ ** Includes */ #include -#include "cfe.h" -#include "private/cfe_private.h" +#include "cfe_sb.h" +#include "cfe_time_extern_typedefs.h" + #include "utstubs.h" typedef struct diff --git a/fsw/cfe-core/ut-stubs/ut_tbl_stubs.c b/modules/core_api/ut-stubs/src/ut_tbl_stubs.c similarity index 99% rename from fsw/cfe-core/ut-stubs/ut_tbl_stubs.c rename to modules/core_api/ut-stubs/src/ut_tbl_stubs.c index f75ae4a35..31d4156ab 100644 --- a/fsw/cfe-core/ut-stubs/ut_tbl_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_tbl_stubs.c @@ -22,8 +22,8 @@ ** Includes */ #include -#include "cfe.h" -#include "private/cfe_private.h" +#include "cfe_tbl.h" + #include "utstubs.h" /* diff --git a/fsw/cfe-core/ut-stubs/ut_time_stubs.c b/modules/core_api/ut-stubs/src/ut_time_stubs.c similarity index 99% rename from fsw/cfe-core/ut-stubs/ut_time_stubs.c rename to modules/core_api/ut-stubs/src/ut_time_stubs.c index 6d86b9625..e3a1414dd 100644 --- a/fsw/cfe-core/ut-stubs/ut_time_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_time_stubs.c @@ -35,7 +35,7 @@ #include #include #include "cfe_time.h" -#include "private/cfe_private.h" + #include "utstubs.h" /* diff --git a/modules/core_private/CMakeLists.txt b/modules/core_private/CMakeLists.txt new file mode 100644 index 000000000..6912ced6f --- /dev/null +++ b/modules/core_private/CMakeLists.txt @@ -0,0 +1,34 @@ +################################################################## +# +# cFE Inter-module interface +# +################################################################## + + +add_library(core_private INTERFACE) + +# code compiled as CFE core internal will have _CFE_CORE_ macro set +target_compile_definitions(core_private INTERFACE _CFE_CORE_) + +target_include_directories(core_private INTERFACE + fsw/inc # includes shared typedefs among CFE core apps, not called/used by apps + ${CFE_SOURCE_DIR}/cmake/target/inc # allow CFE core apps to get "target_config.h" file +) + +# also use all headers/definitions from public intf +target_link_libraries(core_private INTERFACE core_api) + +# Add unit test coverage subdirectory +if (ENABLE_UNIT_TESTS) + add_subdirectory(ut-stubs) +endif (ENABLE_UNIT_TESTS) + +cfs_app_check_intf(${DEP} + cfe_es_erlog_typedef.h + cfe_evs_log_typedef.h + cfe_es_resetdata_typedef.h + cfe_sbr.h + cfe_sb_destination_typedef.h + cfe_es_perfdata_typedef.h + cfe_core_resourceid_basevalues.h +) diff --git a/fsw/cfe-core/arch_build.cmake b/modules/core_private/arch_build.cmake similarity index 79% rename from fsw/cfe-core/arch_build.cmake rename to modules/core_private/arch_build.cmake index 2f2f0d5d3..0de378fab 100644 --- a/fsw/cfe-core/arch_build.cmake +++ b/modules/core_private/arch_build.cmake @@ -17,9 +17,3 @@ generate_config_includefile( PREFIXES ${BUILD_CONFIG} ) -generate_config_includefile( - FILE_NAME "cfe_msgids.h" - MATCH_SUFFIX "msgids.h" - PREFIXES ${BUILD_CONFIG} -) - diff --git a/modules/core_private/eds/base_types.xml b/modules/core_private/eds/base_types.xml new file mode 100644 index 000000000..55d7c7679 --- /dev/null +++ b/modules/core_private/eds/base_types.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + single + + + + + + double + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/core_private/eds/config.xml b/modules/core_private/eds/config.xml new file mode 100644 index 000000000..1635b02e4 --- /dev/null +++ b/modules/core_private/eds/config.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fsw/cfe-core/src/inc/private/cfe_core_resourceid_basevalues.h b/modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h similarity index 100% rename from fsw/cfe-core/src/inc/private/cfe_core_resourceid_basevalues.h rename to modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h diff --git a/fsw/cfe-core/src/inc/private/cfe_es_erlog_typedef.h b/modules/core_private/fsw/inc/cfe_es_erlog_typedef.h similarity index 95% rename from fsw/cfe-core/src/inc/private/cfe_es_erlog_typedef.h rename to modules/core_private/fsw/inc/cfe_es_erlog_typedef.h index a2193ae5c..76b30a8eb 100644 --- a/fsw/cfe-core/src/inc/private/cfe_es_erlog_typedef.h +++ b/modules/core_private/fsw/inc/cfe_es_erlog_typedef.h @@ -32,7 +32,10 @@ #define CFE_ES_ERLOG_TYPEDEF_H_ #include -#include /* Needed for CFE_TIME_SysTime_t */ +#include + +#include /* Needed for CFE_TIME_SysTime_t */ +#include /* Needed for CFE_ES_AppId_t */ #define CFE_ES_ERLOG_DESCRIPTION_MAX_LENGTH 80 diff --git a/fsw/cfe-core/src/inc/private/cfe_es_perfdata_typedef.h b/modules/core_private/fsw/inc/cfe_es_perfdata_typedef.h similarity index 100% rename from fsw/cfe-core/src/inc/private/cfe_es_perfdata_typedef.h rename to modules/core_private/fsw/inc/cfe_es_perfdata_typedef.h diff --git a/fsw/cfe-core/src/inc/private/cfe_es_resetdata_typedef.h b/modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h similarity index 96% rename from fsw/cfe-core/src/inc/private/cfe_es_resetdata_typedef.h rename to modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h index 2c59613e0..75f17b8bf 100644 --- a/fsw/cfe-core/src/inc/private/cfe_es_resetdata_typedef.h +++ b/modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h @@ -33,7 +33,7 @@ #include -#include /* Required for CFE_TIME_ResetVars_t definition */ +#include "cfe_time_resetvars_typedef.h" /* Required for CFE_TIME_ResetVars_t definition */ #include "cfe_es_erlog_typedef.h" /* Required for CFE_ES_ERLog_t definition */ #include "cfe_es_perfdata_typedef.h" /* Required for CFE_ES_PerfData_t definition */ #include "cfe_evs_log_typedef.h" /* Required for CFE_EVS_Log_t definition */ diff --git a/fsw/cfe-core/src/inc/private/cfe_evs_log_typedef.h b/modules/core_private/fsw/inc/cfe_evs_log_typedef.h similarity index 98% rename from fsw/cfe-core/src/inc/private/cfe_evs_log_typedef.h rename to modules/core_private/fsw/inc/cfe_evs_log_typedef.h index dc9a7303a..a312b6adc 100644 --- a/fsw/cfe-core/src/inc/private/cfe_evs_log_typedef.h +++ b/modules/core_private/fsw/inc/cfe_evs_log_typedef.h @@ -32,6 +32,8 @@ #define CFE_EVS_LOG_TYPEDEF_H_ #include +#include + #include "cfe_evs_msg.h" /* Required for CFE_EVS_LongEventTlm_t definition */ /* diff --git a/fsw/cfe-core/src/inc/private/cfe_sb_destination_typedef.h b/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h similarity index 95% rename from fsw/cfe-core/src/inc/private/cfe_sb_destination_typedef.h rename to modules/core_private/fsw/inc/cfe_sb_destination_typedef.h index 8627b8476..5faf02a32 100644 --- a/fsw/cfe-core/src/inc/private/cfe_sb_destination_typedef.h +++ b/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h @@ -27,7 +27,7 @@ #define CFE_SB_DESTINATION_TYPEDEF_H_ #include "common_types.h" -#include "cfe_sb.h" /* Required for CFE_SB_PipeId_t definition */ +#include "cfe_sb_extern_typedefs.h" /* Required for CFE_SB_PipeId_t definition */ /****************************************************************************** * This structure defines a DESTINATION DESCRIPTOR used to specify diff --git a/fsw/cfe-core/src/inc/private/cfe_sbr.h b/modules/core_private/fsw/inc/cfe_sbr.h similarity index 79% rename from fsw/cfe-core/src/inc/private/cfe_sbr.h rename to modules/core_private/fsw/inc/cfe_sbr.h index 63d00d2ba..0d22a106c 100644 --- a/fsw/cfe-core/src/inc/private/cfe_sbr.h +++ b/modules/core_private/fsw/inc/cfe_sbr.h @@ -26,55 +26,18 @@ * routing internal use. *****************************************************************************/ -#ifndef CFE_SBR_H_ -#define CFE_SBR_H_ +#ifndef CFE_SBR_H +#define CFE_SBR_H /* * Includes */ #include "common_types.h" -#include "private/cfe_sb_destination_typedef.h" -#include "cfe_sb.h" -#include "cfe_msg_typedefs.h" -#include "cfe_platform_cfg.h" - -/* - * Macro Definitions - */ - -/** \brief Invalid route id */ -#define CFE_SBR_INVALID_ROUTE_ID ((CFE_SBR_RouteId_t) {.RouteId = 0}) +#include "cfe_sbr_api_typedefs.h" +#include "cfe_msg_api_typedefs.h" +#include "cfe_sb_destination_typedef.h" -/****************************************************************************** - * Type Definitions - */ - -/** - * \brief Routing table id - * - * This is intended as a form of "strong typedef" where direct assignments should - * be restricted. Software bus uses numeric indexes into multiple tables to perform - * its duties, and it is important that these index values are distinct and separate - * and not mixed together. - * - * Using this holding structure prevents assignment directly into a different index - * or direct usage as numeric value. - */ -typedef struct -{ - CFE_SB_RouteId_Atom_t RouteId; /**< \brief Holding value, do not use directly in code */ -} CFE_SBR_RouteId_t; - -/** \brief Callback throttling structure */ -typedef struct -{ - uint32 StartIndex; /**< /brief 0 based index to start at */ - uint32 MaxLoop; /**< /brief Max number to process */ - uint32 NextIndex; /**< /brief Next start index (output), 0 if completed */ -} CFE_SBR_Throttle_t; - -/** \brief For each id callback function prototype */ -typedef void (*CFE_SBR_CallbackPtr_t)(CFE_SBR_RouteId_t RouteId, void *ArgPtr); +#include "cfe_platform_cfg.h" /****************************************************************************** * Function prototypes @@ -209,4 +172,4 @@ static inline CFE_SB_RouteId_Atom_t CFE_SBR_RouteIdToValue(CFE_SBR_RouteId_t Rou return (RouteId.RouteId - 1); } -#endif /* CFE_SBR_H_ */ +#endif /* CFE_SBR_H */ diff --git a/modules/core_private/fsw/inc/cfe_sbr_api_typedefs.h b/modules/core_private/fsw/inc/cfe_sbr_api_typedefs.h new file mode 100644 index 000000000..25ff71742 --- /dev/null +++ b/modules/core_private/fsw/inc/cfe_sbr_api_typedefs.h @@ -0,0 +1,78 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/****************************************************************************** + * File: cfe_sbr.h + * + * Purpose: + * Prototypes for private functions and type definitions for SB + * routing internal use. + *****************************************************************************/ + +#ifndef CFE_SBR_API_TYPEDEFS_H +#define CFE_SBR_API_TYPEDEFS_H + +/* + * Includes + */ +#include "common_types.h" +#include "cfe_sb_extern_typedefs.h" + +/* + * Macro Definitions + */ + +/** \brief Invalid route id */ +#define CFE_SBR_INVALID_ROUTE_ID ((CFE_SBR_RouteId_t) {.RouteId = 0}) + + +/****************************************************************************** + * Type Definitions + */ + +/** + * \brief Routing table id + * + * This is intended as a form of "strong typedef" where direct assignments should + * be restricted. Software bus uses numeric indexes into multiple tables to perform + * its duties, and it is important that these index values are distinct and separate + * and not mixed together. + * + * Using this holding structure prevents assignment directly into a different index + * or direct usage as numeric value. + */ +typedef struct +{ + CFE_SB_RouteId_Atom_t RouteId; /**< \brief Holding value, do not use directly in code */ +} CFE_SBR_RouteId_t; + +/** \brief Callback throttling structure */ +typedef struct +{ + uint32 StartIndex; /**< /brief 0 based index to start at */ + uint32 MaxLoop; /**< /brief Max number to process */ + uint32 NextIndex; /**< /brief Next start index (output), 0 if completed */ +} CFE_SBR_Throttle_t; + +/** \brief For each id callback function prototype */ +typedef void (*CFE_SBR_CallbackPtr_t)(CFE_SBR_RouteId_t RouteId, void *ArgPtr); + + +#endif /* CFE_SBR_API_TYPEDEFS_H */ diff --git a/modules/core_private/fsw/inc/cfe_time_resetvars_typedef.h b/modules/core_private/fsw/inc/cfe_time_resetvars_typedef.h new file mode 100644 index 000000000..6b231e2b9 --- /dev/null +++ b/modules/core_private/fsw/inc/cfe_time_resetvars_typedef.h @@ -0,0 +1,70 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/* +** File: cfe_time.h +** +** Purpose: cFE Time Services (TIME) library API header file +** +** Author: S.Walling/Microtel +** +** Notes: +** +*/ + +/* +** Ensure that header is included only once... +*/ +#ifndef CFE_TIME_RESETVARS_TYPEDEF_H +#define CFE_TIME_RESETVARS_TYPEDEF_H + + +/* +** Includes +*/ +#include "common_types.h" +#include "cfe_time_extern_typedefs.h" + + +/** +** \brief Time related variables that are maintained through a Processor Reset +** +** \par Description +** The #CFE_TIME_ResetVars_t data structure contains those variables that are maintained +** in an area of memory that is not cleared during a Processor Reset. This allows the +** cFE Time Service to maintain time to the best of its ability after a Processor Reset. +*/ +typedef struct CFE_TIME_ResetVars +{ + uint32 Signature; /**< \brief Data validation signature used to verify data structure contents*/ + int16 LeapSeconds; /**< \brief Leap seconds value */ + uint16 ClockSignal; /**< \brief Current clock signal selection */ + CFE_TIME_SysTime_t CurrentMET; /**< \brief Current Mission Elapsed Time (MET) */ + CFE_TIME_SysTime_t CurrentSTCF; /**< \brief Current Spacecraft Time Correlation Factor (STCF) */ + CFE_TIME_SysTime_t CurrentDelay; /**< \brief Current time client delay value */ + +} CFE_TIME_ResetVars_t; + + +#endif /* CFE_TIME_RESETVARS_TYPEDEF_H */ + +/************************/ +/* End of File Comment */ +/************************/ diff --git a/fsw/cfe-core/ut-stubs/CMakeLists.txt b/modules/core_private/ut-stubs/CMakeLists.txt similarity index 69% rename from fsw/cfe-core/ut-stubs/CMakeLists.txt rename to modules/core_private/ut-stubs/CMakeLists.txt index 14e388a7e..ca2150efa 100644 --- a/fsw/cfe-core/ut-stubs/CMakeLists.txt +++ b/modules/core_private/ut-stubs/CMakeLists.txt @@ -9,27 +9,25 @@ # ################################################################## -# Reference the UT assert include directory -include_directories(${osal_MISSION_DIR}/ut_assert/inc) - # # Create the generic stubs library # -add_library(ut_cfe-core_stubs STATIC - ut_es_stubs.c - ut_evs_stubs.c - ut_msg_stubs.c - ut_resourceid_stubs.c - ut_sb_stubs.c - ut_tbl_stubs.c - ut_time_stubs.c - ut_fs_stubs.c) +add_library(ut_${DEP}_stubs STATIC + src/ut_osprintf_stubs.c + src/ut_support.c +) + +target_include_directories(ut_${DEP}_stubs PUBLIC inc) + # linking with the CFE stubs implies also linking # with the OSAL and PSP stubs. This is in line with # how the real application is linked, in that cfe-core # executable also provides OSAL and PSP functions. -target_link_libraries(ut_cfe-core_stubs +target_link_libraries(ut_${DEP}_stubs + core_private + ut_core_api_stubs ut_psp-${CFE_SYSTEM_PSPNAME}_stubs ut_osapi_stubs + ut_assert ) diff --git a/fsw/cfe-core/unit-test/ut_osprintf_stubs.h b/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h similarity index 100% rename from fsw/cfe-core/unit-test/ut_osprintf_stubs.h rename to modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h diff --git a/fsw/cfe-core/unit-test/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h similarity index 99% rename from fsw/cfe-core/unit-test/ut_support.h rename to modules/core_private/ut-stubs/inc/ut_support.h index 5b3e38660..6ff966828 100644 --- a/fsw/cfe-core/unit-test/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -38,14 +38,7 @@ #include #include "cfe.h" -#include "cfe_sb.h" -#include "cfe_es.h" -#include "common_types.h" -#include "cfe_evs_task.h" -#include "cfe_es_global.h" -#include "cfe_es_cds.h" -#include "cfe_es_generic_pool.h" -#include "cfe_time_utils.h" +#include "cfe_es_resetdata_typedef.h" #include "utassert.h" #include "uttest.h" diff --git a/fsw/cfe-core/unit-test/ut_osprintf_stubs.c b/modules/core_private/ut-stubs/src/ut_osprintf_stubs.c similarity index 100% rename from fsw/cfe-core/unit-test/ut_osprintf_stubs.c rename to modules/core_private/ut-stubs/src/ut_osprintf_stubs.c diff --git a/fsw/cfe-core/unit-test/ut_support.c b/modules/core_private/ut-stubs/src/ut_support.c similarity index 100% rename from fsw/cfe-core/unit-test/ut_support.c rename to modules/core_private/ut-stubs/src/ut_support.c diff --git a/modules/es/CMakeLists.txt b/modules/es/CMakeLists.txt new file mode 100644 index 000000000..c3d1cb1d6 --- /dev/null +++ b/modules/es/CMakeLists.txt @@ -0,0 +1,39 @@ +################################################################## +# +# cFE Executive Services (ES) module CMake build recipe +# +################################################################## + +project(CFE_ES C) + +# Executive services source files +set(es_SOURCES + fsw/src/cfe_es_api.c + fsw/src/cfe_es_apps.c + fsw/src/cfe_es_backgroundtask.c + fsw/src/cfe_es_cds.c + fsw/src/cfe_es_cds_mempool.c + fsw/src/cfe_es_erlog.c + fsw/src/cfe_es_generic_pool.c + fsw/src/cfe_es_mempool.c + fsw/src/cfe_es_objtab.c + fsw/src/cfe_es_perf.c + fsw/src/cfe_es_resource.c + fsw/src/cfe_es_start.c + fsw/src/cfe_es_syslog.c + fsw/src/cfe_es_task.c +) +add_library(es STATIC ${es_SOURCES}) + +target_include_directories(es PUBLIC fsw/inc) +target_link_libraries(es PRIVATE core_private) + +# Add unit test coverage subdirectory +if (ENABLE_UNIT_TESTS) + add_subdirectory(ut-coverage) +endif (ENABLE_UNIT_TESTS) + +cfs_app_check_intf(${DEP} + cfe_es_msg.h + cfe_es_events.h +) diff --git a/fsw/cfe-core/eds/cfe_es.xml b/modules/es/eds/cfe_es.xml similarity index 100% rename from fsw/cfe-core/eds/cfe_es.xml rename to modules/es/eds/cfe_es.xml diff --git a/fsw/cfe-core/src/inc/cfe_es_events.h b/modules/es/fsw/inc/cfe_es_events.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_es_events.h rename to modules/es/fsw/inc/cfe_es_events.h diff --git a/fsw/cfe-core/src/inc/cfe_es_msg.h b/modules/es/fsw/inc/cfe_es_msg.h similarity index 88% rename from fsw/cfe-core/src/inc/cfe_es_msg.h rename to modules/es/fsw/inc/cfe_es_msg.h index de4bd34e9..33a538da9 100644 --- a/fsw/cfe-core/src/inc/cfe_es_msg.h +++ b/modules/es/fsw/inc/cfe_es_msg.h @@ -38,8 +38,10 @@ /* ** Includes */ +#include "common_types.h" /* Basic data types */ +#include "cfe_msg_hdr.h" /* for header definitions */ #include "cfe_es_extern_typedefs.h" -#include "cfe_sb.h" + /* ** ES task command packet command codes @@ -1426,143 +1428,6 @@ typedef struct CFE_ES_DumpCDSRegistryCmd /* Telemetry Interface Data Formats */ /************************************/ -/** - * \brief Application Information - * - * Structure that is used to provide information about an app. - * It is primarily used for the QueryOne and QueryAll Commands. - * - * While this structure is primarily intended for Application info, - * it can also represent Library information where only a subset of - * the information applies. - */ -typedef struct CFE_ES_AppInfo -{ - CFE_ResourceId_t ResourceId; /**< \cfetlmmnemonic \ES_APP_ID - \brief Application or Library ID for this resource */ - uint32 Type; /**< \cfetlmmnemonic \ES_APPTYPE - \brief The type of App: CORE or EXTERNAL */ - - char Name[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \ES_APPNAME - \brief The Registered Name of the Application */ - char EntryPoint[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \ES_APPENTRYPT - \brief The Entry Point label for the Application */ - char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \cfetlmmnemonic \ES_APPFILENAME - \brief The Filename of the file containing the Application */ - - CFE_ES_MemOffset_t StackSize; /**< \cfetlmmnemonic \ES_STACKSIZE - \brief The Stack Size of the Application */ - uint32 AddressesAreValid; /**< \cfetlmmnemonic \ES_ADDRVALID - \brief Indicates that the Code, Data, and BSS addresses/sizes are valid */ - CFE_ES_MemAddress_t CodeAddress; /**< \cfetlmmnemonic \ES_CODEADDR - \brief The Address of the Application Code Segment*/ - CFE_ES_MemOffset_t CodeSize; /**< \cfetlmmnemonic \ES_CODESIZE - \brief The Code Size of the Application */ - CFE_ES_MemAddress_t DataAddress; /**< \cfetlmmnemonic \ES_DATAADDR - \brief The Address of the Application Data Segment*/ - CFE_ES_MemOffset_t DataSize; /**< \cfetlmmnemonic \ES_DATASIZE - \brief The Data Size of the Application */ - CFE_ES_MemAddress_t BSSAddress; /**< \cfetlmmnemonic \ES_BSSADDR - \brief The Address of the Application BSS Segment*/ - CFE_ES_MemOffset_t BSSSize; /**< \cfetlmmnemonic \ES_BSSSIZE - \brief The BSS Size of the Application */ - CFE_ES_MemAddress_t StartAddress; /**< \cfetlmmnemonic \ES_STARTADDR - \brief The Start Address of the Application */ - CFE_ES_ExceptionAction_Enum_t ExceptionAction; /**< \cfetlmmnemonic \ES_EXCEPTNACTN - \brief What should occur if Application has an exception - (Restart Application OR Restart Processor) */ - CFE_ES_TaskPriority_Atom_t Priority; /**< \cfetlmmnemonic \ES_PRIORITY - \brief The Priority of the Application */ - CFE_ES_TaskId_t MainTaskId; /**< \cfetlmmnemonic \ES_MAINTASKID - \brief The Application's Main Task ID */ - uint32 ExecutionCounter; /**< \cfetlmmnemonic \ES_MAINTASKEXECNT - \brief The Application's Main Task Execution Counter */ - char MainTaskName[CFE_MISSION_MAX_API_LEN]; /**< \cfetlmmnemonic \ES_MAINTASKNAME - \brief The Application's Main Task ID */ - uint32 NumOfChildTasks; /**< \cfetlmmnemonic \ES_CHILDTASKS - \brief Number of Child tasks for an App */ - -} CFE_ES_AppInfo_t; - -/** - * \brief Task Information - * - * Structure that is used to provide information about a task. It is primarily - * used for the Query All Tasks (#CFE_ES_QUERY_ALL_TASKS_CC) command. - * - * \note There is not currently a telemetry message directly containing this - * data structure, but it does define the format of the data file generated - * by the Query All Tasks command. Therefore it should be considered - * part of the overall telemetry interface. - */ -typedef struct CFE_ES_TaskInfo -{ - CFE_ES_TaskId_t TaskId; /**< \brief Task Id */ - uint32 ExecutionCounter; /**< \brief Task Execution Counter */ - char TaskName[CFE_MISSION_MAX_API_LEN]; /**< \brief Task Name */ - CFE_ES_AppId_t AppId; /**< \brief Parent Application ID */ - char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Parent Application Name */ - CFE_ES_MemOffset_t StackSize; /**< Size of task stack */ - CFE_ES_TaskPriority_Atom_t Priority; /**< Priority of task */ - uint8 Spare[2]; /**< Spare bytes for alignment */ -} CFE_ES_TaskInfo_t; - -/** - * \brief CDS Register Dump Record - * - * Structure that is used to provide information about a critical data store. - * It is primarily used for the Dump CDS registry (#CFE_ES_DUMP_CDS_REGISTRY_CC) - * command. - * - * \note There is not currently a telemetry message directly containing this - * data structure, but it does define the format of the data file generated - * by the Dump CDS registry command. Therefore it should be considered - * part of the overall telemetry interface. - */ -typedef struct CFE_ES_CDSRegDumpRec -{ - CFE_ES_CDSHandle_t Handle; /**< \brief Handle of CDS */ - CFE_ES_MemOffset_t Size; /**< \brief Size, in bytes, of the CDS memory block */ - bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */ - char Name[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief Processor Unique Name of CDS */ - uint8 ByteAlignSpare[3]; /**< \brief Spare bytes to ensure structure size is multiple of 4 bytes */ -} CFE_ES_CDSRegDumpRec_t; - -/** - * \brief Block statistics - * - * Sub-Structure that is used to provide information about a specific - * block size/bucket within a memory pool. - */ -typedef struct CFE_ES_BlockStats -{ - CFE_ES_MemOffset_t BlockSize; /**< \brief Number of bytes in each of these blocks */ - uint32 NumCreated; /**< \brief Number of Memory Blocks of this size created */ - uint32 NumFree; /**< \brief Number of Memory Blocks of this size that are free */ -} CFE_ES_BlockStats_t; - -/** - * \brief Memory Pool Statistics - * - * Structure that is used to provide information about a memory - * pool. Used by the Memory Pool Stats telemetry message. - * - * \sa #CFE_ES_SEND_MEM_POOL_STATS_CC - */ -typedef struct CFE_ES_MemPoolStats -{ - CFE_ES_MemOffset_t PoolSize; /**< \cfetlmmnemonic \ES_POOLSIZE - \brief Size of Memory Pool (in bytes) */ - uint32 NumBlocksRequested; /**< \cfetlmmnemonic \ES_BLKSREQ - \brief Number of times a memory block has been allocated */ - uint32 CheckErrCtr; /**< \cfetlmmnemonic \ES_BLKERRCTR - \brief Number of errors detected when freeing a memory block */ - CFE_ES_MemOffset_t NumFreeBytes; /**< \cfetlmmnemonic \ES_FREEBYTES - \brief Number of bytes never allocated to a block */ - CFE_ES_BlockStats_t BlockStats[CFE_MISSION_ES_POOL_MAX_BUCKETS]; /**< \cfetlmmnemonic \ES_BLKSTATS - \brief Contains stats on each block size */ -} CFE_ES_MemPoolStats_t; - /**********************************/ /* Telemetry Message Data Formats */ diff --git a/fsw/cfe-core/src/es/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_api.c rename to modules/es/fsw/src/cfe_es_api.c index f2618019b..a67a751ba 100644 --- a/fsw/cfe-core/src/es/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -36,17 +36,7 @@ /* ** Required header files. */ -#include "private/cfe_private.h" -#include "cfe_es.h" -#include "cfe_es_apps.h" -#include "cfe_es_global.h" -#include "cfe_es_events.h" -#include "cfe_es_cds.h" -#include "cfe_es_cds_mempool.h" -#include "cfe_es_task.h" -#include "cfe_es_resource.h" -#include "cfe_psp.h" -#include "cfe_es_log.h" +#include "cfe_es_module_all.h" #include diff --git a/fsw/cfe-core/src/es/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_apps.c rename to modules/es/fsw/src/cfe_es_apps.c index 4802ba75e..ba4dbea70 100644 --- a/fsw/cfe-core/src/es/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -36,14 +36,12 @@ /* ** Includes */ -#include "private/cfe_private.h" -#include "cfe_es.h" -#include "cfe_psp.h" -#include "cfe_es_global.h" -#include "cfe_es_task.h" -#include "cfe_es_apps.h" -#include "cfe_es_log.h" -#include "cfe_es_resource.h" +#include "cfe_es_module_all.h" + +#include "cfe_evs_core_internal.h" +#include "cfe_sb_core_internal.h" +#include "cfe_tbl_core_internal.h" +#include "cfe_time_core_internal.h" #include #include /* memset() */ @@ -498,7 +496,6 @@ int32 CFE_ES_LoadModule(CFE_ResourceId_t ParentResourceId, const char *ModuleNam int32 CFE_ES_GetTaskFunction(CFE_ES_TaskEntryFuncPtr_t *FuncPtr) { CFE_ES_TaskRecord_t *TaskRecPtr; - CFE_ES_AppId_t AppId; CFE_ES_TaskEntryFuncPtr_t EntryFunc; int32 ReturnCode; int32 Timeout; @@ -508,7 +505,6 @@ int32 CFE_ES_GetTaskFunction(CFE_ES_TaskEntryFuncPtr_t *FuncPtr) */ ReturnCode = CFE_ES_ERR_APP_REGISTER; Timeout = CFE_PLATFORM_ES_STARTUP_SCRIPT_TIMEOUT_MSEC; - AppId = CFE_ES_APPID_UNDEFINED; EntryFunc = NULL; while(true) @@ -519,9 +515,8 @@ int32 CFE_ES_GetTaskFunction(CFE_ES_TaskEntryFuncPtr_t *FuncPtr) TaskRecPtr = CFE_ES_GetTaskRecordByContext(); if (TaskRecPtr != NULL) { - AppId = TaskRecPtr->AppId; EntryFunc = TaskRecPtr->EntryFunc; - if (CFE_RESOURCEID_TEST_DEFINED(AppId) && EntryFunc != 0) + if (CFE_RESOURCEID_TEST_DEFINED(TaskRecPtr->AppId) && EntryFunc != 0) { ReturnCode = CFE_SUCCESS; } @@ -1448,8 +1443,6 @@ int32 CFE_ES_CleanUpApp(CFE_ES_AppId_t AppId) * of resources are freed. */ CFE_ES_AppRecordSetUsed(AppRecPtr, CFE_RESOURCEID_RESERVED); - - ReturnCode = CFE_SUCCESS; } else { diff --git a/fsw/cfe-core/src/es/cfe_es_apps.h b/modules/es/fsw/src/cfe_es_apps.h similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_apps.h rename to modules/es/fsw/src/cfe_es_apps.h index 2e6bf558d..d776f044d 100644 --- a/fsw/cfe-core/src/es/cfe_es_apps.h +++ b/modules/es/fsw/src/cfe_es_apps.h @@ -40,7 +40,9 @@ ** Include Files */ #include "common_types.h" -#include "osapi.h" + +#include "cfe_es_api_typedefs.h" +#include "cfe_fs_api_typedefs.h" /* ** Macro Definitions diff --git a/fsw/cfe-core/src/es/cfe_es_backgroundtask.c b/modules/es/fsw/src/cfe_es_backgroundtask.c similarity index 98% rename from fsw/cfe-core/src/es/cfe_es_backgroundtask.c rename to modules/es/fsw/src/cfe_es_backgroundtask.c index 93b70867e..d17bb0cb4 100644 --- a/fsw/cfe-core/src/es/cfe_es_backgroundtask.c +++ b/modules/es/fsw/src/cfe_es_backgroundtask.c @@ -35,11 +35,7 @@ #include -#include "osapi.h" -#include "private/cfe_private.h" -#include "cfe_es_perf.h" -#include "cfe_es_global.h" -#include "cfe_es_task.h" +#include "cfe_es_module_all.h" #define CFE_ES_BACKGROUND_SEM_NAME "ES_BG_SEM" #define CFE_ES_BACKGROUND_CHILD_NAME "ES_BG_TASK" diff --git a/fsw/cfe-core/src/es/cfe_es_cds.c b/modules/es/fsw/src/cfe_es_cds.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_cds.c rename to modules/es/fsw/src/cfe_es_cds.c index 4efd36cd8..0af312a6d 100644 --- a/fsw/cfe-core/src/es/cfe_es_cds.c +++ b/modules/es/fsw/src/cfe_es_cds.c @@ -38,14 +38,7 @@ /* ** Required header files. */ -#include "private/cfe_private.h" -#include "cfe_es_apps.h" -#include "cfe_es_cds.h" -#include "cfe_es_global.h" -#include "cfe_es_resource.h" -#include "cfe_es_log.h" -#include "cfe_psp.h" -#include "cfe_es_cds_mempool.h" +#include "cfe_es_module_all.h" #include #include diff --git a/fsw/cfe-core/src/es/cfe_es_cds.h b/modules/es/fsw/src/cfe_es_cds.h similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_cds.h rename to modules/es/fsw/src/cfe_es_cds.h index d4168f448..e57de070e 100644 --- a/fsw/cfe-core/src/es/cfe_es_cds.h +++ b/modules/es/fsw/src/cfe_es_cds.h @@ -42,10 +42,6 @@ ** Include Files */ #include "common_types.h" -#include "osapi.h" -#include "cfe_es_apps.h" -#include "cfe_platform_cfg.h" -#include "cfe_es.h" #include "cfe_es_generic_pool.h" /* diff --git a/fsw/cfe-core/src/es/cfe_es_cds_mempool.c b/modules/es/fsw/src/cfe_es_cds_mempool.c similarity index 98% rename from fsw/cfe-core/src/es/cfe_es_cds_mempool.c rename to modules/es/fsw/src/cfe_es_cds_mempool.c index a3acfc3a9..ad634adac 100644 --- a/fsw/cfe-core/src/es/cfe_es_cds_mempool.c +++ b/modules/es/fsw/src/cfe_es_cds_mempool.c @@ -38,13 +38,7 @@ #include #include -#include "private/cfe_private.h" -#include "cfe_es.h" -#include "cfe_psp.h" -#include "cfe_es_generic_pool.h" -#include "cfe_es_cds_mempool.h" -#include "cfe_es_global.h" -#include "cfe_es_log.h" +#include "cfe_es_module_all.h" /*****************************************************************************/ /* diff --git a/fsw/cfe-core/src/es/cfe_es_cds_mempool.h b/modules/es/fsw/src/cfe_es_cds_mempool.h similarity index 98% rename from fsw/cfe-core/src/es/cfe_es_cds_mempool.h rename to modules/es/fsw/src/cfe_es_cds_mempool.h index abacf5a7e..53e07ac3e 100644 --- a/fsw/cfe-core/src/es/cfe_es_cds_mempool.h +++ b/modules/es/fsw/src/cfe_es_cds_mempool.h @@ -41,7 +41,6 @@ /* ** Include Files */ -#include "private/cfe_private.h" #include "cfe_es_cds.h" /* diff --git a/fsw/cfe-core/src/es/cfe_es_erlog.c b/modules/es/fsw/src/cfe_es_erlog.c similarity index 98% rename from fsw/cfe-core/src/es/cfe_es_erlog.c rename to modules/es/fsw/src/cfe_es_erlog.c index 1ebd390ef..efb0b50bf 100644 --- a/fsw/cfe-core/src/es/cfe_es_erlog.c +++ b/modules/es/fsw/src/cfe_es_erlog.c @@ -38,14 +38,7 @@ /* ** Required header files. */ -#include "private/cfe_private.h" -#include "cfe_es.h" -#include "cfe_es_apps.h" -#include "cfe_es_global.h" -#include "cfe_es_resource.h" -#include "cfe_es_log.h" -#include "cfe_es_task.h" -#include "cfe_psp.h" +#include "cfe_es_module_all.h" #include #include diff --git a/fsw/cfe-core/src/es/cfe_es_generic_pool.c b/modules/es/fsw/src/cfe_es_generic_pool.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_generic_pool.c rename to modules/es/fsw/src/cfe_es_generic_pool.c index d8b76bcb1..18a9bf385 100644 --- a/fsw/cfe-core/src/es/cfe_es_generic_pool.c +++ b/modules/es/fsw/src/cfe_es_generic_pool.c @@ -34,17 +34,12 @@ /* ** Includes */ +#include "cfe_es_module_all.h" + #include #include #include -#include "common_types.h" -#include "osapi.h" -#include "cfe_es.h" -#include "cfe_es_generic_pool.h" -#include "cfe_es_global.h" -#include "cfe_platform_cfg.h" - /*****************************************************************************/ /* diff --git a/fsw/cfe-core/src/es/cfe_es_generic_pool.h b/modules/es/fsw/src/cfe_es_generic_pool.h similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_generic_pool.h rename to modules/es/fsw/src/cfe_es_generic_pool.h index 2796ed1eb..fb1947e78 100644 --- a/fsw/cfe-core/src/es/cfe_es_generic_pool.h +++ b/modules/es/fsw/src/cfe_es_generic_pool.h @@ -42,7 +42,6 @@ ** Include Files */ #include "common_types.h" -#include "private/cfe_private.h" /* ** Macro Definitions diff --git a/fsw/cfe-core/src/es/cfe_es_global.h b/modules/es/fsw/src/cfe_es_global.h similarity index 91% rename from fsw/cfe-core/src/es/cfe_es_global.h rename to modules/es/fsw/src/cfe_es_global.h index 0965ef9ea..369f0eec6 100644 --- a/fsw/cfe-core/src/es/cfe_es_global.h +++ b/modules/es/fsw/src/cfe_es_global.h @@ -35,24 +35,16 @@ #define _cfe_es_global_ /* -** Includes: +** Includes */ -#include "osapi.h" -#include "private/cfe_private.h" -#include "private/cfe_es_resetdata_typedef.h" -#include "cfe_es.h" -#include "cfe_es_apps.h" +#include "common_types.h" +#include "cfe_es_api_typedefs.h" + +#include "cfe_es_erlog_typedef.h" +#include "cfe_es_resetdata_typedef.h" #include "cfe_es_cds.h" -#include "cfe_es_perf.h" -#include "cfe_es_generic_pool.h" -#include "cfe_es_mempool.h" -#include "cfe_es_cds_mempool.h" -#include "cfe_time.h" -#include "cfe_platform_cfg.h" -#include "cfe_evs.h" -#include "cfe_psp.h" - -#include + +#include /* for sig_atomic_t */ /* diff --git a/fsw/cfe-core/src/es/cfe_es_log.h b/modules/es/fsw/src/cfe_es_log.h similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_log.h rename to modules/es/fsw/src/cfe_es_log.h index e52ae1c0a..4c168274e 100644 --- a/fsw/cfe-core/src/es/cfe_es_log.h +++ b/modules/es/fsw/src/cfe_es_log.h @@ -41,9 +41,9 @@ /* ** Include Files */ -#include "cfe.h" -#include "cfe_es.h" -#include "cfe_es_global.h" +#include "common_types.h" +#include "cfe_es_api_typedefs.h" +#include "cfe_time_api_typedefs.h" #include /* required for "va_list" */ diff --git a/fsw/cfe-core/src/es/cfe_es_mempool.c b/modules/es/fsw/src/cfe_es_mempool.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_mempool.c rename to modules/es/fsw/src/cfe_es_mempool.c index 66a833a42..ec9901ffc 100644 --- a/fsw/cfe-core/src/es/cfe_es_mempool.c +++ b/modules/es/fsw/src/cfe_es_mempool.c @@ -34,17 +34,12 @@ /* ** Includes */ +#include "cfe_es_module_all.h" + #include #include #include -#include "private/cfe_private.h" -#include "cfe_es_generic_pool.h" -#include "cfe_es.h" -#include "cfe_es_task.h" -#include "cfe_es_log.h" -#include "cfe_es_resource.h" - /** * Macro that determines the native alignment requirement of a specific type * diff --git a/fsw/cfe-core/src/es/cfe_es_mempool.h b/modules/es/fsw/src/cfe_es_mempool.h similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_mempool.h rename to modules/es/fsw/src/cfe_es_mempool.h index d94724faa..c8627925d 100644 --- a/fsw/cfe-core/src/es/cfe_es_mempool.h +++ b/modules/es/fsw/src/cfe_es_mempool.h @@ -34,6 +34,7 @@ ** Include Files */ #include "common_types.h" +#include "cfe_resourceid.h" #include "cfe_es_generic_pool.h" typedef struct diff --git a/modules/es/fsw/src/cfe_es_module_all.h b/modules/es/fsw/src/cfe_es_module_all.h new file mode 100644 index 000000000..2faf519bb --- /dev/null +++ b/modules/es/fsw/src/cfe_es_module_all.h @@ -0,0 +1,58 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file cfe_es_module_all.h + * + * Encapsulates all ES module internal header files, as well + * as the public API from all other CFE core modules, OSAL, and PSP. + * + * This simplifies the set of include files that need to be put at the + * start of every source file. + */ + +#ifndef CFE_ES_MODULE_ALL_H +#define CFE_ES_MODULE_ALL_H + +/* +** Includes +*/ +#include "cfe.h" +#include "cfe_platform_cfg.h" + +#include "cfe_msgids.h" +#include "cfe_perfids.h" + +#include "cfe_es_core_internal.h" +#include "cfe_es_apps.h" +#include "cfe_es_cds.h" +#include "cfe_es_perf.h" +#include "cfe_es_generic_pool.h" +#include "cfe_es_mempool.h" +#include "cfe_es_global.h" +#include "cfe_es_cds_mempool.h" +#include "cfe_es_events.h" +#include "cfe_es_start.h" +#include "cfe_es_task.h" +#include "cfe_es_resource.h" +#include "cfe_es_log.h" + + +#endif diff --git a/fsw/cfe-core/src/es/cfe_es_objtab.c b/modules/es/fsw/src/cfe_es_objtab.c similarity index 94% rename from fsw/cfe-core/src/es/cfe_es_objtab.c rename to modules/es/fsw/src/cfe_es_objtab.c index 18c4c3287..0b13cc6fc 100644 --- a/fsw/cfe-core/src/es/cfe_es_objtab.c +++ b/modules/es/fsw/src/cfe_es_objtab.c @@ -36,9 +36,14 @@ /* ** Include files */ -#include "private/cfe_private.h" -#include "cfe_es_global.h" -#include "cfe_es_start.h" +#include "cfe_es_module_all.h" + +/* Init functions from other modules are in separate headers */ +#include "cfe_evs_core_internal.h" +#include "cfe_fs_core_internal.h" +#include "cfe_sb_core_internal.h" +#include "cfe_tbl_core_internal.h" +#include "cfe_time_core_internal.h" /* ** diff --git a/fsw/cfe-core/src/es/cfe_es_perf.c b/modules/es/fsw/src/cfe_es_perf.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_perf.c rename to modules/es/fsw/src/cfe_es_perf.c index a4b47104c..0e0691630 100644 --- a/fsw/cfe-core/src/es/cfe_es_perf.c +++ b/modules/es/fsw/src/cfe_es_perf.c @@ -29,17 +29,8 @@ /* ** Include Section */ +#include "cfe_es_module_all.h" -#include "osapi.h" -#include "private/cfe_private.h" -#include "cfe_es_perf.h" -#include "cfe_es_log.h" -#include "cfe_es_global.h" -#include "cfe_es_start.h" -#include "cfe_es_events.h" -#include "cfe_es_task.h" -#include "cfe_fs.h" -#include "cfe_psp.h" #include diff --git a/fsw/cfe-core/src/es/cfe_es_perf.h b/modules/es/fsw/src/cfe_es_perf.h similarity index 96% rename from fsw/cfe-core/src/es/cfe_es_perf.h rename to modules/es/fsw/src/cfe_es_perf.h index 74cd370e6..ce2b2ac76 100644 --- a/fsw/cfe-core/src/es/cfe_es_perf.h +++ b/modules/es/fsw/src/cfe_es_perf.h @@ -37,14 +37,8 @@ ** Include Files */ #include "common_types.h" -#include "osapi.h" -#include "cfe_es.h" -#include "cfe_es_msg.h" -#include "cfe_es_events.h" -#include "cfe_sb.h" -#include "cfe_evs.h" -#include "cfe_perfids.h" -#include "cfe_psp.h" +#include "osconfig.h" +#include "cfe_es_api_typedefs.h" /* ** Defines diff --git a/fsw/cfe-core/src/es/cfe_es_resource.c b/modules/es/fsw/src/cfe_es_resource.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_resource.c rename to modules/es/fsw/src/cfe_es_resource.c index 4af1cacea..e1f7a6b5f 100644 --- a/fsw/cfe-core/src/es/cfe_es_resource.c +++ b/modules/es/fsw/src/cfe_es_resource.c @@ -33,13 +33,12 @@ /* ** Includes */ +#include "cfe_es_module_all.h" + #include #include #include -#include "cfe_platform_cfg.h" -#include "cfe_es_resource.h" - /*********************************************************************/ /* diff --git a/fsw/cfe-core/src/es/cfe_es_resource.h b/modules/es/fsw/src/cfe_es_resource.h similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_resource.h rename to modules/es/fsw/src/cfe_es_resource.h index efdb8280a..ad30b13a9 100644 --- a/fsw/cfe-core/src/es/cfe_es_resource.h +++ b/modules/es/fsw/src/cfe_es_resource.h @@ -34,8 +34,8 @@ /* ** Include Files */ -#include "cfe_resourceid_api.h" -#include "private/cfe_core_resourceid_basevalues.h" +#include "cfe_resourceid.h" +#include "cfe_core_resourceid_basevalues.h" #include "cfe_es_global.h" diff --git a/fsw/cfe-core/src/es/cfe_es_start.c b/modules/es/fsw/src/cfe_es_start.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_start.c rename to modules/es/fsw/src/cfe_es_start.c index da0538c4c..9a1ae2831 100644 --- a/fsw/cfe-core/src/es/cfe_es_start.c +++ b/modules/es/fsw/src/cfe_es_start.c @@ -37,14 +37,7 @@ ** Includes */ -#include "private/cfe_private.h" -#include "cfe_es.h" -#include "cfe_es_global.h" -#include "cfe_es_resource.h" -#include "cfe_es_start.h" -#include "cfe_es_apps.h" -#include "cfe_es_log.h" -#include "cfe_psp.h" +#include "cfe_es_module_all.h" #include #include @@ -386,7 +379,6 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo if ( CFE_ES_ResetDataPtr->ResetVars.ES_CausedReset != true ) { CFE_ES_ResetDataPtr->ResetVars.ResetType = CFE_PSP_RST_TYPE_PROCESSOR; - CFE_ES_ResetDataPtr->ResetVars.ResetSubtype = StartSubtype; CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount++; /* diff --git a/fsw/cfe-core/src/es/cfe_es_start.h b/modules/es/fsw/src/cfe_es_start.h similarity index 98% rename from fsw/cfe-core/src/es/cfe_es_start.h rename to modules/es/fsw/src/cfe_es_start.h index 119df0a5a..0fa233a78 100644 --- a/fsw/cfe-core/src/es/cfe_es_start.h +++ b/modules/es/fsw/src/cfe_es_start.h @@ -41,7 +41,7 @@ ** Include Files */ -#include "cfe.h" +#include "cfe_es_api_typedefs.h" /* ** Macro Definitions diff --git a/fsw/cfe-core/src/es/cfe_es_syslog.c b/modules/es/fsw/src/cfe_es_syslog.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_syslog.c rename to modules/es/fsw/src/cfe_es_syslog.c index 1da1738af..8502e60e7 100644 --- a/fsw/cfe-core/src/es/cfe_es_syslog.c +++ b/modules/es/fsw/src/cfe_es_syslog.c @@ -51,11 +51,7 @@ /* ** Required header files. */ -#include "cfe.h" -#include "cfe_es.h" -#include "cfe_es_global.h" -#include "cfe_es_task.h" -#include "cfe_es_log.h" +#include "cfe_es_module_all.h" #include #include diff --git a/fsw/cfe-core/src/es/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c similarity index 99% rename from fsw/cfe-core/src/es/cfe_es_task.c rename to modules/es/fsw/src/cfe_es_task.c index a24cf3c6d..e29d9a796 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -36,20 +36,10 @@ /* ** Includes */ -#include "private/cfe_private.h" -#include "cfe_platform_cfg.h" +#include "cfe_es_module_all.h" + #include "cfe_version.h" -#include "cfe_es_global.h" -#include "cfe_es_apps.h" -#include "cfe_es_resource.h" -#include "cfe_es_events.h" -#include "cfe_es_verify.h" -#include "cfe_es_task.h" -#include "cfe_es_log.h" -#include "cfe_es_cds.h" -#include "cfe_fs.h" -#include "cfe_psp.h" -#include "cfe_msgids.h" +#include "target_config.h" #include @@ -1394,8 +1384,7 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) FileSize += Result; EntryCount ++; } - - ++AppRecPtr; + } /* end for */ OS_close(FileDescriptor); diff --git a/fsw/cfe-core/src/es/cfe_es_task.h b/modules/es/fsw/src/cfe_es_task.h similarity index 97% rename from fsw/cfe-core/src/es/cfe_es_task.h rename to modules/es/fsw/src/cfe_es_task.h index fb8d69cf6..d52a7207b 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.h +++ b/modules/es/fsw/src/cfe_es_task.h @@ -38,13 +38,12 @@ /* ** Includes */ -#include "cfe.h" -#include "cfe_es.h" -#include "cfe_es_apps.h" -#include "cfe_es_events.h" #include "cfe_es_msg.h" -#include "cfe_es_perf.h" -#include "private/cfe_es_erlog_typedef.h" + +#include "cfe_es_api_typedefs.h" +#include "cfe_fs_api_typedefs.h" +#include "cfe_sb_api_typedefs.h" +#include "cfe_es_erlog_typedef.h" /*************************************************************************/ diff --git a/fsw/cfe-core/src/es/cfe_es_verify.h b/modules/es/fsw/src/cfe_es_verify.h similarity index 100% rename from fsw/cfe-core/src/es/cfe_es_verify.h rename to modules/es/fsw/src/cfe_es_verify.h diff --git a/modules/es/ut-coverage/CMakeLists.txt b/modules/es/ut-coverage/CMakeLists.txt new file mode 100644 index 000000000..11e674c02 --- /dev/null +++ b/modules/es/ut-coverage/CMakeLists.txt @@ -0,0 +1,7 @@ +################################################################## +# +# cFE unit test CMake build recipe +# +################################################################## + +# Nothing yet - placeholder for future use diff --git a/fsw/cfe-core/unit-test/es_UT.c b/modules/es/ut-coverage/es_UT.c similarity index 100% rename from fsw/cfe-core/unit-test/es_UT.c rename to modules/es/ut-coverage/es_UT.c diff --git a/fsw/cfe-core/unit-test/es_UT.h b/modules/es/ut-coverage/es_UT.h similarity index 100% rename from fsw/cfe-core/unit-test/es_UT.h rename to modules/es/ut-coverage/es_UT.h diff --git a/modules/evs/CMakeLists.txt b/modules/evs/CMakeLists.txt new file mode 100644 index 000000000..a406d1651 --- /dev/null +++ b/modules/evs/CMakeLists.txt @@ -0,0 +1,33 @@ +################################################################## +# +# cFE Event Services (EVS) module CMake build recipe +# +################################################################## + +project(CFE_EVS C) + +# Event services source files +set(evs_SOURCES + fsw/src/cfe_evs.c + fsw/src/cfe_evs_log.c + fsw/src/cfe_evs_task.c + fsw/src/cfe_evs_utils.c + fsw/src/cfe_evs.c + fsw/src/cfe_evs_log.c + fsw/src/cfe_evs_task.c + fsw/src/cfe_evs_utils.c +) +add_library(evs STATIC ${evs_SOURCES}) + +target_include_directories(evs PUBLIC fsw/inc) +target_link_libraries(evs PRIVATE core_private) + +# Add unit test coverage subdirectory +if(ENABLE_UNIT_TESTS) + add_subdirectory(ut-coverage) +endif(ENABLE_UNIT_TESTS) + +cfs_app_check_intf(${DEP} + cfe_evs_msg.h + cfe_evs_events.h +) diff --git a/fsw/cfe-core/eds/cfe_evs.xml b/modules/evs/eds/cfe_evs.xml similarity index 100% rename from fsw/cfe-core/eds/cfe_evs.xml rename to modules/evs/eds/cfe_evs.xml diff --git a/fsw/cfe-core/src/inc/cfe_evs_events.h b/modules/evs/fsw/inc/cfe_evs_events.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_evs_events.h rename to modules/evs/fsw/inc/cfe_evs_events.h diff --git a/fsw/cfe-core/src/inc/cfe_evs_msg.h b/modules/evs/fsw/inc/cfe_evs_msg.h similarity index 99% rename from fsw/cfe-core/src/inc/cfe_evs_msg.h rename to modules/evs/fsw/inc/cfe_evs_msg.h index cfefb1514..c5434ea70 100644 --- a/fsw/cfe-core/src/inc/cfe_evs_msg.h +++ b/modules/evs/fsw/inc/cfe_evs_msg.h @@ -37,10 +37,9 @@ /********************************** Include Files ************************************/ #include "common_types.h" /* Basic data types */ +#include "cfe_msg_hdr.h" /* for header definitions */ #include "cfe_evs_extern_typedefs.h" /* for EVS-specific types such as CFE_EVS_LogMode_Enum_t */ -#include "cfe_time.h" /* Time library function definitions */ -#include "cfe_sb.h" -#include "cfe_es.h" +#include "cfe_es_extern_typedefs.h" /* for CFE_ES_AppId_t type */ /** \name Event Services Command Codes */ diff --git a/fsw/cfe-core/src/evs/cfe_evs.c b/modules/evs/fsw/src/cfe_evs.c similarity index 95% rename from fsw/cfe-core/src/evs/cfe_evs.c rename to modules/evs/fsw/src/cfe_evs.c index ac6c32318..586ca4565 100644 --- a/fsw/cfe-core/src/evs/cfe_evs.c +++ b/modules/evs/fsw/src/cfe_evs.c @@ -30,12 +30,7 @@ */ /* Include Files */ -#include "cfe_evs.h" /* EVS library function definitions */ -#include "cfe_evs_task.h" /* EVS internal definitions */ -#include "cfe_evs_utils.h" /* EVS utility function definitions */ -#include "common_types.h" /* Basic data types */ -#include "cfe_es.h" /* Executive Service definitions */ -#include "cfe_error.h" /* cFE error code definitions */ +#include "cfe_evs_module_all.h" /* All EVS internal definitions and API */ #include #include diff --git a/fsw/cfe-core/src/evs/cfe_evs_log.c b/modules/evs/fsw/src/cfe_evs_log.c similarity index 95% rename from fsw/cfe-core/src/evs/cfe_evs_log.c rename to modules/evs/fsw/src/cfe_evs_log.c index b8d1cc6fe..022d68a4e 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_log.c +++ b/modules/evs/fsw/src/cfe_evs_log.c @@ -29,14 +29,7 @@ */ /* Include Files */ -#include "cfe_evs_task.h" /* EVS internal definitions */ -#include "cfe_evs_log.h" /* EVS log file definitions */ -#include "cfe_evs.h" /* EVS API definitions */ -#include "cfe_evs_utils.h" /* EVS utility function definitions */ -#include "cfe_fs.h" /* File Service definitions */ -#include "cfe_error.h" /* cFE error code definitions */ -#include "cfe_psp.h" /* Get reset area function prototype */ - +#include "cfe_evs_module_all.h" /* All EVS internal definitions and API */ #include diff --git a/fsw/cfe-core/src/evs/cfe_evs_log.h b/modules/evs/fsw/src/cfe_evs_log.h similarity index 100% rename from fsw/cfe-core/src/evs/cfe_evs_log.h rename to modules/evs/fsw/src/cfe_evs_log.h diff --git a/modules/evs/fsw/src/cfe_evs_module_all.h b/modules/evs/fsw/src/cfe_evs_module_all.h new file mode 100644 index 000000000..4d9c9ec33 --- /dev/null +++ b/modules/evs/fsw/src/cfe_evs_module_all.h @@ -0,0 +1,50 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file cfe_evs_module_all.h + * + * Encapsulates all EVS module internal header files, as well + * as the public API from all other CFE core modules, OSAL, and PSP. + * + * This simplifies the set of include files that need to be put at the + * start of every source file. + */ + +#ifndef CFE_EVS_MODULE_ALL_H +#define CFE_EVS_MODULE_ALL_H + +/********************* Include Files ************************/ + +#include "cfe.h" /* All CFE+OSAL public API definitions */ +#include "cfe_platform_cfg.h" + +#include "cfe_msgids.h" +#include "cfe_perfids.h" + +#include "cfe_evs_core_internal.h" + +#include "cfe_evs_events.h" /* EVS event IDs */ +#include "cfe_evs_task.h" /* EVS internal definitions */ +#include "cfe_evs_log.h" /* EVS log file definitions */ +#include "cfe_evs_utils.h" /* EVS utility function definitions */ + + +#endif /* CFE_EVS_MODULE_ALL_H */ diff --git a/fsw/cfe-core/src/evs/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c similarity index 98% rename from fsw/cfe-core/src/evs/cfe_evs_task.c rename to modules/evs/fsw/src/cfe_evs_task.c index ce6efb091..b480ed9c4 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -30,21 +30,12 @@ */ /* Include Files */ -#include "cfe_evs_task.h" /* EVS internal definitions */ -#include "cfe_evs_log.h" /* EVS log file definitions */ -#include "cfe_evs_utils.h" /* EVS utility function definitions */ -#include "cfe_evs.h" /* EVS API definitions */ +#include "cfe_evs_module_all.h" /* All EVS internal definitions and API */ +#include "cfe_version.h" /* cFE version definitions */ #include -#include "cfe_version.h" /* cFE version definitions */ -#include "cfe_error.h" /* cFE error code definitions */ -#include "cfe_es.h" /* Executive Service definitions */ -#include "cfe_fs.h" /* File Service definitions */ -#include "cfe_psp.h" /* cFE Platform Support Package definitions */ -#include "osapi.h" /* OS API file system definitions */ - -#include "private/cfe_es_resetdata_typedef.h" /* Definition of CFE_ES_ResetData_t */ +#include "cfe_es_resetdata_typedef.h" /* Definition of CFE_ES_ResetData_t */ /* Global Data */ CFE_EVS_Global_t CFE_EVS_Global; diff --git a/fsw/cfe-core/src/evs/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h similarity index 93% rename from fsw/cfe-core/src/evs/cfe_evs_task.h rename to modules/evs/fsw/src/cfe_evs_task.h index 079e1118f..f9dbf7c87 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -42,15 +42,13 @@ #define _cfe_evs_task_ /********************************** Include Files ************************************/ -#include "private/cfe_private.h" -#include "private/cfe_evs_log_typedef.h" -#include "cfe_sb.h" /* Software Bus library function definitions */ -#include "cfe_msgids.h" /* Software Bus Message ID definitions */ -#include "cfe_es.h" /* Memory Pool definitions */ -#include "osapi.h" /* OS definitions */ -#include "cfe_evs_msg.h" /* EVS message definitions */ -#include "cfe_evs_verify.h" -#include "cfe_evs.h" +#include "common_types.h" +#include "cfe_platform_cfg.h" +#include "cfe_mission_cfg.h" +#include "osconfig.h" +#include "cfe_evs_api_typedefs.h" +#include "cfe_evs_log_typedef.h" +#include "cfe_sb_api_typedefs.h" #include "cfe_evs_events.h" /********************* Macro and Constant Type Definitions ***************************/ diff --git a/fsw/cfe-core/src/evs/cfe_evs_utils.c b/modules/evs/fsw/src/cfe_evs_utils.c similarity index 97% rename from fsw/cfe-core/src/evs/cfe_evs_utils.c rename to modules/evs/fsw/src/cfe_evs_utils.c index ad80eb88a..2bfb59a53 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_utils.c +++ b/modules/evs/fsw/src/cfe_evs_utils.c @@ -29,21 +29,11 @@ */ /* Include Files */ -#include "cfe_evs.h" /* EVS library function definitions */ -#include "cfe_evs_log.h" /* EVS local event log definitions */ -#include "cfe_evs_task.h" /* EVS internal definitions */ -#include "cfe_evs_utils.h" /* EVS utility function definitions */ +#include "cfe_evs_module_all.h" /* All EVS internal definitions and API */ #include #include -#include "cfe_error.h" /* cFE error code definitions */ -#include "common_types.h" /* Basic data types */ -#include "osapi.h" /* OS API interface definitions */ -#include "cfe_psp.h" /* cFE PSP glue functions */ -#include "cfe_sb.h" /* Software Bus library function definitions */ -#include "cfe_es.h" - /* Local Function Prototypes */ void EVS_SendViaPorts (CFE_EVS_LongEventTlm_t *EVS_PktPtr); void EVS_OutputPort1 (char *Message); diff --git a/fsw/cfe-core/src/evs/cfe_evs_utils.h b/modules/evs/fsw/src/cfe_evs_utils.h similarity index 98% rename from fsw/cfe-core/src/evs/cfe_evs_utils.h rename to modules/evs/fsw/src/cfe_evs_utils.h index b2ee70d84..eb82998c1 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_utils.h +++ b/modules/evs/fsw/src/cfe_evs_utils.h @@ -44,6 +44,9 @@ /********************* Include Files ************************/ #include "cfe_evs_task.h" /* EVS internal definitions */ +#include "cfe_resourceid.h" +#include "cfe_es_api_typedefs.h" +#include "cfe_time_api_typedefs.h" /* ============== Section I: Macro and Constant Type Definitions =========== */ diff --git a/fsw/cfe-core/src/evs/cfe_evs_verify.h b/modules/evs/fsw/src/cfe_evs_verify.h similarity index 100% rename from fsw/cfe-core/src/evs/cfe_evs_verify.h rename to modules/evs/fsw/src/cfe_evs_verify.h diff --git a/modules/evs/ut-coverage/CMakeLists.txt b/modules/evs/ut-coverage/CMakeLists.txt new file mode 100644 index 000000000..11e674c02 --- /dev/null +++ b/modules/evs/ut-coverage/CMakeLists.txt @@ -0,0 +1,7 @@ +################################################################## +# +# cFE unit test CMake build recipe +# +################################################################## + +# Nothing yet - placeholder for future use diff --git a/fsw/cfe-core/unit-test/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c similarity index 100% rename from fsw/cfe-core/unit-test/evs_UT.c rename to modules/evs/ut-coverage/evs_UT.c diff --git a/fsw/cfe-core/unit-test/evs_UT.h b/modules/evs/ut-coverage/evs_UT.h similarity index 100% rename from fsw/cfe-core/unit-test/evs_UT.h rename to modules/evs/ut-coverage/evs_UT.h diff --git a/modules/fs/CMakeLists.txt b/modules/fs/CMakeLists.txt new file mode 100644 index 000000000..a6fc75603 --- /dev/null +++ b/modules/fs/CMakeLists.txt @@ -0,0 +1,25 @@ +################################################################## +# +# cFE File Services (FS) module CMake build recipe +# +################################################################## + +project(CFE_FS C) + +# File services source files +set(fs_SOURCES + fsw/src/cfe_fs_api.c + fsw/src/cfe_fs_priv.c + fsw/src/cfe_fs_api.c + fsw/src/cfe_fs_priv.c +) +add_library(fs STATIC ${fs_SOURCES}) + +target_include_directories(fs PUBLIC fsw/inc) +target_link_libraries(fs PRIVATE core_private) + +# Add unit test coverage subdirectory +if(ENABLE_UNIT_TESTS) + add_subdirectory(ut-coverage) +endif(ENABLE_UNIT_TESTS) + diff --git a/fsw/cfe-core/src/fs/cfe_fs_api.c b/modules/fs/fsw/src/cfe_fs_api.c similarity index 99% rename from fsw/cfe-core/src/fs/cfe_fs_api.c rename to modules/fs/fsw/src/cfe_fs_api.c index fd2e9ef5f..b06d2c419 100644 --- a/fsw/cfe-core/src/fs/cfe_fs_api.c +++ b/modules/fs/fsw/src/cfe_fs_api.c @@ -33,19 +33,13 @@ /* ** Required header files... */ -#include "private/cfe_private.h" -#include "cfe_fs_priv.h" -#include "cfe_fs.h" -#include "cfe_time.h" -#include "osapi.h" -#include "cfe_psp.h" -#include "cfe_es.h" +#include "cfe_fs_module_all.h" + #include /* The target config allows refs into global CONFIGDATA object(s) */ #include "target_config.h" - /* * Fixed default file system extensions (not platform dependent) */ diff --git a/modules/fs/fsw/src/cfe_fs_module_all.h b/modules/fs/fsw/src/cfe_fs_module_all.h new file mode 100644 index 000000000..6730941c2 --- /dev/null +++ b/modules/fs/fsw/src/cfe_fs_module_all.h @@ -0,0 +1,43 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file cfe_fs_module_all.h + * + * Encapsulates all FS module internal header files, as well + * as the public API from all other CFE core modules, OSAL, and PSP. + * + * This simplifies the set of include files that need to be put at the + * start of every source file. + */ + +#ifndef CFE_FS_MODULE_ALL_H +#define CFE_FS_MODULE_ALL_H + +/* +** Includes +*/ +#include "cfe.h" +#include "cfe_fs_priv.h" +#include "cfe_fs_core_internal.h" + + +#endif /* CFE_FS_MODULE_ALL_H */ +/*****************************************************************************/ diff --git a/fsw/cfe-core/src/fs/cfe_fs_priv.c b/modules/fs/fsw/src/cfe_fs_priv.c similarity index 96% rename from fsw/cfe-core/src/fs/cfe_fs_priv.c rename to modules/fs/fsw/src/cfe_fs_priv.c index b0d0785f8..d474dfe30 100644 --- a/fsw/cfe-core/src/fs/cfe_fs_priv.c +++ b/modules/fs/fsw/src/cfe_fs_priv.c @@ -33,14 +33,11 @@ /* ** Required header files */ -#include "osapi.h" -#include "private/cfe_private.h" -#include "cfe_es.h" -#include "cfe_fs.h" -#include "cfe_fs_priv.h" +#include "cfe_fs_module_all.h" #include + /* ** Global data ** diff --git a/fsw/cfe-core/src/fs/cfe_fs_priv.h b/modules/fs/fsw/src/cfe_fs_priv.h similarity index 98% rename from fsw/cfe-core/src/fs/cfe_fs_priv.h rename to modules/fs/fsw/src/cfe_fs_priv.h index c2826b466..0c26cafb7 100644 --- a/fsw/cfe-core/src/fs/cfe_fs_priv.h +++ b/modules/fs/fsw/src/cfe_fs_priv.h @@ -37,8 +37,8 @@ ** Includes */ #include "common_types.h" -#include "cfe_fs.h" -#include "cfe_es.h" +#include "cfe_fs_api_typedefs.h" +#include "cfe_es_api_typedefs.h" /* ** Macro Definitions diff --git a/modules/fs/ut-coverage/CMakeLists.txt b/modules/fs/ut-coverage/CMakeLists.txt new file mode 100644 index 000000000..11e674c02 --- /dev/null +++ b/modules/fs/ut-coverage/CMakeLists.txt @@ -0,0 +1,7 @@ +################################################################## +# +# cFE unit test CMake build recipe +# +################################################################## + +# Nothing yet - placeholder for future use diff --git a/fsw/cfe-core/unit-test/fs_UT.c b/modules/fs/ut-coverage/fs_UT.c similarity index 100% rename from fsw/cfe-core/unit-test/fs_UT.c rename to modules/fs/ut-coverage/fs_UT.c diff --git a/fsw/cfe-core/unit-test/fs_UT.h b/modules/fs/ut-coverage/fs_UT.h similarity index 100% rename from fsw/cfe-core/unit-test/fs_UT.h rename to modules/fs/ut-coverage/fs_UT.h diff --git a/modules/msg/CMakeLists.txt b/modules/msg/CMakeLists.txt index d1abfb5eb..9018021a1 100644 --- a/modules/msg/CMakeLists.txt +++ b/modules/msg/CMakeLists.txt @@ -16,35 +16,35 @@ # Add the basic set of files which are always built # Defined as absolute so this list can also be used to build unit tests set(${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_ccsdspri.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_init.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_msgid_shared.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_sechdr_checksum.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_sechdr_fc.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_sechdr_time.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_ccsdspri.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_init.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_msgid_shared.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_sechdr_checksum.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_sechdr_fc.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_sechdr_time.c ) # Source selection for if CCSDS extended header is included, and MsgId version use if (MISSION_INCLUDE_CCSDSEXT_HEADER) message(STATUS "CCSDS primary and extended header included in message header") list(APPEND ${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_ccsdsext.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_initdefaulthdr_priext.c) + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_ccsdsext.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_initdefaulthdr_priext.c) if (MISSION_MSGID_V2) # MsgId v2 or v1 can be used with extended headers message(STATUS "Message Id version 2 in use (MsgId V2)") list(APPEND ${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_msgid_v2.c) + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_msgid_v2.c) else (MISSION_MSGID_V2) message(STATUS "Message Id version 1 in use (MsgId V1)") list(APPEND ${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_msgid_v1.c) + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_msgid_v1.c) endif (MISSION_MSGID_V2) else (MISSION_INCLUDE_CCSDSEXT_HEADER) message(STATUS "CCSDS primary header included in message header (not including CCSDS extended header)") message(STATUS "Message Id version 1 in use (MsgId V1)") list(APPEND ${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_initdefaulthdr_pri.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_msg_msgid_v1.c) + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_initdefaulthdr_pri.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_msg_msgid_v1.c) if (MISSION_MSGID_V2) message(FATAL_ERROR "Message Id (MsgId) version 2 can only be used if MISSION_INCLUDE_CCSDSEXT_HEADER is set") endif (MISSION_MSGID_V2) @@ -53,10 +53,16 @@ endif (MISSION_INCLUDE_CCSDSEXT_HEADER) # Module library add_library(${DEP} STATIC ${${DEP}_SRC}) -# Add private include -target_include_directories(${DEP} PRIVATE private_inc) +target_include_directories(${DEP} PUBLIC fsw/inc) + +target_link_libraries(${DEP} PRIVATE core_private) # Add unit test coverage subdirectory if(ENABLE_UNIT_TESTS) - add_subdirectory(unit-test-coverage) + add_subdirectory(ut-coverage) endif(ENABLE_UNIT_TESTS) + +cfs_app_check_intf(${DEP} + ccsds_hdr.h + cfe_msg_api_typedefs.h +) diff --git a/fsw/cfe-core/src/inc/ccsds_hdr.h b/modules/msg/fsw/inc/ccsds_hdr.h similarity index 99% rename from fsw/cfe-core/src/inc/ccsds_hdr.h rename to modules/msg/fsw/inc/ccsds_hdr.h index ec523dce1..efcbc5eb8 100644 --- a/fsw/cfe-core/src/inc/ccsds_hdr.h +++ b/modules/msg/fsw/inc/ccsds_hdr.h @@ -32,7 +32,6 @@ */ #include "common_types.h" -#include "cfe_mission_cfg.h" /* * Type Definitions diff --git a/modules/msg/src/cfe_msg_ccsdsext.c b/modules/msg/fsw/src/cfe_msg_ccsdsext.c similarity index 99% rename from modules/msg/src/cfe_msg_ccsdsext.c rename to modules/msg/fsw/src/cfe_msg_ccsdsext.c index 658e9ac7d..e8b91684b 100644 --- a/modules/msg/src/cfe_msg_ccsdsext.c +++ b/modules/msg/fsw/src/cfe_msg_ccsdsext.c @@ -21,7 +21,7 @@ /****************************************************************************** * Message CCSDS extended header implementations */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_msg_defaults.h" #include "cfe_error.h" diff --git a/modules/msg/src/cfe_msg_ccsdspri.c b/modules/msg/fsw/src/cfe_msg_ccsdspri.c similarity index 99% rename from modules/msg/src/cfe_msg_ccsdspri.c rename to modules/msg/fsw/src/cfe_msg_ccsdspri.c index 1d1f9698a..780b93d23 100644 --- a/modules/msg/src/cfe_msg_ccsdspri.c +++ b/modules/msg/fsw/src/cfe_msg_ccsdspri.c @@ -21,7 +21,7 @@ /****************************************************************************** * Message CCSDS Primary header implementations */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_msg_defaults.h" #include "cfe_error.h" diff --git a/modules/msg/private_inc/cfe_msg_defaults.h b/modules/msg/fsw/src/cfe_msg_defaults.h similarity index 98% rename from modules/msg/private_inc/cfe_msg_defaults.h rename to modules/msg/fsw/src/cfe_msg_defaults.h index b93b0a1ae..cd25862ba 100644 --- a/modules/msg/private_inc/cfe_msg_defaults.h +++ b/modules/msg/fsw/src/cfe_msg_defaults.h @@ -31,6 +31,7 @@ */ #include "cfe_platform_cfg.h" #include "cfe_mission_cfg.h" +#include "cfe_msg_api_typedefs.h" /* * Defines diff --git a/modules/msg/src/cfe_msg_init.c b/modules/msg/fsw/src/cfe_msg_init.c similarity index 98% rename from modules/msg/src/cfe_msg_init.c rename to modules/msg/fsw/src/cfe_msg_init.c index 664b8c3dc..b116601d3 100644 --- a/modules/msg/src/cfe_msg_init.c +++ b/modules/msg/fsw/src/cfe_msg_init.c @@ -21,7 +21,7 @@ /****************************************************************************** * Message initialization */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_msg_defaults.h" #include "string.h" diff --git a/modules/msg/src/cfe_msg_initdefaulthdr_pri.c b/modules/msg/fsw/src/cfe_msg_initdefaulthdr_pri.c similarity index 100% rename from modules/msg/src/cfe_msg_initdefaulthdr_pri.c rename to modules/msg/fsw/src/cfe_msg_initdefaulthdr_pri.c diff --git a/modules/msg/src/cfe_msg_initdefaulthdr_priext.c b/modules/msg/fsw/src/cfe_msg_initdefaulthdr_priext.c similarity index 100% rename from modules/msg/src/cfe_msg_initdefaulthdr_priext.c rename to modules/msg/fsw/src/cfe_msg_initdefaulthdr_priext.c diff --git a/modules/msg/src/cfe_msg_msgid_shared.c b/modules/msg/fsw/src/cfe_msg_msgid_shared.c similarity index 98% rename from modules/msg/src/cfe_msg_msgid_shared.c rename to modules/msg/fsw/src/cfe_msg_msgid_shared.c index 79caaac7f..8cb31a322 100644 --- a/modules/msg/src/cfe_msg_msgid_shared.c +++ b/modules/msg/fsw/src/cfe_msg_msgid_shared.c @@ -21,7 +21,7 @@ /****************************************************************************** * Message id access functions, shared cFS implementation */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_error.h" diff --git a/modules/msg/src/cfe_msg_msgid_v1.c b/modules/msg/fsw/src/cfe_msg_msgid_v1.c similarity index 98% rename from modules/msg/src/cfe_msg_msgid_v1.c rename to modules/msg/fsw/src/cfe_msg_msgid_v1.c index 8b79ec3d3..47c002a0c 100644 --- a/modules/msg/src/cfe_msg_msgid_v1.c +++ b/modules/msg/fsw/src/cfe_msg_msgid_v1.c @@ -21,10 +21,11 @@ /****************************************************************************** * Message id access functions, cFS version 1 implementation */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_error.h" #include "cfe_platform_cfg.h" +#include "cfe_sb.h" /****************************************************************************** * Get message id - See API and header file for details diff --git a/modules/msg/src/cfe_msg_msgid_v2.c b/modules/msg/fsw/src/cfe_msg_msgid_v2.c similarity index 99% rename from modules/msg/src/cfe_msg_msgid_v2.c rename to modules/msg/fsw/src/cfe_msg_msgid_v2.c index 6845f9755..4e2c3b3fc 100644 --- a/modules/msg/src/cfe_msg_msgid_v2.c +++ b/modules/msg/fsw/src/cfe_msg_msgid_v2.c @@ -37,7 +37,7 @@ * | APID Qualifier |C/T flg | Pri Hdr APID | * +-+-+-+-+-+-+-+-+|--------|+-+-+-+-+-+-+-+ */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_error.h" #include "cfe_platform_cfg.h" diff --git a/modules/msg/private_inc/cfe_msg_priv.h b/modules/msg/fsw/src/cfe_msg_priv.h similarity index 99% rename from modules/msg/private_inc/cfe_msg_priv.h rename to modules/msg/fsw/src/cfe_msg_priv.h index 32d785715..ddd2c3d14 100644 --- a/modules/msg/private_inc/cfe_msg_priv.h +++ b/modules/msg/fsw/src/cfe_msg_priv.h @@ -30,6 +30,7 @@ * Includes */ #include "common_types.h" +#include "cfe_msg_hdr.h" /*****************************************************************************/ /** diff --git a/modules/msg/src/cfe_msg_sechdr_checksum.c b/modules/msg/fsw/src/cfe_msg_sechdr_checksum.c similarity index 99% rename from modules/msg/src/cfe_msg_sechdr_checksum.c rename to modules/msg/fsw/src/cfe_msg_sechdr_checksum.c index a958250ab..4a40d8ad5 100644 --- a/modules/msg/src/cfe_msg_sechdr_checksum.c +++ b/modules/msg/fsw/src/cfe_msg_sechdr_checksum.c @@ -21,7 +21,7 @@ /****************************************************************************** * Checksum field access functions */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" /******************************************************************************/ diff --git a/modules/msg/src/cfe_msg_sechdr_fc.c b/modules/msg/fsw/src/cfe_msg_sechdr_fc.c similarity index 99% rename from modules/msg/src/cfe_msg_sechdr_fc.c rename to modules/msg/fsw/src/cfe_msg_sechdr_fc.c index aa1c5abc9..34cd53c21 100644 --- a/modules/msg/src/cfe_msg_sechdr_fc.c +++ b/modules/msg/fsw/src/cfe_msg_sechdr_fc.c @@ -21,7 +21,7 @@ /****************************************************************************** * Function code field access functions */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" #define CFE_MSG_FC_MASK 0x7F /**< \brief Function code mask */ diff --git a/modules/msg/src/cfe_msg_sechdr_time.c b/modules/msg/fsw/src/cfe_msg_sechdr_time.c similarity index 99% rename from modules/msg/src/cfe_msg_sechdr_time.c rename to modules/msg/fsw/src/cfe_msg_sechdr_time.c index 71d8d7a84..314676709 100644 --- a/modules/msg/src/cfe_msg_sechdr_time.c +++ b/modules/msg/fsw/src/cfe_msg_sechdr_time.c @@ -22,7 +22,7 @@ * Time field access functions - cFS default 32 bit seconds, 16 bit subseconds * in big endian format */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "cfe_msg_priv.h" #include "cfe_error.h" #include diff --git a/modules/msg/mission_build.cmake b/modules/msg/mission_build.cmake index b34a3f6e5..2ff86e581 100644 --- a/modules/msg/mission_build.cmake +++ b/modules/msg/mission_build.cmake @@ -18,10 +18,10 @@ endif (MISSION_INCLUDE_CCSDSEXT_HEADER) # Generate the header definition files, use local default for this module) generate_config_includefile( FILE_NAME "cfe_msg_hdr.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/mission_inc/${MSG_HDR_FILE}" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/option_inc/${MSG_HDR_FILE}" ) generate_config_includefile( FILE_NAME "cfe_msg_sechdr.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/mission_inc/default_cfe_msg_sechdr.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/option_inc/default_cfe_msg_sechdr.h" ) diff --git a/modules/msg/mission_inc/default_cfe_msg_hdr_pri.h b/modules/msg/option_inc/default_cfe_msg_hdr_pri.h similarity index 88% rename from modules/msg/mission_inc/default_cfe_msg_hdr_pri.h rename to modules/msg/option_inc/default_cfe_msg_hdr_pri.h index 4ff9880bf..f51260b4a 100644 --- a/modules/msg/mission_inc/default_cfe_msg_hdr_pri.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_pri.h @@ -34,6 +34,7 @@ #include "common_types.h" #include "ccsds_hdr.h" #include "cfe_msg_sechdr.h" +#include "cfe_msg_api_typedefs.h" /* * Type Definitions @@ -56,34 +57,36 @@ typedef struct /** * \brief cFS generic base message + * + * This provides the definition of CFE_MSG_Message_t */ -typedef union +union CFE_MSG_Message { CCSDS_SpacePacket_t CCSDS; /**< \brief CCSDS Header (Pri or Pri + Ext) */ uint8 Byte[sizeof(CCSDS_SpacePacket_t)]; /**< \brief Byte level access */ -} CFE_MSG_Message_t; +}; /** * \brief cFS command header + * + * This provides the definition of CFE_MSG_CommandHeader_t */ -typedef struct +struct CFE_MSG_CommandHeader { - CFE_MSG_Message_t Msg; /**< \brief Base message */ CFE_MSG_CommandSecondaryHeader_t Sec; /**< \brief Secondary header */ - -} CFE_MSG_CommandHeader_t; +}; /** * \brief cFS telemetry header + * + * This provides the definition of CFE_MSG_TelemetryHeader_t */ -typedef struct +struct CFE_MSG_TelemetryHeader { - CFE_MSG_Message_t Msg; /**< \brief Base message */ CFE_MSG_TelemetrySecondaryHeader_t Sec; /**< \brief Secondary header */ uint8 Spare[4]; /**< \brief Padding to end on 64 bit boundary */ - -} CFE_MSG_TelemetryHeader_t; +}; #endif /* _cfe_msg_hdr_ */ diff --git a/modules/msg/mission_inc/default_cfe_msg_hdr_priext.h b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h similarity index 100% rename from modules/msg/mission_inc/default_cfe_msg_hdr_priext.h rename to modules/msg/option_inc/default_cfe_msg_hdr_priext.h diff --git a/modules/msg/mission_inc/default_cfe_msg_sechdr.h b/modules/msg/option_inc/default_cfe_msg_sechdr.h similarity index 100% rename from modules/msg/mission_inc/default_cfe_msg_sechdr.h rename to modules/msg/option_inc/default_cfe_msg_sechdr.h diff --git a/modules/msg/unit-test-coverage/CMakeLists.txt b/modules/msg/ut-coverage/CMakeLists.txt similarity index 94% rename from modules/msg/unit-test-coverage/CMakeLists.txt rename to modules/msg/ut-coverage/CMakeLists.txt index dd06ff924..2e36147e6 100644 --- a/modules/msg/unit-test-coverage/CMakeLists.txt +++ b/modules/msg/ut-coverage/CMakeLists.txt @@ -48,14 +48,14 @@ endif (MISSION_MSGID_V2) add_executable(${DEP}_UT ${ut_${DEP}_tests}) # Add include to get private defaults -target_include_directories(${DEP}_UT PRIVATE ../private_inc) +target_include_directories(${DEP}_UT PRIVATE ../fsw/src) # Also add the UT_COVERAGE_LINK_FLAGS to the link command # This should enable coverage analysis on platforms that support this target_link_libraries(${DEP}_UT ${UT_COVERAGE_LINK_FLAGS} - ut_cfe-core_support - ut_cfe-core_stubs + ut_core_private_stubs + ut_core_api_stubs ut_assert) add_test(${DEP}_UT ${DEP}_UT) diff --git a/modules/msg/unit-test-coverage/msg_UT.c b/modules/msg/ut-coverage/msg_UT.c similarity index 100% rename from modules/msg/unit-test-coverage/msg_UT.c rename to modules/msg/ut-coverage/msg_UT.c diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_ccsdsext.c b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_ccsdsext.c rename to modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c index 07c2decac..f7eaed5b4 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_ccsdsext.c +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c @@ -27,7 +27,7 @@ */ #include "utassert.h" #include "ut_support.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" #include "test_msg_utils.h" #include "test_cfe_msg_ccsdsext.h" diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_ccsdsext.h b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.h similarity index 100% rename from modules/msg/unit-test-coverage/test_cfe_msg_ccsdsext.h rename to modules/msg/ut-coverage/test_cfe_msg_ccsdsext.h diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_ccsdspri.c b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_ccsdspri.c rename to modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c index daffa4947..816ed4f83 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_ccsdspri.c +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.c @@ -27,7 +27,7 @@ */ #include "utassert.h" #include "ut_support.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" #include "test_msg_utils.h" #include "test_cfe_msg_ccsdspri.h" diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_ccsdspri.h b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.h similarity index 100% rename from modules/msg/unit-test-coverage/test_cfe_msg_ccsdspri.h rename to modules/msg/ut-coverage/test_cfe_msg_ccsdspri.h diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_checksum.c b/modules/msg/ut-coverage/test_cfe_msg_checksum.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_checksum.c rename to modules/msg/ut-coverage/test_cfe_msg_checksum.c index ba2b8b7a2..c1b3b98eb 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_checksum.c +++ b/modules/msg/ut-coverage/test_cfe_msg_checksum.c @@ -29,7 +29,7 @@ #include "ut_support.h" #include "test_msg_not.h" #include "test_msg_utils.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_cfe_msg_checksum.h" #include "cfe_error.h" #include diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_checksum.h b/modules/msg/ut-coverage/test_cfe_msg_checksum.h similarity index 100% rename from modules/msg/unit-test-coverage/test_cfe_msg_checksum.h rename to modules/msg/ut-coverage/test_cfe_msg_checksum.h diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_fc.c b/modules/msg/ut-coverage/test_cfe_msg_fc.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_fc.c rename to modules/msg/ut-coverage/test_cfe_msg_fc.c index 41828a2a0..88a907a68 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_fc.c +++ b/modules/msg/ut-coverage/test_cfe_msg_fc.c @@ -29,7 +29,7 @@ #include "ut_support.h" #include "test_msg_not.h" #include "test_msg_utils.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_cfe_msg_fc.h" #include "cfe_error.h" #include diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_fc.h b/modules/msg/ut-coverage/test_cfe_msg_fc.h similarity index 100% rename from modules/msg/unit-test-coverage/test_cfe_msg_fc.h rename to modules/msg/ut-coverage/test_cfe_msg_fc.h diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_init.c b/modules/msg/ut-coverage/test_cfe_msg_init.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_init.c rename to modules/msg/ut-coverage/test_cfe_msg_init.c index 4c2cb4a5d..ef2353017 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_init.c +++ b/modules/msg/ut-coverage/test_cfe_msg_init.c @@ -29,7 +29,7 @@ #include "ut_support.h" #include "test_msg_not.h" #include "test_msg_utils.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_cfe_msg_init.h" #include "cfe_error.h" #include "cfe_msg_defaults.h" diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_init.h b/modules/msg/ut-coverage/test_cfe_msg_init.h similarity index 100% rename from modules/msg/unit-test-coverage/test_cfe_msg_init.h rename to modules/msg/ut-coverage/test_cfe_msg_init.h diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_msgid.h b/modules/msg/ut-coverage/test_cfe_msg_msgid.h similarity index 100% rename from modules/msg/unit-test-coverage/test_cfe_msg_msgid.h rename to modules/msg/ut-coverage/test_cfe_msg_msgid.h diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_msgid_shared.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_msgid_shared.c rename to modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c index 16e4bcc9e..817308ff0 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_msgid_shared.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c @@ -27,7 +27,7 @@ */ #include "utassert.h" #include "ut_support.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" #include "test_msg_utils.h" #include "test_cfe_msg_msgid_shared.h" diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_msgid_shared.h b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.h similarity index 100% rename from modules/msg/unit-test-coverage/test_cfe_msg_msgid_shared.h rename to modules/msg/ut-coverage/test_cfe_msg_msgid_shared.h diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_msgid_v1.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_msgid_v1.c rename to modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c index 3afce7943..3f7ddd646 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_msgid_v1.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_v1.c @@ -24,7 +24,7 @@ #include "utassert.h" #include "ut_support.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" #include "test_msg_utils.h" #include "test_cfe_msg_msgid.h" diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_msgid_v2.c b/modules/msg/ut-coverage/test_cfe_msg_msgid_v2.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_msgid_v2.c rename to modules/msg/ut-coverage/test_cfe_msg_msgid_v2.c index a64664f73..ff0ef54fc 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_msgid_v2.c +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_v2.c @@ -27,7 +27,7 @@ */ #include "utassert.h" #include "ut_support.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" #include "test_msg_utils.h" #include "test_cfe_msg_msgid.h" diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_time.c b/modules/msg/ut-coverage/test_cfe_msg_time.c similarity index 99% rename from modules/msg/unit-test-coverage/test_cfe_msg_time.c rename to modules/msg/ut-coverage/test_cfe_msg_time.c index 657dbe227..c72eab80c 100644 --- a/modules/msg/unit-test-coverage/test_cfe_msg_time.c +++ b/modules/msg/ut-coverage/test_cfe_msg_time.c @@ -29,7 +29,7 @@ #include "ut_support.h" #include "test_msg_not.h" #include "test_msg_utils.h" -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_cfe_msg_time.h" #include "cfe_error.h" #include diff --git a/modules/msg/unit-test-coverage/test_cfe_msg_time.h b/modules/msg/ut-coverage/test_cfe_msg_time.h similarity index 100% rename from modules/msg/unit-test-coverage/test_cfe_msg_time.h rename to modules/msg/ut-coverage/test_cfe_msg_time.h diff --git a/modules/msg/unit-test-coverage/test_msg_ext_not.c b/modules/msg/ut-coverage/test_msg_ext_not.c similarity index 99% rename from modules/msg/unit-test-coverage/test_msg_ext_not.c rename to modules/msg/ut-coverage/test_msg_ext_not.c index d764bfabd..7bda6257a 100644 --- a/modules/msg/unit-test-coverage/test_msg_ext_not.c +++ b/modules/msg/ut-coverage/test_msg_ext_not.c @@ -25,7 +25,7 @@ /* * Includes */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" unsigned int Test_MSG_Ext_NotZero(const CFE_MSG_Message_t *MsgPtr) diff --git a/modules/msg/unit-test-coverage/test_msg_not.c b/modules/msg/ut-coverage/test_msg_not.c similarity index 98% rename from modules/msg/unit-test-coverage/test_msg_not.c rename to modules/msg/ut-coverage/test_msg_not.c index 8d7d60e86..39595129b 100644 --- a/modules/msg/unit-test-coverage/test_msg_not.c +++ b/modules/msg/ut-coverage/test_msg_not.c @@ -25,7 +25,7 @@ /* * Includes */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" unsigned int Test_MSG_NotZero(const CFE_MSG_Message_t *MsgPtr) diff --git a/modules/msg/unit-test-coverage/test_msg_not.h b/modules/msg/ut-coverage/test_msg_not.h similarity index 100% rename from modules/msg/unit-test-coverage/test_msg_not.h rename to modules/msg/ut-coverage/test_msg_not.h diff --git a/modules/msg/unit-test-coverage/test_msg_pri_not.c b/modules/msg/ut-coverage/test_msg_pri_not.c similarity index 99% rename from modules/msg/unit-test-coverage/test_msg_pri_not.c rename to modules/msg/ut-coverage/test_msg_pri_not.c index 3f35cf3b0..4c8e81afd 100644 --- a/modules/msg/unit-test-coverage/test_msg_pri_not.c +++ b/modules/msg/ut-coverage/test_msg_pri_not.c @@ -26,7 +26,7 @@ * Includes */ #include "test_cfe_msg_ccsdspri.h" /* For TEST_MSG_SIZE_OFFSET */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" unsigned int Test_MSG_Pri_NotZero(const CFE_MSG_Message_t *MsgPtr) diff --git a/modules/msg/unit-test-coverage/test_msg_prionly.c b/modules/msg/ut-coverage/test_msg_prionly.c similarity index 97% rename from modules/msg/unit-test-coverage/test_msg_prionly.c rename to modules/msg/ut-coverage/test_msg_prionly.c index 6df77d970..c85f95e5b 100644 --- a/modules/msg/unit-test-coverage/test_msg_prionly.c +++ b/modules/msg/ut-coverage/test_msg_prionly.c @@ -25,7 +25,7 @@ /* * Includes */ -#include "cfe_msg_api.h" +#include "cfe_msg.h" #include "test_msg_not.h" #include "test_cfe_msg_ccsdsext.h" diff --git a/modules/msg/unit-test-coverage/test_msg_utils.h b/modules/msg/ut-coverage/test_msg_utils.h similarity index 96% rename from modules/msg/unit-test-coverage/test_msg_utils.h rename to modules/msg/ut-coverage/test_msg_utils.h index e79eeda90..f95a9c017 100644 --- a/modules/msg/unit-test-coverage/test_msg_utils.h +++ b/modules/msg/ut-coverage/test_msg_utils.h @@ -27,7 +27,7 @@ /* * Includes */ -#include "cfe_msg_typedefs.h" +#include "cfe_msg_api_typedefs.h" /* * Defines diff --git a/modules/resourceid/CMakeLists.txt b/modules/resourceid/CMakeLists.txt index 5550cb33d..819135dad 100644 --- a/modules/resourceid/CMakeLists.txt +++ b/modules/resourceid/CMakeLists.txt @@ -7,12 +7,14 @@ project(CFE_RESOURCEID C) # Module library -set(resourceid_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_resourceid_api.c) +set(resourceid_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_resourceid_api.c +) add_library(resourceid STATIC ${resourceid_SOURCES}) -target_include_directories(resourceid PUBLIC inc) +target_link_libraries(resourceid PRIVATE core_private) # Add unit test coverage subdirectory if(ENABLE_UNIT_TESTS) - add_subdirectory(unit-test-coverage) + add_subdirectory(ut-coverage) endif(ENABLE_UNIT_TESTS) diff --git a/modules/resourceid/arch_build.cmake b/modules/resourceid/arch_build.cmake deleted file mode 100644 index 9d77078a7..000000000 --- a/modules/resourceid/arch_build.cmake +++ /dev/null @@ -1,13 +0,0 @@ -########################################################### -# -# Resource ID arch build setup -# -# This file is evaluated as part of the "prepare" stage -# and can be used to set up prerequisites for the build, -# such as generating header files -# -########################################################### - -# allow all other code to refer to the public API in the "inc" dir -# ideally this should use an interface library instead -include_directories(${CMAKE_CURRENT_LIST_DIR}/inc) diff --git a/modules/resourceid/src/cfe_resourceid_api.c b/modules/resourceid/fsw/src/cfe_resourceid_api.c similarity index 99% rename from modules/resourceid/src/cfe_resourceid_api.c rename to modules/resourceid/fsw/src/cfe_resourceid_api.c index fd7a16718..531976151 100644 --- a/modules/resourceid/src/cfe_resourceid_api.c +++ b/modules/resourceid/fsw/src/cfe_resourceid_api.c @@ -38,7 +38,7 @@ #include #include "cfe.h" -#include "cfe_resourceid_api.h" +#include "cfe_resourceid.h" #include "cfe_resourceid_basevalue.h" diff --git a/modules/resourceid/mission_build.cmake b/modules/resourceid/mission_build.cmake index 31bd3e9d0..0b9a02189 100644 --- a/modules/resourceid/mission_build.cmake +++ b/modules/resourceid/mission_build.cmake @@ -18,7 +18,7 @@ endif () # Generate the header definition files, use local default for this module) generate_config_includefile( FILE_NAME "cfe_resourceid_typedef.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/option/${RESOURCEID_HDR_FILE}" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/option_inc/${RESOURCEID_HDR_FILE}" ) # Resource ID base value header @@ -26,7 +26,7 @@ generate_config_includefile( # but missions can provide their own if desired to override this. generate_config_includefile( FILE_NAME "cfe_resourceid_basevalue.h" - FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/option/cfe_resourceid_osal_compatible.h" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/option_inc/cfe_resourceid_osal_compatible.h" ) include_directories(${CMAKE_CURRENT_LIST_DIR}/inc) diff --git a/modules/resourceid/option/cfe_resourceid_osal_compatible.h b/modules/resourceid/option_inc/cfe_resourceid_osal_compatible.h similarity index 100% rename from modules/resourceid/option/cfe_resourceid_osal_compatible.h rename to modules/resourceid/option_inc/cfe_resourceid_osal_compatible.h diff --git a/modules/resourceid/option/cfe_resourceid_simple.h b/modules/resourceid/option_inc/cfe_resourceid_simple.h similarity index 100% rename from modules/resourceid/option/cfe_resourceid_simple.h rename to modules/resourceid/option_inc/cfe_resourceid_simple.h diff --git a/modules/resourceid/option/cfe_resourceid_strict.h b/modules/resourceid/option_inc/cfe_resourceid_strict.h similarity index 100% rename from modules/resourceid/option/cfe_resourceid_strict.h rename to modules/resourceid/option_inc/cfe_resourceid_strict.h diff --git a/modules/resourceid/unit-test-coverage/CMakeLists.txt b/modules/resourceid/ut-coverage/CMakeLists.txt similarity index 83% rename from modules/resourceid/unit-test-coverage/CMakeLists.txt rename to modules/resourceid/ut-coverage/CMakeLists.txt index 42ca3bde8..7be770ae3 100644 --- a/modules/resourceid/unit-test-coverage/CMakeLists.txt +++ b/modules/resourceid/ut-coverage/CMakeLists.txt @@ -9,7 +9,12 @@ # Unit test object library sources, options, and includes add_library(ut_resourceid_OBJS OBJECT ${resourceid_SOURCES}) -target_compile_options(ut_resourceid_OBJS PRIVATE ${UT_COVERAGE_COMPILE_FLAGS}) +target_compile_options(ut_resourceid_OBJS PRIVATE + ${UT_COVERAGE_COMPILE_FLAGS} +) +target_include_directories(ut_resourceid_OBJS PRIVATE + $ +) # Add executable add_executable(resourceid_UT test_cfe_resourceid.c $) @@ -21,6 +26,7 @@ target_include_directories(resourceid_UT PRIVATE ${CFE_RESOURCEID_SOURCE_DIR}/op # This should enable coverage analysis on platforms that support this target_link_libraries(resourceid_UT ${UT_COVERAGE_LINK_FLAGS} + ut_core_private_stubs ut_assert) add_test(resourceid_UT resourceid_UT) diff --git a/modules/resourceid/unit-test-coverage/test_cfe_resourceid.c b/modules/resourceid/ut-coverage/test_cfe_resourceid.c similarity index 99% rename from modules/resourceid/unit-test-coverage/test_cfe_resourceid.c rename to modules/resourceid/ut-coverage/test_cfe_resourceid.c index df59ffeaa..16b562dab 100644 --- a/modules/resourceid/unit-test-coverage/test_cfe_resourceid.c +++ b/modules/resourceid/ut-coverage/test_cfe_resourceid.c @@ -22,7 +22,7 @@ * Includes */ #include "cfe.h" -#include "cfe_resourceid_api.h" +#include "cfe_resourceid.h" #include "cfe_resourceid_basevalue.h" #include "utassert.h" #include "utstubs.h" diff --git a/modules/sb/CMakeLists.txt b/modules/sb/CMakeLists.txt new file mode 100644 index 000000000..4362a2774 --- /dev/null +++ b/modules/sb/CMakeLists.txt @@ -0,0 +1,39 @@ +################################################################## +# +# cFE Software Bus (SB) module CMake build recipe +# +################################################################## + +project(CFE_SB C) + +# Software Bus source files +set(sb_SOURCES + fsw/src/cfe_sb_api.c + fsw/src/cfe_sb_buf.c + fsw/src/cfe_sb_init.c + fsw/src/cfe_sb_msg_id_util.c + fsw/src/cfe_sb_priv.c + fsw/src/cfe_sb_task.c + fsw/src/cfe_sb_util.c + fsw/src/cfe_sb_api.c + fsw/src/cfe_sb_buf.c + fsw/src/cfe_sb_init.c + fsw/src/cfe_sb_msg_id_util.c + fsw/src/cfe_sb_priv.c + fsw/src/cfe_sb_task.c + fsw/src/cfe_sb_util.c +) +add_library(sb STATIC ${sb_SOURCES}) + +target_include_directories(sb PUBLIC fsw/inc) +target_link_libraries(sb PRIVATE core_private) + +# Add unit test coverage subdirectory +if(ENABLE_UNIT_TESTS) + add_subdirectory(ut-coverage) +endif(ENABLE_UNIT_TESTS) + +cfs_app_check_intf(${DEP} + cfe_sb_msg.h + cfe_sb_events.h +) diff --git a/fsw/cfe-core/eds/cfe_sb.xml b/modules/sb/eds/cfe_sb.xml similarity index 100% rename from fsw/cfe-core/eds/cfe_sb.xml rename to modules/sb/eds/cfe_sb.xml diff --git a/fsw/cfe-core/src/inc/cfe_sb_events.h b/modules/sb/fsw/inc/cfe_sb_events.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_sb_events.h rename to modules/sb/fsw/inc/cfe_sb_events.h diff --git a/fsw/cfe-core/src/inc/cfe_sb_msg.h b/modules/sb/fsw/inc/cfe_sb_msg.h similarity index 99% rename from fsw/cfe-core/src/inc/cfe_sb_msg.h rename to modules/sb/fsw/inc/cfe_sb_msg.h index e504f4b37..4912ea7e4 100644 --- a/fsw/cfe-core/src/inc/cfe_sb_msg.h +++ b/modules/sb/fsw/inc/cfe_sb_msg.h @@ -35,9 +35,10 @@ /* ** Includes */ -#include "common_types.h" -#include "cfe_sb.h" -#include "cfe_es.h" +#include "common_types.h" /* Basic data types */ +#include "cfe_msg_hdr.h" /* for header definitions */ +#include "cfe_sb_extern_typedefs.h" +#include "cfe_es_extern_typedefs.h" /**************************************** diff --git a/fsw/cfe-core/src/sb/cfe_sb_api.c b/modules/sb/fsw/src/cfe_sb_api.c similarity index 99% rename from fsw/cfe-core/src/sb/cfe_sb_api.c rename to modules/sb/fsw/src/cfe_sb_api.c index ba2eff5af..ea824a4f7 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_api.c +++ b/modules/sb/fsw/src/cfe_sb_api.c @@ -58,17 +58,9 @@ /* ** Include Files */ -#include "common_types.h" -#include "private/cfe_private.h" -#include "cfe_sb_events.h" -#include "cfe_sb_priv.h" -#include "cfe_sb.h" -#include "osapi.h" -#include "cfe_es.h" -#include "cfe_psp.h" -#include "cfe_error.h" +#include "cfe_sb_module_all.h" + #include -#include "private/cfe_core_resourceid_basevalues.h" /* * Macro to reflect size of PipeDepthStats Telemetry array - @@ -763,7 +755,6 @@ int32 CFE_SB_GetPipeIdByName(CFE_SB_PipeId_t *PipeIdPtr, const char *PipeName) osal_id_t SysQueueId; PendingEventID = 0; - Status = CFE_SUCCESS; SysQueueId = OS_OBJECT_ID_UNDEFINED; if(PipeName == NULL || PipeIdPtr == NULL) diff --git a/fsw/cfe-core/src/sb/cfe_sb_buf.c b/modules/sb/fsw/src/cfe_sb_buf.c similarity index 98% rename from fsw/cfe-core/src/sb/cfe_sb_buf.c rename to modules/sb/fsw/src/cfe_sb_buf.c index ab87523e9..2b3385507 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_buf.c +++ b/modules/sb/fsw/src/cfe_sb_buf.c @@ -33,11 +33,7 @@ ** Include Files */ -#include "cfe_sb_priv.h" -#include "cfe_sb_events.h" -#include "osapi.h" -#include "cfe_es.h" -#include "cfe_error.h" +#include "cfe_sb_module_all.h" /* * The actual message content of a SB Buffer Descriptor is the diff --git a/fsw/cfe-core/src/sb/cfe_sb_init.c b/modules/sb/fsw/src/cfe_sb_init.c similarity index 95% rename from fsw/cfe-core/src/sb/cfe_sb_init.c rename to modules/sb/fsw/src/cfe_sb_init.c index 561f88b48..0e3c40734 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_init.c +++ b/modules/sb/fsw/src/cfe_sb_init.c @@ -32,15 +32,7 @@ ** Include Files */ -#include "cfe_sb_priv.h" -#include "cfe_sb.h" -#include "osapi.h" -#include "cfe_msgids.h" -#include "cfe_es.h" -#include "cfe_psp.h" -#include "cfe_error.h" -#include "cfe_sb_events.h" -#include "private/cfe_core_resourceid_basevalues.h" +#include "cfe_sb_module_all.h" #include diff --git a/modules/sb/fsw/src/cfe_sb_module_all.h b/modules/sb/fsw/src/cfe_sb_module_all.h new file mode 100644 index 000000000..aa2687387 --- /dev/null +++ b/modules/sb/fsw/src/cfe_sb_module_all.h @@ -0,0 +1,52 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file cfe_sb_module_all.h + * + * Encapsulates all SB module internal header files, as well + * as the public API from all other CFE core modules, OSAL, and PSP. + * + * This simplifies the set of include files that need to be put at the + * start of every source file. + */ + +#ifndef CFE_SB_MODULE_ALL_H +#define CFE_SB_MODULE_ALL_H + +/* +** Includes +*/ +#include "cfe.h" +#include "cfe_platform_cfg.h" +#include "cfe_msgids.h" +#include "cfe_perfids.h" + +#include "cfe_sb_core_internal.h" + +#include "cfe_sb_priv.h" +#include "cfe_sb_events.h" +#include "cfe_sb_destination_typedef.h" +#include "cfe_sb_msg.h" +#include "cfe_sbr.h" +#include "cfe_core_resourceid_basevalues.h" + + +#endif /* CFE_SB_MODULE_ALL_H */ diff --git a/fsw/cfe-core/src/sb/cfe_sb_msg_id_util.c b/modules/sb/fsw/src/cfe_sb_msg_id_util.c similarity index 93% rename from fsw/cfe-core/src/sb/cfe_sb_msg_id_util.c rename to modules/sb/fsw/src/cfe_sb_msg_id_util.c index 299dc931e..6dceaf77f 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_msg_id_util.c +++ b/modules/sb/fsw/src/cfe_sb_msg_id_util.c @@ -26,13 +26,8 @@ /* ** Include Files */ -#include "cfe_mission_cfg.h" -#include "ccsds.h" -#include "cfe_sb.h" -#include "osapi.h" -#include "cfe_error.h" -#include "cfe_sb_priv.h" -#include "cfe_msg_api.h" +#include "cfe_sb_module_all.h" + #ifndef CFE_OMIT_DEPRECATED_6_8 /* diff --git a/fsw/cfe-core/src/sb/cfe_sb_priv.c b/modules/sb/fsw/src/cfe_sb_priv.c similarity index 98% rename from fsw/cfe-core/src/sb/cfe_sb_priv.c rename to modules/sb/fsw/src/cfe_sb_priv.c index fa478e631..3f3ea3b99 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_priv.c +++ b/modules/sb/fsw/src/cfe_sb_priv.c @@ -76,16 +76,8 @@ ** Include Files */ -#include "common_types.h" -#include "osapi.h" -#include "private/cfe_private.h" -#include "cfe_sb_priv.h" -#include "cfe_sb.h" -#include "ccsds.h" -#include "cfe_error.h" -#include "cfe_es.h" -#include "cfe_msg_api.h" -#include "cfe_msgids.h" +#include "cfe_sb_module_all.h" + #include /****************************************************************************** diff --git a/fsw/cfe-core/src/sb/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h similarity index 98% rename from fsw/cfe-core/src/sb/cfe_sb_priv.h rename to modules/sb/fsw/src/cfe_sb_priv.h index de6e5096f..08d8cafaf 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -35,14 +35,16 @@ /* ** Includes */ +#include "cfe_platform_cfg.h" #include "common_types.h" -#include "private/cfe_private.h" -#include "private/cfe_sb_destination_typedef.h" -#include "cfe_sb.h" +#include "cfe_sb_api_typedefs.h" +#include "cfe_es_api_typedefs.h" +#include "cfe_sbr_api_typedefs.h" +#include "cfe_msg_api_typedefs.h" +#include "cfe_fs_api_typedefs.h" +#include "cfe_resourceid_api_typedefs.h" +#include "cfe_sb_destination_typedef.h" #include "cfe_sb_msg.h" -#include "cfe_time.h" -#include "cfe_es.h" -#include "private/cfe_sbr.h" /* ** Macro Definitions diff --git a/fsw/cfe-core/src/sb/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c similarity index 99% rename from fsw/cfe-core/src/sb/cfe_sb_task.c rename to modules/sb/fsw/src/cfe_sb_task.c index 5c24e5fe6..3744d00db 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -30,18 +30,10 @@ /* Include Files */ -#include "cfe_sb.h" -#include "cfe_sb_events.h" -#include "cfe_evs.h" -#include "cfe_sb_priv.h" -#include "osapi.h" +#include "cfe_sb_module_all.h" #include "cfe_version.h" -#include "cfe_msgids.h" -#include "cfe_error.h" -#include "cfe_es.h" -#include "cfe_psp.h" -#include "cfe_es_msg.h" -#include "cfe_sb_verify.h" +#include "cfe_es_msg.h" /* needed for local use of CFE_ES_RestartCmd_t */ + #include /* Task Globals */ diff --git a/fsw/cfe-core/src/sb/cfe_sb_util.c b/modules/sb/fsw/src/cfe_sb_util.c similarity index 98% rename from fsw/cfe-core/src/sb/cfe_sb_util.c rename to modules/sb/fsw/src/cfe_sb_util.c index e8501a49b..78f9b15d8 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_util.c +++ b/modules/sb/fsw/src/cfe_sb_util.c @@ -34,12 +34,7 @@ ** Include Files */ -#include "cfe_sb.h" -#include "ccsds.h" -#include "osapi.h" -#include "cfe_error.h" -#include "cfe_msg_api.h" -#include "cfe_es.h" +#include "cfe_sb_module_all.h" #include diff --git a/fsw/cfe-core/src/sb/cfe_sb_verify.h b/modules/sb/fsw/src/cfe_sb_verify.h similarity index 100% rename from fsw/cfe-core/src/sb/cfe_sb_verify.h rename to modules/sb/fsw/src/cfe_sb_verify.h diff --git a/modules/sb/ut-coverage/CMakeLists.txt b/modules/sb/ut-coverage/CMakeLists.txt new file mode 100644 index 000000000..11e674c02 --- /dev/null +++ b/modules/sb/ut-coverage/CMakeLists.txt @@ -0,0 +1,7 @@ +################################################################## +# +# cFE unit test CMake build recipe +# +################################################################## + +# Nothing yet - placeholder for future use diff --git a/fsw/cfe-core/unit-test/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c similarity index 99% rename from fsw/cfe-core/unit-test/sb_UT.c rename to modules/sb/ut-coverage/sb_UT.c index 2f2cd8346..b6899aee4 100644 --- a/fsw/cfe-core/unit-test/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -39,8 +39,8 @@ ** Includes */ #include "sb_UT.h" -#include "cfe_msg_api.h" -#include "private/cfe_core_resourceid_basevalues.h" +#include "cfe_msg.h" +#include "cfe_core_resourceid_basevalues.h" /* * A method to add an SB "Subtest" diff --git a/fsw/cfe-core/unit-test/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h similarity index 100% rename from fsw/cfe-core/unit-test/sb_UT.h rename to modules/sb/ut-coverage/sb_UT.h diff --git a/modules/sbr/CMakeLists.txt b/modules/sbr/CMakeLists.txt index 615589ca3..a8a564a7a 100644 --- a/modules/sbr/CMakeLists.txt +++ b/modules/sbr/CMakeLists.txt @@ -13,6 +13,8 @@ # ################################################################## +project(CFE_SBR C) + if (NOT MISSION_MSGMAP_IMPLEMENTATION) set(MISSION_MSGMAP_IMPLEMENTATION "DIRECT") endif (NOT MISSION_MSGMAP_IMPLEMENTATION) @@ -20,13 +22,13 @@ endif (NOT MISSION_MSGMAP_IMPLEMENTATION) if (MISSION_MSGMAP_IMPLEMENTATION STREQUAL "DIRECT") message(STATUS "Using direct map software bus routing implementation") set(${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_sbr_map_direct.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_sbr_route_unsorted.c) + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_sbr_map_direct.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_sbr_route_unsorted.c) elseif (MISSION_MSGMAP_IMPLEMENTATION STREQUAL "HASH") message(STATUS "Using hashed map software bus routing implementation") set(${DEP}_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_sbr_map_hash.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/cfe_sbr_route_unsorted.c) + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_sbr_map_hash.c + ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cfe_sbr_route_unsorted.c) else() message(ERROR "Invalid software bush routing implementation selected:" MISSION_MSGMAP_IMPLEMENTATION) endif() @@ -36,8 +38,10 @@ add_library(${DEP} STATIC ${${DEP}_SRC}) # Add private include target_include_directories(${DEP} PRIVATE private_inc) +target_link_libraries(sbr PRIVATE core_private) # Add unit test coverage subdirectory if(ENABLE_UNIT_TESTS) - add_subdirectory(unit-test-coverage) + add_subdirectory(ut-coverage) endif(ENABLE_UNIT_TESTS) + diff --git a/modules/sbr/src/cfe_sbr_map_direct.c b/modules/sbr/fsw/src/cfe_sbr_map_direct.c similarity index 98% rename from modules/sbr/src/cfe_sbr_map_direct.c rename to modules/sbr/fsw/src/cfe_sbr_map_direct.c index 1545bf4ef..8aab2d0fa 100644 --- a/modules/sbr/src/cfe_sbr_map_direct.c +++ b/modules/sbr/fsw/src/cfe_sbr_map_direct.c @@ -32,10 +32,12 @@ */ #include "common_types.h" -#include "private/cfe_sbr.h" +#include "cfe_sbr.h" #include "cfe_sbr_priv.h" #include +#include "cfe_sb.h" + /* * Macro Definitions */ diff --git a/modules/sbr/src/cfe_sbr_map_hash.c b/modules/sbr/fsw/src/cfe_sbr_map_hash.c similarity index 99% rename from modules/sbr/src/cfe_sbr_map_hash.c rename to modules/sbr/fsw/src/cfe_sbr_map_hash.c index dd9b8bd5c..44a85dc8e 100644 --- a/modules/sbr/src/cfe_sbr_map_hash.c +++ b/modules/sbr/fsw/src/cfe_sbr_map_hash.c @@ -32,8 +32,10 @@ */ #include "common_types.h" -#include "private/cfe_sbr.h" +#include "cfe_sbr.h" #include "cfe_sbr_priv.h" +#include "cfe_sb.h" + #include #include diff --git a/modules/sbr/private_inc/cfe_sbr_priv.h b/modules/sbr/fsw/src/cfe_sbr_priv.h similarity index 98% rename from modules/sbr/private_inc/cfe_sbr_priv.h rename to modules/sbr/fsw/src/cfe_sbr_priv.h index ecabbb6bb..308185a05 100644 --- a/modules/sbr/private_inc/cfe_sbr_priv.h +++ b/modules/sbr/fsw/src/cfe_sbr_priv.h @@ -29,7 +29,7 @@ /* * Includes */ -#include "private/cfe_sbr.h" +#include "cfe_sbr.h" /****************************************************************************** diff --git a/modules/sbr/src/cfe_sbr_route_unsorted.c b/modules/sbr/fsw/src/cfe_sbr_route_unsorted.c similarity index 99% rename from modules/sbr/src/cfe_sbr_route_unsorted.c rename to modules/sbr/fsw/src/cfe_sbr_route_unsorted.c index d47aa4eb1..40404fc53 100644 --- a/modules/sbr/src/cfe_sbr_route_unsorted.c +++ b/modules/sbr/fsw/src/cfe_sbr_route_unsorted.c @@ -33,10 +33,12 @@ */ #include "common_types.h" -#include "private/cfe_sbr.h" +#include "cfe_sbr.h" #include "cfe_sbr_priv.h" #include +#include "cfe_sb.h" + /****************************************************************************** * Type Definitions */ diff --git a/modules/sbr/unit-test-coverage/CMakeLists.txt b/modules/sbr/ut-coverage/CMakeLists.txt similarity index 78% rename from modules/sbr/unit-test-coverage/CMakeLists.txt rename to modules/sbr/ut-coverage/CMakeLists.txt index 95b22232e..e8b80206f 100644 --- a/modules/sbr/unit-test-coverage/CMakeLists.txt +++ b/modules/sbr/ut-coverage/CMakeLists.txt @@ -17,18 +17,18 @@ set(SBR_TEST_SET ${SBR_TEST_MAP_DIRECT} ${SBR_TEST_MAP_HASH} ${SBR_TEST_ROUTE_UN # Add configured map implementation to routing test source if (MISSION_MSGMAP_IMPLEMENTATION STREQUAL "DIRECT") - set(${SBR_TEST_ROUTE_UNSORTED}_SRC ../src/cfe_sbr_map_direct.c) + set(${SBR_TEST_ROUTE_UNSORTED}_SRC ${CFE_SBR_SOURCE_DIR}/fsw/src/cfe_sbr_map_direct.c) elseif (MISSION_MSGMAP_IMPLEMENTATION STREQUAL "HASH") - set(${SBR_TEST_ROUTE_UNSORTED}_SRC ../src/cfe_sbr_map_hash.c) + set(${SBR_TEST_ROUTE_UNSORTED}_SRC ${CFE_SBR_SOURCE_DIR}/fsw/src/cfe_sbr_map_hash.c) endif() # Add route implementation to map hash -set(${SBR_TEST_MAP_HASH}_SRC ../src/cfe_sbr_route_unsorted.c) +set(${SBR_TEST_MAP_HASH}_SRC ${CFE_SBR_SOURCE_DIR}/fsw/src/cfe_sbr_route_unsorted.c) foreach(SBR_TEST ${SBR_TEST_SET}) # Unit test object library sources, options, and includes - add_library(ut_${SBR_TEST}_objs OBJECT ${${SBR_TEST}_SRC} ../src/cfe_${SBR_TEST}.c) + add_library(ut_${SBR_TEST}_objs OBJECT ${${SBR_TEST}_SRC} ${CFE_SBR_SOURCE_DIR}/fsw/src/cfe_${SBR_TEST}.c) target_compile_options(ut_${SBR_TEST}_objs PRIVATE ${UT_COVERAGE_COMPILE_FLAGS}) target_include_directories(ut_${SBR_TEST}_objs PRIVATE $) @@ -41,14 +41,14 @@ foreach(SBR_TEST ${SBR_TEST_SET}) add_executable(${SBR_TEST}_UT ${ut_${SBR_TEST}_tests}) # Add include to get private defaults - target_include_directories(${SBR_TEST}_UT PRIVATE ../private_inc) + target_include_directories(${SBR_TEST}_UT PRIVATE ../fsw/src) # Also add the UT_COVERAGE_LINK_FLAGS to the link command # This should enable coverage analysis on platforms that support this target_link_libraries(${SBR_TEST}_UT ${UT_COVERAGE_LINK_FLAGS} - ut_cfe-core_support - ut_cfe-core_stubs + ut_core_private_stubs + ut_core_api_stubs ut_assert) add_test(${SBR_TEST}_UT ${SBR_TEST}_UT) diff --git a/modules/sbr/unit-test-coverage/test_cfe_sbr_map_direct.c b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c similarity index 99% rename from modules/sbr/unit-test-coverage/test_cfe_sbr_map_direct.c rename to modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c index c78c41e2a..f0ed6c102 100644 --- a/modules/sbr/unit-test-coverage/test_cfe_sbr_map_direct.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c @@ -27,7 +27,7 @@ */ #include "utassert.h" #include "ut_support.h" -#include "private/cfe_sbr.h" +#include "cfe_sbr.h" #include "cfe_sbr_priv.h" #include diff --git a/modules/sbr/unit-test-coverage/test_cfe_sbr_map_hash.c b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c similarity index 99% rename from modules/sbr/unit-test-coverage/test_cfe_sbr_map_hash.c rename to modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c index 1ba6c0db2..0b7586ad4 100644 --- a/modules/sbr/unit-test-coverage/test_cfe_sbr_map_hash.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c @@ -27,7 +27,7 @@ */ #include "utassert.h" #include "ut_support.h" -#include "private/cfe_sbr.h" +#include "cfe_sbr.h" #include "cfe_sbr_priv.h" /* diff --git a/modules/sbr/unit-test-coverage/test_cfe_sbr_route_unsorted.c b/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c similarity index 99% rename from modules/sbr/unit-test-coverage/test_cfe_sbr_route_unsorted.c rename to modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c index 2c202d6e0..22f436664 100644 --- a/modules/sbr/unit-test-coverage/test_cfe_sbr_route_unsorted.c +++ b/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c @@ -27,7 +27,7 @@ */ #include "utassert.h" #include "ut_support.h" -#include "private/cfe_sbr.h" +#include "cfe_sbr.h" #include "cfe_sbr_priv.h" /* Callback function for testing */ diff --git a/modules/tbl/CMakeLists.txt b/modules/tbl/CMakeLists.txt new file mode 100644 index 000000000..b2343f1d1 --- /dev/null +++ b/modules/tbl/CMakeLists.txt @@ -0,0 +1,33 @@ +################################################################## +# +# cFE Table Services (TBL) module CMake build recipe +# +################################################################## + +project(CFE_TBL C) + +# Table Services source files +set(tbl_SOURCES + fsw/src/cfe_tbl_api.c + fsw/src/cfe_tbl_internal.c + fsw/src/cfe_tbl_task.c + fsw/src/cfe_tbl_task_cmds.c + fsw/src/cfe_tbl_api.c + fsw/src/cfe_tbl_internal.c + fsw/src/cfe_tbl_task.c + fsw/src/cfe_tbl_task_cmds.c +) +add_library(tbl STATIC ${tbl_SOURCES}) + +target_include_directories(tbl PUBLIC fsw/inc) +target_link_libraries(tbl PRIVATE core_private) + +# Add unit test coverage subdirectory +if(ENABLE_UNIT_TESTS) + add_subdirectory(ut-coverage) +endif(ENABLE_UNIT_TESTS) + +cfs_app_check_intf(${DEP} + cfe_tbl_msg.h + cfe_tbl_events.h +) diff --git a/fsw/cfe-core/eds/cfe_tbl.xml b/modules/tbl/eds/cfe_tbl.xml similarity index 100% rename from fsw/cfe-core/eds/cfe_tbl.xml rename to modules/tbl/eds/cfe_tbl.xml diff --git a/fsw/cfe-core/src/inc/cfe_tbl_events.h b/modules/tbl/fsw/inc/cfe_tbl_events.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_tbl_events.h rename to modules/tbl/fsw/inc/cfe_tbl_events.h diff --git a/fsw/cfe-core/src/inc/cfe_tbl_msg.h b/modules/tbl/fsw/inc/cfe_tbl_msg.h similarity index 99% rename from fsw/cfe-core/src/inc/cfe_tbl_msg.h rename to modules/tbl/fsw/inc/cfe_tbl_msg.h index e4d83d211..54a9ad1a5 100644 --- a/fsw/cfe-core/src/inc/cfe_tbl_msg.h +++ b/modules/tbl/fsw/inc/cfe_tbl_msg.h @@ -38,7 +38,10 @@ /* ** Required header files... */ -#include "cfe.h" +#include "common_types.h" /* Basic data types */ +#include "cfe_msg_hdr.h" /* for header definitions */ +#include "cfe_tbl_extern_typedefs.h" +#include "cfe_time_extern_typedefs.h" /*************************************************************************/ diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_api.c b/modules/tbl/fsw/src/cfe_tbl_api.c similarity index 99% rename from fsw/cfe-core/src/tbl/cfe_tbl_api.c rename to modules/tbl/fsw/src/cfe_tbl_api.c index 1b58a2e69..5226bb35d 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_api.c +++ b/modules/tbl/fsw/src/cfe_tbl_api.c @@ -33,13 +33,9 @@ /* ** Required header files... */ +#include "cfe_tbl_module_all.h" + #include -#include "private/cfe_private.h" -#include "cfe_es.h" -#include "cfe_tbl.h" -#include "cfe_error.h" -#include "cfe_tbl_internal.h" -#include "cfe_psp.h" /* ** Local Macros @@ -59,8 +55,8 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, CFE_TBL_LoadBuff_t *WorkingBufferPtr; CFE_TBL_CritRegRec_t *CritRegRecPtr = NULL; int32 Status; - size_t NameLen = 0; - int16 RegIndx = -1; + size_t NameLen; + int16 RegIndx; CFE_ES_AppId_t ThisAppId; char AppName[OS_MAX_API_NAME] = {"UNKNOWN"}; char TblName[CFE_TBL_MAX_FULL_NAME_LEN] = {""}; @@ -522,7 +518,7 @@ int32 CFE_TBL_Share( CFE_TBL_Handle_t *TblHandlePtr, { int32 Status; CFE_ES_AppId_t ThisAppId; - int16 RegIndx = CFE_TBL_NOT_FOUND; + int16 RegIndx; CFE_TBL_AccessDescriptor_t *AccessDescPtr = NULL; CFE_TBL_RegistryRec_t *RegRecPtr = NULL; char AppName[OS_MAX_API_NAME] = {"UNKNOWN"}; @@ -1511,7 +1507,7 @@ int32 CFE_TBL_Modified( CFE_TBL_Handle_t TblHandle ) CFE_TBL_RegistryRec_t *RegRecPtr = NULL; CFE_TBL_Handle_t AccessIterator; CFE_ES_AppId_t ThisAppId; - size_t FilenameLen = 0; + size_t FilenameLen; /* Verify that this application has the right to perform operation */ Status = CFE_TBL_ValidateAccess(TblHandle, &ThisAppId); diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c similarity index 99% rename from fsw/cfe-core/src/tbl/cfe_tbl_internal.c rename to modules/tbl/fsw/src/cfe_tbl_internal.c index c50b6b116..30c6740aa 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -33,14 +33,8 @@ /* ** Required header files... */ -#include "cfe_msgids.h" -#include "cfe_tbl_internal.h" -#include "cfe_tbl_events.h" -#include "cfe_error.h" -#include "cfe_es.h" -#include "cfe_evs.h" -#include "cfe_fs.h" -#include "cfe_psp.h" +#include "cfe_tbl_module_all.h" + #include #include diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_internal.h b/modules/tbl/fsw/src/cfe_tbl_internal.h similarity index 98% rename from fsw/cfe-core/src/tbl/cfe_tbl_internal.h rename to modules/tbl/fsw/src/cfe_tbl_internal.h index 7fbdb25c3..a94205fa8 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_internal.h +++ b/modules/tbl/fsw/src/cfe_tbl_internal.h @@ -29,15 +29,20 @@ ** */ -#ifndef _cfe_tbl_internal_ -#define _cfe_tbl_internal_ +#ifndef CFE_TBL_INTERNAL_H +#define CFE_TBL_INTERNAL_H /* ** Required header files... */ -#include "cfe_tbl.h" +#include "cfe.h" +#include "cfe_platform_cfg.h" +#include "cfe_msgids.h" +#include "cfe_perfids.h" #include "cfe_tbl_task.h" -#include "cfe_tbl_filedef.h" +#include "cfe_tbl_task_cmds.h" +#include "cfe_tbl_events.h" +#include "cfe_tbl_msg.h" /********************* Macro and Constant Type Definitions ***************************/ @@ -595,4 +600,4 @@ extern CFE_TBL_Global_t CFE_TBL_Global; -#endif /* _cfe_tbl_internal_ */ +#endif /* CFE_TBL_INTERNAL_H */ diff --git a/modules/tbl/fsw/src/cfe_tbl_module_all.h b/modules/tbl/fsw/src/cfe_tbl_module_all.h new file mode 100644 index 000000000..c7b2f9120 --- /dev/null +++ b/modules/tbl/fsw/src/cfe_tbl_module_all.h @@ -0,0 +1,57 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file cfe_tbl_module_all.h + * + * Encapsulates all TBL module internal header files, as well + * as the public API from all other CFE core modules, OSAL, and PSP. + * + * This simplifies the set of include files that need to be put at the + * start of every source file. + */ + +#ifndef CFE_TBL_MODULE_ALL_H +#define CFE_TBL_MODULE_ALL_H + +/* +** Includes +*/ +#include "cfe.h" +#include "cfe_platform_cfg.h" +#include "cfe_msgids.h" +#include "cfe_perfids.h" + +#include "cfe_tbl_core_internal.h" + +#include "cfe_tbl_events.h" +#include "cfe_tbl_msg.h" +#include "cfe_tbl_internal.h" +#include "cfe_tbl_task.h" +#include "cfe_tbl_task_cmds.h" + +/* + * Additionally TBL needs to use special/extra CDS APIs that are not in the normal API + */ +#include "cfe_es_core_internal.h" + + + +#endif /* CFE_TBL_MODULE_ALL_H */ diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task.c b/modules/tbl/fsw/src/cfe_tbl_task.c similarity index 98% rename from fsw/cfe-core/src/tbl/cfe_tbl_task.c rename to modules/tbl/fsw/src/cfe_tbl_task.c index 3583e8cd3..3e7bed088 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task.c +++ b/modules/tbl/fsw/src/cfe_tbl_task.c @@ -33,14 +33,9 @@ /* ** Required header files */ -#include "private/cfe_private.h" +#include "cfe_tbl_module_all.h" #include "cfe_version.h" -#include "cfe_tbl_internal.h" -#include "cfe_tbl_events.h" -#include "cfe_tbl_msg.h" -#include "cfe_tbl_task_cmds.h" -#include "cfe_tbl_verify.h" -#include "cfe_msgids.h" + #include @@ -149,7 +144,7 @@ void CFE_TBL_TaskMain(void) int32 CFE_TBL_TaskInit(void) { - int32 Status = CFE_SUCCESS; + int32 Status; /* ** Register Table Services with ES diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task.h b/modules/tbl/fsw/src/cfe_tbl_task.h similarity index 99% rename from fsw/cfe-core/src/tbl/cfe_tbl_task.h rename to modules/tbl/fsw/src/cfe_tbl_task.h index e17ddf804..2c88fb7a1 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task.h +++ b/modules/tbl/fsw/src/cfe_tbl_task.h @@ -39,8 +39,6 @@ /* ** Required header files */ -#include "private/cfe_private.h" -#include "cfe_tbl_events.h" #include "cfe_tbl_msg.h" diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c similarity index 99% rename from fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c rename to modules/tbl/fsw/src/cfe_tbl_task_cmds.c index 5ac2b95d0..94fb817d1 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -33,16 +33,9 @@ /* ** Required header files */ +#include "cfe_tbl_module_all.h" #include "cfe_version.h" -#include "cfe_evs.h" -#include "cfe_es.h" -#include "cfe_sb.h" -#include "cfe_fs.h" -#include "cfe_psp.h" -#include "cfe_tbl_internal.h" -#include "cfe_tbl_events.h" -#include "cfe_tbl_msg.h" -#include "cfe_tbl_task_cmds.h" + #include @@ -1034,7 +1027,7 @@ int32 CFE_TBL_ActivateCmd(const CFE_TBL_ActivateCmd_t *data) const CFE_TBL_ActivateCmd_Payload_t *CmdPtr = &data->Payload; char TableName[CFE_TBL_MAX_FULL_NAME_LEN]; CFE_TBL_RegistryRec_t *RegRecPtr; - bool ValidationStatus = false; + bool ValidationStatus; /* Make sure all strings are null terminated before attempting to process them */ CFE_SB_MessageStringGet(TableName, (char *)CmdPtr->TableName, NULL, diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h similarity index 99% rename from fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h rename to modules/tbl/fsw/src/cfe_tbl_task_cmds.h index fb04b98af..d77f435e3 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.h +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h @@ -35,7 +35,12 @@ /* ** Required header files */ -#include "cfe.h" +#include "common_types.h" +#include "cfe_tbl_task.h" +#include "cfe_tbl_msg.h" +#include "cfe_error.h" + +#include "cfe_sb_extern_typedefs.h" /********************* Macro and Constant Type Definitions ***************************/ diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_verify.h b/modules/tbl/fsw/src/cfe_tbl_verify.h similarity index 100% rename from fsw/cfe-core/src/tbl/cfe_tbl_verify.h rename to modules/tbl/fsw/src/cfe_tbl_verify.h diff --git a/modules/tbl/ut-coverage/CMakeLists.txt b/modules/tbl/ut-coverage/CMakeLists.txt new file mode 100644 index 000000000..11e674c02 --- /dev/null +++ b/modules/tbl/ut-coverage/CMakeLists.txt @@ -0,0 +1,7 @@ +################################################################## +# +# cFE unit test CMake build recipe +# +################################################################## + +# Nothing yet - placeholder for future use diff --git a/fsw/cfe-core/unit-test/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c similarity index 99% rename from fsw/cfe-core/unit-test/tbl_UT.c rename to modules/tbl/ut-coverage/tbl_UT.c index 156c560a6..2344b08d5 100644 --- a/fsw/cfe-core/unit-test/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -39,7 +39,7 @@ ** Includes */ #include "tbl_UT.h" -#include "private/cfe_core_resourceid_basevalues.h" +#include "cfe_core_resourceid_basevalues.h" /* ** External global variables diff --git a/fsw/cfe-core/unit-test/tbl_UT.h b/modules/tbl/ut-coverage/tbl_UT.h similarity index 99% rename from fsw/cfe-core/unit-test/tbl_UT.h rename to modules/tbl/ut-coverage/tbl_UT.h index 2b8884b5f..a5f6fde71 100644 --- a/fsw/cfe-core/unit-test/tbl_UT.h +++ b/modules/tbl/ut-coverage/tbl_UT.h @@ -46,7 +46,7 @@ #include "common_types.h" #include "ut_support.h" #include "cfe_tbl_msg.h" -#include "cfe_tbl_internal.h" +#include "cfe_tbl_module_all.h" #include "cfe_tbl_task.h" #include "cfe_tbl_task_cmds.h" diff --git a/modules/time/CMakeLists.txt b/modules/time/CMakeLists.txt new file mode 100644 index 000000000..2168ed154 --- /dev/null +++ b/modules/time/CMakeLists.txt @@ -0,0 +1,33 @@ +################################################################## +# +# cFE Time Services (TIME) module CMake build recipe +# +################################################################## + +project(CFE_TIME C) + +# Time Services source files +set(time_SOURCES + fsw/src/cfe_time_api.c + fsw/src/cfe_time_task.c + fsw/src/cfe_time_tone.c + fsw/src/cfe_time_utils.c + fsw/src/cfe_time_api.c + fsw/src/cfe_time_task.c + fsw/src/cfe_time_tone.c + fsw/src/cfe_time_utils.c +) +add_library(time STATIC ${time_SOURCES}) + +target_include_directories(time PUBLIC fsw/inc) +target_link_libraries(time PRIVATE core_private) + +# Add unit test coverage subdirectory +if(ENABLE_UNIT_TESTS) + add_subdirectory(ut-coverage) +endif(ENABLE_UNIT_TESTS) + +cfs_app_check_intf(${DEP} + cfe_time_events.h + cfe_time_msg.h +) diff --git a/fsw/cfe-core/eds/cfe_time.xml b/modules/time/eds/cfe_time.xml similarity index 100% rename from fsw/cfe-core/eds/cfe_time.xml rename to modules/time/eds/cfe_time.xml diff --git a/fsw/cfe-core/src/inc/cfe_time_events.h b/modules/time/fsw/inc/cfe_time_events.h similarity index 100% rename from fsw/cfe-core/src/inc/cfe_time_events.h rename to modules/time/fsw/inc/cfe_time_events.h diff --git a/fsw/cfe-core/src/inc/cfe_time_msg.h b/modules/time/fsw/inc/cfe_time_msg.h similarity index 99% rename from fsw/cfe-core/src/inc/cfe_time_msg.h rename to modules/time/fsw/inc/cfe_time_msg.h index 2345a05b8..7d952188b 100644 --- a/fsw/cfe-core/src/inc/cfe_time_msg.h +++ b/modules/time/fsw/inc/cfe_time_msg.h @@ -38,7 +38,9 @@ /* ** Required header files... */ -#include "cfe.h" +#include "common_types.h" /* Basic data types */ +#include "cfe_msg_hdr.h" /* for header definitions */ +#include "cfe_time_extern_typedefs.h" /*************************************************************************/ diff --git a/fsw/cfe-core/src/time/cfe_time_api.c b/modules/time/fsw/src/cfe_time_api.c similarity index 99% rename from fsw/cfe-core/src/time/cfe_time_api.c rename to modules/time/fsw/src/cfe_time_api.c index bab936009..61b16e809 100644 --- a/fsw/cfe-core/src/time/cfe_time_api.c +++ b/modules/time/fsw/src/cfe_time_api.c @@ -33,7 +33,7 @@ /* ** Required header files... */ -#include "cfe_time_utils.h" +#include "cfe_time_module_all.h" #include diff --git a/modules/time/fsw/src/cfe_time_module_all.h b/modules/time/fsw/src/cfe_time_module_all.h new file mode 100644 index 000000000..e5a401f0f --- /dev/null +++ b/modules/time/fsw/src/cfe_time_module_all.h @@ -0,0 +1,49 @@ +/* +** GSC-18128-1, "Core Flight Executive Version 6.7" +** +** Copyright (c) 2006-2019 United States Government as represented by +** the Administrator of the National Aeronautics and Space Administration. +** All Rights Reserved. +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +/** + * @file cfe_time_module_all.h + * + * Encapsulates all TIME module internal header files, as well + * as the public API from all other CFE core modules, OSAL, and PSP. + * + * This simplifies the set of include files that need to be put at the + * start of every source file. + */ + +#ifndef CFE_TIME_MODULE_ALL_H +#define CFE_TIME_MODULE_ALL_H + +/********************* Include Files ************************/ + +#include "cfe.h" /* All CFE+OSAL public API definitions */ +#include "cfe_platform_cfg.h" + +#include "cfe_msgids.h" +#include "cfe_perfids.h" + +#include "cfe_time_core_internal.h" + +#include "cfe_time_msg.h" +#include "cfe_time_events.h" +#include "cfe_time_utils.h" + + +#endif /* CFE_TIME_MODULE_ALL_H */ diff --git a/fsw/cfe-core/src/time/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c similarity index 99% rename from fsw/cfe-core/src/time/cfe_time_task.c rename to modules/time/fsw/src/cfe_time_task.c index 66e6bb9f0..99f1b371c 100644 --- a/fsw/cfe-core/src/time/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -33,9 +33,8 @@ /* ** Required header files... */ -#include "cfe_time_utils.h" +#include "cfe_time_module_all.h" #include "cfe_version.h" -#include "cfe_msgids.h" /* ** Time task global data... @@ -198,7 +197,7 @@ void CFE_TIME_TaskMain(void) int32 CFE_TIME_TaskInit(void) { - int32 Status = CFE_SUCCESS; + int32 Status; osal_id_t TimeBaseId; osal_id_t TimerId; diff --git a/fsw/cfe-core/src/time/cfe_time_tone.c b/modules/time/fsw/src/cfe_time_tone.c similarity index 99% rename from fsw/cfe-core/src/time/cfe_time_tone.c rename to modules/time/fsw/src/cfe_time_tone.c index 1505d6a73..48b765a94 100644 --- a/fsw/cfe-core/src/time/cfe_time_tone.c +++ b/modules/time/fsw/src/cfe_time_tone.c @@ -40,7 +40,7 @@ /* ** Required header files... */ -#include "cfe_time_utils.h" +#include "cfe_time_module_all.h" #include @@ -1461,7 +1461,7 @@ void CFE_TIME_Local1HzTask(void) void CFE_TIME_NotifyTimeSynchApps(void) { - uint32 i = 0; + uint32 i; CFE_TIME_SynchCallbackPtr_t Func; /* diff --git a/fsw/cfe-core/src/time/cfe_time_utils.c b/modules/time/fsw/src/cfe_time_utils.c similarity index 99% rename from fsw/cfe-core/src/time/cfe_time_utils.c rename to modules/time/fsw/src/cfe_time_utils.c index 9718fbad0..85b1de2fb 100644 --- a/fsw/cfe-core/src/time/cfe_time_utils.c +++ b/modules/time/fsw/src/cfe_time_utils.c @@ -34,7 +34,11 @@ */ #include "cfe_time_utils.h" #include "cfe_msgids.h" -#include "private/cfe_es_resetdata_typedef.h" +#include "cfe_es_resetdata_typedef.h" + +#include "cfe_es.h" +#include "cfe_msg.h" +#include "cfe_sb.h" #include diff --git a/fsw/cfe-core/src/time/cfe_time_utils.h b/modules/time/fsw/src/cfe_time_utils.h similarity index 98% rename from fsw/cfe-core/src/time/cfe_time_utils.h rename to modules/time/fsw/src/cfe_time_utils.h index 2e52298bd..8a605ae2a 100644 --- a/fsw/cfe-core/src/time/cfe_time_utils.h +++ b/modules/time/fsw/src/cfe_time_utils.h @@ -38,12 +38,7 @@ /* ** Required header files... */ -#include "cfe_platform_cfg.h" -#include "cfe.h" -#include "cfe_time_verify.h" -#include "cfe_time_msg.h" -#include "cfe_time_events.h" -#include "cfe_psp.h" +#include "cfe_time_module_all.h" /*************************************************************************/ @@ -442,7 +437,7 @@ static inline volatile CFE_TIME_ReferenceState_t *CFE_TIME_GetReferenceState(voi ** Function prototypes (process time at the tone signal and data packet)... */ void CFE_TIME_ToneSignal(void); -void CFE_TIME_ToneData(const CFE_TIME_ToneDataCmd_Payload_t *Packet); +void CFE_TIME_ToneData(const CFE_TIME_ToneDataCmd_Payload_t *ToneDataCmd); void CFE_TIME_ToneVerify(CFE_TIME_SysTime_t Time1, CFE_TIME_SysTime_t Time2); void CFE_TIME_ToneUpdate(void); diff --git a/fsw/cfe-core/src/time/cfe_time_verify.h b/modules/time/fsw/src/cfe_time_verify.h similarity index 99% rename from fsw/cfe-core/src/time/cfe_time_verify.h rename to modules/time/fsw/src/cfe_time_verify.h index c754d37ff..539805df0 100644 --- a/fsw/cfe-core/src/time/cfe_time_verify.h +++ b/modules/time/fsw/src/cfe_time_verify.h @@ -36,6 +36,9 @@ #ifndef _cfe_time_verify_ #define _cfe_time_verify_ +#include "cfe_mission_cfg.h" +#include "cfe_platform_cfg.h" + /*************************************************************************/ /* diff --git a/modules/time/ut-coverage/CMakeLists.txt b/modules/time/ut-coverage/CMakeLists.txt new file mode 100644 index 000000000..11e674c02 --- /dev/null +++ b/modules/time/ut-coverage/CMakeLists.txt @@ -0,0 +1,7 @@ +################################################################## +# +# cFE unit test CMake build recipe +# +################################################################## + +# Nothing yet - placeholder for future use diff --git a/fsw/cfe-core/unit-test/time_UT.c b/modules/time/ut-coverage/time_UT.c similarity index 100% rename from fsw/cfe-core/unit-test/time_UT.c rename to modules/time/ut-coverage/time_UT.c diff --git a/fsw/cfe-core/unit-test/time_UT.h b/modules/time/ut-coverage/time_UT.h similarity index 100% rename from fsw/cfe-core/unit-test/time_UT.h rename to modules/time/ut-coverage/time_UT.h