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

Fix #10, modularize the ram, port, and eeprom access #282

Conversation

jphickey
Copy link
Contributor

Describe the contribution
This is another attempt at resolving the long-standing issue of platform-specific code in the shared directory which is not easy to replace/override.

Convert the current "cfe_psp_ram.c" and "cfe_psp_port.c" routines into modular components, and remove from "shared" dir. The existing implementations become the corresponding "direct" module, and are enabled based on the psp module selection.

Also added is a "notimpl" variant, where all the functions return CFE_PSP_ERR_NOT_IMPLEMENTED. This is used on Linux
or any other system where direct access is not possible.

Note this also renames the existing "eeprom_stub" module to be "eeprom_notimpl" for consistency and to avoid any
confusion with the unit test stubs.

Fixes #10

Testing performed
Build and sanity check CFE on RTEMS, VxWorks/MCP750 and native Linux
run all unit tests
Confirm that the "direct" implementation of Port/RAM access is used only on VxWorks build
Confirm that the "notimpl" implementation is used on Linux.

Expected behavior changes
No longer segfaults if e.g. CFE_PSP_Port routines are invoked on Linux. Instead an error code is returned.

System(s) tested on
Ubuntu 20.04 (native)
MCP750 (vxworks)
RTEMS 4.11.3 + QEMU

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Convert the current "cfe_psp_ram.c" and "cfe_psp_port.c" routines
into modular components, and remove from "shared" dir.

The existing implementations become the corresponding "direct"
module, and are enabled based on the psp module selection.

Also added is a "notimpl" variant, where all the functions
return CFE_PSP_ERR_NOT_IMPLEMENTED.  This is used on Linux
or any other system where direct access is not possible.

Note this also renames the existing "eeprom_stub" module
to be "eeprom_notimpl" for consistency and to avoid any
confusion with the unit test stubs.
@jphickey jphickey added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Mar 29, 2021
@astrogeco
Copy link
Contributor

CCB:2021-03-31 APPROVED

  • moves a platform-specific file in the shared directory so it is hard to override it
  • makes this modular

@astrogeco astrogeco changed the base branch from main to integration-candidate April 7, 2021 03:10
@astrogeco astrogeco merged commit 5b57249 into nasa:integration-candidate Apr 7, 2021
@astrogeco astrogeco added IC:2021-04-06 and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Apr 7, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Apr 8, 2021
Combines:

nasa/cFE#1284
nasa/osal#951
nasa/PSP#289

Including:

nasa/cFE#1251 - ES Info API Functional test

nasa/osal#931 - Scrub include guards
nasa/osal#937 - Switch to use CLOCK_REALTIME
nasa/osal#938 - specify shell name in ShellOutputToFile

nasa/PSP#286 - use OSAL timebase for CFE timers
nasa/PSP#282 - modularize the ram, port, and eenasa/psp#om access
nasa/PSP#285 - add psp module to implement timebase
@jphickey jphickey deleted the fix-10-modularize-ram-port-access branch April 29, 2021 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PSP memory, port, and EEPROM functions assume direct-mapped access
2 participants