From 1e44f157d0408c7848181fe4293db220bff05a54 Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jeremy@system76.com> Date: Wed, 15 Jul 2020 16:10:51 -0600 Subject: [PATCH] Fix graphical_debug feature --- src/arch/x86_64/graphical_debug/display.rs | 4 ++-- src/arch/x86_64/graphical_debug/mod.rs | 12 ++++++------ src/arch/x86_64/start.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/arch/x86_64/graphical_debug/display.rs b/src/arch/x86_64/graphical_debug/display.rs index a88248be..4f5ecbf8 100644 --- a/src/arch/x86_64/graphical_debug/display.rs +++ b/src/arch/x86_64/graphical_debug/display.rs @@ -15,7 +15,7 @@ pub struct Display { impl Display { pub fn new(width: usize, height: usize, onscreen: usize) -> Display { let size = width * height; - let offscreen = unsafe { ::ALLOCATOR.alloc(Layout::from_size_align_unchecked(size * 4, 4096)) }; + let offscreen = unsafe { crate::ALLOCATOR.alloc(Layout::from_size_align_unchecked(size * 4, 4096)) }; unsafe { fast_set64(offscreen as *mut u64, 0, size/2) }; Display { width: width, @@ -144,6 +144,6 @@ impl Display { impl Drop for Display { fn drop(&mut self) { - unsafe { ::ALLOCATOR.dealloc(self.offscreen.as_mut_ptr() as *mut u8, Layout::from_size_align_unchecked(self.offscreen.len() * 4, 4096)) }; + unsafe { crate::ALLOCATOR.dealloc(self.offscreen.as_mut_ptr() as *mut u8, Layout::from_size_align_unchecked(self.offscreen.len() * 4, 4096)) }; } } diff --git a/src/arch/x86_64/graphical_debug/mod.rs b/src/arch/x86_64/graphical_debug/mod.rs index 081f5678..6ea97ed5 100644 --- a/src/arch/x86_64/graphical_debug/mod.rs +++ b/src/arch/x86_64/graphical_debug/mod.rs @@ -1,9 +1,9 @@ use spin::Mutex; -use memory::Frame; -use paging::{ActivePageTable, Page, PhysicalAddress, VirtualAddress}; -use paging::entry::EntryFlags; -use paging::mapper::MapperFlushAll; +use crate::memory::Frame; +use crate::paging::{ActivePageTable, Page, PhysicalAddress, VirtualAddress}; +use crate::paging::entry::EntryFlags; +use crate::paging::mapper::MapperFlushAll; pub use self::debug::DebugDisplay; use self::display::Display; @@ -54,13 +54,13 @@ pub fn init(active_table: &mut ActivePageTable) { { let size = width * height; - let onscreen = physbaseptr + ::KERNEL_OFFSET; + let onscreen = physbaseptr + crate::KERNEL_OFFSET; { let mut flush_all = MapperFlushAll::new(); let start_page = Page::containing_address(VirtualAddress::new(onscreen)); let end_page = Page::containing_address(VirtualAddress::new(onscreen + size * 4)); for page in Page::range_inclusive(start_page, end_page) { - let frame = Frame::containing_address(PhysicalAddress::new(page.start_address().get() - ::KERNEL_OFFSET)); + let frame = Frame::containing_address(PhysicalAddress::new(page.start_address().get() - crate::KERNEL_OFFSET)); let flags = EntryFlags::PRESENT | EntryFlags::NO_EXECUTE | EntryFlags::WRITABLE | EntryFlags::HUGE_PAGE; let result = active_table.map_to(page, frame, flags); flush_all.consume(result); diff --git a/src/arch/x86_64/start.rs b/src/arch/x86_64/start.rs index 30425f0e..7cdec3d5 100644 --- a/src/arch/x86_64/start.rs +++ b/src/arch/x86_64/start.rs @@ -10,7 +10,7 @@ use crate::allocator; #[cfg(feature = "acpi")] use crate::acpi; #[cfg(feature = "graphical_debug")] -use arch::x86_64::graphical_debug; +use crate::arch::x86_64::graphical_debug; use crate::arch::x86_64::pti; use crate::device; use crate::gdt; -- GitLab