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 #263, modular psp implementation #264

Merged
merged 13 commits into from
Mar 17, 2021

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Mar 9, 2021

Describe the contribution
This is a very simple approach to addressing the issue of incompatible/non-portable code blobs in "shared" directory of the PSP. It uses the same modular init pattern as is used elsewhere in CFE.

CMake is used to generate a list of "base" modules correlating with the selected PSP (i.e. pc-linux, mcp750-vxworks, etc).
These modules are then initialized (in order) before the rest of PSP runs.

Fixes #263

Testing performed
Build and run CFE for pc-rtems and pc-linux
Confirm the correct/expected EEPROM implementation was used

Expected behavior changes
The "direct write" EEPROM is not used unconditionally. Instead the proper eeprom implementation module is selected based on which PSP is selected. MCP750 uses direct write, pc-linux uses an mmap file, and pc-rtems uses a stub (not implemented).

System(s) tested on
Ubuntu 20.04 (native)
RTEMS 4.11.3

Additional context
This pattern could be applied to much more of the PSP stuff.

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

zanzaben and others added 7 commits March 1, 2021 10:08
Use target_include_directories and target_compile_definitions to
propagate the interface details for PSP
Add a PSP implementation of the version API discussed in nasa/cFS#200
…256-version-api', 'jphickey/fix-254-psp-interface' and 'zanzaben/fix246_fix_comment_style' into ic-20210305
Adds a new target for PSP modules and use this to propagate the compile
definitions and include directories for all PSP code.
@jphickey jphickey marked this pull request as draft March 9, 2021 20:21
@jphickey
Copy link
Contributor Author

jphickey commented Mar 9, 2021

Note this approach is all handled within PSP so it makes it transparent to users, and should be fully backward compatible.

Pushed proof of concept as draft initially - specifically see last commit 3ab3600 - which does this for EEPROM. Same thing can/should be done for cfe_psp_memutils.c, cfe_psp_port.c, cfe_psp_ram.c, and I'd also like to do this for the OSAL-based 1Hz generation and some other things that are repeated/cloned between more than one of the impl layers.

astrogeco and others added 5 commits March 10, 2021 19:33
Certain operations in the recent baseline were dependent on a
recent version of CMake.  In particular object libraries cannot
be used in the intended way in the older versions.  This adds
workarounds for those cases.

Tested against CMake versions 3.5.1, 3.10.2, and 3.16.3.
Integration candidate: 2021-03-12
Update Readme, fix URL for IC-2021-03-12 entry in changelog
Use the PSP module feature to allow selection/override of EEPROM accessors.
The current code is converted to an "eeprom_direct" module which is included
only on platforms where it is valid (e.g. mcp750, no mmu).
@jphickey jphickey marked this pull request as ready for review March 17, 2021 17:28
@jphickey
Copy link
Contributor Author

Note - this was discussed/brought up during the 2021-03-10 review of the directory reorganization, but not merged at that time as it was not strictly related to reorganization.

However some future items depend on this so I'd like to get it in there.

@astrogeco astrogeco changed the base branch from main to integration-candidate March 17, 2021 21:37
@astrogeco astrogeco changed the base branch from integration-candidate to main March 17, 2021 21:38
@astrogeco astrogeco changed the base branch from main to integration-candidate March 17, 2021 21:42
@astrogeco astrogeco merged commit 1a799ef into nasa:integration-candidate Mar 17, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Mar 17, 2021
nasa/PSP#264 - Fix #263, modular psp implementation
nasa/PSP#272 - Fix #265, Use quotes for local includes
nasa/PSP#271 - Fix #270, Add Contributing Guide
astrogeco added a commit to nasa/cFS that referenced this pull request Mar 18, 2021
nasa/PSP#264 - modular psp implementation
nasa/PSP#272 - Use quotes for local includes
nasa/PSP#271 - Add Contributing Guide
astrogeco added a commit to nasa/cFS that referenced this pull request Mar 22, 2021
nasa/cFE#1243 v6.8.0-rc1+dev436

  nasa/cFE#1225, Add coverage test fix
  nasa/cFE#1218, Adds a local definition of `SOFTWARE_BIG/LITTLE_BIT_ORDER` directly inside `cfe_endian.h` to provide a compatible symbol for apps that still require this. This allows CFE to build and run successfully when OSAL stops providing this in `common_types.h`.
  nasa/cFE#1193, Removes incorrect statements from Application Developers Guide
  nasa/cFE#1235, Fixes truncation handling on vsnprintf error by adding a cast to avoid implicit conversion
  nasa/cFE#1220, Clarify the documentation on SB MsgId regarding requirements for command and telemetry messages
  nasa/cFE#1230, Avoids undefined behavior and resolves static analysis warnings by casting `isspace` input to `unsigned char`.
  nasa/cFE#1231, Updates message module and msgid v1, `CFE_MSG_SetMsgId`, to use mask instead of cast to alter value. Resolves static analysis warning.
  nasa/cFE#1232, Updates `CFE_ES_FileWriteByteCntErr` to report status, not a `size_t` actual since `OS_write` returns `int32`. Use `int16` for local type from `CFE_TBL_FindTableInRegistry` since it's an index, not a status.
  nasa/cFE#1228, Replaces `<>` with `"` in local `#include`s
  nasa/cFE#1227, Adds `CONTRIBUING.md` that links to the main cFS contributing guide.

nasa/PSP#273 v1.5.0-rc1+dev90

  nasa/PSP#264, modular psp implementation
  nasa/PSP#272, Use quotes for local includes
  nasa/PSP#271, Add Contributing Guide

nasa/osal#917 v5.1.0-rc1+dev347

  nasa/osal#890, Move copyblock size to a #define and add comments
  nasa/osal#891, Removed rogue while loop
  nasa/osal#892, Scripted replacement for #include <os and #include <OSC_ matches of < and > with "
  nasa/osal#893, Consolidates the duplicated switch in OS_SocketOpen_Impl
  nasa/osal#894, Add `const` to input pointers
  nasa/osal#895, Removed network prototypes defined in osapi_sockets.h that are also in osapi_network.h
  nasa/osal#896, Removes NULL redefine from common_types.h
  nasa/osal#912, Add Contributing Guide
  nasa/osal#914, Utilize UTASSERT_CASETYPE_NA to report OS_ERR_NOT_IMPLEMENTED
  nasa/osal#898, correct interval calculation in DoSelect
  nasa/osal#909, comments describing select after connect
  nasa/osal#902, add check for EAGAIN in addition to EINTR
  nasa/osal#908, compile time assert for sockaddr size
  nasa/osal#910, check/report fcntl status
  nasa/osal#897, Add assert for FD_SET_SIZE in relation to OSAL_set
  nasa/osal#903, better error translation for ESPIPE errno
  nasa/osal#840, add shell functional test
  nasa/osal#901, rename OS_U32ValueWrapper_t
  nasa/osal#900, break up logic in return statement
  nasa/osal#906, return moduleInfoGet error
  nasa/osal#907, report timer_gettime error
  nasa/osal#899, remove unreachable test
  nasa/osal#905, make module comment same as other services
  nasa/osal#920 to fix test error check index inside fdset conversions
  nasa/osal#922, make non-selectable FD an error

nasa/sample_app#137 v1.2.0-rc1+dev54

  nasa/sample_app#134, Convert from <> to " for local includes
  nasa/sample_app#136, Added a contributing guide that links to the main cFS contributing guide.
  nasa/sample_app#132, Add context to the values for MsgIDs

nasa/sample_lib#55 v1.2.0-rc1+dev30

  nasa/sample_lib#54, Replace <> with " for local includes
  nasa/sample_lib#53, Adds CONTRIBUTING.md that links to the main cFS contributing guide.

nasa/cFS-GroundSystem#171 v2.2.0-rc1+dev41

  nasa/cFS-GroundSystem#166, Updated TBL and SB tlm for an operational TLM display
  nasa/cFS-GroundSystem#170, Add Contributing Guide
  nasa/cFS-GroundSystem#137, Create package for cfs-groundsystem
astrogeco added a commit to nasa/cFS that referenced this pull request Mar 22, 2021
nasa/cFE#1243 v6.8.0-rc1+dev436

  nasa/cFE#1225, Add coverage test fix
  nasa/cFE#1218, bit order macros
  nasa/cFE#1193, Removes incorrect statements from Application Developers Guide
  nasa/cFE#1235, Fixes truncation handling on vsnprintf error by adding a cast to avoid implicit conversion
  nasa/cFE#1220, Clarify the documentation on SB MsgId regarding requirements for command and telemetry messages
  nasa/cFE#1230, Cast isspace input to unsigned char to avoid undefined behavior
  nasa/cFE#1231, Updated message module, msgid v1 to use mask instead of cast to alter value
  nasa/cFE#1232, Coercion alters value caused by incorrect type - static analysis warning
  nasa/cFE#1228, Replaces `<>` with `"` in local `#include`s
  nasa/cFE#1227, Adds `CONTRIBUING.md` that links to the main cFS contributing guide.

nasa/PSP#273 v1.5.0-rc1+dev90

  nasa/PSP#264, modular psp implementation
  nasa/PSP#272, Use quotes for local includes
  nasa/PSP#271, Add Contributing Guide

nasa/osal#917 v5.1.0-rc1+dev347

  nasa/osal#890, Move copyblock size to a #define and add comments
  nasa/osal#891, Removed rogue while loop
  nasa/osal#892, Scripted replacement for #include <os and #include <OSC_ matches of < and > with "
  nasa/osal#893, Consolidates the duplicated switch in OS_SocketOpen_Impl
  nasa/osal#894, Add `const` to input pointers
  nasa/osal#895, Removed network prototypes defined in osapi_sockets.h that are also in osapi_network.h
  nasa/osal#896, Removes NULL redefine from common_types.h
  nasa/osal#912, Add Contributing Guide
  nasa/osal#914, Utilize UTASSERT_CASETYPE_NA to report OS_ERR_NOT_IMPLEMENTED
  nasa/osal#898, correct interval calculation in DoSelect
  nasa/osal#909, comments describing select after connect
  nasa/osal#902, add check for EAGAIN in addition to EINTR
  nasa/osal#908, compile time assert for sockaddr size
  nasa/osal#910, check/report fcntl status
  nasa/osal#897, Add assert for FD_SET_SIZE in relation to OSAL_set
  nasa/osal#903, better error translation for ESPIPE errno
  nasa/osal#840, add shell functional test
  nasa/osal#901, rename OS_U32ValueWrapper_t
  nasa/osal#900, break up logic in return statement
  nasa/osal#906, return moduleInfoGet error
  nasa/osal#907, report timer_gettime error
  nasa/osal#899, remove unreachable test
  nasa/osal#905, make module comment same as other services
  nasa/osal#920 to fix test error check index inside fdset conversions
  nasa/osal#922, make non-selectable FD an error

nasa/sample_app#137 v1.2.0-rc1+dev54

  nasa/sample_app#134, Convert from <> to " for local includes
  nasa/sample_app#136, Added a contributing guide that links to the main cFS contributing guide.
  nasa/sample_app#132, Add context to the values for MsgIDs

nasa/sample_lib#55 v1.2.0-rc1+dev30

  nasa/sample_lib#54, Replace <> with " for local includes
  nasa/sample_lib#53, Adds CONTRIBUTING.md that links to the main cFS contributing guide.

nasa/cFS-GroundSystem#171 v2.2.0-rc1+dev41

  nasa/cFS-GroundSystem#166, Updated TBL and SB tlm for an operational TLM display
  nasa/cFS-GroundSystem#170, Add Contributing Guide
  nasa/cFS-GroundSystem#137, Create package for cfs-groundsystem
@jphickey jphickey deleted the fix-263-modular-psp branch April 29, 2021 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make PSP more modular
5 participants