From 42d94c3d50f3b878fcff47f151324453c68219fd Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 13 Mar 2019 13:59:58 +0100 Subject: [PATCH] Fix missing imports in code examples --- .../second-edition/posts/10-paging-implementation/index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blog/content/second-edition/posts/10-paging-implementation/index.md b/blog/content/second-edition/posts/10-paging-implementation/index.md index 5fa7a8ed..ce507488 100644 --- a/blog/content/second-edition/posts/10-paging-implementation/index.md +++ b/blog/content/second-edition/posts/10-paging-implementation/index.md @@ -478,6 +478,8 @@ For translating a virtual to a physical address, we have to traverse the four-le ```rust // in src/memory.rs +use x86_64::{PhysAddr, VirtAddr}; + /// Translates the given virtual address to the mapped physical address, or /// `None` if the address is not mapped. /// @@ -612,6 +614,9 @@ The traits only define the interface, they don't provide any implementation. The We have the complete physical memory mapped at `physical_memory_offset`, so we can use the `MappedPageTable` type. To initialize it, we create a new `init` function in our `memory` module: ```rust +use x86_64::structures::paging::{PhysFrame, MapperAllSizes, MappedPageTable}; +use x86_64::PhysAddr; + /// Initialize a new MappedPageTable. /// /// This function is unsafe because the caller must guarantee that the