From c352b598572e1bee3bcb3c6eff93b79b2c368318 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 1 Dec 2020 15:21:38 +0000 Subject: [PATCH] hypervisor: emulator: drop InstructionMap It is not needed anymore. Signed-off-by: Wei Liu --- .../src/arch/x86/emulator/instructions/mod.rs | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/hypervisor/src/arch/x86/emulator/instructions/mod.rs b/hypervisor/src/arch/x86/emulator/instructions/mod.rs index ecdec16ea..9c99b26e2 100644 --- a/hypervisor/src/arch/x86/emulator/instructions/mod.rs +++ b/hypervisor/src/arch/x86/emulator/instructions/mod.rs @@ -10,7 +10,6 @@ use crate::arch::emulator::{EmulationError, PlatformEmulator, PlatformError}; use crate::arch::x86::emulator::CpuStateManager; use crate::arch::x86::Exception; use iced_x86::*; -use std::collections::HashMap; macro_rules! imm_op { (u8, $insn:ident) => { @@ -83,38 +82,6 @@ pub trait InstructionHandler { ) -> Result<(), EmulationError>; } -pub struct InstructionMap { - pub instructions: HashMap + Sync + Send>>, -} - -impl InstructionMap { - pub fn new() -> InstructionMap { - InstructionMap { - instructions: HashMap::new(), - } - } - - pub fn add_insn( - &mut self, - insn: Code, - insn_handler: Box + Sync + Send>, - ) { - self.instructions.insert(insn, insn_handler); - } -} - -impl Default for InstructionMap { - fn default() -> Self { - Self::new() - } -} - -macro_rules! insn_add { - ($insn_map:ident, $mnemonic:ident, $code:ident) => { - $insn_map.add_insn(Code::$code, Box::new($mnemonic::$code {})); - }; -} - macro_rules! insn_format { ($insn:ident) => {{ let mut output = String::new();