Skip to content

Commit

Permalink
Merge pull request #1191 from astrogeco/integration-candidate
Browse files Browse the repository at this point in the history
osal Integration candidate: Caelum+dev1
  • Loading branch information
astrogeco authored Dec 6, 2021
2 parents 42af0f7 + 30635f8 commit 4cc6dbb
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 9 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/local_unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

## Version History

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

- Add Duplicate Check to Local Unit Test
- Rename OS_XXXTime to OS_XXXLocalTime in comments
- Fix vxWorks intLib stub aliasing issue
- Recognize ifdef __cplusplus
- Remove extern in stub prototypes
- Add typedef for OSAL status codes
- Set new build baseline for cFS-Caelum-rc4: v6.0.0-rc4
- See <https://github.com/nasa/osal/pull/1191> and <https://github.com/nasa/cFS/pull/390>


### Development Build: v5.1.0-rc1+dev619

- Enable symbol api test and MIR dump too large
- MIR symbol too long or table to long for osloader test
- Add bsp-specific configuration flag registry
- Add os-specifc socket flag function
- See <https://github.com/nasa/osal/pull/1158> and <https://github.com/nasa/cFS/pull/359>

### Development Build: v5.1.0-rc1+dev604

- Add typecast to memchr call
Expand Down
6 changes: 6 additions & 0 deletions src/os/inc/common_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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 */
16 changes: 16 additions & 0 deletions src/os/inc/osapi-error.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/os/inc/osapi-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/os/portable/os-impl-posix-gettime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
31 changes: 27 additions & 4 deletions ut_assert/scripts/generate_stubs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);

Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -327,7 +351,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";
}
}

Expand Down Expand Up @@ -408,4 +432,3 @@

print "Generated $stubfile\n";
}

0 comments on commit 4cc6dbb

Please sign in to comment.