Skip to content

piolib: Increase data_bytes range to 32-bits - #108

Merged
pelwell merged 1 commit into
raspberrypi:masterfrom
pelwell:xferdata32
Dec 17, 2024
Merged

pelwell merged 1 commit into
raspberrypi:masterfrom
pelwell:xferdata32

Conversation

@pelwell

@pelwell pelwell commented Dec 16, 2024

Copy link
Copy Markdown
Collaborator

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 <phil@raspberrypi.com>
@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