aboutsummaryrefslogtreecommitdiff
path: root/src/real_mode/mod.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2025-06-01 09:11:30 +0000
committeriximeow <me@iximeow.net>2025-06-01 09:21:57 +0000
commit54538a07bf4e0b8b2335e146198cda02a49589c8 (patch)
tree6033f4b63cb1426fcce9d1240e7f8deb10461d7b /src/real_mode/mod.rs
parent72968a35438e5284a0ba63c947e70f8880b3abb5 (diff)
revise_instruction is the same on all bitnesses, so macro it too
Diffstat (limited to 'src/real_mode/mod.rs')
-rw-r--r--src/real_mode/mod.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/real_mode/mod.rs b/src/real_mode/mod.rs
index c07d783..8037d93 100644
--- a/src/real_mode/mod.rs
+++ b/src/real_mode/mod.rs
@@ -3,7 +3,6 @@ mod evex;
#[cfg(feature = "fmt")]
mod display;
pub mod uarch;
-mod isa_settings;
pub use crate::MemoryAccessSize;
@@ -19,6 +18,10 @@ use yaxpeax_arch::annotation::{AnnotatingDecoder, DescriptionSink, NullSink};
use yaxpeax_arch::{DecodeError as ArchDecodeError};
use yaxpeax_arch::safer_unchecked::unreachable_kinda_unchecked as unreachable_unchecked;
+// generate InstDecoder settings and `revise_instruction` here. a bit early, but
+// gets it out of the way..
+crate::isa_settings::gen_arch_isa_settings!(Instruction, Opcode, DecodeError, InstDecoder);
+
use core::fmt;
impl fmt::Display for DecodeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -2779,7 +2782,7 @@ fn decode_with_annotation<
return Err(DecodeError::TooLong);
}
- isa_settings::revise_instruction(decoder, instr)?;
+ revise_instruction(decoder, instr)?;
Ok(())
}
@@ -6554,7 +6557,7 @@ fn read_operands<
);
vex::three_byte_vex(words, modrm, instruction, sink)?;
- isa_settings::revise_instruction(decoder, instruction)?;
+ revise_instruction(decoder, instruction)?;
return Ok(());
}
@@ -6586,7 +6589,7 @@ fn read_operands<
);
vex::two_byte_vex(words, modrm, instruction, sink)?;
- isa_settings::revise_instruction(decoder, instruction)?;
+ revise_instruction(decoder, instruction)?;
return Ok(());
}