Fix #10, modularize the ram, port, and eeprom access #282
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
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.