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

piolib: Increase data_bytes range to 32-bits #108

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

pelwell
Copy link
Collaborator

@pelwell pelwell commented Dec 16, 2024

In many places, the number of bytes in a data transfer is stored as a 32-bit (or greater) value, but the ioctl API to the kernel stores it in a 16-bit field, alongside which is a 16-bit gap due to the alignment requirements of the pointer that follows.

Increase the size of data_bytes to a uint32_t, so that it can handle larger transfers. Since using different sizes as either end can lead to unpredictable results, a separate IOCTL is used for larger transfers, allowing the kernel support to be determined and backwards compatibility to be maintained.

See: #107

In many places, the number of bytes in a data transfer is stored as a
32-bit (or greater) value, but the ioctl API to the kernel stores it in
a 16-bit field, alongside which is a 16-bit gap due to the alignment
requirements of the pointer that follows.

Increase the size of data_bytes to a uint32_t, so that it can handle
larger transfers. Since using different sizes as either end can lead
to unpredictable results, a separate IOCTL is used for larger
transfers, allowing the kernel support to be determined and
backwards compatibility to be maintained.

See: raspberrypi#107

Signed-off-by: Phil Elwell <[email protected]>
@pelwell pelwell merged commit b7d55f2 into raspberrypi:master Dec 17, 2024
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.

1 participant