Skip to content

fix: build error on the latest nightly (asm! import) #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/instructions/interrupts.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Enabling and disabling interrupts

#[cfg(feature = "inline_asm")]
use core::arch::asm;

/// Returns whether interrupts are enabled.
#[inline]
pub fn are_enabled() -> bool {
Expand Down
3 changes: 3 additions & 0 deletions src/instructions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ pub mod segmentation;
pub mod tables;
pub mod tlb;

#[cfg(feature = "inline_asm")]
use core::arch::asm;

/// Halts the CPU until the next interrupt arrives.
#[inline]
pub fn hlt() {
Expand Down
2 changes: 2 additions & 0 deletions src/instructions/port.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Access to I/O ports

#[cfg(feature = "inline_asm")]
use core::arch::asm;
use core::fmt;
use core::marker::PhantomData;

Expand Down
2 changes: 2 additions & 0 deletions src/instructions/segmentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use crate::{
structures::gdt::SegmentSelector,
VirtAddr,
};
#[cfg(feature = "inline_asm")]
use core::arch::asm;

macro_rules! get_reg_impl {
($name:literal, $asm_get:ident) => {
Expand Down
2 changes: 2 additions & 0 deletions src/instructions/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

use crate::structures::gdt::SegmentSelector;
use crate::VirtAddr;
#[cfg(feature = "inline_asm")]
use core::arch::asm;

pub use crate::structures::DescriptorTablePointer;

Expand Down
2 changes: 2 additions & 0 deletions src/instructions/tlb.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Functions to flush the translation lookaside buffer (TLB).

use crate::VirtAddr;
#[cfg(feature = "inline_asm")]
use core::arch::asm;

/// Invalidate the given address in the TLB using the `invlpg` instruction.
#[inline]
Expand Down
2 changes: 2 additions & 0 deletions src/registers/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

pub use super::model_specific::{Efer, EferFlags};
use bitflags::bitflags;
#[cfg(feature = "inline_asm")]
use core::arch::asm;

/// Various control flags modifying the basic operation of the CPU.
#[derive(Debug)]
Expand Down
2 changes: 2 additions & 0 deletions src/registers/model_specific.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use bitflags::bitflags;
// imports for intra doc links
#[cfg(doc)]
use crate::registers::segmentation::{FS, GS};
#[cfg(feature = "inline_asm")]
use core::arch::asm;

/// A model specific register.
#[derive(Debug)]
Expand Down
3 changes: 3 additions & 0 deletions src/registers/rflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#[cfg(feature = "instructions")]
pub use self::x86_64::*;

#[cfg(feature = "inline_asm")]
use core::arch::asm;

use bitflags::bitflags;

bitflags! {
Expand Down
3 changes: 3 additions & 0 deletions src/registers/xcontrol.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! Access to various extended system registers
use bitflags::bitflags;

#[cfg(feature = "inline_asm")]
use core::arch::asm;

/// Extended feature enable mask register
#[derive(Debug)]
pub struct XCr0;
Expand Down