儲存庫 vbox 的更動 65959
- 時間撮記:
- 2017-3-6 下午09:24:32 (8 年 以前)
- 位置:
- trunk/src/VBox
- 檔案:
-
- 修改 7 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsOneByte.cpp.h
r65894 r65959 101 101 * @opgroup op_gen_arith_bin 102 102 * @opflmodify of,sf,zf,af,pf,cf 103 * @optest op1=1 op2=1 -> op1=2 efl=of,sf,zf,af 103 104 */ 104 105 FNIEMOP_DEF(iemOp_add_Al_Ib) … … 113 114 * @opgroup op_gen_arith_bin 114 115 * @opflmodify of,sf,zf,af,pf,cf 116 * @optest op1=1 op2=1 -> op1=2 efl=of,sf,zf,af 115 117 */ 116 118 FNIEMOP_DEF(iemOp_add_eAX_Iz) -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py
r65944 r65959 271 271 self.asFlags = []; 272 272 self.fAdvanceMnemonic = True; ##< Set by the caller. 273 if self.sEncoding == 'ModR/M': 274 if 'ignores_op_size' not in oInstr.dHints: 275 self.sPfxKind = 'BS3CGPFXKIND_MODRM'; 276 else: 277 self.sPfxKind = 'BS3CGPFXKIND_MODRM_NO_OP_SIZES'; 278 else: 279 self.sPfxKind = '0'; 280 273 281 274 282 def getOperands(self): … … 279 287 """ Returns an array of BS3CG1INSTR member initializers. """ 280 288 return [ 281 ' /* cbOpcode = */%s,' % (len(self.asOpcodes),),289 ' /* cbOpcodes = */ %s,' % (len(self.asOpcodes),), 282 290 ' /* cOperands = */ %s,' % (len(self.oInstr.aoOperands),), 283 291 ' /* cchMnemonic = */ %s,' % (len(self.oInstr.sMnemonic),), … … 285 293 ' /* offTests = */ %s,' % (self.oTests.offTests,), 286 294 ' /* enmEncoding = */ (unsigned)%s,' % (self.sEncoding,), 295 ' /* enmPfxKind = */ (unsigned)%s,' % (self.sPfxKind,), 287 296 ' /* uUnused = */ 0,', 288 297 ' /* fFlags = */ %s' % (' | '.join(self.asFlags) if self.asFlags else '0'), -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r65926 r65959 40 40 41 41 /********************************************************************************************************************************* 42 * Defined Constants And Macros * 43 *********************************************************************************************************************************/ 44 #define P_CS X86_OP_PRF_CS 45 #define P_SS X86_OP_PRF_SS 46 #define P_DS X86_OP_PRF_DS 47 #define P_ES X86_OP_PRF_ES 48 #define P_FS X86_OP_PRF_FS 49 #define P_GS X86_OP_PRF_GS 50 #define P_OZ X86_OP_PRF_SIZE_OP 51 #define P_AZ X86_OP_PRF_SIZE_ADDR 52 #define P_LK X86_OP_PRF_LOCK 53 #define P_RN X86_OP_PRF_REPNZ 54 #define P_RZ X86_OP_PRF_REPZ 55 56 #define REX_WRBX (X86_OP_REX_W | X86_OP_REX_R | X86_OP_REX_B | X86_OP_REX_X) 57 #define REX_W___ (X86_OP_REX_W) 58 #define REX_WR__ (X86_OP_REX_W | X86_OP_REX_R) 59 #define REX_W_B_ (X86_OP_REX_W | X86_OP_REX_B) 60 #define REX_W__X (X86_OP_REX_W | X86_OP_REX_X) 61 #define REX_WRB_ (X86_OP_REX_W | X86_OP_REX_R | X86_OP_REX_B) 62 #define REX_WR_X (X86_OP_REX_W | X86_OP_REX_R | X86_OP_REX_X) 63 #define REX_W_BX (X86_OP_REX_W | X86_OP_REX_B | X86_OP_REX_X) 64 #define REX__R__ (X86_OP_REX_R) 65 #define REX__RB_ (X86_OP_REX_R | X86_OP_REX_B) 66 #define REX__R_X (X86_OP_REX_R | X86_OP_REX_X) 67 #define REX__RBX (X86_OP_REX_R | X86_OP_REX_B | X86_OP_REX_X) 68 #define REX___B_ (X86_OP_REX_B) 69 #define REX___BX (X86_OP_REX_B | X86_OP_REX_X) 70 #define REX____X (X86_OP_REX_X) 71 #define REX_____ (0x40) 72 73 74 /********************************************************************************************************************************* 42 75 * Structures and Typedefs * 43 76 *********************************************************************************************************************************/ … … 75 108 uint8_t fAdvanceMnemonic; 76 109 /** The number of opcode bytes. */ 77 uint8_t cbOpcode ;110 uint8_t cbOpcodes; 78 111 /** Number of operands. */ 79 112 uint8_t cOperands; … … 88 121 uint8_t bMode; 89 122 90 uint8_t abPadding1[2]; 123 /** @name Current encoded instruction. 124 * @{ */ 125 /** The size of the current instruction that we're testing. */ 126 uint8_t cbCurInstr; 127 /** The size the prefixes. */ 128 uint8_t cbCurPrefix; 129 /** The offset into abCurInstr of the immediate. */ 130 uint8_t offCurImm; 131 /** Buffer for assembling the current instruction. */ 132 uint8_t abCurInstr[31]; 133 134 /** Operands details. */ 135 struct 136 { 137 uint8_t cbOp; 138 bool fMem; 139 bool afUnused[2]; 140 BS3PTRUNION uOpPtr; 141 } aOperands[4]; 142 /** @} */ 91 143 92 144 /** Page to put code in. When paging is enabled, the page before and after … … 113 165 } MemOp; 114 166 } BS3CG1STATE; 115 116 117 118 BS3_DECL_FAR(uint8_t) BS3_CMN_NM(bs3CpuInstr2_mul)(uint8_t bMode) 167 /** Pointer to the generated test state. */ 168 typedef BS3CG1STATE *PBS3CG1STATE; 169 170 171 #define BS3CG1_PF_OZ UINT16_C(0x0001) 172 #define BS3CG1_PF_AZ UINT16_C(0x0002) 173 #define BS3CG1_PF_CS UINT16_C(0x0004) 174 #define BS3CG1_PF_DS UINT16_C(0x0008) 175 #define BS3CG1_PF_ES UINT16_C(0x0010) 176 #define BS3CG1_PF_FS UINT16_C(0x0020) 177 #define BS3CG1_PF_GS UINT16_C(0x0040) 178 #define BS3CG1_PF_SS UINT16_C(0x0080) 179 #define BS3CG1_PF_SEGS (BS3CG1_PF_CS | BS3CG1_PF_DS | BS3CG1_PF_ES | BS3CG1_PF_FS | BS3CG1_PF_GS | BS3CG1_PF_SS) 180 #define BS3CG1_PF_MEM (BS3CG1_PF_SEGS | BS3CG1_PF_AZ) 181 #define BS3CG1_PF_LK UINT16_C(0x0100) 182 #define BS3CG1_PF_RN UINT16_C(0x0200) 183 #define BS3CG1_PF_RZ UINT16_C(0x0400) 184 #define BS3CG1_PF_W UINT16_C(0x0800) /**< REX.W */ 185 #define BS3CG1_PF_R UINT16_C(0x1000) /**< REX.R */ 186 #define BS3CG1_PF_B UINT16_C(0x2000) /**< REX.B */ 187 #define BS3CG1_PF_X UINT16_C(0x4000) /**< REX.X */ 188 189 190 /********************************************************************************************************************************* 191 * Global Variables * 192 *********************************************************************************************************************************/ 193 #if 0 194 static const struct 195 { 196 uint8_t cbPrefixes; 197 uint8_t abPrefixes[14]; 198 uint16_t fEffective; 199 } g_aPrefixVariations[] = 200 { 201 { 0, { 0x00 }, BS3CG1_PF_NONE }, 202 203 { 1, { P_OZ }, BS3CG1_PF_OZ }, 204 { 1, { P_CS }, BS3CG1_PF_CS }, 205 { 1, { P_DS }, BS3CG1_PF_DS }, 206 { 1, { P_ES }, BS3CG1_PF_ES }, 207 { 1, { P_FS }, BS3CG1_PF_FS }, 208 { 1, { P_GS }, BS3CG1_PF_GS }, 209 { 1, { P_SS }, BS3CG1_PF_SS }, 210 { 1, { P_LK }, BS3CG1_PF_LK }, 211 212 { 2, { P_CS, P_OZ, }, BS3CG1_PF_CS | BS3CFG1_PF_OZ }, 213 { 2, { P_DS, P_OZ, }, BS3CG1_PF_DS | BS3CFG1_PF_OZ }, 214 { 2, { P_ES, P_OZ, }, BS3CG1_PF_ES | BS3CFG1_PF_OZ }, 215 { 2, { P_FS, P_OZ, }, BS3CG1_PF_FS | BS3CFG1_PF_OZ }, 216 { 2, { P_GS, P_OZ, }, BS3CG1_PF_GS | BS3CFG1_PF_OZ }, 217 { 2, { P_GS, P_OZ, }, BS3CG1_PF_SS | BS3CFG1_PF_OZ }, 218 { 2, { P_SS, P_OZ, }, BS3CG1_PF_SS | BS3CFG1_PF_OZ }, 219 220 { 2, { P_OZ, P_CS, }, BS3CG1_PF_CS | BS3CFG1_PF_OZ }, 221 { 2, { P_OZ, P_DS, }, BS3CG1_PF_DS | BS3CFG1_PF_OZ }, 222 { 2, { P_OZ, P_ES, }, BS3CG1_PF_ES | BS3CFG1_PF_OZ }, 223 { 2, { P_OZ, P_FS, }, BS3CG1_PF_FS | BS3CFG1_PF_OZ }, 224 { 2, { P_OZ, P_GS, }, BS3CG1_PF_GS | BS3CFG1_PF_OZ }, 225 { 2, { P_OZ, P_GS, }, BS3CG1_PF_SS | BS3CFG1_PF_OZ }, 226 { 2, { P_OZ, P_SS, }, BS3CG1_PF_SS | BS3CFG1_PF_OZ }, 227 }; 228 229 static const uint16_t g_afPfxKindToIgnoredFlags[BS3CGPFXKIND_END] = 230 { 231 /* [BS3CGPFXKIND_INVALID] = */ UINT16_MAX, 232 /* [BS3CGPFXKIND_MODRM] = */ 0, 233 /* [BS3CGPFXKIND_MODRM_NO_OP_SIZES] = */ BS3CG1_PF_OZ | BS3CG1_PF_W, 234 }; 235 236 #endif 237 238 239 DECLINLINE(void) Bs3Cg1InsertOpcodes(PBS3CG1STATE pThis, unsigned offDst) 240 { 241 switch (pThis->cbOpcodes) 242 { 243 case 4: pThis->abCurInstr[offDst + 3] = pThis->abOpcodes[3]; 244 case 3: pThis->abCurInstr[offDst + 2] = pThis->abOpcodes[2]; 245 case 2: pThis->abCurInstr[offDst + 1] = pThis->abOpcodes[1]; 246 case 1: pThis->abCurInstr[offDst] = pThis->abOpcodes[0]; 247 return; 248 249 default: 250 BS3_ASSERT(0); 251 } 252 } 253 254 255 static bool Bs3Cg1EncodeNext(PBS3CG1STATE pThis, unsigned iEncoding) 256 { 257 bool fDone = false; 258 switch (pThis->enmEncoding) 259 { 260 case BS3CG1ENC_MODRM_Eb_Gb: 261 //Bs3CgiInsertOpcodes(pThis, 0); 262 //This.aenmOperands[0] 263 264 break; 265 266 case BS3CG1ENC_MODRM_Ev_Gv: 267 case BS3CG1ENC_FIXED_AL_Ib: 268 case BS3CG1ENC_FIXED_rAX_Iz: 269 fDone = true; 270 break; 271 272 case BS3CG1ENC_END: case BS3CG1ENC_INVALID: /* Impossible; to shut up gcc. */ fDone = true; break; 273 } 274 275 276 return false; 277 } 278 279 280 BS3_DECL_FAR(uint8_t) BS3_CMN_NM(Bs3Cg1Worker)(uint8_t bMode) 119 281 { 120 282 BS3CG1STATE This; … … 131 293 Bs3MemSet(&This, 0, sizeof(This)); 132 294 133 This.bMode = bMode; 134 This.pchMnemonic = g_achBs3Cg1Mnemonics; 135 This.pabOperands = g_abBs3Cg1Operands; 136 This.pabOpcodes = g_abBs3Cg1Opcodes; 295 This.bMode = bMode; 296 This.pchMnemonic = g_achBs3Cg1Mnemonics; 297 This.pabOperands = g_abBs3Cg1Operands; 298 This.pabOpcodes = g_abBs3Cg1Opcodes; 299 This.fAdvanceMnemonic = 1; 137 300 138 301 /* Allocate guarded exectuable and data memory. */ … … 181 344 This.pchMnemonic += This.fAdvanceMnemonic * This.cchMnemonic, 182 345 This.pabOperands += This.cOperands, 183 This.pabOpcodes += This.cbOpcode 346 This.pabOpcodes += This.cbOpcodes) 184 347 { 185 348 unsigned iEncoding; … … 194 357 This.enmEncoding = (BS3CG1ENC)pInstr->enmEncoding; 195 358 This.cchMnemonic = pInstr->cchMnemonic; 196 This.fAdvanceMnemonic= pInstr->fAdvanceMnemonic; 359 if (This.fAdvanceMnemonic) 360 Bs3TestSubF("%.*s", This.cchMnemonic, This.pchMnemonic); 361 This.fAdvanceMnemonic = pInstr->fAdvanceMnemonic; 197 362 This.cOperands = pInstr->cOperands; 198 This.cbOpcode = pInstr->cbOpcode;363 This.cbOpcodes = pInstr->cbOpcodes; 199 364 switch (This.cOperands) 200 365 { … … 205 370 } 206 371 207 switch (This.cbOpcode )372 switch (This.cbOpcodes) 208 373 { 209 374 case 3: This.abOpcodes[3] = This.pabOpcodes[3]; … … 213 378 } 214 379 215 if (This.enmEncoding <= BS3CG1ENC_INVALID || This.enmEncoding >= BS3CG1ENC_END) 216 { 217 Bs3TestFailedF("Invalid enmEncoding for instruction #%u (%.*s): %d", 218 iInstr, This.cchMnemonic, This.pchMnemonic, This.enmEncoding); 219 continue; 380 /* 381 * Prep the operands and encoding handling. 382 */ 383 switch (This.enmEncoding) 384 { 385 case BS3CG1ENC_MODRM_Eb_Gb: 386 break; 387 case BS3CG1ENC_MODRM_Ev_Gv: 388 break; 389 case BS3CG1ENC_FIXED_AL_Ib: 390 break; 391 case BS3CG1ENC_FIXED_rAX_Iz: 392 break; 393 394 default: 395 Bs3TestFailedF("Invalid enmEncoding for instruction #%u (%.*s): %d", 396 iInstr, This.cchMnemonic, This.pchMnemonic, This.enmEncoding); 397 continue; 220 398 } 221 399 … … 225 403 for (iEncoding = 0; ; iEncoding++) 226 404 { 227 / /switch (This.enmEncoding)228 //{229 //230 //}231 405 /* 406 * Encode the next instruction variation. 407 */ 408 if (Bs3Cg1EncodeNext(&This, iEncoding)) { /* likely*/ } 409 else break; 232 410 233 411 /* … … 235 413 */ 236 414 415 237 416 } 238 417 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.c
r65893 r65959 36 36 * Internal Functions * 37 37 *********************************************************************************************************************************/ 38 BS3TESTMODE_PROTOTYPES_CMN(Bs3Cg1Worker); 38 39 39 40 … … 41 42 * Global Variables * 42 43 *********************************************************************************************************************************/ 43 44 45 44 static const BS3TESTMODEENTRY g_aModeTest[] = 45 { 46 BS3TESTMODEENTRY_CMN(NULL, Bs3Cg1Worker), 47 }; 46 48 47 49 … … 51 53 Bs3TestInit("bs3-cpu-generated-1"); 52 54 55 Bs3TestDoModes_rm(g_aModeTest, RT_ELEMENTS(g_aModeTest)); 53 56 54 57 Bs3TestTerm(); -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h
r65931 r65959 48 48 BS3CG1OP_Gv, 49 49 50 BS3CG1OP_Ib, 51 BS3CG1OP_Iz, 52 53 BS3CG1OP_AL, 54 BS3CG1OP_rAX, 55 50 56 BS3CG1OP_END 51 57 } BS3CG1OP; … … 64 70 BS3CG1ENC_INVALID = 0, 65 71 66 BS3CG1ENC_FIXED_Iz,67 BS3CG1ENC_FIXED_FIRST = BS3CG1ENC_FIXED_Iz,68 BS3CG1ENC_FIXED_Iv,69 70 72 BS3CG1ENC_MODRM_Eb_Gb, 71 73 BS3CG1ENC_MODRM_Ev_Gv, 72 74 75 BS3CG1ENC_FIXED_AL_Ib, 76 BS3CG1ENC_FIXED_rAX_Iz, 77 73 78 BS3CG1ENC_END 74 79 } BS3CG1ENC; … … 76 81 77 82 /** 83 * Prefix sensitivitiy kind. 84 */ 85 typedef enum BS3CGPFXKIND 86 { 87 BS3CGPFXKIND_INVALID = 0, 88 89 BS3CGPFXKIND_MODRM, 90 BS3CGPFXKIND_MODRM_NO_OP_SIZES, 91 92 BS3CGPFXKIND_END 93 } BS3CGPFXKIND; 94 95 96 /** 78 97 * Generated instruction info. 79 98 */ … … 81 100 { 82 101 /** The opcode size. */ 83 uint32_t cbOpcode : 2;102 uint32_t cbOpcodes : 2; 84 103 /** The number of operands. */ 85 104 uint32_t cOperands : 2; … … 92 111 /** BS3CG1ENC values. */ 93 112 uint32_t enmEncoding : 10; 94 /** BS3CG1ENC values. */ 95 uint32_t uUnused : 22; 113 /** BS3CGPFXKIND values. */ 114 uint32_t enmPrefixKind : 4; 115 /** Currently unused bits. */ 116 uint32_t uUnused : 18; 96 117 /** BS3CG1INSTR_F_XXX. */ 97 118 uint32_t fFlags; … … 104 125 /** @name BS3CG1INSTR_F_XXX 105 126 * @{ */ 106 #define BS3CG1INSTR_F_ UINT32_C(0x00000000) 127 /** Defaults to SS rather than DS. */ 128 #define BS3CG1INSTR_F_DEF_SS UINT32_C(0x00000001) 107 129 /** @} */ 108 130 … … 331 353 /** The opcodes (generated). 332 354 * Variable length sequence of opcode bytes that runs in parallel to 333 * g_aBs3Cg1Instructions, advancing by BS3CG1INSTR::cbOpcode each time. */355 * g_aBs3Cg1Instructions, advancing by BS3CG1INSTR::cbOpcodes each time. */ 334 356 extern const uint8_t BS3_FAR_DATA g_abBs3Cg1Opcodes[]; 335 357 /** The operands (generated). -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c
r60585 r65959 206 206 bool fSkipped = true; 207 207 uint8_t bErrNo; 208 Bs3TestSub(paEntries[i].pszSubTest); 208 209 if (paEntries[i].pszSubTest != NULL) 210 Bs3TestSub(paEntries[i].pszSubTest); 209 211 210 212 #define PRE_DO_CALL(a_szModeName) do { if (fVerbose) Bs3TestPrintf("...%s\n", a_szModeName); } while (0) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r65507 r65959 3038 3038 typedef struct BS3TESTMODEENTRY 3039 3039 { 3040 /** The sub-test name to be passed to Bs3TestSub if not NULL. */ 3040 3041 const char * BS3_FAR pszSubTest; 3041 3042
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器