Repository navigation
Migrate dmffs to 64-bit file offsets and sizes (dmfsi API 2.0) - #26
Merged
Merged
Conversation
Widen the TLV file-entry/handle offset and size fields to dmfsi_offset_t/dmfsi_size_t and move _lseek/_tell to dmfsi interface version 2.0, matching the updated dmfsi.h. TLV wire-format fields (type/length) stay uint32_t since that is the on-disk format, but the running offsets used to walk the flash image are now 64-bit so a flash region larger than 4 GiB no longer wraps. Part of choco-technologies/dmod-ecosystem#7.
Same drift as dmramfs: dmfsi.h moved these two interfaces to version 2.0 after this branch was cut (dmfsi_dir_entry_t/dmfsi_stat_t now carry the 64-bit size field). The bodies already used dmfsi_size_t, only the registered version number was stale.
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
dmfsi_offset_t/dmfsi_size_ttypedefs and bumped_lseek/_tellto interface version 2.0. dmffs still useduint32_tfor every flash offset/size and registered the old 1.0 signatures, which no longer matches dmfsi.h.dmffs_file_entry_t.data_offset/data_size,dmffs_file_handle_t.position,dmffs_dir_handle_t.current_offset/dir_end_offset, and the context'sflash_sizetodmfsi_size_t/dmfsi_offset_t._lseek/_tellto interface version 2.0 and_size's return type todmfsi_size_t.read_tlv_header,parse_file_entry,find_directory_range, etc.) now carry offsets as 64-bit, so a flash image bigger than 4 GiB no longer wraps while walking entries. The on-disk TLVtype/lengthfields themselves stayuint32_tsince that's the actual wire format, unrelated to this migration.Part of choco-technologies/dmod-ecosystem#7.
Test plan
cmake -DDMOD_TOOLS_NAME=arch/x86_64+cmake --build . --target dmffscompiles clean, no new warnings (checked with-Wall -Wextra -Wsign-comparetoo).