From f097d7d30465f5bf1dd6b658260646ef29a117ca Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 20 Jul 2021 15:55:10 -0400 Subject: [PATCH 1/7] Partial #1108, add typedef for OSAL status codes Minimal change to add a typedef for OS_Status_t, a macro for constants/literals, and an inline function to convert to "long" for printing/logging. --- src/os/inc/common_types.h | 6 ++++++ src/os/inc/osapi-error.h | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/os/inc/common_types.h b/src/os/inc/common_types.h index 411407452..277c85ec9 100644 --- a/src/os/inc/common_types.h +++ b/src/os/inc/common_types.h @@ -118,6 +118,11 @@ extern "C" */ typedef uint32 osal_objtype_t; + /** + * The preferred type to represent OSAL status codes defined in osapi-error.h + */ + typedef int32 osal_status_t; + /** * @brief General purpose OSAL callback function * @@ -155,5 +160,6 @@ extern "C" #define OSAL_BLOCKCOUNT_C(X) ((osal_blockcount_t)(X)) #define OSAL_INDEX_C(X) ((osal_index_t)(X)) #define OSAL_OBJTYPE_C(X) ((osal_objtype_t)(X)) +#define OSAL_STATUS_C(X) ((osal_status_t)(X)) #endif /* COMMON_TYPES_H */ diff --git a/src/os/inc/osapi-error.h b/src/os/inc/osapi-error.h index f71e97eb7..53db5c3c5 100644 --- a/src/os/inc/osapi-error.h +++ b/src/os/inc/osapi-error.h @@ -138,6 +138,22 @@ typedef char os_err_name_t[OS_ERROR_NAME_LENGTH]; * @{ */ +/*-------------------------------------------------------------------------------------*/ +/** + * @brief Convert a status code to a native "long" type + * + * For printing or logging purposes, this converts the given status code + * to a "long" (signed integer) value. It should be used in conjunction + * with the "%ld" conversion specifier in printf-style statements. + * + * @param[in] Status Execution status, see @ref OSReturnCodes + * @return Same status value converted to the "long" data type + */ +static inline long OS_StatusToInteger(osal_status_t Status) +{ + return (long)Status; +} + /*-------------------------------------------------------------------------------------*/ /** * @brief Convert an error number to a string From a2ad51e984d5bd365b8e75bf8f474d183a1486c6 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 28 Sep 2021 09:15:09 -0400 Subject: [PATCH 2/7] Fix #1167, vxWorks intLib stub aliasing issue Use a separate local variable rather than casting to (void **). --- src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c index 2b22aba0b..bae886686 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c @@ -54,10 +54,12 @@ OCS_VOIDFUNCPTR *OCS_INUM_TO_IVEC(unsigned int ui) OCS_VOIDFUNCPTR * VecTbl; static OCS_VOIDFUNCPTR DummyVec; size_t VecTblSize; + void * GenericPtr; if (Status == 0) { - UT_GetDataBuffer(UT_KEY(OCS_INUM_TO_IVEC), (void **)&VecTbl, &VecTblSize, NULL); + UT_GetDataBuffer(UT_KEY(OCS_INUM_TO_IVEC), &GenericPtr, &VecTblSize, NULL); + VecTbl = GenericPtr; if (VecTbl != NULL && ui < (VecTblSize / sizeof(OCS_VOIDFUNCPTR))) { VecTbl += ui; From f2fbc904c8454162f35c4ef7e97b3ba55dd56a2d Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 28 Sep 2021 09:06:58 -0400 Subject: [PATCH 3/7] Fix #1166, recognize ifdef __cplusplus Add feature to generate_stubs.pl input phase to recognize and skip over `#ifdef __cplusplus` blocks. This makes it so it can be used on C headers which are C++-enabled too. --- ut_assert/scripts/generate_stubs.pl | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/ut_assert/scripts/generate_stubs.pl b/ut_assert/scripts/generate_stubs.pl index 4a0792a24..32879ab16 100755 --- a/ut_assert/scripts/generate_stubs.pl +++ b/ut_assert/scripts/generate_stubs.pl @@ -110,6 +110,7 @@ my $file = ""; my $file_boilerplate; my $file_variadic; + my @ifdef_level = (1); # All header files start with some legal boilerplate comments # Take the first one and save it, so it can be put into the output. @@ -125,7 +126,31 @@ # so it will be in a single "line" in the result. chomp if (s/\\$//); } - push(@lines, $_); + + # detect "#ifdef" lines - some may need to be recognized. + # at the very least, any C++-specific bits need to be skipped. + # for now this just specifically looks for __cplusplus + if (/^\#(if\w+)\s+(.*)$/) { + my $check = $1; + my $cond = $2; + my $result = $ifdef_level[0]; + + if ($cond eq "__cplusplus" && $check eq "ifdef") { + $result = 0; + } + + unshift(@ifdef_level, $result); + } + elsif (/^\#else/) { + # invert the last preprocessor condition + $ifdef_level[0] = $ifdef_level[0] ^ $ifdef_level[1]; + } + elsif (/^\#endif/) { + shift(@ifdef_level); + } + elsif ($ifdef_level[0]) { + push(@lines, $_) ; + } } close(HDR); @@ -164,7 +189,6 @@ next if (/\btypedef\b/); # ignore typedefs next if (/\bstatic inline\b/); # ignore - # discard "extern" qualifier # (but other qualifiers like "const" are OK and should be preserved, as # it is part of return type). @@ -408,4 +432,3 @@ print "Generated $stubfile\n"; } - From 5cba5aedc8d40bff010cd7563dc40a7766cb99c9 Mon Sep 17 00:00:00 2001 From: Sam Price Date: Thu, 7 Oct 2021 10:40:51 -0400 Subject: [PATCH 4/7] Fix #1177 Rename OS_XXXTime to OS_XXXLocalTime in comments. --- src/os/portable/os-impl-posix-gettime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/portable/os-impl-posix-gettime.c b/src/os/portable/os-impl-posix-gettime.c index 0bd232200..07fd7e3f9 100644 --- a/src/os/portable/os-impl-posix-gettime.c +++ b/src/os/portable/os-impl-posix-gettime.c @@ -22,7 +22,7 @@ * \file os-impl-posix-gettime.c * \author joseph.p.hickey@nasa.gov * - * This file contains implementation for OS_GetTime() and OS_SetTime() + * This file contains implementation for OS_GetLocalTime() and OS_SetLocalTime() * that map to the C library clock_gettime() and clock_settime() calls. * This should be usable on any OS that supports those standard calls. * The OS-specific code must \#include the correct headers that define the From b16c6f149aae0ffb73c868255c518dd9c3698b50 Mon Sep 17 00:00:00 2001 From: Shefali321 <53991521+Shefali321@users.noreply.github.com> Date: Sun, 10 Oct 2021 02:21:56 +0530 Subject: [PATCH 5/7] Update generate_stubs.pl --- ut_assert/scripts/generate_stubs.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ut_assert/scripts/generate_stubs.pl b/ut_assert/scripts/generate_stubs.pl index 4a0792a24..1a0323bb5 100755 --- a/ut_assert/scripts/generate_stubs.pl +++ b/ut_assert/scripts/generate_stubs.pl @@ -327,7 +327,7 @@ if ($fileapi->{$funcname}->{variadic}) { $args .= ", va_list"; } - print OUT "extern void ".$handler_func->{$funcname}."($args);\n"; + print OUT "void ".$handler_func->{$funcname}."($args);\n"; } } From 9d1ba83e5fb50bd89f7b22d2ccb75aa77d7de679 Mon Sep 17 00:00:00 2001 From: ArielSAdamsNASA Date: Fri, 22 Oct 2021 10:16:19 -0500 Subject: [PATCH 6/7] Fix #1183, Add Duplicate Check to Local Unit Test --- .github/workflows/local_unit_test.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/local_unit_test.yml b/.github/workflows/local_unit_test.yml index 17da300b9..7be29b6ca 100644 --- a/.github/workflows/local_unit_test.yml +++ b/.github/workflows/local_unit_test.yml @@ -5,8 +5,23 @@ on: pull_request: jobs: + #Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action. + check-for-duplicates: + runs-on: ubuntu-latest + # Map a step output to a job output + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + with: + concurrent_skipping: 'same_content' + skip_after_successful_duplicate: 'true' + do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' Local-Unit-Test: + needs: check-for-duplicates + if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }} runs-on: ubuntu-18.04 timeout-minutes: 15 From 30635f856d28177ed2fcea0b3dd1512e7f8cdf9d Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Wed, 17 Nov 2021 21:31:06 -0500 Subject: [PATCH 7/7] Update build baseline and bump to v6.0.0-rc4+dev15 - Set new build baseline for cFS-Caelum-rc4: v6.0.0-rc4 --- README.md | 13 +++++++++++++ src/os/inc/osapi-version.h | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7d1deac5e..cbbb80a25 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,18 @@ The autogenerated OSAL user's guide can be viewed at and + + ### Development Build: v5.1.0-rc1+dev619 - Enable symbol api test and MIR dump too large @@ -18,6 +30,7 @@ The autogenerated OSAL user's guide can be viewed at and + ### Development Build: v5.1.0-rc1+dev604 - Add typecast to memchr call diff --git a/src/os/inc/osapi-version.h b/src/os/inc/osapi-version.h index 9c1ad5b6e..6e4ce779a 100644 --- a/src/os/inc/osapi-version.h +++ b/src/os/inc/osapi-version.h @@ -36,8 +36,8 @@ /* * Development Build Macro Definitions */ -#define OS_BUILD_NUMBER 619 -#define OS_BUILD_BASELINE "v5.1.0-rc1" +#define OS_BUILD_NUMBER 15 +#define OS_BUILD_BASELINE "v6.0.0-rc4" /* * Version Macro Definitions @@ -68,7 +68,7 @@ /*! @brief Version code name * All modular components which are tested/validated together should share the same code name */ -#define OS_VERSION_CODENAME "Bootes" +#define OS_VERSION_CODENAME "Draco" /*! @brief Development Build Version String. * @details Reports the current development build's baseline, number, and name. Also includes a note about the latest