mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-21 19:02:30 +00:00
hypervisor: x86: Make imm_op available to all emulated instructions
By moving it to the instructions root module. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
e2c81f9ed8
commit
3fa6e17cc4
@ -12,6 +12,40 @@ use crate::arch::x86::Exception;
|
||||
use iced_x86::*;
|
||||
use std::collections::HashMap;
|
||||
|
||||
macro_rules! imm_op {
|
||||
(u8, $insn:ident) => {
|
||||
$insn.immediate8()
|
||||
};
|
||||
|
||||
(u16, $insn:ident) => {
|
||||
$insn.immediate16()
|
||||
};
|
||||
|
||||
(u32, $insn:ident) => {
|
||||
$insn.immediate32()
|
||||
};
|
||||
|
||||
(u64, $insn:ident) => {
|
||||
$insn.immediate64()
|
||||
};
|
||||
|
||||
(u32tou64, $insn:ident) => {
|
||||
$insn.immediate32to64()
|
||||
};
|
||||
|
||||
(u8tou16, $insn:ident) => {
|
||||
$insn.immediate8to16()
|
||||
};
|
||||
|
||||
(u8tou32, $insn:ident) => {
|
||||
$insn.immediate8to32()
|
||||
};
|
||||
|
||||
(u8tou64, $insn:ident) => {
|
||||
$insn.immediate8to64()
|
||||
};
|
||||
}
|
||||
|
||||
pub mod mov;
|
||||
|
||||
// Returns the linear a.k.a. virtual address for a memory operand.
|
||||
|
@ -144,40 +144,6 @@ macro_rules! mov_r_imm {
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! imm_op {
|
||||
(u8, $insn:ident) => {
|
||||
$insn.immediate8()
|
||||
};
|
||||
|
||||
(u16, $insn:ident) => {
|
||||
$insn.immediate16()
|
||||
};
|
||||
|
||||
(u32, $insn:ident) => {
|
||||
$insn.immediate32()
|
||||
};
|
||||
|
||||
(u64, $insn:ident) => {
|
||||
$insn.immediate64()
|
||||
};
|
||||
|
||||
(u32tou64, $insn:ident) => {
|
||||
$insn.immediate32to64()
|
||||
};
|
||||
|
||||
(u8tou16, $insn:ident) => {
|
||||
$insn.immediate8to16()
|
||||
};
|
||||
|
||||
(u8tou32, $insn:ident) => {
|
||||
$insn.immediate8to32()
|
||||
};
|
||||
|
||||
(u8tou64, $insn:ident) => {
|
||||
$insn.immediate8to64()
|
||||
};
|
||||
}
|
||||
|
||||
pub struct Mov_r8_rm8 {}
|
||||
impl<T: CpuStateManager> InstructionHandler<T> for Mov_r8_rm8 {
|
||||
mov_r_rm!(u8);
|
||||
|
Loading…
x
Reference in New Issue
Block a user