diff options
Diffstat (limited to 'src/bits64')
-rw-r--r-- | src/bits64/mod.rs | 3 | ||||
-rw-r--r-- | src/bits64/rflags.rs | 56 | ||||
-rw-r--r-- | src/bits64/tobba.rs | 17 |
3 files changed, 0 insertions, 76 deletions
diff --git a/src/bits64/mod.rs b/src/bits64/mod.rs index 413d3cf..63ebac2 100644 --- a/src/bits64/mod.rs +++ b/src/bits64/mod.rs @@ -33,7 +33,6 @@ macro_rules! check_bit_fn { pub mod msr; pub mod time; pub mod irq; -pub mod rflags; pub mod paging; pub mod task; pub mod syscall; @@ -44,5 +43,3 @@ pub mod cpuid { pub use raw_cpuid::*; } pub mod tlb; - -pub mod tobba; diff --git a/src/bits64/rflags.rs b/src/bits64/rflags.rs deleted file mode 100644 index 7cf4bbd..0000000 --- a/src/bits64/rflags.rs +++ /dev/null @@ -1,56 +0,0 @@ -//! Description of RFlag values that store the results of operations and the state of the processor. - -/// RFLAGS description. -bitflags! { - pub flags RFlags: u64 { - /// ID Flag (ID) - const RFLAGS_ID = 1 << 21, - /// Virtual Interrupt Pending (VIP) - const RFLAGS_VIP = 1 << 20, - /// Virtual Interrupt Flag (VIF) - const RFLAGS_VIF = 1 << 19, - /// Alignment Check (AC) - const RFLAGS_AC = 1 << 18, - /// Virtual-8086 Mode (VM) - const RFLAGS_VM = 1 << 17, - /// Resume Flag (RF) - const RFLAGS_RF = 1 << 16, - /// Nested Task (NT) - const RFLAGS_NT = 1 << 14, - /// I/O Privilege Level (IOPL) 0 - const RFLAGS_IOPL0 = 0 << 12, - /// I/O Privilege Level (IOPL) 1 - const RFLAGS_IOPL1 = 1 << 12, - /// I/O Privilege Level (IOPL) 2 - const RFLAGS_IOPL2 = 2 << 12, - /// I/O Privilege Level (IOPL) 3 - const RFLAGS_IOPL3 = 3 << 12, - /// Overflow Flag (OF) - const RFLAGS_OF = 1 << 11, - /// Direction Flag (DF) - const RFLAGS_DF = 1 << 10, - /// Interrupt Enable Flag (IF) - const RFLAGS_IF = 1 << 9, - /// Trap Flag (TF) - const RFLAGS_TF = 1 << 8, - /// Sign Flag (SF) - const RFLAGS_SF = 1 << 7, - /// Zero Flag (ZF) - const RFLAGS_ZF = 1 << 6, - /// Auxiliary Carry Flag (AF) - const RFLAGS_AF = 1 << 4, - /// Parity Flag (PF) - const RFLAGS_PF = 1 << 2, - /// Bit 1 is always 1. - const RFLAGS_A1 = 1 << 1, - /// Carry Flag (CF) - const RFLAGS_CF = 1 << 0, - } -} - -impl RFlags { - /// Creates a new RFlags entry. Ensures bit 1 is set. - pub fn new() -> RFlags { - RFLAGS_A1 - } -} diff --git a/src/bits64/tobba.rs b/src/bits64/tobba.rs deleted file mode 100644 index 3e3231e..0000000 --- a/src/bits64/tobba.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![allow(non_upper_case_globals)] - -pub use shared::*; - -#[inline(always)] -pub fn get_flags() -> Flags { - unsafe { - let r: usize; - asm!("pushfq; pop $0" : "=r"(r) ::: "intel"); - Flags::from_bits_truncate(r) - } -} - -#[inline(always)] -pub unsafe fn set_flags(val: Flags) { - asm!("push $0; popfq" :: "r"(val.bits()) : "flags" : "volatile", "intel"); -} |