Changeset 99832 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- May 18, 2023 1:18:57 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsThreadedRecompiler.cpp
r99819 r99832 78 78 79 79 /********************************************************************************************************************************* 80 * Structures and Typedefs * 81 *********************************************************************************************************************************/ 82 /** 83 * A call for the threaded call table. 84 */ 85 typedef struct IEMTHRDEDCALLENTRY 86 { 87 /** The function to call (IEMTHREADEDFUNCS). */ 88 uint16_t enmFunction; 89 uint16_t uUnused0; 90 91 /** The opcode length. */ 92 uint8_t cbOpcode; 93 /** The opcode chunk number. 94 * @note sketches for discontiguous opcode support */ 95 uint8_t idxOpcodeChunk; 96 /** The offset into the opcode chunk of this function. 97 * @note sketches for discontiguous opcode support */ 98 uint16_t offOpcodeChunk; 99 100 /** Generic parameters. */ 101 uint64_t auParams[3]; 102 } IEMTHRDEDCALLENTRY; 103 AssertCompileSize(IEMTHRDEDCALLENTRY, sizeof(uint64_t) * 4); 104 /** Pointer to a threaded call entry. */ 105 typedef IEMTHRDEDCALLENTRY *PIEMTHRDEDCALLENTRY; 106 /** Pointer to a const threaded call entry. */ 107 typedef IEMTHRDEDCALLENTRY const *PCIEMTHRDEDCALLENTRY; 108 109 /** @name IEMTB_F_XXX - Translation block flags. 110 * @{ */ 111 #define IEMTB_F_MODE_MASK UINT32_C(0x00000007) 112 #define IEMTB_F_MODE_X86_16BIT UINT32_C(0x00000001) 113 #define IEMTB_F_MODE_X86_32BIT UINT32_C(0x00000002) 114 #define IEMTB_F_MODE_X86_32BIT_FLAT UINT32_C(0x00000003) 115 #define IEMTB_F_MODE_X86_64BIT UINT32_C(0x00000004) 116 117 #define IEMTB_F_COMPILING RT_BIT_32(0) 118 #define IEMTB_F_NATIVE RT_BIT_32(1) 119 /** @} */ 120 121 /** 122 * Translation block. 123 */ 124 typedef struct IEMTB 125 { 126 /** Next block with the same hash table entry. */ 127 PIEMTB volatile pNext; 128 /** List on the local VCPU for blocks. */ 129 RTLISTNODE LocalList; 130 131 /** @name What uniquely identifies the block. 132 * @{ */ 133 RTGCPHYS GCPhysPc; 134 uint64_t uPc; 135 uint32_t fFlags; 136 union 137 { 138 struct 139 { 140 /** The CS base. */ 141 uint32_t uCsBase; 142 /** The CS limit (UINT32_MAX for 64-bit code). */ 143 uint32_t uCsLimit; 144 /** The CS selector value. */ 145 uint16_t CS; 146 /**< Relevant X86DESCATTR_XXX bits. */ 147 uint16_t fAttr; 148 } x86; 149 }; 150 /** @} */ 151 152 /** Number of bytes of opcodes covered by this block. 153 * @todo Support discontiguous chunks of opcodes in same block, though maybe 154 * restrict to the initial page or smth. */ 155 uint32_t cbPC; 156 157 union 158 { 159 struct 160 { 161 /** Number of calls in paCalls. */ 162 uint32_t cCalls; 163 /** Number of calls allocated. */ 164 uint32_t cAllocated; 165 /** The call sequence table. */ 166 PIEMTHRDEDCALLENTRY paCalls; 167 } Thrd; 168 }; 169 170 171 } IEMTB; 172 173 174 /********************************************************************************************************************************* 80 175 * Defined Constants And Macros * 81 176 *********************************************************************************************************************************/ … … 97 192 IEMTHREADEDFUNCS const enmFunctionCheck = a_enmFunction; RT_NOREF(enmFunctionCheck); \ 98 193 uint64_t const uArg0Check = (a_uArg0); RT_NOREF(uArg0Check); \ 194 \ 195 PIEMTB const pTb = pVCpu->iem.s.pCurTbR3; \ 196 PIEMTHRDEDCALLENTRY const pCall = &pTb->Thrd.paCalls[pTb->Thrd.cCalls++]; \ 197 pCall->enmFunction = a_enmFunction; \ 198 pCall->cbOpcode = IEM_GET_INSTR_LEN(pVCpu); \ 199 pCall->auParams[0] = a_uArg0; \ 200 pCall->auParams[1] = 0; \ 201 pCall->auParams[2] = 0; \ 99 202 } while (0) 100 203 #define IEM_MC2_EMIT_CALL_2(a_enmFunction, a_uArg0, a_uArg1) do { \ … … 102 205 uint64_t const uArg0Check = (a_uArg0); RT_NOREF(uArg0Check); \ 103 206 uint64_t const uArg1Check = (a_uArg1); RT_NOREF(uArg1Check); \ 207 \ 208 PIEMTB const pTb = pVCpu->iem.s.pCurTbR3; \ 209 PIEMTHRDEDCALLENTRY const pCall = &pTb->Thrd.paCalls[pTb->Thrd.cCalls++]; \ 210 pCall->enmFunction = a_enmFunction; \ 211 pCall->cbOpcode = IEM_GET_INSTR_LEN(pVCpu); \ 212 pCall->auParams[0] = a_uArg0; \ 213 pCall->auParams[1] = a_uArg1; \ 214 pCall->auParams[2] = 0; \ 104 215 } while (0) 105 216 #define IEM_MC2_EMIT_CALL_3(a_enmFunction, a_uArg0, a_uArg1, a_uArg2) do { \ … … 108 219 uint64_t const uArg1Check = (a_uArg1); RT_NOREF(uArg1Check); \ 109 220 uint64_t const uArg2Check = (a_uArg2); RT_NOREF(uArg2Check); \ 221 \ 222 PIEMTB const pTb = pVCpu->iem.s.pCurTbR3; \ 223 PIEMTHRDEDCALLENTRY const pCall = &pTb->Thrd.paCalls[pTb->Thrd.cCalls++]; \ 224 pCall->enmFunction = a_enmFunction; \ 225 pCall->cbOpcode = IEM_GET_INSTR_LEN(pVCpu); \ 226 pCall->auParams[0] = a_uArg0; \ 227 pCall->auParams[1] = a_uArg1; \ 228 pCall->auParams[2] = a_uArg2; \ 110 229 } while (0) 111 230
Note:
See TracChangeset
for help on using the changeset viewer.