rustubs/arch/
x86_64.rs

1pub mod arch_regs;
2pub mod gdt;
3pub mod interrupt;
4pub mod io_port;
5pub mod misc;
6pub mod paging;
7use core::arch::asm;
8
9pub const RFLAGS_IF_MASK: u64 = 1 << 9;
10
11#[inline]
12pub fn read_rflags() -> u64 {
13	let rflags;
14	unsafe { asm!("pushfq; pop {}", out(reg) rflags) };
15	rflags
16}
17
18pub fn is_int_enabled() -> bool {
19	let rf = read_rflags();
20	(rf & RFLAGS_IF_MASK) != 0
21}