diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bits64/paging.rs | 30 | ||||
-rw-r--r-- | src/irq.rs | 2 | ||||
-rw-r--r-- | src/perfcnt/intel/description.rs | 5 | ||||
-rw-r--r-- | src/perfcnt/intel/mod.rs | 2 |
4 files changed, 32 insertions, 7 deletions
diff --git a/src/bits64/paging.rs b/src/bits64/paging.rs index f08442a..0fbbf28 100644 --- a/src/bits64/paging.rs +++ b/src/bits64/paging.rs @@ -17,7 +17,7 @@ macro_rules! check_flag { /// A wrapper for a physical address. #[repr(transparent)] -#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] +#[derive(Copy, Clone, Eq, Ord, PartialEq, PartialOrd)] pub struct PAddr(pub u64); impl PAddr { @@ -185,6 +185,12 @@ impl fmt::Display for PAddr { } } +impl fmt::Debug for PAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + impl fmt::LowerHex for PAddr { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.0.fmt(f) @@ -203,9 +209,16 @@ impl fmt::UpperHex for PAddr { } } +impl fmt::Pointer for PAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use core::fmt::LowerHex; + self.0.fmt(f) + } +} + /// A wrapper for a virtual address. #[repr(transparent)] -#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] +#[derive(Copy, Clone, Eq, Ord, PartialEq, PartialOrd)] pub struct VAddr(pub u64); impl VAddr { @@ -404,6 +417,12 @@ impl fmt::Display for VAddr { } } +impl fmt::Debug for VAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + impl fmt::LowerHex for VAddr { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.0.fmt(f) @@ -422,6 +441,13 @@ impl fmt::UpperHex for VAddr { } } +impl fmt::Pointer for VAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use core::fmt::LowerHex; + self.0.fmt(f) + } +} + /// Log2 of base page size (12 bits). pub const BASE_PAGE_SHIFT: usize = 12; @@ -185,7 +185,7 @@ pub static EXCEPTIONS: [InterruptDescription; 21] = [ }, ]; -bitflags!{ +bitflags! { // Taken from Intel Manual Section 4.7 Page-Fault Exceptions. pub struct PageFaultError: u32 { /// 0: The fault was caused by a non-present page. diff --git a/src/perfcnt/intel/description.rs b/src/perfcnt/intel/description.rs index d47da75..4e5e8cc 100644 --- a/src/perfcnt/intel/description.rs +++ b/src/perfcnt/intel/description.rs @@ -234,11 +234,10 @@ pub struct EventDescription<'a> { /// Port Mask pub port_mask: u8, - /// This field maps to the Unit Mask filed in the IA32_PERFEVTSELx[15:8] MSRs. - /// It further qualifies the event logic unit selected in the event select + /// This field maps to the Unit Mask filed in the IA32_PERFEVTSELx[15:8] MSRs. + /// It further qualifies the event logic unit selected in the event select /// field to detect a specific micro-architectural condition. pub umask_ext: u8, - } impl<'a> EventDescription<'a> { diff --git a/src/perfcnt/intel/mod.rs b/src/perfcnt/intel/mod.rs index 0c072d4..51af1c8 100644 --- a/src/perfcnt/intel/mod.rs +++ b/src/perfcnt/intel/mod.rs @@ -5,9 +5,9 @@ pub mod events; mod description; pub use self::description::{Counter, EventDescription, MSRIndex, PebsType, Tuple}; +use crate::cpuid; use core::fmt::{Error, Result, Write}; use core::str; -use crate::cpuid; use phf; const MODEL_LEN: usize = 30; |