-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
osal Integration candidate: 2021-01-12 #750
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Convert remaining operations using for loops to use iterators. This ensures locking is done consistently and correctly.
Implement an "unlock key" - based on task ID - which can be part of the local token, rather than relying on the task ID being the same between the lock and unlock ops. Notably, the task ID can change, in particular if the task is exiting. Also Fixes #701, other general cleanup Implement all global lock/unlock error checking in shared layer, not in impl layer, for consistency. Remove redundant checks. Make all functions return void (should never fail) and in the unlikely event that something does fail then report the error, but no other recourse possible.
Change the EXCLUSIVE lock type such that it sets the ID in the global table to RESERVED and unlocks the global before returning to the caller. This allows the potentially long-running operation to complete and not block other operations from happening in other tasks. Use the EXCLUSIVE lock for all create/delete ops as well as for bind and connect socket ops. Also implement a new "RESERVED" lock to handle a special case in the vxworks timebase implementation where the impl layer needs to acquire a token for an object as it is being created. This case is special because it needs to happen during OS_TimeBaseCreate, and cannot be completed after the fact like normal tasks, because it is a factor in determining the success/fail status of the overall operation.
In the POSIX implementation, OS_TaskDelete was implemented in a deferred manner - the API call was a request, and the actual deletion occured sometime thereafter. This is a problem if the task is running code within a dynamically loaded module, and the intent is to delete the task so the module can be unloaded. In this case the app needs to be certain that the task has actually been deleted before unloading can be done safely. To do this requires use of pthread_join() on POSIX which confirms that the task has exited. However, this is a (potentially) blocking call, so to do this requires rework of the EXCLUSIVE lock mode such that the OSAL lock is _not_ held during the join operation.
Update unit tests for idmap functions, add test cases where coverage was incomplete. All OS_ObjectId* function coverage is back at 100%.
Instead of maintaining a one-off implementation for VxWorks 6, use the POSIX implementation for this module. The only incompatibility is the prototype for mkdir() which is missing the second argument. This can be worked around with a simple compatibility macro that is only enabled for VxWorks 6.x builds.
The mount/unmount implementation was not really checking for and handling this mapping type. To be consistent with POSIX it should also create a directory if it does not already exist.
Better error translations in the OS_FileChmod_Impl() function. Also corrects a file handle leak. This makes it return OS_ERR_NOT_IMPLEMENTED when run on a file system that does not have permissions, which in turn causes the unit test to be skipped rather than fail.
When cleaning up for shutdown, delete resources that have a task/thread first, followed by other resource types. This helps avoid possible dependencies as running threads might be using the other resources.
Add OS_CHECK_POINTER macros to OS_ConvertToArrayIndex and OS_TimeBaseGetFreeRun.
Add OS_FileSysStatVolume as replacement for OS_fsBytesFree and OS_fsBlocksFree. Update unit tests and stubs for the new API call. Does not (yet) deprecate the existing functions, as references still need to be updated elsewhere in apps.
Add parameter check to OS_SocketSendTo and adjust coverage test to validate.
Do not access members of OS_time_t directly, instead use conversion/accessor inline functions to get the desired value. Update the "stat" structure output by OS_stat to use the OS_time_t struct instead of int32, and update the OS_stat implemention to transfer the full resolution if it supports it (POSIX.1-2008 or newer).
Add test cases to coverage test to validate all basic OS_time_t access operations and conversions.
Add OS_TimeAssembleFromMilliseconds and OS_TimeAssembleFromMicroseconds for a complete set of conversion routines in both directions.
Fix #642, 645, 701, 702, 703 - OSAL global table management
Fix #708, chmod error handling
Fix #544, add pointer check
Fix #573, add OS_FileSysStatVolume
Fix #471, order of operations for delete all
Fix #580, improve FS_BASED mounts on VxWorks
@jphickey Got some doxygen errors with the last merge
|
astrogeco
force-pushed
the
integration-candidate
branch
from
January 13, 2021 04:07
6b43e19
to
f9dd6b3
Compare
Fixed, see f9dd6b3 |
Fix #755, resolve subtasks not ending on time
Update ReadMe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the contribution
Fix #702, use iterators instead of for loops
Fix #645, implement separate lock/unlock key
Fix #703, implement exclusive/reserved lock
Fix #642, make OS_TaskDelete sync
Fix #703, unit test
Fix #697, use POSIX dir implementation on V
Fix #580, improve FS_BASED mounts on
Fix #708, chmod error h
Fix #471, order of operations for delete all
Fix #445, add pointer parameter checks
Fix #573, add OS_FileSysSta
Fix #544, add pointer check
Fix #606, Resolve cast-align error in VxWorks OS_TaskGet
Fix #429, update OSAL code to use time ac
Fix #429, check time conversions in coverage test
Fix #644, Remove alignment macros
Fix #429, add "assemble" routines for milli/mi
Fix #732 change uint32 to size_t
Fix #755, resolve subtasks not ending on time
Testing performed
See https://github.com/nasa/cFS/pull/174/checks
Expected behavior changes
PR #704
OS_TaskDelete()
on POSIX does not return until the task has actually exited (see OS_TaskDelete is not synchronous on POSIX #642)PR #710
OS_FileChmod_Impl()
function now returnsOS_ERR_NOT_IMPLEMENTED
when run on a file system that does not have permissions, which in turn causes the unit test to be skipped rather than fail.PR #716
OS_SocketSendTo
and adjust coverage test to validate.PR #717
OS_fsBytesFree
andOS_fsBlocksFree
withOS_FileSysStatVolume
. This new API for getting stats on file system. Uses existingOS_FileSysStatVolume_Impl
call and exposes it in the public API.PR #711
PR #709
FS_BASED
pass -through mapping type - which should be mostly a no-op. Create a mount point directory if it does not already exist when using this mapping type for consistency with POSIX.OS_FileSysAddFixedMap()
: The virtual mount point cannot be empty - soOS_FileSysAddFixedMap(.., "/", "/")
does not work butOS_FileSysAddFixedMap(.., "/", "/root")
does work and allows one to open files in the root as"/root/"
from OSAL applications. Mount-point directories do not need to previously exist when using OS_FileSysAddFixedMapPR #720
taskTCB
return in avoid *
, then cast toOS_impl_task_internal_record_t *
to avoid a strict alignment compiler errorPR #734
OS_PACK
andOS_ALIGNED
macros.PR #706
mkdir()
which is missing the second argument; this is worked around with a compatibility macro for VxWorks 6.x builds.PR #733
PR #715
OS_CHECK_POINTER
macros toOS_ConvertToArrayIndex
andOS_TimeBaseGetFreeRun
so they can handle NULL pointers and return the correct error.PR #723
int32
withOS_time_t
in the "stat" structure used by the file module. Updates the pointer argument toOS_SetLocalTime()
to beconst
. Prototype change ofOS_SetLocalTime()
should be backward compatible.Additional context
Part of nasa/cFS#174
Third party code
None
Contributor Info - All information REQUIRED for consideration of pull request
@skliper
@jphickey
@zanzaben