Skip to content

Commit

Permalink
paging::mapper: switch from Unique<T> to NonNull<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
barzamin committed Oct 22, 2018
1 parent 903414f commit aa1408b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/arch/x86_64/memory/paging/mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
use super::table::{self, EntryFlags, Level4, Table, ENTRY_COUNT};
use super::{Frame, Page, PhysicalAddress, VirtualAddress};
use arch::x86_64::memory::FrameAllocator;
use core::ptr::Unique;
use core::ptr::NonNull;

/// Owns the top-level active page table (P4).
pub struct Mapper {
p4: Unique<Table<Level4>>,
p4: NonNull<Table<Level4>>,
}

impl Mapper {
/// There **must** be ***only one*** Mapper instance.
/// Since we cannot guarantee this trivially, the constructor is unsafe.
pub unsafe fn new() -> Mapper {
Mapper {
p4: Unique::new_unchecked(table::P4),
p4: NonNull::new_unchecked(table::P4),
}
}

Expand Down

0 comments on commit aa1408b

Please sign in to comment.