aboutsummaryrefslogtreecommitdiff
path: root/src/bits64/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bits64/mod.rs')
-rw-r--r--src/bits64/mod.rs52
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;