Skip to content

Separate RP2040 implementation details into a separate module - #50

Draft
datdenkikniet wants to merge 1 commit into
masterfrom
isolate-rp2040
Draft

Separate RP2040 implementation details into a separate module#50
datdenkikniet wants to merge 1 commit into
masterfrom
isolate-rp2040

Conversation

@datdenkikniet

Copy link
Copy Markdown
Collaborator

Instead of having RP2040 implementation details scattered around the codebase, this PR aims to centralize all of its details into a single module file.

This way, it becomes more obvious what must be implemented for other targets, and implementing different targets will not greatly increase the complexity of the UF2 flashing and generation code.

Comment thread src/elf.rs
/// (have the `PT_LOAD` type) and are non-empty.
pub fn loadable_nonempty(entries: &[Elf32PhEntry]) -> impl Iterator<Item = &Elf32PhEntry> {
entries.iter().filter(|e| {
let mapped_size = e.filez.min(e.memsz);

@datdenkikniet datdenkikniet Oct 12, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: previously, this was closer to:

                                   /* `mapped_size` */
e.typ == PT_LOAD && e.memsz > 0 && e.filesz.min(e.memsz) > 0

However, e.memsz > 0 && e.filesz.min(e.memsz) > 0 is the same operation as e.filesz.min(e.memsz) > 0, so we can get rid of an unnecessary check

@datdenkikniet
datdenkikniet force-pushed the isolate-rp2040 branch 3 times, most recently from 4f5cc30 to a1e9c92 Compare October 12, 2025 20:43
@datdenkikniet
datdenkikniet marked this pull request as draft October 13, 2025 19:31
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