From 7e19b13aa9e92e411491c2a745a693dcda500926 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Sat, 11 Dec 2021 20:59:21 +0100 Subject: fmt: add TF flag --- src/fmt.rs | 3 ++- src/x86_64.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt.rs b/src/fmt.rs index 9ae8689..24971bf 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -12,7 +12,7 @@ impl fmt::Display for kvm_regs { 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} rfl: {:#018x} O({}) D({}) I({}) S({}) Z({}) P({}) C({})", + rip: {:#018x} rfl: {:#018x} O({}) D({}) I({}) T({}) S({}) Z({}) P({}) C({})", self.rax, self.rbx, self.rcx, @@ -34,6 +34,7 @@ impl fmt::Display for kvm_regs { rflags_of(self.rflags), rflags_df(self.rflags), rflags_if(self.rflags), + rflags_tf(self.rflags), rflags_sf(self.rflags), rflags_zf(self.rflags), rflags_pf(self.rflags), diff --git a/src/x86_64.rs b/src/x86_64.rs index db1e922..d87319c 100644 --- a/src/x86_64.rs +++ b/src/x86_64.rs @@ -16,6 +16,8 @@ mod x86_64 { pub const RFLAGS_ZF: u64 = 1 << 6; /// Sign flag. pub const RFLAGS_SF: u64 = 1 << 7; + /// Trap flag. + pub const RFLAGS_TF: u64 = 1 << 8; /// Sign flag. pub const RFLAGS_IF: u64 = 1 << 9; /// Direction flag. @@ -32,6 +34,7 @@ mod x86_64 { pub const fn rflags_af(r: u64) -> u64 { (r & RFLAGS_AF) >> 4 } pub const fn rflags_zf(r: u64) -> u64 { (r & RFLAGS_ZF) >> 6 } pub const fn rflags_sf(r: u64) -> u64 { (r & RFLAGS_SF) >> 7 } + pub const fn rflags_tf(r: u64) -> u64 { (r & RFLAGS_TF) >> 8 } pub const fn rflags_if(r: u64) -> u64 { (r & RFLAGS_IF) >> 9 } pub const fn rflags_df(r: u64) -> u64 { (r & RFLAGS_DF) >> 10 } pub const fn rflags_of(r: u64) -> u64 { (r & RFLAGS_OF) >> 11 } -- cgit v1.2.3