Skip to content

Make ranges jump address space gaps - #618

Open
mkroening wants to merge 5 commits into
rust-osdev:masterfrom
mkroening:range-jump-gap
Open

mkroening wants to merge 5 commits into
rust-osdev:masterfrom
mkroening:range-jump-gap

Conversation

@mkroening

Copy link
Copy Markdown
Member

I recently discovered that this range panics during iteration, even though it does not even cross the address space gap:

let pages = PageRangeInclusive {
	start: Page::<Size4KiB>::from_start_address(VirtAddr::new(0x0000_7fff_ffff_f000))
		.unwrap(),
	end: Page::<Size4KiB>::from_start_address(VirtAddr::new(0x0000_7fff_ffff_f000))
		.unwrap(),
};

We could use #616 to fix that, similar to #617. I believe it makes more sense to jump the gap, as proposed in #589 and already done via the unstable Step trait.

Note that this does not add a checked version for subtracting two addresses yet.
Note that this changes the panic behavior, since `rhs * S::SIZE` did not panic before without overflow checks.
Note that this does not add a checked version for subtracting two pages or frames yet.

This branch has not been deployed

No deployments
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