#![cfg(all(feature = "instructions", target_arch = "x86_64"))]
pub mod interrupts;
pub mod port;
pub mod random;
pub mod segmentation;
pub mod smap;
pub mod tables;
pub mod tlb;
use core::arch::asm;
#[inline]
pub fn hlt() {
unsafe {
asm!("hlt", options(nomem, nostack, preserves_flags));
}
}
#[inline]
pub fn nop() {
unsafe {
asm!("nop", options(nomem, nostack, preserves_flags));
}
}
#[inline]
pub fn bochs_breakpoint() {
unsafe {
asm!("xchg bx, bx", options(nomem, nostack, preserves_flags));
}
}
#[inline(always)]
pub fn read_rip() -> crate::VirtAddr {
let rip: u64;
unsafe {
asm!("lea {}, [rip]", out(reg) rip, options(nostack, nomem, preserves_flags));
}
crate::VirtAddr::new(rip)
}