Skip to content

Commit af206af

Browse files
committed
fix: build error on the latest nightly
`asm!` is excluded from Prelude.
1 parent 55d5fad commit af206af

File tree

10 files changed

+24
-0
lines changed

10 files changed

+24
-0
lines changed

src/instructions/interrupts.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! Enabling and disabling interrupts
22
3+
#[cfg(feature = "inline_asm")]
4+
use core::arch::asm;
5+
36
/// Returns whether interrupts are enabled.
47
#[inline]
58
pub fn are_enabled() -> bool {

src/instructions/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ pub mod segmentation;
99
pub mod tables;
1010
pub mod tlb;
1111

12+
#[cfg(feature = "inline_asm")]
13+
use core::arch::asm;
14+
1215
/// Halts the CPU until the next interrupt arrives.
1316
#[inline]
1417
pub fn hlt() {

src/instructions/port.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Access to I/O ports
22
3+
#[cfg(feature = "inline_asm")]
4+
use core::arch::asm;
35
use core::fmt;
46
use core::marker::PhantomData;
57

src/instructions/segmentation.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use crate::{
66
structures::gdt::SegmentSelector,
77
VirtAddr,
88
};
9+
#[cfg(feature = "inline_asm")]
10+
use core::arch::asm;
911

1012
macro_rules! get_reg_impl {
1113
($name:literal, $asm_get:ident) => {

src/instructions/tables.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
33
use crate::structures::gdt::SegmentSelector;
44
use crate::VirtAddr;
5+
#[cfg(feature = "inline_asm")]
6+
use core::arch::asm;
57

68
pub use crate::structures::DescriptorTablePointer;
79

src/instructions/tlb.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! Functions to flush the translation lookaside buffer (TLB).
22
33
use crate::VirtAddr;
4+
#[cfg(feature = "inline_asm")]
5+
use core::arch::asm;
46

57
/// Invalidate the given address in the TLB using the `invlpg` instruction.
68
#[inline]

src/registers/control.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
33
pub use super::model_specific::{Efer, EferFlags};
44
use bitflags::bitflags;
5+
#[cfg(feature = "inline_asm")]
6+
use core::arch::asm;
57

68
/// Various control flags modifying the basic operation of the CPU.
79
#[derive(Debug)]

src/registers/model_specific.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use bitflags::bitflags;
44
// imports for intra doc links
55
#[cfg(doc)]
66
use crate::registers::segmentation::{FS, GS};
7+
#[cfg(feature = "inline_asm")]
8+
use core::arch::asm;
79

810
/// A model specific register.
911
#[derive(Debug)]

src/registers/rflags.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#[cfg(feature = "instructions")]
44
pub use self::x86_64::*;
55

6+
#[cfg(feature = "inline_asm")]
7+
use core::arch::asm;
8+
69
use bitflags::bitflags;
710

811
bitflags! {

src/registers/xcontrol.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//! Access to various extended system registers
22
use bitflags::bitflags;
33

4+
#[cfg(feature = "inline_asm")]
5+
use core::arch::asm;
6+
47
/// Extended feature enable mask register
58
#[derive(Debug)]
69
pub struct XCr0;

0 commit comments

Comments
 (0)