Make Page::containing address public in post

This brings it in line with the code
This commit is contained in:
Philipp Oppermann
2015-12-31 00:00:41 +01:00
parent b11ed7bd46
commit 9bad9020f6

View File

@@ -458,7 +458,7 @@ pub fn translate(virtual_address: VirtualAddress) -> Option<PhysicalAddress> {
It uses two functions we haven't defined yet: `translate_page` and `Page::containing_address`. Let's start with the latter: It uses two functions we haven't defined yet: `translate_page` and `Page::containing_address`. Let's start with the latter:
```rust ```rust
fn containing_address(address: VirtualAddress) -> Page { pub fn containing_address(address: VirtualAddress) -> Page {
assert!(address < 0x0000_8000_0000_0000 || address >= 0xffff_8000_0000_0000, assert!(address < 0x0000_8000_0000_0000 || address >= 0xffff_8000_0000_0000,
"invalid address: 0x{:x}", address); "invalid address: 0x{:x}", address);
Page { number: address / PAGE_SIZE } Page { number: address / PAGE_SIZE }