aboutsummaryrefslogtreecommitdiff
path: root/src/shared/mod.rs
diff options
context:
space:
mode:
authorGravatar Gerd Zellweger <mail@gerdzellweger.com> 2016-08-29 15:16:31 +0200
committerGravatar Gerd Zellweger <mail@gerdzellweger.com> 2016-08-29 15:16:31 +0200
commite4682d427960560a55e148610ce60faf08a2a0cd (patch)
tree400078565995d4af2d36089d958b52fbf739984c /src/shared/mod.rs
parentb149e05c89d72f60efc2ba965289fd521453019e (diff)
downloadrust-x86-e4682d427960560a55e148610ce60faf08a2a0cd.tar.gz
rust-x86-e4682d427960560a55e148610ce60faf08a2a0cd.tar.zst
rust-x86-e4682d427960560a55e148610ce60faf08a2a0cd.zip
Move perfcnt and cpuid module in shared as they are architecture independent.
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
Diffstat (limited to 'src/shared/mod.rs')
-rw-r--r--src/shared/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/mod.rs b/src/shared/mod.rs
index 64a8548..8c81478 100644
--- a/src/shared/mod.rs
+++ b/src/shared/mod.rs
@@ -10,6 +10,10 @@ pub mod segmentation;
pub mod task;
pub mod tlb;
+pub mod cpuid {
+ pub use raw_cpuid::*;
+}
+
#[derive(Copy, Clone, PartialEq, Eq)]
#[repr(u8)]
pub enum PrivilegeLevel {
@@ -19,6 +23,9 @@ pub enum PrivilegeLevel {
Ring3 = 3,
}
+#[cfg(feature = "performance-counter")]
+pub mod perfcnt;
+
#[inline(always)]
pub unsafe fn halt() {
asm!("hlt" :::: "volatile");