Skip to content

Commit

Permalink
Merge pull request #1233 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
osal Integration candidate: Caelum-rc4+dev6
  • Loading branch information
astrogeco authored Mar 16, 2022
2 parents a173f30 + 1d591d8 commit fafb045
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 26 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/codeql-cfe-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
component-path: osal
test: true

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ The autogenerated OSAL user's guide can be viewed at <https://github.com/nasa/cF

## Version History

### Development Build: v6.0.0-rc4+dev54

- Revert development version identifier to 99 for revision number
- Fix cFS-build CodeQL reusable worfklow
- Implement OS_ModuleGetInfo_Impl for RTEMS
- Doxygen strip path and expose common config
- Refactor doxygen and remove mainpage
- See <https://github.com/nasa/osal/pull/1233> and <https://github.com/nasa/cFS/pull/443>

### Development Build: v6.0.0-rc4+dev42

- Resolve UT uninitialized variable warnings
Expand Down
2 changes: 1 addition & 1 deletion docs/osal-detaildesign.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 12 additions & 7 deletions docs/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)

Expand All @@ -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"
)
6 changes: 2 additions & 4 deletions docs/src/osal-apiguide.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
5 changes: 4 additions & 1 deletion docs/src/osal-common.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
# Allow overrides
@INCLUDE_PATH = @MISSION_SOURCE_DIR@

# Default settings from cFE
# Default settings
@INCLUDE = @OSAL_NATIVE_DEFAULT_SETTINGS@

# Include any passed in predefines
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@
9 changes: 4 additions & 5 deletions src/os/inc/osapi-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,22 @@
/*
* Development Build Macro Definitions
*/
#define OS_BUILD_NUMBER 42
#define OS_BUILD_NUMBER 54
#define OS_BUILD_BASELINE "v6.0.0-rc4"

/*
* Version Macro Definitions
*/
#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
Expand Down
4 changes: 4 additions & 0 deletions src/os/rtems/inc/os-rtems.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
***************************************************************************************/
Expand Down
57 changes: 52 additions & 5 deletions src/os/rtems/src/os-impl-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
#include "os-impl-loader.h"
#include "os-shared-module.h"
#include "os-shared-idmap.h"
#include <rtems/rtl/rtl.h>

/****************************************************************************************
TYPEDEFS
***************************************************************************************/

#ifndef _RTEMS_5_

typedef rtems_rtl_obj_t rtems_rtl_obj; /* Alias for RTEMS 4.11 */

#endif

/****************************************************************************************
GLOBAL DATA
Expand Down Expand Up @@ -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 */

0 comments on commit fafb045

Please sign in to comment.