-
Notifications
You must be signed in to change notification settings - Fork 207
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
Improve separation/distinction between OSAL and CFE error codes #1676
Comments
After reviewing existing code, here is a list of functions which intermix an OSAL status code with a CFE status code (e.g. storing it in the same local variable, etc). These do not appear to return the value to the caller, at least in the current form: CFE_ES_StartApplications |
The following functions are OK as far as implementation goes (they use a dedicated/separate variable for OSAL status codes, and do not mix with a CFE status code). However they use a non-ideal or inconsistent conversion when sending events or log messages (typically they print an OSAL error has hex, should print as decimal to match what OSAL defines). CFE_ES_DeleteChildTask |
Finally, this set of functions (from issue #1599) should be fixed so that they do NOT return an OSAL status to the caller - they should rewrite to a CFE status code before returning: CFE_ES_BackgroundInit |
Related issue #1755 and PR #1756 resolves part of this issue, specifically it ensures that a separate stack variable is created for OSAL status vs. CFE status, and a translation to CFE error occurs in places where an OSAL status was previously returned by a CFE function. Remaining work to do is to change type from |
Is your feature request related to a problem? Please describe.
Application code should not conflate/intermix these two sets of error/status code values.
OSAL and CFE differ in how their error codes are defined. For OSAL, in
osapi-errors.h
, the codes are in signed decimal format (e.g.-10
). For CFE, incfe_error.h
, the codes are in hexadecimal format (e.g.0xc2000003
) with bits having certain meanings.Describe the solution you'd like
CFE_Status_t
for CFE codes, and (ideally)OS_Status_t
for OSAL codes (which does not exist yet, but see issue Add typedef for OSAL status codes osal#1108).%d
for OSAL codes, and%08x
for CFE codes. (In many cases, OSAL error codes are printed using the%08x
conversion currently).Additional context
For Caelum, the approach will be to document the functions/cases where OSAL and CFE status codes are conflated (see issue #1599) but ideally for better code modularity, the two sets of status codes should not be intermixed at all. While issue #1599 will just document where this is a problem, this issue should be to fix those problem areas and keep things isolated.
Also note that PSP also has a few of its own status codes, which also should be kept separate.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: