diff options
author | iximeow <me@iximeow.net> | 2021-07-04 13:21:09 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2021-07-04 13:21:09 -0700 |
commit | e15ef43a243ae0e0db369cead1786f4f2c4e690e (patch) | |
tree | e6ee5bebf5c1681cc67712b01d3b89c04b824af9 /src/real_mode/display.rs | |
parent | 2c84821ee0d9807d20ea82b8550edde09426a867 (diff) |
support xacquire/xrelease prefixing
Diffstat (limited to 'src/real_mode/display.rs')
-rw-r--r-- | src/real_mode/display.rs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/real_mode/display.rs b/src/real_mode/display.rs index a6e0a32..29bfa3a 100644 --- a/src/real_mode/display.rs +++ b/src/real_mode/display.rs @@ -3324,8 +3324,14 @@ impl Instruction { } fn contextualize_intel<T: fmt::Write, Y: YaxColors>(instr: &Instruction, colors: &Y, _address: u32, _context: Option<&NoContext>, out: &mut T) -> fmt::Result { + if instr.xacquire() { + out.write_str("xacquire ")?; + } + if instr.xrelease() { + out.write_str("xrelease ")?; + } if instr.prefixes.lock() { - write!(out, "lock ")?; + out.write_str("lock ")?; } if instr.prefixes.rep_any() { @@ -3436,8 +3442,23 @@ fn contextualize_intel<T: fmt::Write, Y: YaxColors>(instr: &Instruction, colors: fn contextualize_c<T: fmt::Write, Y: YaxColors>(instr: &Instruction, _colors: &Y, _address: u32, _context: Option<&NoContext>, out: &mut T) -> fmt::Result { let mut brace_count = 0; + let mut prefixed = false; + + if instr.xacquire() { + out.write_str("xacquire ")?; + prefixed = true; + } + if instr.xrelease() { + out.write_str("xrelease ")?; + prefixed = true; + } if instr.prefixes.lock() { - out.write_str("lock { ")?; + out.write_str("lock ")?; + prefixed = true; + } + + if prefixed { + out.write_str("{ ")?; brace_count += 1; } |