diff --git a/boot/amd64/src/cpuid.rs b/boot/amd64/src/cpuid.rs index ddde206b..84d330ff 100644 --- a/boot/amd64/src/cpuid.rs +++ b/boot/amd64/src/cpuid.rs @@ -1,3 +1,5 @@ +use core::arch::asm; + pub struct Features { max_basic_eax: u32, max_extended_eax: u32, diff --git a/boot/amd64/src/gdt.rs b/boot/amd64/src/gdt.rs index ec94f30c..db375bed 100644 --- a/boot/amd64/src/gdt.rs +++ b/boot/amd64/src/gdt.rs @@ -1,3 +1,4 @@ +use core::arch::asm; use core::mem; #[repr(C)] diff --git a/boot/amd64/src/main.rs b/boot/amd64/src/main.rs index 0577ec1a..4b74a1de 100644 --- a/boot/amd64/src/main.rs +++ b/boot/amd64/src/main.rs @@ -1,6 +1,6 @@ #![no_main] #![no_std] -#![feature(asm, asm_const)] +#![feature(asm_const)] #![feature(maybe_uninit_uninit_array, maybe_uninit_slice)] mod cpuid; @@ -13,6 +13,7 @@ mod multiboot2; mod paging; mod vga; +use core::arch::asm; use core::mem::MaybeUninit; use core::panic::PanicInfo; use core::slice; diff --git a/boot/amd64/src/msr.rs b/boot/amd64/src/msr.rs index f6b3384d..26575dd7 100644 --- a/boot/amd64/src/msr.rs +++ b/boot/amd64/src/msr.rs @@ -1,3 +1,5 @@ +use core::arch::asm; + /// # Safety /// /// MSRs must be supported. diff --git a/kernel/src/arch/amd64/asm.rs b/kernel/src/arch/amd64/asm.rs index 9f460e34..9b8023f6 100644 --- a/kernel/src/arch/amd64/asm.rs +++ b/kernel/src/arch/amd64/asm.rs @@ -1,4 +1,6 @@ pub mod io { + use core::arch::asm; + pub unsafe fn inb(address: u16) -> u8 { let out: u8; asm!("in al, dx", out("al") out, in("dx") address); diff --git a/kernel/src/arch/amd64/gdt.rs b/kernel/src/arch/amd64/gdt.rs index a11de454..f9792590 100644 --- a/kernel/src/arch/amd64/gdt.rs +++ b/kernel/src/arch/amd64/gdt.rs @@ -1,4 +1,5 @@ use super::tss::TSS; +use core::arch::asm; use core::marker::PhantomData; use core::mem; use core::pin::Pin; diff --git a/kernel/src/arch/amd64/idt.rs b/kernel/src/arch/amd64/idt.rs index 689cd5c0..95044fbe 100644 --- a/kernel/src/arch/amd64/idt.rs +++ b/kernel/src/arch/amd64/idt.rs @@ -1,3 +1,4 @@ +use core::arch::asm; use core::mem; #[macro_export] diff --git a/kernel/src/arch/amd64/mod.rs b/kernel/src/arch/amd64/mod.rs index e0aa5602..ff199ab9 100644 --- a/kernel/src/arch/amd64/mod.rs +++ b/kernel/src/arch/amd64/mod.rs @@ -9,11 +9,11 @@ mod tss; pub mod r#virtual; use crate::{driver::apic, power, scheduler, time::Monotonic}; +use core::arch::asm; +use core::mem::MaybeUninit; pub use idt::{Handler, IDTEntry}; pub use syscall::{current_process, current_thread, current_thread_weak, set_current_thread}; -use core::mem::MaybeUninit; - static mut TSS: tss::TSS = tss::TSS::new(); static mut TSS_STACK: [usize; 512] = [0; 512]; diff --git a/kernel/src/arch/amd64/msr.rs b/kernel/src/arch/amd64/msr.rs index 4422fbb7..4a2365b7 100644 --- a/kernel/src/arch/amd64/msr.rs +++ b/kernel/src/arch/amd64/msr.rs @@ -1,3 +1,5 @@ +use core::arch::asm; + pub const IA32_APIC_BASE_MSR: u32 = 0x1b; #[allow(dead_code)] pub const IA32_APIC_BASE_MSR_BSP: u64 = 0x100; diff --git a/kernel/src/arch/amd64/syscall.rs b/kernel/src/arch/amd64/syscall.rs index 63ad14a2..e0cb1f8e 100644 --- a/kernel/src/arch/amd64/syscall.rs +++ b/kernel/src/arch/amd64/syscall.rs @@ -6,6 +6,7 @@ use alloc::{ boxed::Box, sync::{Arc, Weak}, }; +use core::arch::asm; use core::ptr::{self, NonNull}; pub unsafe fn init() { diff --git a/kernel/src/arch/amd64/virtual/address_space.rs b/kernel/src/arch/amd64/virtual/address_space.rs index 684f251d..f1e3f4c9 100644 --- a/kernel/src/arch/amd64/virtual/address_space.rs +++ b/kernel/src/arch/amd64/virtual/address_space.rs @@ -2,6 +2,7 @@ use super::common; use crate::memory::frame; use crate::memory::r#virtual::{phys_to_virt, RWX}; use crate::memory::Page; +use core::arch::asm; use core::num::NonZeroUsize; use core::ptr::NonNull; diff --git a/kernel/src/arch/amd64/virtual/common.rs b/kernel/src/arch/amd64/virtual/common.rs index aafd0634..1ba2e454 100644 --- a/kernel/src/arch/amd64/virtual/common.rs +++ b/kernel/src/arch/amd64/virtual/common.rs @@ -1,5 +1,6 @@ use crate::memory::frame; use crate::memory::Page; +use core::arch::asm; use core::fmt; use core::ptr; diff --git a/kernel/src/driver/apic/mod.rs b/kernel/src/driver/apic/mod.rs index 2a4aa6e3..c0a23946 100644 --- a/kernel/src/driver/apic/mod.rs +++ b/kernel/src/driver/apic/mod.rs @@ -6,6 +6,7 @@ use crate::arch::amd64::msr; use crate::memory::Page; use crate::time::Monotonic; use acpi::{AcpiHandler, AcpiTables}; +use core::arch::asm; use core::time::Duration; use reg::*; diff --git a/kernel/src/driver/rtc/mod.rs b/kernel/src/driver/rtc/mod.rs index 7dba310f..717f8c46 100644 --- a/kernel/src/driver/rtc/mod.rs +++ b/kernel/src/driver/rtc/mod.rs @@ -1,4 +1,5 @@ //! # RTC driver +use core::arch::asm; use crate::time::Monotonic; use core::sync::atomic::AtomicU64; diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 09f3ba5b..ce50b557 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -1,7 +1,7 @@ #![no_std] #![no_main] #![feature(alloc_error_handler)] -#![feature(asm, asm_const, asm_sym)] +#![feature(asm_const, asm_sym)] #![feature(const_trait_impl)] #![feature(derive_default_enum)] #![feature(drain_filter)] diff --git a/kernel/src/scheduler/syscall.rs b/kernel/src/scheduler/syscall.rs index cfea8be5..659f9518 100644 --- a/kernel/src/scheduler/syscall.rs +++ b/kernel/src/scheduler/syscall.rs @@ -10,6 +10,7 @@ use alloc::{ sync::{Arc, Weak}, vec::Vec, }; +use core::arch::asm; use core::mem; use core::ptr::NonNull; use core::time::Duration; diff --git a/kernel/src/scheduler/thread.rs b/kernel/src/scheduler/thread.rs index c8e369f0..648df067 100644 --- a/kernel/src/scheduler/thread.rs +++ b/kernel/src/scheduler/thread.rs @@ -3,6 +3,7 @@ use crate::arch; use crate::memory::frame; use crate::time::Monotonic; use alloc::sync::{Arc, Weak}; +use core::arch::asm; use core::cell::Cell; use core::num::NonZeroUsize; use core::ptr::NonNull;