diff --git a/posts/2015-12-09-modifying-page-tables.md b/posts/2015-12-09-modifying-page-tables.md index 6de3f973..7c21741d 100644 --- a/posts/2015-12-09-modifying-page-tables.md +++ b/posts/2015-12-09-modifying-page-tables.md @@ -458,7 +458,7 @@ pub fn translate(virtual_address: VirtualAddress) -> Option { It uses two functions we haven't defined yet: `translate_page` and `Page::containing_address`. Let's start with the latter: ```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, "invalid address: 0x{:x}", address); Page { number: address / PAGE_SIZE }