IEMInternal.h revision ebcd1425af96dcfb6168526dd1a457f44b137bdc
1124N/A * IEM - Internal header file. 1124N/A * Copyright (C) 2011-2012 Oracle Corporation 1124N/A * This file is part of VirtualBox Open Source Edition (OSE), as 1124N/A * you can redistribute it and/or modify it under the terms of the GNU 1124N/A * General Public License (GPL) as published by the Free Software 1124N/A * Foundation, in version 2 as it comes in the "COPYING" file of the 1124N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 1124N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 1124N/A/** @defgroup grp_iem_int Internals * Operand or addressing mode. * Extended operand mode that includes a representation of 8-bit. * This is used for packing down modes when invoking some C instruction /** The output status. */ /** Pointer to a FPU result. */ /** Pointer to a const FPU result. */ * Verification event type. /** Checks if the event type is a RAM read or write. */ * Verification event record. /** Pointer to the next record in the list. */ /** IEMVERIFYEVENT_IOPORT_READ */ /** IEMVERIFYEVENT_IOPORT_WRITE */ /** IEMVERIFYEVENT_RAM_READ */ /** IEMVERIFYEVENT_RAM_WRITE */ /** Pointer to an IEM event verification records. */ #
endif /* IEM_VERIFICATION_MODE */ /** Pointer to the CPU context - ring-3 contex. */ /** Pointer to the CPU context - ring-0 contex. */ /** Pointer to the CPU context - raw-mode contex. */ /** Offset of the VMCPU structure relative to this structure (negative). */ /** Offset of the VM structure relative to this structure (negative). */ /** Whether to bypass access handlers or not. */ /** Explicit alignment padding. */ /** The flags of the current exception / interrupt. */ /** The current exception / interrupt. */ /** Exception / interrupt recursion depth. */ /** Explicit alignment padding. */ /** The current CPU execution mode (CS). */ /** The number of instructions we've executed. */ /** The number of potential exits. */ /** The Number of I/O port reads that has been performed. */ /** The Number of I/O port writes that has been performed. */ /** Set if no comparison to REM is currently performed. * This is used to skip past really slow bits. */ /** Indicates that RAX and RDX differences should be ignored since RDTSC * and RDTSCP are timing sensitive. */ /** Mask of undefined eflags. * The verifier will any difference in these flags. */ /** The physical address corresponding to abOpcodes[0]. */ /** The default addressing mode . */ /** The effective addressing mode . */ /** The default operand mode . */ /** The effective operand mode . */ /** The prefix mask (IEM_OP_PRF_XXX). */ /** The extra REX ModR/M register field bit (REX.R << 3). */ /** The extra REX ModR/M r/m field, SIB base and opcode reg bit /** The extra REX SIB index field bit (REX.X << 3). */ /** The effective segment register (X86_SREG_XXX). */ /** The current offset into abOpcodes. */ /** The size of what has currently been fetched into abOpcodes. */ /** Offset into abOpcodes where the FPU instruction starts. * Only set by the FPU escape opcodes (0xd8-0xdf) and used later on when the * instruction result is committed. */ /** Alignment padding for aMemMappings. */ /** The number of active guest memory mappings. */ /** The next unused mapping index. */ /** Records for tracking guest memory mappings. */ /** The address of the mapped bytes. */ /** The access flags (IEM_ACCESS_XXX). * IEM_ACCESS_INVALID if the entry is unused. */ * This runs in parallel to aMemMappings. */ /** The physical address of the first byte. */ /** The physical address of the second page. */ /** The number of bytes in the first page. */ /** The number of bytes in the second page. */ /** Whether it's unassigned memory. */ /** Explicit alignment padding. */ /** Bounce buffer storage. * This runs in parallel to aMemMappings and aMemBbMappings. */ /** The event verification records for what IEM did (LIFO). */ /** Insertion point for pIemEvtRecHead. */ /** The event verification records for what the other party did (FIFO). */ /** Insertion point for pOtherEvtRecHead. */ /** List of free event records. */ /** Pointer to the per-CPU IEM state. */ /** Converts a IEMCPU pointer to a VMCPU pointer. * @returns VMCPU pointer. * @param a_pIemCpu The IEM per CPU instance data. /** Converts a IEMCPU pointer to a VM pointer. * @param a_pIemCpu The IEM per CPU instance data. /** @name IEM_ACCESS_XXX - Access details. /** The writes are partial, so if initialize the bounce buffer with the * orignal RAM content. */ /** Used in aMemMappings to indicate that the entry is bounce buffered. */ /** Read+write data alias. */ /** Instruction fetch alias. */ /** Stack write alias. */ /** Stack read+write alias. */ /** Read system table alias. */ /** Read+write system table alias. */ /** @name Prefix constants (IEMCPU::fPrefixes) * Tests if verification mode is enabled. * This expands to @c false when IEM_VERIFICATION_MODE is not defined and * should therefore cause the compiler to eliminate the verification branch * Indicates to the verifier that the given flag set is undefined. * Can be invoked again to add more flags. * This is a NOOP if the verifier isn't compiled in. /** @def IEM_DECL_IMPL_TYPE * For typedef'ing an instruction implementation function. * @param a_RetType The return type. * @param a_Name The name of the type. * @param a_ArgList The argument list enclosed in parentheses. /** @def IEM_DECL_IMPL_DEF * For defining an instruction implementation function. * @param a_RetType The return type. * @param a_Name The name of the type. * @param a_ArgList The argument list enclosed in parentheses. /** @name Arithmetic assignment operations on bytes (binary). /** @name Arithmetic assignment operations on words (binary). /** @name Arithmetic assignment operations on double words (binary). /** @name Arithmetic assignment operations on quad words (binary). /** @name Compare operations (thrown in with the binary ops). /** @name Test operations (thrown in with the binary ops). /** @name Bit operations operations (thrown in with the binary ops). /** @name Exchange memory with register operations. /** @name Exchange and add operations. /** @name Double precision shifts /** @name Bit search operations (thrown in with the binary ops). /** @name Signed multiplication operations (thrown in with the binary ops). /** @name Arithmetic assignment operations on bytes (unary). /** @name Arithmetic assignment operations on words (unary). /** @name Arithmetic assignment operations on double words (unary). /** @name Arithmetic assignment operations on quad words (unary). /** @name Shift operations on bytes (Group 2). /** @name Shift operations on words (Group 2). /** @name Shift operations on double words (Group 2). /** @name Shift operations on words (Group 2). /** @name Multiplication and division operations. /** @name FPU operations taking a 32-bit float argument /** @name FPU operations taking a 64-bit float argument /** @name FPU operations taking a 80-bit float argument /** @name FPU operations taking a 32-bit signed integer argument /** @name Function tables. * Function table for a binary operator providing implementation based on /** Pointer to a binary operator function table. */ * Function table for a unary operator providing implementation based on /** Pointer to a unary operator function table. */ * Function table for a shift operator providing implementation based on /** Pointer to a shift operator function table. */ * Function table for a multiplication or division operation. /** Pointer to a multiplication or division operation function table. */ * Function table for a double precision shift operator providing implementation /** Pointer to a double precision shift function table. */ /** @name C instruction implementations for anything slightly complicated. * For typedef'ing or declaring a C instruction implementation function taking * @param a_Name The name of the type. * For defining a C instruction implementation function taking no extra * @param a_Name The name of the function * For calling a C instruction implementation function taking no extra * This special call macro adds default arguments to the call and allow us to * @param a_fn The name of the function. * For typedef'ing or declaring a C instruction implementation function taking * @param a_Name The name of the type. * @param a_Type0 The argument type. * @param a_Arg0 The argument name. * For defining a C instruction implementation function taking one extra * @param a_Name The name of the function * @param a_Type0 The argument type. * @param a_Arg0 The argument name. * For calling a C instruction implementation function taking one extra * This special call macro adds default arguments to the call and allow us to * @param a_fn The name of the function. * @param a0 The name of the 1st argument. * For typedef'ing or declaring a C instruction implementation function taking * @param a_Name The name of the type. * @param a_Type0 The type of the 1st argument * @param a_Arg0 The name of the 1st argument. * @param a_Type1 The type of the 2nd argument. * @param a_Arg1 The name of the 2nd argument. * For defining a C instruction implementation function taking two extra * @param a_Name The name of the function. * @param a_Type0 The type of the 1st argument * @param a_Arg0 The name of the 1st argument. * @param a_Type1 The type of the 2nd argument. * @param a_Arg1 The name of the 2nd argument. * For calling a C instruction implementation function taking two extra * This special call macro adds default arguments to the call and allow us to * @param a_fn The name of the function. * @param a0 The name of the 1st argument. * @param a1 The name of the 2nd argument. * For typedef'ing or declaring a C instruction implementation function taking * @param a_Name The name of the type. * @param a_Type0 The type of the 1st argument * @param a_Arg0 The name of the 1st argument. * @param a_Type1 The type of the 2nd argument. * @param a_Arg1 The name of the 2nd argument. * @param a_Type2 The type of the 3rd argument. * @param a_Arg2 The name of the 3rd argument. * For defining a C instruction implementation function taking three extra * @param a_Name The name of the function. * @param a_Type0 The type of the 1st argument * @param a_Arg0 The name of the 1st argument. * @param a_Type1 The type of the 2nd argument. * @param a_Arg1 The name of the 2nd argument. * @param a_Type2 The type of the 3rd argument. * @param a_Arg2 The name of the 3rd argument. * For calling a C instruction implementation function taking three extra * This special call macro adds default arguments to the call and allow us to * @param a_fn The name of the function. * @param a0 The name of the 1st argument. * @param a1 The name of the 2nd argument. * @param a2 The name of the 3rd argument. * For typedef'ing or declaring a C instruction implementation function taking * @param a_Name The name of the type. * @param a_Type0 The type of the 1st argument * @param a_Arg0 The name of the 1st argument. * @param a_Type1 The type of the 2nd argument. * @param a_Arg1 The name of the 2nd argument. * @param a_Type2 The type of the 3rd argument. * @param a_Arg2 The name of the 3rd argument. * @param a_Type3 The type of the 4th argument. * @param a_Arg3 The name of the 4th argument. * For defining a C instruction implementation function taking four extra * @param a_Name The name of the function. * @param a_Type0 The type of the 1st argument * @param a_Arg0 The name of the 1st argument. * @param a_Type1 The type of the 2nd argument. * @param a_Arg1 The name of the 2nd argument. * @param a_Type2 The type of the 3rd argument. * @param a_Arg2 The name of the 3rd argument. * @param a_Type3 The type of the 4th argument. * @param a_Arg3 The name of the 4th argument. * For calling a C instruction implementation function taking four extra * This special call macro adds default arguments to the call and allow us to * @param a_fn The name of the function. * @param a0 The name of the 1st argument. * @param a1 The name of the 2nd argument. * @param a2 The name of the 3rd argument. * @param a3 The name of the 4th argument. * For typedef'ing or declaring a C instruction implementation function taking * @param a_Name The name of the type. * @param a_Type0 The type of the 1st argument * @param a_Arg0 The name of the 1st argument. * @param a_Type1 The type of the 2nd argument. * @param a_Arg1 The name of the 2nd argument. * @param a_Type2 The type of the 3rd argument. * @param a_Arg2 The name of the 3rd argument. * @param a_Type3 The type of the 4th argument. * @param a_Arg3 The name of the 4th argument. * @param a_Type4 The type of the 5th argument. * @param a_Arg4 The name of the 5th argument. #
define IEM_CIMPL_DECL_TYPE_5(
a_Name,
a_Type0,
a_Arg0,
a_Type1,
a_Arg1,
a_Type2,
a_Arg2,
a_Type3,
a_Arg3,
a_Type4,
a_Arg4) \
* For defining a C instruction implementation function taking five extra * @param a_Name The name of the function. * @param a_Type0 The type of the 1st argument * @param a_Arg0 The name of the 1st argument. * @param a_Type1 The type of the 2nd argument. * @param a_Arg1 The name of the 2nd argument. * @param a_Type2 The type of the 3rd argument. * @param a_Arg2 The name of the 3rd argument. * @param a_Type3 The type of the 4th argument. * @param a_Arg3 The name of the 4th argument. * @param a_Type4 The type of the 5th argument. * @param a_Arg4 The name of the 5th argument. #
define IEM_CIMPL_DEF_5(
a_Name,
a_Type0,
a_Arg0,
a_Type1,
a_Arg1,
a_Type2,
a_Arg2,
a_Type3,
a_Arg3,
a_Type4,
a_Arg4) \
* For calling a C instruction implementation function taking five extra * This special call macro adds default arguments to the call and allow us to * @param a_fn The name of the function. * @param a0 The name of the 1st argument. * @param a1 The name of the 2nd argument. * @param a2 The name of the 3rd argument. * @param a3 The name of the 4th argument. * @param a4 The name of the 5th argument. #
define IEM_CIMPL_CALL_5(
a_fn,
a0,
a1,
a2,
a3,
a4)
a_fn(
pIemCpu,
cbInstr, (
a0), (
a1), (
a2), (
a3), (
a4))