diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kvm_sys.rs | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/kvm_sys.rs b/src/kvm_sys.rs index 8d5c85b..8179a8f 100644 --- a/src/kvm_sys.rs +++ b/src/kvm_sys.rs @@ -5,8 +5,6 @@ // Generated by `build.rs`. include!(concat!(env!("OUT_DIR"), "/kvm_constants.rs")); -use std::fmt; - #[repr(C)] #[derive(Default, Debug)] pub struct Rflags(pub u64); @@ -143,55 +141,6 @@ union kvm_run_union_s { padding: [u8; 2048], } -// {{{ Display : Rflags - -impl fmt::Display for Rflags { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let IF = || (self.0 >> 9) & 0b1; - let IOPL = || (self.0 >> 12) & 0b11; - let AC = || (self.0 >> 19) & 0b1; - write!(f, "AC({}) IOPL({}) IF({})", AC(), IOPL(), IF()) - } -} - -// }}} -// {{{ Display : kvm_regs - -impl fmt::Display for kvm_regs { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!( - f, - "rax: {:#018x} rbx: {:#018x} rcx: {:#018x} rdx: {:#018x}\n\ - rsi: {:#018x} rdi: {:#018x}\n\ - r8 : {:#018x} r9 : {:#018x} r10: {:#018x} r11: {:#018x}\n\ - r12: {:#018x} r13: {:#018x} r14: {:#018x} r15: {:#018x}\n\ - rsp: {:#018x} rbp: {:#018x}\n\ - rip: {:#018x} rflags: {:#018x} [{}]", - self.rax, - self.rbx, - self.rcx, - self.rdx, - self.rsi, - self.rdi, - self.r8, - self.r9, - self.r10, - self.r11, - self.r12, - self.r13, - self.r14, - self.r15, - self.rsp, - self.rbp, - self.rip, - self.rflags.0, - self.rflags - ) - } -} - -// }}} - #[cfg(test)] mod tests { use super::*; |