Skip to content

Commit

Permalink
Add missing MemoryMap and MemoryRegionType imports
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-opp committed May 13, 2019
1 parent 1ebe869 commit 6db5ad7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,8 @@ In order to create new page tables, we need to create a proper frame allocator.
```rust
// in src/memory.rs

use bootloader::bootinfo::MemoryMap;

/// A FrameAllocator that returns usable frames from the bootloader's memory map.
pub struct BootInfoFrameAllocator {
memory_map: &'static MemoryMap,
Expand Down Expand Up @@ -886,6 +888,8 @@ Before we implement the `FrameAllocator` trait, we add an auxiliary method that
```rust
// in src/memory.rs

use bootloader::bootinfo::MemoryRegionType;

impl BootInfoFrameAllocator {
/// Returns an iterator over the usable frames specified in the memory map.
fn usable_frames(&self) -> impl Iterator<Item = PhysFrame> {
Expand Down

0 comments on commit 6db5ad7

Please sign in to comment.