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 #2240, improve 64-bit memory address handling in CMD/TLM #2256

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
The "CFE_ES_MemAddress_t" and "CFE_ES_MemOffset_t" types were intended to provide a path for easily upgrading the CMD/TLM structs from 32-bit to 64-bit memory addresses. However, this type was a bit overused and in some of those use-cases (e.g. in TBL header) it assumed that the type was 32-bits during the byte swap ops. As a result, the type could not be changed to 64 bits as intended.

This reverts those cases in TBL back to uint32 (meaning that tables will still be limited to 32 bit sizes, even on 64 bit CPUs) but otherwise the addresses and sizes in ES/SB telemetry can grow to 64 bits as intended.

For unit tests, correct operation depends on the availablily of an updated test macro that can compare integers as "size_t" type. (as opposed to uint32).

Fixes #2240

Testing performed
Build and run all tests

Expected behavior changes
Changing the definition of "CFE_ES_MemAddress_t" and "CFE_ES_MemOffset_t" should now work as intended, provided that the conversion macros are also updated to match the definition.

System(s) tested on
Debian

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

The "CFE_ES_MemAddress_t" and "CFE_ES_MemOffset_t" types were intended
to provide a path for easily upgrading the CMD/TLM structs from 32-bit
to 64-bit memory addresses.  However, this type was a bit overused and
in some of those use-cases (e.g. in TBL header) it assumed that the type
was 32-bits during the byte swap ops.  As a result, the type could not
be changed to 64 bits as intended.

This reverts those cases in TBL back to uint32 (meaning that tables will
still be limited to 32 bit sizes, even on 64 bit CPUs) but otherwise the
addresses and sizes in ES/SB telemetry can grow to 64 bits as intended.

For unit tests, correct operation depends on the availablily of an updated
test macro that can compare integers as "size_t" type. (as opposed to
uint32).
@dzbaker dzbaker added the CCB:Approved Indicates code review and approval by community CCB label Mar 16, 2023
dzbaker added a commit to nasa/cFS that referenced this pull request Mar 16, 2023
*Combines:*

osal v6.0.0-rc4+dev209
cFE v7.0.0-rc4+dev154

**Includes:**

*osal*
- nasa/osal#1375

*cFE*
- nasa/cFE#2256

Co-authored by: Joseph Hickey <[email protected]>
@dzbaker dzbaker merged commit 45984f1 into nasa:main Mar 17, 2023
dzbaker added a commit to nasa/cFS that referenced this pull request Mar 17, 2023
*Combines:*

osal v6.0.0-rc4+dev209
cFE v7.0.0-rc4+dev154

**Includes:**

*osal*
- nasa/osal#1375

*cFE*
- nasa/cFE#2256

Co-authored by: Joseph Hickey <[email protected]>
@jphickey jphickey deleted the fix-2240-memaddress-handling branch March 17, 2023 13:02
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB enhancement Equuleus-rc1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correct use of "MemAddress" and "MemOffset"
4 participants