Changeset 47132 in vbox for trunk/src/VBox
- Timestamp:
- Jul 14, 2013 12:06:54 AM (11 years ago)
- Location:
- trunk/src/VBox/VMM/testcase/Instructions
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/Instructions/InstructionTestGen.py
r47047 r47132 944 944 self.fIsIDiv = fIsIDiv; 945 945 946 def generateInputEdgeCases(self, cbEffOp, fLong, fXcpt): 947 """ Generate edge case inputs for cbEffOp. Returns a list of pairs, dividen + divisor. """ 948 # Test params. 949 uStep = 1 << (cbEffOp * 8); 950 if self.fIsIDiv: 951 uStep /= 2; 952 953 # edge tests 954 auRet = []; 955 956 uDivisor = 1 if fLong else 3; 957 uDividend = uStep * uDivisor - 1; 958 for i in range(5 if fLong else 3): 959 auRet.append([uDividend + fXcpt, uDivisor]); 960 if self.fIsIDiv: 961 auRet.append([-uDividend - fXcpt, -uDivisor]); 962 auRet.append([-(uDividend + uDivisor + fXcpt), uDivisor]); 963 auRet.append([ (uDividend + uDivisor + fXcpt), -uDivisor]); 964 if i <= 3 and fLong: 965 auRet.append([uDividend - 1 + fXcpt*3, uDivisor]); 966 if self.fIsIDiv: 967 auRet.append([-(uDividend - 1 + fXcpt*3), -uDivisor]); 968 uDivisor += 1; 969 uDividend += uStep; 970 971 uDivisor = uStep - 1; 972 uDividend = uStep * uDivisor - 1; 973 for _ in range(3 if fLong else 1): 974 auRet.append([uDividend + fXcpt, uDivisor]); 975 if self.fIsIDiv: 976 auRet.append([-uDividend - fXcpt, -uDivisor]); 977 uDivisor -= 1; 978 uDividend -= uStep; 979 980 if self.fIsIDiv: 981 uDivisor = -uStep; 982 for _ in range(3 if fLong else 1): 983 auRet.append([uDivisor * (-uStep - 1) - (not fXcpt), uDivisor]); 984 uDivisor += 1 985 uDivisor = uStep - 1; 986 for _ in range(3 if fLong else 1): 987 auRet.append([-(uDivisor * (uStep + 1) - (not fXcpt)), uDivisor]); 988 uDivisor -= 1 989 990 return auRet; 991 946 992 def generateInputsNoXcpt(self, cbEffOp, fLong = False): 947 993 """ Generate inputs for cbEffOp. Returns a list of pairs, dividen + divisor. """ … … 952 998 953 999 # edge tests 954 auRet = []; 955 956 uDivisor = 1 if fLong else 3; 957 uDividend = uStep * uDivisor - 1; 958 for i in range(5 if fLong else 3): 959 auRet.append([uDividend, uDivisor]); 960 if self.fIsIDiv: 961 auRet.append([-uDividend, -uDivisor]); 962 auRet.append([-(uDividend + uDivisor - 1), uDivisor]); 963 auRet.append([ (uDividend + uDivisor - 1), -uDivisor]); 964 if i <= 3 and fLong: 965 auRet.append([uDividend - 1, uDivisor]); 966 if self.fIsIDiv: 967 auRet.append([-(uDividend - 1), -uDivisor]); 968 uDivisor += 1; 969 uDividend += uStep; 970 971 uDivisor = uStep - 1; 972 uDividend = uStep * uDivisor - 1; 973 for _ in range(3 if fLong else 1): 974 auRet.append([uDividend, uDivisor]); 975 if self.fIsIDiv: 976 auRet.append([-uDividend, -uDivisor]); 977 uDivisor -= 1; 978 uDividend -= uStep; 979 980 if self.fIsIDiv: 981 uDivisor = -uStep; 982 for _ in range(3 if fLong else 1): 983 auRet.append([uDivisor * (uDivisor - 1) - 1, uDivisor]); 984 uDivisor += 1 985 uDivisor = uStep - 1; 986 for _ in range(3 if fLong else 1): 987 auRet.append([-(uDivisor * (uDivisor + 1) - 1), uDivisor]); 988 uDivisor -= 1 1000 auRet = self.generateInputEdgeCases(cbEffOp, fLong, False) 989 1001 990 1002 # random tests. … … 992 1004 for _ in range(6 if fLong else 2): 993 1005 while True: 994 uDivisor = randSxx(cbEffOp * 4);1006 uDivisor = randSxx(cbEffOp * 8); 995 1007 if uDivisor == 0 or uDivisor >= uStep or uDivisor < -uStep: 996 1008 continue; 997 uDividend = randSxx(cbEffOp * 8);1009 uDividend = randSxx(cbEffOp * 16); 998 1010 uResult = uDividend / uDivisor; 999 1011 if uResult >= uStep or uResult <= -uStep: # exclude difficulties … … 1004 1016 for _ in range(6 if fLong else 2): 1005 1017 while True: 1006 uDivisor = randUxx(cbEffOp * 4);1018 uDivisor = randUxx(cbEffOp * 8); 1007 1019 if uDivisor == 0 or uDivisor >= uStep: 1008 1020 continue; 1009 uDividend = randUxx(cbEffOp * 8);1021 uDividend = randUxx(cbEffOp * 16); 1010 1022 uResult = uDividend / uDivisor; 1011 1023 if uResult >= uStep: … … 1155 1167 return True; 1156 1168 1169 def generateInputsXcpt(self, cbEffOp, fLong = False): 1170 """ 1171 Generate inputs for cbEffOp that will overflow or underflow. 1172 Returns a list of pairs, dividen + divisor. 1173 """ 1174 # Test params. 1175 uStep = 1 << (cbEffOp * 8); 1176 if self.fIsIDiv: 1177 uStep /= 2; 1178 1179 # edge tests 1180 auRet = self.generateInputEdgeCases(cbEffOp, fLong, True); 1181 auRet.extend([[0, 0], [1, 0], [ uStep * uStep / 2 - 1, 0]]); 1182 1183 # random tests. 1184 if self.fIsIDiv: 1185 for _ in range(6 if fLong else 2): 1186 while True: 1187 uDivisor = randSxx(cbEffOp * 8); 1188 uDividend = randSxx(cbEffOp * 16); 1189 if uDivisor >= uStep or uDivisor < -uStep: 1190 continue; 1191 if uDivisor != 0: 1192 uResult = uDividend / uDivisor; 1193 if (uResult <= uStep and uResult >= 0) or (uResult >= -uStep and uResult < 0): 1194 continue; # exclude difficulties 1195 break; 1196 auRet.append([uDividend, uDivisor]); 1197 else: 1198 for _ in range(6 if fLong else 2): 1199 while True: 1200 uDivisor = randUxx(cbEffOp * 8); 1201 uDividend = randUxx(cbEffOp * 16); 1202 if uDivisor >= uStep: 1203 continue; 1204 if uDivisor != 0: 1205 uResult = uDividend / uDivisor; 1206 if uResult < uStep: 1207 continue; 1208 break; 1209 auRet.append([uDividend, uDivisor]); 1210 1211 return auRet; 1212 1213 def generateOneDivideErrorTestGreg(self, oGen, cbEffOp, iOp2, iDividend, iDivisor): 1214 """ Generate code of one '[I]DIV rDX:rAX,<GREG>' test that causes #DE. """ 1215 cbMaxOp = oGen.oTarget.getMaxOpBytes(); 1216 fEffOp = ((1 << (cbEffOp *8) ) - 1); 1217 fMaxOp = UINT64_MAX if cbMaxOp == 8 else UINT32_MAX; assert cbMaxOp in [8, 4]; 1218 fTopOp = fMaxOp - fEffOp; 1219 fFullOp1 = ((1 << (cbEffOp*16)) - 1); 1220 1221 uAX = iDividend & fFullOp1; # full with unsigned 1222 uDX = uAX >> (cbEffOp*8); 1223 uAX &= fEffOp; 1224 uOp2Val = iDivisor & fEffOp; 1225 1226 if cbEffOp < cbMaxOp: 1227 uAX |= randUxx(cbMaxOp * 8) & fTopOp; 1228 uDX |= randUxx(cbMaxOp * 8) & fTopOp; 1229 uOp2Val |= randUxx(cbMaxOp * 8) & fTopOp; 1230 oGen.write(' ; iDividend=%#x (%d) iDivisor=%#x (%d)\n' 1231 % ( iDividend & fFullOp1, iDividend, iDivisor & fEffOp, iDivisor,)); 1232 oGen.write(' call VBINSTST_NAME(Common_LoadKnownValues)\n'); 1233 oGen.write(' mov %s, 0x%x\n' % (oGen.oTarget.asGRegs[X86_GREG_xDX], uDX,)); 1234 oGen.write(' mov %s, 0x%x\n' % (oGen.oTarget.asGRegs[X86_GREG_xAX], uAX,)); 1235 oGen.write(' mov %s, 0x%x\n' % (oGen.oTarget.asGRegs[iOp2], uOp2Val,)); 1236 oGen.write(' push %s\n' % (oGen.oTarget.asGRegs[iOp2],)); 1237 oGen.write(' push %s\n' % (oGen.oTarget.asGRegs[X86_GREG_xDX],)); 1238 oGen.write(' push %s\n' % (oGen.oTarget.asGRegs[X86_GREG_xAX],)); 1239 oGen.write(' VBINSTST_TRAP_INSTR X86_XCPT_DE, 0, %-4s %s\n' 1240 % (self.sInstr, gregName(iOp2, cbEffOp * 8),)); 1241 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(X86_GREG_xAX, X86_GREG_xDX, iOp2),)); 1242 return True; 1243 1244 def generateOneDivideErrorTestGreg8Bit(self, oGen, cbEffOp, iOp2, iDividend, iDivisor): 1245 """ Generate code of one '[I]DIV AX,<GREG>' test that causes #DE (8-bit). """ 1246 cbMaxOp = oGen.oTarget.getMaxOpBytes(); 1247 fMaxOp = UINT64_MAX if cbMaxOp == 8 else UINT32_MAX; assert cbMaxOp in [8, 4]; 1248 iOp2X = (iOp2 & 3) if oGen.oTarget.is8BitHighGReg(cbEffOp, iOp2) else iOp2; 1249 assert iOp2X != X86_GREG_xAX; 1250 1251 uAX = iDividend & UINT16_MAX; # full with unsigned 1252 uOp2Val = iDivisor & UINT8_MAX; 1253 1254 uAX |= randUxx(cbMaxOp * 8) & (fMaxOp - UINT16_MAX); 1255 uOp2Val |= randUxx(cbMaxOp * 8) & (fMaxOp - UINT8_MAX); 1256 if iOp2X != iOp2: 1257 uOp2Val = rotateLeftUxx(cbMaxOp * 8, uOp2Val, 8); 1258 oGen.write(' ; iDividend=%#x (%d) iDivisor=%#x (%d)\n' 1259 % ( iDividend & UINT16_MAX, iDividend, iDivisor & UINT8_MAX, iDivisor,)); 1260 oGen.write(' call VBINSTST_NAME(Common_LoadKnownValues)\n'); 1261 oGen.write(' mov %s, 0x%x\n' % (oGen.oTarget.asGRegs[X86_GREG_xAX], uAX,)); 1262 oGen.write(' mov %s, 0x%x\n' % (oGen.oTarget.asGRegs[iOp2X], uOp2Val,)); 1263 oGen.write(' push %s\n' % (oGen.oTarget.asGRegs[iOp2X],)); 1264 oGen.write(' push sAX\n'); 1265 oGen.write(' VBINSTST_TRAP_INSTR X86_XCPT_DE, 0, %-4s %s\n' 1266 % (self.sInstr, gregName(iOp2, cbEffOp * 8),)); 1267 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(X86_GREG_xAX, iOp2X),)); 1268 return; 1269 1270 def generateDivideErrorTests(self, oGen): 1271 """ Generate divide error tests (raises X86_XCPT_DE). """ 1272 oGen.write('%ifdef VBINSTST_CAN_DO_TRAPS\n'); 1273 1274 # We do one register variation here, assuming the standard test has got them covered. 1275 # Register tests 1276 if True: 1277 iOp2 = oGen.oTarget.randGRegNoSp(); 1278 while iOp2 == X86_GREG_xAX or iOp2 == X86_GREG_xDX: 1279 iOp2 = oGen.oTarget.randGRegNoSp(); 1280 1281 for cbEffOp in ( 8, 4, 2, 1 ): 1282 if cbEffOp > oGen.oTarget.getMaxOpBytes(): 1283 continue; 1284 oGen.write('; cbEffOp=%u iOp2=%u\n' % (cbEffOp, iOp2,)); 1285 1286 for iDividend, iDivisor in self.generateInputsXcpt(cbEffOp, fLong = not oGen.isTiny()): 1287 oGen.newSubTest(); 1288 if cbEffOp > 1: 1289 self.generateOneDivideErrorTestGreg(oGen, cbEffOp, iOp2, iDividend, iDivisor); 1290 else: 1291 self.generateOneDivideErrorTestGreg8Bit(oGen, cbEffOp, iOp2, iDividend, iDivisor); 1292 1293 oGen.write('%endif ; VBINSTST_CAN_DO_TRAPS\n'); 1294 return True; 1295 1296 1157 1297 def generateTest(self, oGen, sTestFnName): 1158 1298 oGen.write('VBINSTST_BEGINPROC %s\n' % (sTestFnName,)); … … 1160 1300 1161 1301 self.generateStandardTests(oGen); 1302 self.generateDivideErrorTests(oGen); 1162 1303 1163 1304 #oGen.write(' int3\n'); … … 1381 1522 return self._cSibIndexPerRun; 1382 1523 1524 def isTiny(self): 1525 """ Checks if we're in tiny mode.""" 1526 return self.oOptions.sTestSize == InstructionTestGen.ksTestSize_Tiny; 1527 1383 1528 1384 1529 # … … 1446 1591 'VBINSTST_GLOBALNAME_EX g_uVBInsTstSubTestIndicator, data hidden\n' 1447 1592 ' dd 0\n' 1593 '%ifdef VBINSTST_CAN_DO_TRAPS\n' 1594 'VBINSTST_TRAP_RECS_BEGIN\n' 1595 '%endif\n' 1448 1596 'VBINSTST_BEGINCODE\n' 1449 1597 ); … … 1693 1841 """ 1694 1842 1843 # Terminate the trap records. 1844 self.write('\n\n' 1845 ';\n' 1846 '; Terminate the trap records\n' 1847 ';\n' 1848 'VBINSTST_BEGINDATA\n' 1849 '%ifdef VBINSTST_CAN_DO_TRAPS\n' 1850 'VBINSTST_TRAP_RECS_END\n' 1851 '%endif\n' 1852 'VBINSTST_BEGINCODE\n'); 1853 1695 1854 # Register checking functions. 1696 1855 for sName in self._dCheckFns: … … 1788 1947 ' MY_PUSH_ALL\n' 1789 1948 ' sub xSP, 40h\n' 1949 '%ifdef VBINSTST_CAN_DO_TRAPS\n' 1950 ' VBINSTST_TRAP_RECS_INSTALL\n' 1951 '%endif\n' 1790 1952 '\n'); 1791 1953 … … 1806 1968 1807 1969 self.write('\n' 1970 '%ifdef VBINSTST_CAN_DO_TRAPS\n' 1971 ' VBINSTST_TRAP_RECS_UNINSTALL\n' 1972 '%endif\n' 1808 1973 ' add xSP, 40h\n' 1809 1974 ' MY_POP_ALL\n' -
trunk/src/VBox/VMM/testcase/Instructions/env-bs2-r0-big.mac
r47047 r47132 25 25 26 26 27 ;; Same as BEGINPROC in asmdefs.mac.28 %macro VBINSTST_BEGINPROC 129 VBINSTST_GLOBALNAME_EX %1, function hidden30 %endm31 32 ;; Same as ENDPROC in asmdefs.mac.33 %macro VBINSTST_ENDPROC 1,34 VBINSTST_GLOBALNAME_EX %1 %+ _EndProc, function hidden35 %endm36 37 ;; Same as NAME in asmdefs.mac.38 %define VBINSTST_NAME(a_Name) TMPL_NM(a_Name)39 40 ;; Same as GLOBALNAME_EX in asmdefs.mac.41 %macro VBINSTST_GLOBALNAME_EX 2,42 VBINSTST_NAME(%1):43 %endmacro44 45 ;; Same as BEGINCODE in asmdefs.mac.46 %macro VBINSTST_BEGINCODE 0,47 %endmacro48 49 ;; Same as BEGINDATA in asmdefs.mac.50 %macro VBINSTST_BEGINDATA 0,51 %endmacro52 53 54 27 ;; Call RTTestISub like function. 55 28 %define VBINSTST_CALL_FN_SUB_TEST call [TMPL_NM_CMN(g_pfnTestSub) xWrtRIP] … … 70 43 %define VBINSTST_CALL_FN_FAILURE_4 call [TMPL_NM_CMN(g_pfnTestFailedF) xWrtRIP] 71 44 45 ;; The image base label (used by the trap macros). 46 %define VBINSTST_IMAGE_BASE_LABLE bs2_big_image_start 47 48 ;; Wrapper for calling TestInstallTrapRecs (used by the trap macros). 49 %define VBINSTST_CALL_TEST_INSTALL_TRAP_RECS call [TMPL_NM_CMN(g_pfnTestInstallTrapRecs) xWrtRIP] 72 50 73 51 ; 74 52 ; Include the common bits (contains code using above macros) 75 53 ; 76 %include "env- common.mac"54 %include "env-bs2-r0-common.mac" 77 55 78 56 %endif -
trunk/src/VBox/VMM/testcase/Instructions/env-bs2-r0-common.mac
r47126 r47132 16 16 ; 17 17 18 %ifndef ___env_bs2_r0_ mac19 %define ___env_bs2_r0_ mac18 %ifndef ___env_bs2_r0_common_mac 19 %define ___env_bs2_r0_common_mac 20 20 21 21 … … 40 40 ;; Same as BEGINCODE in asmdefs.mac. 41 41 %macro VBINSTST_BEGINCODE 0, 42 BEGINCODE 42 43 %endmacro 43 44 44 45 ;; Same as BEGINDATA in asmdefs.mac. 45 46 %macro VBINSTST_BEGINDATA 0, 47 BEGINDATA 46 48 %endmacro 47 49 48 50 49 ;; Call RTTestISub like function. 50 %define VBINSTST_CALL_FN_SUB_TEST call TMPL_NM_CMN(TestSub) 51 ; 52 ; Trap related macros. 53 ; 54 %define VBINSTST_CAN_DO_TRAPS 1 51 55 52 ;; Call RTTestIFailure like function with simple message. 53 %define VBINSTST_CALL_FN_FAILURE call TMPL_NM_CMN(TestFailedF) 56 %macro VBINSTST_TRAP_INSTR 3+, 57 section .traprecs 58 istruc BS2TRAPREC 59 at BS2TRAPREC.offWhere, dd (%%trapinstr - VBINSTST_IMAGE_BASE_LABLE) 60 at BS2TRAPREC.offResumeAddend, db (%%resume - %%trapinstr) 61 at BS2TRAPREC.u8TrapNo, db %1 62 at BS2TRAPREC.u16ErrCd, dw %2 63 iend 64 VBINSTST_BEGINCODE 65 %if %1 != X86_XCPT_BP 66 %%trapinstr: 67 %3 68 %else 69 %3 70 %%trapinstr: 71 %endif 72 call VBINSTST_NAME(Common_MissingTrap_ %+ %1) 73 %%resume: 74 %endmacro 54 75 55 ;; Call RTTestIFailure like function with format message + 1 arg. 56 %define VBINSTST_CALL_FN_FAILURE_1 call TMPL_NM_CMN(TestFailedF) 76 %macro VBINSTST_TRAP_RECS_BEGIN 0, 77 VBINSTST_BEGINDATA 78 section .traprecs progbits valign=8 vfollows=.data align=8 follows=.data 79 dq 0ffffffffeeeeeeeeh 80 dq 0ddddddddcccccccch 81 VBINSTST_GLOBALNAME_EX g_aTrapRecs, hidden 82 VBINSTST_BEGINCODE 83 %endmacro 57 84 58 ;; Call RTTestIFailure like function with format message + 2 args. 59 %define VBINSTST_CALL_FN_FAILURE_2 call TMPL_NM_CMN(TestFailedF) 85 %macro VBINSTST_TRAP_RECS_END 0, 86 section .traprecs 87 VBINSTST_GLOBALNAME_EX g_aTrapRecsEnd, hidden 88 dq 0ddddddddcccccccch 89 dq 0ffffffffeeeeeeeeh 90 VBINSTST_BEGINCODE 91 %endmacro 60 92 61 ;; Call RTTestIFailure like function with format message + 3 args. 62 %define VBINSTST_CALL_FN_FAILURE_3 call TMPL_NM_CMN(TestFailedF) 93 %macro VBINSTST_TRAP_RECS_INSTALL 0, 94 mov sAX, VBINSTST_NAME(g_aTrapRecs) 95 mov edx, VBINSTST_NAME(g_aTrapRecsEnd) - VBINSTST_NAME(g_aTrapRecs) 96 shr edx, BS2TRAPREC_SIZE_SHIFT 97 mov sCX, VBINSTST_IMAGE_BASE_LABLE 98 VBINSTST_CALL_TEST_INSTALL_TRAP_RECS 99 %endmacro 63 100 64 ;; Call RTTestIFailure like function with format message + 4 args. 65 %define VBINSTST_CALL_FN_FAILURE_4 call TMPL_NM_CMN(TestFailedF) 101 %macro VBINSTST_TRAP_RECS_UNINSTALL 0, 102 xor sAX, sAX 103 xor edx, edx 104 xor sCX, sCX 105 VBINSTST_CALL_TEST_INSTALL_TRAP_RECS 106 %endmacro 66 107 67 108 -
trunk/src/VBox/VMM/testcase/Instructions/env-bs2-r0.mac
r46917 r47132 20 20 21 21 22 ;; Same as BEGINPROC in asmdefs.mac.23 %macro VBINSTST_BEGINPROC 124 VBINSTST_GLOBALNAME_EX %1, function hidden25 %endm26 27 ;; Same as ENDPROC in asmdefs.mac.28 %macro VBINSTST_ENDPROC 1,29 VBINSTST_GLOBALNAME_EX %1 %+ _EndProc, function hidden30 %endm31 32 ;; Same as NAME in asmdefs.mac.33 %define VBINSTST_NAME(a_Name) TMPL_NM(a_Name)34 35 ;; Same as GLOBALNAME_EX in asmdefs.mac.36 %macro VBINSTST_GLOBALNAME_EX 2,37 VBINSTST_NAME(%1):38 %endmacro39 40 ;; Same as BEGINCODE in asmdefs.mac.41 %macro VBINSTST_BEGINCODE 0,42 %endmacro43 44 ;; Same as BEGINDATA in asmdefs.mac.45 %macro VBINSTST_BEGINDATA 0,46 %endmacro47 48 49 22 ;; Call RTTestISub like function. 50 23 %define VBINSTST_CALL_FN_SUB_TEST call TMPL_NM_CMN(TestSub) … … 65 38 %define VBINSTST_CALL_FN_FAILURE_4 call TMPL_NM_CMN(TestFailedF) 66 39 40 ;; The image base label (used by the trap macros). 41 %define VBINSTST_IMAGE_BASE_LABLE start 42 43 ;; Wrapper for calling TestInstallTrapRecs (used by the trap macros). 44 %define VBINSTST_CALL_TEST_INSTALL_TRAP_RECS call TMPL_NM_CMN(TestInstallTrapRecs) 45 67 46 68 47 ; 69 48 ; Include the common bits (contains code using above macros) 70 49 ; 71 %include "env- common.mac"50 %include "env-bs2-r0-common.mac" 72 51 73 52 %endif -
trunk/src/VBox/VMM/testcase/Instructions/env-common.mac
r46954 r47132 175 175 176 176 177 %ifdef VBINSTST_CAN_DO_TRAPS 178 179 ;; 180 ; Report a missing TRAP. 181 ; 182 ; Primary purpose is save all registers and convert from our stack-based to 183 ; the correct calling convention for the environment. 184 ; 185 ; This function will clean up the stack upon return (to save space in the caller). 186 ; 187 ; @param uExpected 188 ; 189 VBINSTST_BEGINPROC Common_MissingTrap 190 MY_PUSH_ALL 191 mov xAX, xSP ; 16-byte align the stack and reserve space for arguments and stuff. 192 sub xSP, 40h 193 and xSP, ~15 194 mov [xSP + 38h], xAX 195 196 %ifdef ASM_CALL64_GCC 197 mov rdx, [VBINSTST_NAME(g_uVBInsTstSubTestIndicator) wrt rip] 198 movzx rsi, byte [rbp + 10h] ; expected 199 lea rdi, [.szFmt wrt rip] 200 VBINSTST_CALL_FN_FAILURE_2 201 202 %elifdef ASM_CALL64_MSC 203 mov r8d, [VBINSTST_NAME(g_uVBInsTstSubTestIndicator) wrt rip] 204 movzx rdx, byte [rbp + 10h] ; expected 205 lea rcx, [.szFmt wrt rip] 206 VBINSTST_CALL_FN_FAILURE_2 207 208 %elifdef ASM_CALL64_BS2 209 mov sBX, [VBINSTST_NAME(g_uVBInsTstSubTestIndicator) xWrtRIP] 210 mov sDX, [xBP + xCB + xCB] ; expected 211 lea sSI, [.szFmt xWrtRIP] 212 mov qword [xSP + xCB + 1*sCB], sBX 213 mov qword [xSP + xCB], sDX 214 mov [xSP], sSI 215 VBINSTST_CALL_FN_FAILURE_2 216 217 %else 218 mov sBX, [VBINSTST_NAME(g_uVBInsTstSubTestIndicator)] 219 mov sDX, [xBP + xCB + xCB] ; expected 220 mov [xSP + xCB + 1*sCB], sBX 221 mov [xSP + xCB], sDX 222 mov [xSP], RTCCPTR_PRE .szFmt 223 VBINSTST_CALL_FN_FAILURE_2 224 %endif 225 226 mov xSP, [xSP + 38h] 227 MY_POP_ALL 228 ret 1*sCB 229 %if ARCH_BITS == 64 230 .szFmt: db 'Missing trap %RX8 (line %RU64)', 13, 0 231 %else 232 .szFmt: db 'Missing trap %RX8 (line %RU32)', 13, 0 233 %endif 234 VBINSTST_ENDPROC Common_MissingTrap 235 236 %macro Common_MissingTrapTemplate 1 237 VBINSTST_BEGINPROC Common_MissingTrap_%1 238 push %1 239 call VBINSTST_NAME(Common_MissingTrap) 240 ret 241 VBINSTST_ENDPROC Common_MissingTrap_%1 242 %endmacro 243 Common_MissingTrapTemplate X86_XCPT_DE 244 Common_MissingTrapTemplate X86_XCPT_DB 245 Common_MissingTrapTemplate X86_XCPT_NMI 246 Common_MissingTrapTemplate X86_XCPT_BP 247 Common_MissingTrapTemplate X86_XCPT_OF 248 Common_MissingTrapTemplate X86_XCPT_BR 249 Common_MissingTrapTemplate X86_XCPT_UD 250 Common_MissingTrapTemplate X86_XCPT_NM 251 ;Common_MissingTrapTemplate X86_XCPT_DF 252 ;Common_MissingTrapTemplate X86_XCPT_CO_SEG_OVERRUN 253 Common_MissingTrapTemplate X86_XCPT_TS 254 Common_MissingTrapTemplate X86_XCPT_NP 255 Common_MissingTrapTemplate X86_XCPT_SS 256 Common_MissingTrapTemplate X86_XCPT_GP 257 Common_MissingTrapTemplate X86_XCPT_PF 258 Common_MissingTrapTemplate X86_XCPT_MF 259 Common_MissingTrapTemplate X86_XCPT_AC 260 ;Common_MissingTrapTemplate X86_XCPT_MC 261 Common_MissingTrapTemplate X86_XCPT_XF 262 263 %endif ; VBINSTST_CAN_DO_TRAPS 264 177 265 178 266 ; -
trunk/src/VBox/VMM/testcase/Instructions/env-iprt-r3.mac
r46856 r47132 87 87 88 88 89 ;; Cannot do traps yet. 90 %undef VBINSTST_CAN_DO_TRAPS 91 92 89 93 ; 90 94 ; Include the common bits (contains code using above macros)
Note:
See TracChangeset
for help on using the changeset viewer.