Repository navigation
Migrate to dmdrvi 2.0 (64-bit I/O contract) - #1
Merged
Merged
Conversation
Bumps every DIF registration to the 2.0 interface version dmdrvi.h now requires. The functional changes are in _read/_write (offset -> dmdrvi_offset_t, return type -> dmdrvi_ssize_t, with explicit -EOVERFLOW/-EINVAL guards). dmdma's _read/_write are stubs (DMA streams are driven entirely through ioctl(), not byte addressing), so only the signature and validation guards changed; the stub behavior (return 0) is preserved. _stat already stored size as an unsigned type with no truncating cast, so it required no change beyond the version bump. _open already carried the dev_num parameter required by both the 1.0 and 2.0 contract, so no drift bug was found there (unlike dmclk). Part of choco-technologies/dmod-ecosystem#8.
JohnAmadis
approved these changes
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/dmdma.c(_create,_free,_open,_close,_read,_write,_ioctl,_flush,_stat) fromdmod_dmdrvi_dif_api_declaration(1.0, ...)to2.0, matching the ecosystem-wide cutover in dmdrvi.h._read/_write: signature updated to the 2.0 contract (offset->dmdrvi_offset_t, return type ->dmdrvi_ssize_t), with explicit-EINVAL(negative offset) and-EOVERFLOW(size > INT64_MAX) guards added. dmdma's DMA streams are not byte-addressable (all I/O is driven through_ioctl), so these remain stubs that return 0 after validation - behavior is otherwise unchanged._stat: version bump only.stat->sizewas already assigned without a truncating cast (stat->size = 0;), so no further change was needed for thedmdrvi_size_tfield-type widening._openalready declared and used thedev_numparameter required by both the 1.0 and 2.0 contract - no signature drift found here (unlike the pre-existing bug fixed in dmclk's migration)._path_readyor_friend_changedimplementation exists in this driver, so nothing to migrate there.tests/) for other DIF call sites oruint32_t offset/sizeusage tied to the interface; found none outsidesrc/dmdma.c.Part of choco-technologies/dmod-ecosystem#8.
Test plan
rm -rf ~/.cache/dmod/dmf-get/{manifests,packages}/*to avoid a stale pre-2.0 dmdrvi manifestcmake -S . -B /tmp/build_dmdma_test -DDMOD_TOOLS_NAME=arch/x86_64 -DDMOD_MODULE_VERSION=0.0.1dmdrvi.hshowsdmod_dmdrvi_dif(2.0, ...)for all DIF functions (not 1.0)cmake --build /tmp/build_dmdma_test --target dmdmacompleted with[100%] Built target dmdma, no new compiler warnings (only a pre-existing harmless linker note)