Closed Freax13 closed 2 years ago
if we are panicking when the PhysAddr
goes out of range, should we do the same if the VirtAddr
goes out of range? It would make things more consistent.
if we are panicking when the
PhysAddr
goes out of range, should we do the same if theVirtAddr
goes out of range? It would make things more consistent.
This pr added just that: https://github.com/rust-osdev/x86_64/blob/49b920493c423b6a2cd7a226fe1dc22c8b472e08/src/addr.rs#L162-L165
Thanks for adding the tests.
This pr fixes
VirtAddr::align_up
andVirtAddr::align_down
. Previously those functions returned non-canonical addresses when aligning addresses near the address space gap. Two tests were added to test such cases.This pr also fixes
PhysAddr::align_up
by adding a check to make sure the address is not too big.