From 3694395dfbb5646b136c104525fd4d42a8366e61 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 12 Aug 2019 19:33:03 -0600 Subject: [PATCH] Fix compilation of acpi feature --- src/acpi/aml/namedobj.rs | 2 +- src/acpi/aml/namespace.rs | 4 ++-- src/acpi/aml/parser.rs | 4 ++-- src/acpi/aml/type1opcode.rs | 4 ++-- src/acpi/aml/type2opcode.rs | 4 ++-- src/acpi/dmar/mod.rs | 6 +++--- src/acpi/fadt.rs | 2 +- src/acpi/hpet.rs | 6 +++--- src/acpi/madt.rs | 14 +++++++------- src/acpi/mod.rs | 10 +++++----- src/acpi/rsdp.rs | 6 +++--- src/acpi/rxsdt.rs | 2 +- src/arch/x86_64/device/hpet.rs | 2 +- src/arch/x86_64/device/mod.rs | 2 +- src/arch/x86_64/ipi.rs | 2 +- src/arch/x86_64/start.rs | 2 +- src/arch/x86_64/stop.rs | 2 +- 17 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/acpi/aml/namedobj.rs b/src/acpi/aml/namedobj.rs index 8422b41..a8df597 100644 --- a/src/acpi/aml/namedobj.rs +++ b/src/acpi/aml/namedobj.rs @@ -1,6 +1,6 @@ use alloc::boxed::Box; use alloc::string::String; -use alloc::btree_map::BTreeMap; +use alloc::collections::BTreeMap; use super::AmlError; use super::parser::{ AmlParseType, ParseResult, AmlParseTypeGeneric, AmlExecutionContext, ExecutionState }; diff --git a/src/acpi/aml/namespace.rs b/src/acpi/aml/namespace.rs index 906d3f6..c420c9d 100644 --- a/src/acpi/aml/namespace.rs +++ b/src/acpi/aml/namespace.rs @@ -2,7 +2,7 @@ use alloc::boxed::Box; use alloc::string::String; use alloc::string::ToString; use alloc::vec::Vec; -use alloc::btree_map::BTreeMap; +use alloc::collections::BTreeMap; use core::fmt::{Debug, Formatter, Error}; use core::str::FromStr; @@ -12,7 +12,7 @@ use super::namedobj::{ RegionSpace, FieldFlags }; use super::parser::{AmlExecutionContext, ExecutionState}; use super::AmlError; -use acpi::{SdtSignature, get_signature_from_index, get_index_from_signature}; +use crate::acpi::{SdtSignature, get_signature_from_index, get_index_from_signature}; #[derive(Clone)] pub enum FieldSelector { diff --git a/src/acpi/aml/parser.rs b/src/acpi/aml/parser.rs index c4a8f92..b1046e2 100644 --- a/src/acpi/aml/parser.rs +++ b/src/acpi/aml/parser.rs @@ -1,5 +1,5 @@ use alloc::string::String; -use alloc::btree_map::BTreeMap; +use alloc::collections::BTreeMap; use alloc::vec::Vec; use alloc::boxed::Box; @@ -8,7 +8,7 @@ use spin::RwLockWriteGuard; use super::namespace::{ AmlValue, ObjectReference }; use super::AmlError; -use acpi::ACPI_TABLE; +use crate::acpi::ACPI_TABLE; pub type ParseResult = Result; pub type AmlParseType = AmlParseTypeGeneric; diff --git a/src/acpi/aml/type1opcode.rs b/src/acpi/aml/type1opcode.rs index 2204e9c..28b86ca 100644 --- a/src/acpi/aml/type1opcode.rs +++ b/src/acpi/aml/type1opcode.rs @@ -5,9 +5,9 @@ use super::pkglength::parse_pkg_length; use super::termlist::{parse_term_arg, parse_term_list}; use super::namestring::{parse_name_string, parse_super_name}; -use time::monotonic; +use crate::time::monotonic; -use acpi::{Sdt, load_table, get_sdt_signature}; +use crate::acpi::{Sdt, load_table, get_sdt_signature}; use super::{parse_aml_table, is_aml_table}; pub fn parse_type1_opcode(data: &[u8], diff --git a/src/acpi/aml/type2opcode.rs b/src/acpi/aml/type2opcode.rs index 9b4e7ef..bd7fb47 100644 --- a/src/acpi/aml/type2opcode.rs +++ b/src/acpi/aml/type2opcode.rs @@ -10,8 +10,8 @@ use super::termlist::{parse_term_arg, parse_method_invocation}; use super::namestring::{parse_super_name, parse_target, parse_name_string, parse_simple_name}; use super::dataobj::parse_data_ref_obj; -use time::monotonic; -use acpi::SDT_POINTERS; +use crate::time::monotonic; +use crate::acpi::SDT_POINTERS; #[derive(Debug, Clone)] pub enum MatchOpcode { diff --git a/src/acpi/dmar/mod.rs b/src/acpi/dmar/mod.rs index 1168718..ad2899f 100644 --- a/src/acpi/dmar/mod.rs +++ b/src/acpi/dmar/mod.rs @@ -2,9 +2,9 @@ use core::mem; use super::sdt::Sdt; use self::drhd::Drhd; -use memory::Frame; -use paging::{ActivePageTable, PhysicalAddress}; -use paging::entry::EntryFlags; +use crate::memory::Frame; +use crate::paging::{ActivePageTable, PhysicalAddress}; +use crate::paging::entry::EntryFlags; use super::{find_sdt, load_table, get_sdt_signature}; diff --git a/src/acpi/fadt.rs b/src/acpi/fadt.rs index c7be82a..31dcea2 100644 --- a/src/acpi/fadt.rs +++ b/src/acpi/fadt.rs @@ -3,7 +3,7 @@ use core::{mem, ptr}; use super::sdt::Sdt; use super::{ACPI_TABLE, SDT_POINTERS, get_sdt, find_sdt, get_sdt_signature, load_table}; -use paging::ActivePageTable; +use crate::paging::ActivePageTable; #[repr(packed)] #[derive(Debug)] diff --git a/src/acpi/hpet.rs b/src/acpi/hpet.rs index 73d15be..906a7b8 100644 --- a/src/acpi/hpet.rs +++ b/src/acpi/hpet.rs @@ -2,9 +2,9 @@ use core::{mem, ptr}; use core::intrinsics::{volatile_load, volatile_store}; -use memory::Frame; -use paging::{ActivePageTable, PhysicalAddress, Page, VirtualAddress}; -use paging::entry::EntryFlags; +use crate::memory::Frame; +use crate::paging::{ActivePageTable, PhysicalAddress, Page, VirtualAddress}; +use crate::paging::entry::EntryFlags; use super::sdt::Sdt; use super::{ACPI_TABLE, find_sdt, load_table, get_sdt_signature}; diff --git a/src/acpi/madt.rs b/src/acpi/madt.rs index e95c519..b671600 100644 --- a/src/acpi/madt.rs +++ b/src/acpi/madt.rs @@ -1,8 +1,8 @@ use core::mem; -use memory::{allocate_frames, Frame}; -use paging::{ActivePageTable, Page, PhysicalAddress, VirtualAddress}; -use paging::entry::EntryFlags; +use crate::memory::{allocate_frames, Frame}; +use crate::paging::{ActivePageTable, Page, PhysicalAddress, VirtualAddress}; +use crate::paging::entry::EntryFlags; use super::sdt::Sdt; use super::{AP_STARTUP, TRAMPOLINE, find_sdt, load_table, get_sdt_signature}; @@ -10,9 +10,9 @@ use super::{AP_STARTUP, TRAMPOLINE, find_sdt, load_table, get_sdt_signature}; use core::intrinsics::{atomic_load, atomic_store}; use core::sync::atomic::Ordering; -use device::local_apic::LOCAL_APIC; -use interrupt; -use start::{kstart_ap, CPU_COUNT, AP_READY}; +use crate::device::local_apic::LOCAL_APIC; +use crate::interrupt; +use crate::start::{kstart_ap, CPU_COUNT, AP_READY}; /// The Multiple APIC Descriptor Table #[derive(Debug)] @@ -64,7 +64,7 @@ impl Madt { CPU_COUNT.fetch_add(1, Ordering::SeqCst); // Allocate a stack - let stack_start = allocate_frames(64).expect("no more frames in acpi stack_start").start_address().get() + ::KERNEL_OFFSET; + let stack_start = allocate_frames(64).expect("no more frames in acpi stack_start").start_address().get() + crate::KERNEL_OFFSET; let stack_end = stack_start + 64 * 4096; let ap_ready = TRAMPOLINE as *mut u64; diff --git a/src/acpi/mod.rs b/src/acpi/mod.rs index 8939938..1686835 100644 --- a/src/acpi/mod.rs +++ b/src/acpi/mod.rs @@ -1,7 +1,7 @@ //! # ACPI //! Code to parse the ACPI tables -use alloc::btree_map::BTreeMap; +use alloc::collections::BTreeMap; use alloc::string::String; use alloc::vec::Vec; use alloc::boxed::Box; @@ -10,11 +10,11 @@ use syscall::io::{Io, Pio}; use spin::RwLock; -use stop::kstop; +use crate::stop::kstop; -use memory::Frame; -use paging::{ActivePageTable, Page, PhysicalAddress, VirtualAddress}; -use paging::entry::EntryFlags; +use crate::memory::Frame; +use crate::paging::{ActivePageTable, Page, PhysicalAddress, VirtualAddress}; +use crate::paging::entry::EntryFlags; use self::dmar::Dmar; use self::fadt::Fadt; diff --git a/src/acpi/rsdp.rs b/src/acpi/rsdp.rs index 1ec3550..6ad61d8 100644 --- a/src/acpi/rsdp.rs +++ b/src/acpi/rsdp.rs @@ -1,6 +1,6 @@ -use memory::Frame; -use paging::{ActivePageTable, Page, PhysicalAddress, VirtualAddress}; -use paging::entry::EntryFlags; +use crate::memory::Frame; +use crate::paging::{ActivePageTable, Page, PhysicalAddress, VirtualAddress}; +use crate::paging::entry::EntryFlags; /// RSDP #[derive(Copy, Clone, Debug)] diff --git a/src/acpi/rxsdt.rs b/src/acpi/rxsdt.rs index d3cf354..0d91c58 100644 --- a/src/acpi/rxsdt.rs +++ b/src/acpi/rxsdt.rs @@ -1,6 +1,6 @@ use alloc::boxed::Box; -use paging::ActivePageTable; +use crate::paging::ActivePageTable; use super::sdt::Sdt; use super::get_sdt; diff --git a/src/arch/x86_64/device/hpet.rs b/src/arch/x86_64/device/hpet.rs index 6f2c69b..1a6dae9 100644 --- a/src/arch/x86_64/device/hpet.rs +++ b/src/arch/x86_64/device/hpet.rs @@ -1,4 +1,4 @@ -use acpi::hpet::Hpet; +use crate::acpi::hpet::Hpet; static LEG_RT_CNF: u64 = 2; static ENABLE_CNF: u64 = 1; diff --git a/src/arch/x86_64/device/mod.rs b/src/arch/x86_64/device/mod.rs index 6c01ad8..3c87652 100644 --- a/src/arch/x86_64/device/mod.rs +++ b/src/arch/x86_64/device/mod.rs @@ -16,7 +16,7 @@ pub unsafe fn init(active_table: &mut ActivePageTable){ #[cfg(feature = "acpi")] unsafe fn init_hpet() -> bool { - use acpi::ACPI_TABLE; + use crate::acpi::ACPI_TABLE; if let Some(ref mut hpet) = *ACPI_TABLE.hpet.write() { hpet::init(hpet) } else { diff --git a/src/arch/x86_64/ipi.rs b/src/arch/x86_64/ipi.rs index 97996dc..28d21cd 100644 --- a/src/arch/x86_64/ipi.rs +++ b/src/arch/x86_64/ipi.rs @@ -22,7 +22,7 @@ pub fn ipi(_kind: IpiKind, _target: IpiTarget) {} #[cfg(feature = "multi_core")] #[inline(always)] pub fn ipi(kind: IpiKind, target: IpiTarget) { - use device::local_apic::LOCAL_APIC; + use crate::device::local_apic::LOCAL_APIC; let icr = (target as u64) << 18 | 1 << 14 | (kind as u64); unsafe { LOCAL_APIC.set_icr(icr) }; diff --git a/src/arch/x86_64/start.rs b/src/arch/x86_64/start.rs index 2fb3066..226c9a2 100644 --- a/src/arch/x86_64/start.rs +++ b/src/arch/x86_64/start.rs @@ -8,7 +8,7 @@ use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use crate::allocator; #[cfg(feature = "acpi")] -use acpi; +use crate::acpi; #[cfg(feature = "graphical_debug")] use arch::x86_64::graphical_debug; use crate::arch::x86_64::pti; diff --git a/src/arch/x86_64/stop.rs b/src/arch/x86_64/stop.rs index 0d4d206..b9fda45 100644 --- a/src/arch/x86_64/stop.rs +++ b/src/arch/x86_64/stop.rs @@ -1,5 +1,5 @@ #[cfg(feature = "acpi")] -use acpi; +use crate::acpi; use crate::syscall::io::{Io, Pio}; #[no_mangle]