diff options
author | 2016-06-29 15:49:33 -0700 | |
---|---|---|
committer | 2016-06-29 15:49:33 -0700 | |
commit | fffa3ae71951c3b8f4b2a441764a44ab8e55416e (patch) | |
tree | 9a9897b863c845d7679bebeb3c46a774ecb5e33c /src/bits64/mod.rs | |
parent | aaf26598addf1ef47fd8422d688965f89302d21b (diff) | |
download | rust-x86-fffa3ae71951c3b8f4b2a441764a44ab8e55416e.tar.gz rust-x86-fffa3ae71951c3b8f4b2a441764a44ab8e55416e.tar.zst rust-x86-fffa3ae71951c3b8f4b2a441764a44ab8e55416e.zip |
Crudely throw everything together
Diffstat (limited to 'src/bits64/mod.rs')
-rw-r--r-- | src/bits64/mod.rs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/bits64/mod.rs b/src/bits64/mod.rs new file mode 100644 index 0000000..315af02 --- /dev/null +++ b/src/bits64/mod.rs @@ -0,0 +1,52 @@ +//! Data structures and functions used by IA-32e but not Protected Mode. + +macro_rules! bit { + ( $x:expr ) => { + 1 << $x + }; +} + +macro_rules! check_flag { + ($doc:meta, $fun:ident, $flag:ident) => ( + #[$doc] + pub fn $fun(&self) -> bool { + self.contains($flag) + } + ) +} + +macro_rules! is_bit_set { + ($field:expr, $bit:expr) => ( + $field & (1 << $bit) > 0 + ) +} + +macro_rules! check_bit_fn { + ($doc:meta, $fun:ident, $field:ident, $bit:expr) => ( + #[$doc] + pub fn $fun(&self) -> bool { + is_bit_set!(self.$field, $bit) + } + ) +} + +pub mod io; +pub mod controlregs; +pub mod msr; +pub mod time; +pub mod irq; +pub mod rflags; +pub mod paging; +pub mod segmentation; +pub mod task; +pub mod dtables; +pub mod syscall; +pub mod sgx; +#[cfg(feature = "performance-counter")] +pub mod perfcnt; +pub mod cpuid { + pub use raw_cpuid::*; +} +pub mod tlb; + +pub mod tobba; |