Skip to content
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

Exception/Interrupt API issues in OSAL #316

Closed
jphickey opened this issue Dec 13, 2019 · 0 comments · Fixed by #334
Closed

Exception/Interrupt API issues in OSAL #316

jphickey opened this issue Dec 13, 2019 · 0 comments · Fixed by #334
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
When running unit tests on the OSAL for the VxWorks, POSIX, and RTEMS environments, it revealed a few minor issues on the implementation side that should be addressed. These are all in the interrupt/fpu/exception API areas for which the CFE FSW does not really rely upon.

  1. For POSIX and RTEMS, the FPU exception APIs should all return OS_ERR_NOT_IMPLEMENTED, because these are in fact not implemented. Returning OS_SUCCESS, as some did, implies that the behavior took effect when it did not (this matters to UT). These are:
  • OS_FPUExcSetMask_Impl()
  • OS_FPUExcGetMask_Impl()
  • OS_FPUExcEnable_Impl()
  • OS_FPUExcDisable_Impl()
  1. RTEMS does not provide a direct equivalent for the OS_IntEnable/OS_IntDisable API like VxWorks has. The implementation had been using rtems_intterupt_enable/disable for this, but the semantics of those calls are different (they are more appropriate for OS_IntLock/OS_IntUnlock). The Enable/Disable implementation should just return OS_ERR_NOT_IMPLEMENTED.

  2. The RTEMS OS_IntLock_Impl/OS_IntUnlock_Impl implementation should use the "local" variant of the RTEMS interrupt enable/disable function. This is documented as being identical on single-processor machines but only the local variant is applicable to multi-processor machines.

  3. The OS_FPUExcGetMask() API accepts a pointer as an output buffer, so to be consistent with all other API calls that accept a pointer, it should check for NULL and return OS_INVALID_POINTER in that case.

To Reproduce
Execute the OSAL unit tests (including changeset for #313 to enable full testing) and some failures are reported due tot his.

Expected behavior
All unit tests should pass.

System observed on:

  • Ubuntu 18.04 LTS 64-bit (native/posix)
  • RTEMS 4.11 on i686/pc (QEMU-emulated target)
  • VxWorks 6.9 on PPC/MCP750

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/osal that referenced this issue Dec 13, 2019
- Ensure the FPU functions that are actually not implemented in
  RTEMS/POSIX all return OS_ERR_NOT_IMPLEMENTED, not OS_SUCCESS.
- The RTEMS IntEnable/Disable API should not be a duplicate of
  the IntLock/Unlock API, as the semantics are slightly different.
  The Enable/Disable API should return OS_ERR_NOT_IMPLEMENTED.
- The OS_FPUExcGetMask API should confirm that the output buffer
  is not NULL.
jphickey added a commit to jphickey/osal that referenced this issue Dec 13, 2019
- Ensure the FPU functions that are actually not implemented in
  RTEMS/POSIX all return OS_ERR_NOT_IMPLEMENTED, not OS_SUCCESS.
- The RTEMS IntEnable/Disable API should not be a duplicate of
  the IntLock/Unlock API, as the semantics are slightly different.
  The Enable/Disable API should return OS_ERR_NOT_IMPLEMENTED.
- The OS_FPUExcGetMask API should confirm that the output buffer
  is not NULL.
skliper pushed a commit that referenced this issue Dec 30, 2019
- Ensure the FPU functions that are actually not implemented in
  RTEMS/POSIX all return OS_ERR_NOT_IMPLEMENTED, not OS_SUCCESS.
- The RTEMS IntEnable/Disable API should not be a duplicate of
  the IntLock/Unlock API, as the semantics are slightly different.
  The Enable/Disable API should return OS_ERR_NOT_IMPLEMENTED.
- The OS_FPUExcGetMask API should confirm that the output buffer
  is not NULL.
skliper added a commit that referenced this issue Dec 30, 2019
Fix #295, #298, #305, #307, #308,
    #313, #314, #316, #321, #323
Reviewed and approved at 2019-12-18 CCB
@skliper skliper added this to the 5.1.0 milestone Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants