diff --git a/.github/workflows/codeql-cfe-build.yml b/.github/workflows/codeql-cfe-build.yml index a0d6db0f2..793e88978 100644 --- a/.github/workflows/codeql-cfe-build.yml +++ b/.github/workflows/codeql-cfe-build.yml @@ -7,8 +7,9 @@ on: jobs: codeql: name: CodeQl Analysis - uses: nasa/cFS/.github/workflows/codeql-build.yml@main + uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main with: - make-prep: 'make prep' make: 'make -j native/default_cpu1/osal/' - tests: '(cd build/native/default_cpu1/osal && make test)' \ No newline at end of file + component-path: osal + test: true + \ No newline at end of file diff --git a/README.md b/README.md index 937320ce8..1a4a7c39c 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,15 @@ The autogenerated OSAL user's guide can be viewed at and + ### Development Build: v6.0.0-rc4+dev42 - Resolve UT uninitialized variable warnings diff --git a/docs/osal-detaildesign.doxyfile.in b/docs/osal-detaildesign.doxyfile.in index f5efaf070..48832ed19 100644 --- a/docs/osal-detaildesign.doxyfile.in +++ b/docs/osal-detaildesign.doxyfile.in @@ -3,7 +3,7 @@ #--------------------------------------------------------------------------- # Common files -@INCLUDE = @MISSION_BINARY_DIR@/docs/osalguide/osal-common.doxyfile +@INCLUDE = @MISSION_BINARY_DIR@/docs/osal-common.doxyfile # All of the OSAL FSW code relevant for a detail design document is under # src/os and src/bsp, everything else is test and examples/support diff --git a/docs/src/CMakeLists.txt b/docs/src/CMakeLists.txt index a8e5191d1..fc837ad43 100644 --- a/docs/src/CMakeLists.txt +++ b/docs/src/CMakeLists.txt @@ -5,7 +5,7 @@ ######################################################## # -# This CMake script currently defines a top-level target "apiguide" +# This CMake script currently defines a top-level target "osal-apiguide" # to build the OSAL API documentation. This may be invoked either # from the main OSAL CMakeLists.txt as a subdirectory (useful in the # case of a self-contained/standalone build) or by a separate script @@ -61,14 +61,19 @@ foreach(DIR ${OSAL_API_INCLUDE_DIRECTORIES}) endforeach() file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide-warnings.log OSAL_NATIVE_LOGFILE) -file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/osal-common.doxyfile OSAL_NATIVE_COMMON_CFGFILE) +file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR}/docs/osal-common.doxyfile OSAL_NATIVE_COMMON_CFGFILE) file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide.doxyfile OSAL_NATIVE_APIGUIDE_CFGFILE) file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/default-settings.doxyfile OSAL_NATIVE_DEFAULT_SETTINGS) +# Add a top level source directory if not defined +if (NOT DEFINED MISSION_SOURCE_DIR) + set(MISSION_SOURCE_DIR ${CMAKE_SOURCE_DIR}) +endif() + # generate the configuration files configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/osal-common.doxyfile.in - ${CMAKE_CURRENT_BINARY_DIR}/osal-common.doxyfile + ${CMAKE_BINARY_DIR}/docs/osal-common.doxyfile @ONLY ) @@ -78,14 +83,14 @@ configure_file( @ONLY ) -add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/apiguide/html/index.html" +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/index.html" COMMAND doxygen ${OSAL_NATIVE_APIGUIDE_CFGFILE} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide.doxyfile ${CMAKE_CURRENT_BINARY_DIR}/osal-common.doxyfile + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/osal-apiguide.doxyfile ${CMAKE_BINARY_DIR}/docs/osal-common.doxyfile ${OSAL_DOCFILE_LIST} ${OSAL_DOC_DEPENDENCY_LIST} WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) add_custom_target(osal-apiguide - COMMAND echo "OSAL API Guide: file://${CMAKE_CURRENT_BINARY_DIR}/apiguide/html/index.html" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/apiguide/html/index.html" + COMMAND echo "OSAL API Guide: file://${CMAKE_CURRENT_BINARY_DIR}/html/index.html" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/index.html" ) diff --git a/docs/src/osal-apiguide.doxyfile.in b/docs/src/osal-apiguide.doxyfile.in index b6bde31e9..2989335fe 100644 --- a/docs/src/osal-apiguide.doxyfile.in +++ b/docs/src/osal-apiguide.doxyfile.in @@ -2,10 +2,8 @@ # Doxygen Configuration options to generate the "OSAL API Guide" #--------------------------------------------------------------------------- -# Common definitions, some of which are extended or overridden here. +# Common definitions, can be overridden here @INCLUDE = @OSAL_NATIVE_COMMON_CFGFILE@ -PROJECT_NAME = "OSAL User's Guide" -OUTPUT_DIRECTORY = apiguide -# output the warnings to a separate file +PROJECT_NAME = "OSAL User's Guide" WARN_LOGFILE = @OSAL_NATIVE_LOGFILE@ diff --git a/docs/src/osal-common.doxyfile.in b/docs/src/osal-common.doxyfile.in index 32ff2099f..ce327fb37 100644 --- a/docs/src/osal-common.doxyfile.in +++ b/docs/src/osal-common.doxyfile.in @@ -5,7 +5,7 @@ # Allow overrides @INCLUDE_PATH = @MISSION_SOURCE_DIR@ -# Default settings from cFE +# Default settings @INCLUDE = @OSAL_NATIVE_DEFAULT_SETTINGS@ # Include any passed in predefines @@ -13,3 +13,6 @@ PREDEFINED += @OSALDOC_PREDEFINED@ # Minimum set of source files (includes *.dox, followed by public headers) INPUT += @OSAL_NATIVE_APIGUIDE_SOURCEFILES@ + +# Strip source dir from path +STRIP_FROM_PATH += @MISSION_SOURCE_DIR@ diff --git a/src/os/inc/osapi-version.h b/src/os/inc/osapi-version.h index fa668d038..048cd2eba 100644 --- a/src/os/inc/osapi-version.h +++ b/src/os/inc/osapi-version.h @@ -36,7 +36,7 @@ /* * Development Build Macro Definitions */ -#define OS_BUILD_NUMBER 42 +#define OS_BUILD_NUMBER 54 #define OS_BUILD_BASELINE "v6.0.0-rc4" /* @@ -44,15 +44,14 @@ */ #define OS_MAJOR_VERSION 5 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */ #define OS_MINOR_VERSION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */ -#define OS_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision number. */ +#define OS_REVISION 99 /*!< * Set to 0 on OFFICIAL releases, and set to 99 on development versions. Revision number. */ /*! * @brief Mission revision. * - * Set to 0 on OFFICIAL releases, and set to 255 (0xFF) on development versions. - * Values 1-254 are reserved for mission use to denote patches/customizations as needed. + * Reserved for mission use to denote patches/customizations as needed. */ -#define OS_MISSION_REV 0xFF +#define OS_MISSION_REV 0 /* * Tools to construct version string diff --git a/src/os/rtems/inc/os-rtems.h b/src/os/rtems/inc/os-rtems.h index b22abbe87..52e904442 100644 --- a/src/os/rtems/inc/os-rtems.h +++ b/src/os/rtems/inc/os-rtems.h @@ -60,13 +60,17 @@ #define OSAL_UNRESOLV_REC_TYPE rtems_rtl_unresolv_rec #define OSAL_UNRESOLVED_SYMBOL rtems_rtl_unresolved_symbol #define OSAL_UNRESOLVED_ITERATE rtems_rtl_unresolved_iterate + #else + #define OSAL_HEAP_INFO_BLOCK region_information_block #define OSAL_UNRESOLV_REC_TYPE rtems_rtl_unresolv_rec_t #define OSAL_UNRESOLVED_SYMBOL rtems_rtl_unresolved_name #define OSAL_UNRESOLVED_ITERATE rtems_rtl_unresolved_interate + #endif + /**************************************************************************************** TYPEDEFS ***************************************************************************************/ diff --git a/src/os/rtems/src/os-impl-loader.c b/src/os/rtems/src/os-impl-loader.c index 1082fdb8d..73baa8957 100644 --- a/src/os/rtems/src/os-impl-loader.c +++ b/src/os/rtems/src/os-impl-loader.c @@ -35,6 +35,17 @@ #include "os-impl-loader.h" #include "os-shared-module.h" #include "os-shared-idmap.h" +#include + +/**************************************************************************************** + TYPEDEFS + ***************************************************************************************/ + +#ifndef _RTEMS_5_ + +typedef rtems_rtl_obj_t rtems_rtl_obj; /* Alias for RTEMS 4.11 */ + +#endif /**************************************************************************************** GLOBAL DATA @@ -216,10 +227,46 @@ int32 OS_ModuleUnload_Impl(const OS_object_token_t *token) *-----------------------------------------------------------------*/ int32 OS_ModuleGetInfo_Impl(const OS_object_token_t *token, OS_module_prop_t *module_prop) { - /* - ** RTEMS does not specify a way to get these values - ** Everything left at zero - */ - return (OS_SUCCESS); + rtems_rtl_obj *obj; + OS_impl_module_internal_record_t *impl; + int32 status = OS_ERROR; + + impl = OS_OBJECT_TABLE_GET(OS_impl_module_table, *token); + + /* Lock RTEMS runtime loader */ + if (rtems_rtl_lock() != NULL) + { + /* Get RTL object from handle and populate section info */ + obj = rtems_rtl_check_handle(impl->dl_handle); + + if (obj != NULL) + { + module_prop->addr.valid = true; + module_prop->addr.code_address = (cpuaddr) obj->text_base; + module_prop->addr.code_size = (cpuaddr) rtems_rtl_obj_text_size(obj); + module_prop->addr.data_address = (cpuaddr) obj->data_base; + module_prop->addr.data_size = (cpuaddr) rtems_rtl_obj_data_size(obj); + module_prop->addr.bss_address = (cpuaddr) obj->bss_base; + module_prop->addr.bss_size = (cpuaddr) rtems_rtl_obj_bss_size(obj); + + status = OS_SUCCESS; + } + + /* Unlock RTEMS runtime loader, report error if applicable */ + rtems_rtl_unlock(); + + if (obj == NULL) + { + OS_DEBUG("Error getting object information from handle\n"); + module_prop->addr.valid = false; + } + } + else + { + OS_DEBUG("Error locking RTEMS runtime loader\n"); + module_prop->addr.valid = false; + } + + return status; } /* end OS_ModuleGetInfo_Impl */