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

UAPI: avoid usage of bitfield values in exchange to keep the Rust interface easy and without dependencies #68

Open
pthierry-ledger opened this issue Oct 8, 2024 · 0 comments
Labels
api impact the external API of the component enhancement request for code evolution
Milestone

Comments

@pthierry-ledger
Copy link
Member

Bitfields is sometime used for cases where behaviors may be concurrently activated for a given feature.
This is a relative standard C model, in the same way HW registers behave.
In Rust, this requires external depedency (bitfield crate), that is not allowed for TCB components, including uapi.

If possible (to be checked), the usage of bitfield in userspace-kernelspace exchanged should be replaced by full enumeration.
This requires an analysis to ensure that such a modification do not make semantics complex and do not increase the memory usage.

@pthierry-ledger pthierry-ledger added api impact the external API of the component enhancement request for code evolution labels Oct 8, 2024
@pthierry-ledger pthierry-ledger added this to the Sentry-v1.0.0 milestone Oct 8, 2024
pthierry-ledger added a commit that referenced this issue Oct 9, 2024
- [x] create a dedicated uapi dma.h header to properly separate
DMA-related exported types
- [x] preparation: export informative-relative DMA types to uapi
- [x] add sysgate for sys_dma_get_stream_info
- [x] add autotest tests for this syscall
- [x] add Rust-related structure definition that match dma.h using
public submodule in systypes module

This API return a complete structured stream definition based on
device-tree. This avoid any device-tee manipulation at userspace level
for DMAs.

Note: the overall DMA UAPI will have its associated full documentation
(RustDoc+Concept/mans) through a dedicated, final, PR.

Note: some fields are bitfields (ORed values) making the UAPI in Rust
harder to manipulate without depending on the public bitfield crate. The
mask may need to be replaced by a full enumeration of cases. This
support is out of this very PR. See #68 for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api impact the external API of the component enhancement request for code evolution
Projects
None yet
Development

No branches or pull requests

1 participant