From 60e877d4aaedfa41d7f928e4c8cf3a514292b1af Mon Sep 17 00:00:00 2001 From: epollack Date: Wed, 23 Feb 2022 04:01:42 +0000 Subject: [PATCH 1/6] Fix #1220, Implement OS_ModuleGetInfo_Impl for RTEMS --- src/os/rtems/src/os-impl-loader.c | 45 +++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/os/rtems/src/os-impl-loader.c b/src/os/rtems/src/os-impl-loader.c index 1082fdb8d..2e7704bbe 100644 --- a/src/os/rtems/src/os-impl-loader.c +++ b/src/os/rtems/src/os-impl-loader.c @@ -35,6 +35,7 @@ #include "os-impl-loader.h" #include "os-shared-module.h" #include "os-shared-idmap.h" +#include /**************************************************************************************** GLOBAL DATA @@ -216,10 +217,44 @@ 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 */ + obj = rtems_rtl_check_handle(impl->dl_handle); + + if (obj == NULL) + { + OS_DEBUG("Error getting object information from handle\n"); + module_prop->addr.valid = false; + } + else + { + module_prop->addr.valid = true; + module_prop->addr.code_address = obj->text_base; + module_prop->addr.code_size = rtems_rtl_obj_text_size(obj); + module_prop->addr.data_address = obj->data_base; + module_prop->addr.data_size = rtems_rtl_obj_data_size(obj); + module_prop->addr.bss_address = obj->bss_base; + module_prop->addr.bss_size = rtems_rtl_obj_bss_size(obj); + + status = OS_SUCCESS; + } + + /* Unlock RTEMS runtime loader */ + rtems_rtl_unlock(); + } + else{ + OS_DEBUG("Error locking RTEMS runtime loader\n"); + module_prop->addr.valid = false; + } + + return status; } /* end OS_ModuleGetInfo_Impl */ From 7f049e5c9beb004c66070d1f6b24fe428cb3655e Mon Sep 17 00:00:00 2001 From: epollack Date: Sat, 26 Feb 2022 04:17:16 +0000 Subject: [PATCH 2/6] Fix #1220, Moved OS_DEBUG calls outside of rtems_rtl_lock and fixed formatting --- src/os/rtems/src/os-impl-loader.c | 46 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/os/rtems/src/os-impl-loader.c b/src/os/rtems/src/os-impl-loader.c index 2e7704bbe..93b864dc6 100644 --- a/src/os/rtems/src/os-impl-loader.c +++ b/src/os/rtems/src/os-impl-loader.c @@ -217,40 +217,42 @@ 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_rtl_obj *obj; - OS_impl_module_internal_record_t *impl; - int32 status = OS_ERROR; + 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 */ + /* 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) - { - OS_DEBUG("Error getting object information from handle\n"); - module_prop->addr.valid = false; - } - else + if (obj != NULL) { module_prop->addr.valid = true; module_prop->addr.code_address = obj->text_base; - module_prop->addr.code_size = rtems_rtl_obj_text_size(obj); - module_prop->addr.data_address = obj->data_base; - module_prop->addr.data_size = rtems_rtl_obj_data_size(obj); - module_prop->addr.bss_address = obj->bss_base; - module_prop->addr.bss_size = rtems_rtl_obj_bss_size(obj); + module_prop->addr.code_size = rtems_rtl_obj_text_size(obj); + module_prop->addr.data_address = obj->data_base; + module_prop->addr.data_size = rtems_rtl_obj_data_size(obj); + module_prop->addr.bss_address = obj->bss_base; + module_prop->addr.bss_size = rtems_rtl_obj_bss_size(obj); - status = OS_SUCCESS; + status = OS_SUCCESS; } - /* Unlock RTEMS runtime loader */ - rtems_rtl_unlock(); + /* 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{ + else + { OS_DEBUG("Error locking RTEMS runtime loader\n"); module_prop->addr.valid = false; } From 42772d981ebf04de309900130e49edb5b057c18b Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Wed, 9 Mar 2022 10:26:50 -0500 Subject: [PATCH 3/6] HotFix #1221, OS_Impl_Loader on RTEMS - Add aliased typedef to handle renames from RTEMS 4.11 to RTEMS 5 - Cast to cpuaddress before assignment to `OS_module_address_t` elements --- src/os/rtems/inc/os-rtems.h | 4 ++++ src/os/rtems/src/os-impl-loader.c | 24 +++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) 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 93b864dc6..73baa8957 100644 --- a/src/os/rtems/src/os-impl-loader.c +++ b/src/os/rtems/src/os-impl-loader.c @@ -37,6 +37,16 @@ #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 ***************************************************************************************/ @@ -217,7 +227,7 @@ 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_rtl_obj * obj; + rtems_rtl_obj *obj; OS_impl_module_internal_record_t *impl; int32 status = OS_ERROR; @@ -232,12 +242,12 @@ int32 OS_ModuleGetInfo_Impl(const OS_object_token_t *token, OS_module_prop_t *mo if (obj != NULL) { module_prop->addr.valid = true; - module_prop->addr.code_address = obj->text_base; - module_prop->addr.code_size = rtems_rtl_obj_text_size(obj); - module_prop->addr.data_address = obj->data_base; - module_prop->addr.data_size = rtems_rtl_obj_data_size(obj); - module_prop->addr.bss_address = obj->bss_base; - module_prop->addr.bss_size = rtems_rtl_obj_bss_size(obj); + 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; } From 569b85a536c21c0936fefe409b05306505cc6b0f Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 16 Mar 2022 06:38:22 -0600 Subject: [PATCH 4/6] Fix #1231, Doxygen strip path and expose common config --- docs/osal-detaildesign.doxyfile.in | 2 +- docs/src/CMakeLists.txt | 19 ++++++++++++------- docs/src/osal-apiguide.doxyfile.in | 6 ++---- docs/src/osal-common.doxyfile.in | 5 ++++- 4 files changed, 19 insertions(+), 13 deletions(-) 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@ From a3065d99ec2559bca39858cae270050872b98365 Mon Sep 17 00:00:00 2001 From: chillfig Date: Fri, 11 Mar 2022 11:55:49 -0500 Subject: [PATCH 5/6] Partial #1225, Update cFS-build CodeQL reusable worfklow target changes tests input to boolean, changes source input for uses, adds new lines component-path to osal, changes tests to test, removes makeprep input --- .github/workflows/codeql-cfe-build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 From 1d591d81af0c0ed3ff44d4ab34efd61710909a28 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:17:48 -0400 Subject: [PATCH 6/6] Bump to v6.0.0-rc4+dev58 IC: Caelum-rc4+dev6, nasa/cFS#443 - Reverts development version identifier to 99 for revision number --- README.md | 9 +++++++++ src/os/inc/osapi-version.h | 9 ++++----- 2 files changed, 13 insertions(+), 5 deletions(-) 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/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