aboutsummaryrefslogtreecommitdiff
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
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>
-rw-r--r--Cargo.toml2
-rw-r--r--build.rs2
-rw-r--r--src/bits64/mod.rs5
-rw-r--r--src/shared/mod.rs7
-rw-r--r--src/shared/perfcnt/intel/counters.rs (renamed from src/bits64/perfcnt/intel/counters.rs)0
-rw-r--r--src/shared/perfcnt/intel/description.rs (renamed from src/bits64/perfcnt/intel/description.rs)0
-rw-r--r--src/shared/perfcnt/intel/mod.rs (renamed from src/bits64/perfcnt/intel/mod.rs)0
-rw-r--r--src/shared/perfcnt/mod.rs (renamed from src/bits64/perfcnt/mod.rs)0
8 files changed, 9 insertions, 7 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 6eb59d6..43f1809 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "x86"
-version = "0.8.0"
+version = "0.9.0"
authors = [
"Gerd Zellweger <mail@gerdzellweger.com>",
"Eric Kidd <git@randomhacks.net>",
diff --git a/build.rs b/build.rs
index 45724dd..0bbbd7d 100644
--- a/build.rs
+++ b/build.rs
@@ -23,7 +23,7 @@ mod performance_counter {
use self::serde_json::Value;
- include!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/bits64/perfcnt/intel/description.rs"));
+ include!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/shared/perfcnt/intel/description.rs"));
/// HACK: We need to convert parsed strings to static because we're reusing
/// the struct definition which declare strings as static in the generated code.
diff --git a/src/bits64/mod.rs b/src/bits64/mod.rs
index b73b530..801e80a 100644
--- a/src/bits64/mod.rs
+++ b/src/bits64/mod.rs
@@ -36,8 +36,3 @@ pub mod paging;
pub mod task;
pub mod syscall;
pub mod sgx;
-#[cfg(feature = "performance-counter")]
-pub mod perfcnt;
-pub mod cpuid {
- pub use raw_cpuid::*;
-}
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");
diff --git a/src/bits64/perfcnt/intel/counters.rs b/src/shared/perfcnt/intel/counters.rs
index e2987cc..e2987cc 100644
--- a/src/bits64/perfcnt/intel/counters.rs
+++ b/src/shared/perfcnt/intel/counters.rs
diff --git a/src/bits64/perfcnt/intel/description.rs b/src/shared/perfcnt/intel/description.rs
index f64426d..f64426d 100644
--- a/src/bits64/perfcnt/intel/description.rs
+++ b/src/shared/perfcnt/intel/description.rs
diff --git a/src/bits64/perfcnt/intel/mod.rs b/src/shared/perfcnt/intel/mod.rs
index 960e0c6..960e0c6 100644
--- a/src/bits64/perfcnt/intel/mod.rs
+++ b/src/shared/perfcnt/intel/mod.rs
diff --git a/src/bits64/perfcnt/mod.rs b/src/shared/perfcnt/mod.rs
index 74b80a2..74b80a2 100644
--- a/src/bits64/perfcnt/mod.rs
+++ b/src/shared/perfcnt/mod.rs