Changeset 66446 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Apr 5, 2017 6:00:17 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/Config.kmk
r64704 r66446 575 575 # -oi Inline instrinsics functions. 576 576 # -ol Loop optimizations. 577 # -oh Expensive optimizations. (saves a byte or two) 577 578 # -or Reorder for best pipeline. 578 579 # -os Favor size over speed. … … 602 603 TEMPLATE_VBoxBS3KitImg_CXXTOOL = Bs3Ow16 603 604 TEMPLATE_VBoxBS3KitImg_CFLAGS = $(if $(BS3KIT_SEGNM_DATA16),-nd=$(BS3KIT_SEGNM_DATA16),) \ 604 -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -wx -zl -zdp -zu -ml $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os - d+605 -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -wx -zl -zdp -zu -ml $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -oh -d+ 605 606 TEMPLATE_VBoxBS3KitImg_CXXFLAGS = $(if $(BS3KIT_SEGNM_DATA16),-nd=$(BS3KIT_SEGNM_DATA16),) \ 606 -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -wx -zl -zdp -zu -ml $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os - d+607 -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -wx -zl -zdp -zu -ml $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -oh -d+ 607 608 TEMPLATE_VBoxBS3KitImg_CDEFS = ARCH_BITS=16 RT_ARCH_X86 608 609 -
trunk/src/VBox/ValidationKit/bootsectors/Makefile.kmk
r65971 r66446 323 323 bs3-cpu-generated-1.c \ 324 324 bs3-cpu-generated-1-asm.asm \ 325 bs3kit/bs3-cmn-instantiate .c16 \325 bs3kit/bs3-cmn-instantiate-x0.c16 \ 326 326 bs3kit/bs3-cmn-instantiate.c32 \ 327 327 bs3kit/bs3-cmn-instantiate.c64 \ … … 330 330 331 331 bs3-cpu-generated-1-template.o:: \ 332 $$(bs3-cpu-generated-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate .o16 \332 $$(bs3-cpu-generated-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate-x0.o16 \ 333 333 $$(bs3-cpu-generated-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o32 \ 334 334 $$(bs3-cpu-generated-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o64 \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66422 r66446 1044 1044 * @param enmXcptType The type to check. 1045 1045 */ 1046 static bool B s3Cg1XcptTypeIsUnaligned(BS3CG1XCPTTYPE enmXcptType)1046 static bool BS3_NEAR_CODE Bs3Cg1XcptTypeIsUnaligned(BS3CG1XCPTTYPE enmXcptType) 1047 1047 { 1048 1048 switch (enmXcptType) … … 1067 1067 * @param uVexR The VEX.R value (caller inverted it already). 1068 1068 */ 1069 DECLINLINE(unsigned) Bs3Cg1InsertVex2bPrefix(PBS3CG1STATE pThis, unsigned offDst, uint8_t uVexV, uint8_t uVexL, uint8_t uVexR) 1069 DECLINLINE(unsigned) BS3_NEAR_CODE Bs3Cg1InsertVex2bPrefix(PBS3CG1STATE pThis, unsigned offDst, 1070 uint8_t uVexV, uint8_t uVexL, uint8_t uVexR) 1070 1071 { 1071 1072 uint8_t b = uVexR << 7; … … 1102 1103 * @param uVexR The VEX.W value (straight). 1103 1104 */ 1104 DECLINLINE(unsigned) B s3Cg1InsertVex3bPrefix(PBS3CG1STATE pThis, unsigned offDst, uint8_t uVexV, uint8_t uVexL,1105 uint8_t uVexR, uint8_t uVexX, uint8_t uVexB, uint8_t uVexW)1105 DECLINLINE(unsigned) BS3_NEAR_CODE Bs3Cg1InsertVex3bPrefix(PBS3CG1STATE pThis, unsigned offDst, uint8_t uVexV, uint8_t uVexL, 1106 uint8_t uVexR, uint8_t uVexX, uint8_t uVexB, uint8_t uVexW) 1106 1107 { 1107 1108 uint8_t b1; … … 1121 1122 case BS3CG1PFXKIND_REQ_F2: b2 |= 3; break; 1122 1123 default: 1123 Bs3TestFailedF("enmPrefixKind=%d not supported for VEX!\n" );1124 Bs3TestFailedF("enmPrefixKind=%d not supported for VEX!\n", pThis->enmPrefixKind); 1124 1125 break; 1125 1126 } … … 1132 1133 1133 1134 1134 DECLINLINE(unsigned) B s3Cg1InsertReqPrefix(PBS3CG1STATE pThis, unsigned offDst)1135 DECLINLINE(unsigned) BS3_NEAR_CODE Bs3Cg1InsertReqPrefix(PBS3CG1STATE pThis, unsigned offDst) 1135 1136 { 1136 1137 switch (pThis->enmPrefixKind) … … 1152 1153 1153 1154 1154 DECLINLINE(unsigned) B s3Cg1InsertOpcodes(PBS3CG1STATE pThis, unsigned offDst)1155 DECLINLINE(unsigned) BS3_NEAR_CODE Bs3Cg1InsertOpcodes(PBS3CG1STATE pThis, unsigned offDst) 1155 1156 { 1156 1157 switch (pThis->cbOpcodes) … … 1174 1175 * @param pThis The state. 1175 1176 */ 1176 static void B s3Cg1EncodeCleanup(PBS3CG1STATE pThis)1177 static void BS3_NEAR_CODE Bs3Cg1EncodeCleanup(PBS3CG1STATE pThis) 1177 1178 { 1178 1179 /* Restore the DS registers in the contexts. */ … … 1190 1191 1191 1192 1192 static unsigned B s3Cfg1EncodeMemMod0Disp(PBS3CG1STATE pThis, bool fAddrOverride, unsigned off, uint8_t iReg,1193 uint8_t cbOp, uint8_t cbMissalign, BS3CG1OPLOC enmLocation)1193 static unsigned BS3_NEAR_CODE Bs3Cfg1EncodeMemMod0Disp(PBS3CG1STATE pThis, bool fAddrOverride, unsigned off, uint8_t iReg, 1194 uint8_t cbOp, uint8_t cbMissalign, BS3CG1OPLOC enmLocation) 1194 1195 { 1195 1196 pThis->aOperands[pThis->iRmOp].idxField = BS3CG1DST_INVALID; … … 1255 1256 case 0: break; 1256 1257 default: 1258 { 1259 BS3CG1_DPRINTF(("Bs3MemSet(%p,%#x,%#x)\n", &pThis->pbDataPg[X86_PAGE_SIZE - cbOp - cbMissalign], 0xcc, cbOp - cbMissalign)); 1260 ASMHalt(); 1257 1261 Bs3MemSet(&pThis->pbDataPg[X86_PAGE_SIZE - cbOp - cbMissalign], 0xcc, cbOp - cbMissalign); 1258 1262 break; 1263 } 1259 1264 } 1260 1265 … … 1263 1268 1264 1269 1265 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Eb_Gb(PBS3CG1STATE pThis, unsigned iEncoding)1270 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Eb_Gb(PBS3CG1STATE pThis, unsigned iEncoding) 1266 1271 { 1267 1272 unsigned off; … … 1294 1299 1295 1300 1296 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Gb_Eb(PBS3CG1STATE pThis, unsigned iEncoding)1301 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Gb_Eb(PBS3CG1STATE pThis, unsigned iEncoding) 1297 1302 { 1298 1303 unsigned off; … … 1325 1330 1326 1331 1327 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Gv_Ev__OR__BS3CG1ENC_MODRM_Ev_Gv(PBS3CG1STATE pThis, unsigned iEncoding)1332 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Gv_Ev__OR__BS3CG1ENC_MODRM_Ev_Gv(PBS3CG1STATE pThis, unsigned iEncoding) 1328 1333 { 1329 1334 unsigned off; … … 1404 1409 1405 1410 1406 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Wss_Vss(PBS3CG1STATE pThis, unsigned iEncoding)1411 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Wss_Vss(PBS3CG1STATE pThis, unsigned iEncoding) 1407 1412 { 1408 1413 unsigned off; … … 1433 1438 1434 1439 1435 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Wsd_Vsd(PBS3CG1STATE pThis, unsigned iEncoding)1440 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Wsd_Vsd(PBS3CG1STATE pThis, unsigned iEncoding) 1436 1441 { 1437 1442 unsigned off; … … 1462 1467 1463 1468 1464 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Wps_Vps__OR__BS3CG1ENC_MODRM_Wpd_Vpd(PBS3CG1STATE pThis, unsigned iEncoding)1469 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Wps_Vps__OR__BS3CG1ENC_MODRM_Wpd_Vpd(PBS3CG1STATE pThis, unsigned iEncoding) 1465 1470 { 1466 1471 unsigned off; … … 1493 1498 1494 1499 1495 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_WqZxReg_Vq(PBS3CG1STATE pThis, unsigned iEncoding)1500 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_WqZxReg_Vq(PBS3CG1STATE pThis, unsigned iEncoding) 1496 1501 { 1497 1502 unsigned off; … … 1522 1527 1523 1528 1524 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Vq_UqHi(PBS3CG1STATE pThis, unsigned iEncoding)1529 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Vq_UqHi(PBS3CG1STATE pThis, unsigned iEncoding) 1525 1530 { 1526 1531 unsigned off; … … 1546 1551 1547 1552 1548 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Vq_Mq(PBS3CG1STATE pThis, unsigned iEncoding)1553 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Vq_Mq(PBS3CG1STATE pThis, unsigned iEncoding) 1549 1554 { 1550 1555 unsigned off; … … 1568 1573 1569 1574 1570 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Vdq_Wdq(PBS3CG1STATE pThis, unsigned iEncoding)1575 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Vdq_Wdq(PBS3CG1STATE pThis, unsigned iEncoding) 1571 1576 { 1572 1577 unsigned off; … … 1599 1604 1600 1605 1601 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_Gv_Ma(PBS3CG1STATE pThis, unsigned iEncoding)1606 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_Gv_Ma(PBS3CG1STATE pThis, unsigned iEncoding) 1602 1607 { 1603 1608 unsigned off; … … 1642 1647 1643 1648 1644 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_MbRO(PBS3CG1STATE pThis, unsigned iEncoding)1649 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_MbRO(PBS3CG1STATE pThis, unsigned iEncoding) 1645 1650 { 1646 1651 unsigned off; … … 1659 1664 1660 1665 1661 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_MdRO(PBS3CG1STATE pThis, unsigned iEncoding)1666 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_MdRO(PBS3CG1STATE pThis, unsigned iEncoding) 1662 1667 { 1663 1668 unsigned off; … … 1676 1681 1677 1682 1678 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_MdWO(PBS3CG1STATE pThis, unsigned iEncoding)1683 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_MdWO(PBS3CG1STATE pThis, unsigned iEncoding) 1679 1684 { 1680 1685 unsigned off; … … 1693 1698 1694 1699 1695 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_VEX_MODRM_MdWO(PBS3CG1STATE pThis, unsigned iEncoding)1700 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_VEX_MODRM_MdWO(PBS3CG1STATE pThis, unsigned iEncoding) 1696 1701 { 1697 1702 unsigned off; … … 1793 1798 1794 1799 1795 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_FIXED(PBS3CG1STATE pThis, unsigned iEncoding)1800 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_FIXED(PBS3CG1STATE pThis, unsigned iEncoding) 1796 1801 { 1797 1802 unsigned off; … … 1808 1813 1809 1814 1810 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_FIXED_AL_Ib(PBS3CG1STATE pThis, unsigned iEncoding)1815 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_FIXED_AL_Ib(PBS3CG1STATE pThis, unsigned iEncoding) 1811 1816 { 1812 1817 unsigned off; … … 1824 1829 1825 1830 1826 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_FIXED_rAX_Iz(PBS3CG1STATE pThis, unsigned iEncoding)1831 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_FIXED_rAX_Iz(PBS3CG1STATE pThis, unsigned iEncoding) 1827 1832 { 1828 1833 unsigned off; … … 1889 1894 1890 1895 1891 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_MOD_EQ_3(PBS3CG1STATE pThis, unsigned iEncoding)1896 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_MOD_EQ_3(PBS3CG1STATE pThis, unsigned iEncoding) 1892 1897 { 1893 1898 unsigned off; … … 1912 1917 1913 1918 1914 static unsigned B s3Cg1EncodeNext_BS3CG1ENC_MODRM_MOD_NE_3(PBS3CG1STATE pThis, unsigned iEncoding)1919 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_BS3CG1ENC_MODRM_MOD_NE_3(PBS3CG1STATE pThis, unsigned iEncoding) 1915 1920 { 1916 1921 unsigned off; … … 1949 1954 * internal. 1950 1955 */ 1951 static unsigned B s3Cg1EncodeNext(PBS3CG1STATE pThis, unsigned iEncoding)1956 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext(PBS3CG1STATE pThis, unsigned iEncoding) 1952 1957 { 1953 1958 pThis->bAlignmentXcpt = UINT8_MAX; … … 2024 2029 * @param pThis The state. 2025 2030 */ 2026 static bool Bs3Cg1EncodePrep(PBS3CG1STATE pThis) 2031 #define Bs3Cg1EncodePrep BS3_CMN_NM(Bs3Cg1EncodePrep) 2032 bool BS3_NEAR_CODE Bs3Cg1EncodePrep(PBS3CG1STATE pThis) 2027 2033 { 2028 2034 unsigned iRing = 4; … … 2189 2195 2190 2196 default: 2191 return Bs3TestFailedF("Invalid/unimplemented enmEncoding for instruction #%RU32 (%.*s): %d", 2192 pThis->iInstr, pThis->cchMnemonic, pThis->pchMnemonic, pThis->enmEncoding); 2197 ASMHalt(); 2198 Bs3TestFailedF("Invalid/unimplemented enmEncoding for instruction #%RU32 (%.*s): %d", 2199 pThis->iInstr, pThis->cchMnemonic, pThis->pchMnemonic, pThis->enmEncoding); 2200 return false; 2193 2201 } 2194 2202 return true; … … 2203 2211 * @param pThis The state. 2204 2212 */ 2205 static bool B s3Cg3SetupSseAndAvx(PBS3CG1STATE pThis)2213 static bool BS3_NEAR_CODE Bs3Cg3SetupSseAndAvx(PBS3CG1STATE pThis) 2206 2214 { 2207 2215 if (!pThis->fWorkExtCtx) … … 2254 2262 * input to avoid unnecessary CPUID work. 2255 2263 */ 2256 static bool B s3Cg1CpuSetupNext(PBS3CG1STATE pThis, unsigned iCpuSetup, bool BS3_FAR *pfInvalidInstr)2264 static bool BS3_NEAR_CODE Bs3Cg1CpuSetupNext(PBS3CG1STATE pThis, unsigned iCpuSetup, bool BS3_FAR *pfInvalidInstr) 2257 2265 { 2258 2266 if ( (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT) … … 2301 2309 * @param pThis The state. 2302 2310 */ 2303 static bool B s3Cg1CpuSetupFirst(PBS3CG1STATE pThis)2311 static bool BS3_NEAR_CODE Bs3Cg1CpuSetupFirst(PBS3CG1STATE pThis) 2304 2312 { 2305 2313 uint32_t fEax; … … 2420 2428 * @param pHdr The test header. 2421 2429 */ 2422 static bool B s3Cg1RunSelector(PBS3CG1STATE pThis, PCBS3CG1TESTHDR pHdr)2430 static bool BS3_NEAR_CODE Bs3Cg1RunSelector(PBS3CG1STATE pThis, PCBS3CG1TESTHDR pHdr) 2423 2431 { 2424 2432 … … 2474 2482 * @param bOpcode The context modifier program opcode. 2475 2483 */ 2476 static const char BS3_FAR * Bs3Cg1CtxOpToString(uint8_t bOpcode)2484 static const char BS3_FAR * BS3_NEAR_CODE Bs3Cg1CtxOpToString(uint8_t bOpcode) 2477 2485 { 2478 2486 switch (bOpcode & BS3CG1_CTXOP_OPERATOR_MASK) … … 2503 2511 * NULL for output contexts. 2504 2512 */ 2505 static bool Bs3Cg1RunContextModifier(PBS3CG1STATE pThis, PBS3REGCTX pCtx, PCBS3CG1TESTHDR pHdr, unsigned off, unsigned cb, 2506 PCBS3REGCTX pEflCtx, uint8_t BS3_FAR *pbInstr) 2513 static bool BS3_NEAR_CODE Bs3Cg1RunContextModifier(PBS3CG1STATE pThis, PBS3REGCTX pCtx, PCBS3CG1TESTHDR pHdr, 2514 unsigned off, unsigned cb, 2515 PCBS3REGCTX pEflCtx, uint8_t BS3_FAR *pbInstr) 2507 2516 { 2508 2517 uint8_t const BS3_FAR *pbCode = (uint8_t const BS3_FAR *)(pHdr + 1) + off; … … 2898 2907 * @param iEncoding For error reporting. 2899 2908 */ 2900 static bool B s3Cg1CheckResult(PBS3CG1STATE pThis, uint8_t bTestXcptExpected, unsigned iEncoding)2909 static bool BS3_NEAR_CODE Bs3Cg1CheckResult(PBS3CG1STATE pThis, uint8_t bTestXcptExpected, unsigned iEncoding) 2901 2910 { 2902 2911 unsigned iOperand; … … 3153 3162 * @param pThis The state. 3154 3163 */ 3155 static void B s3Cg1Destroy(PBS3CG1STATE pThis)3164 static void BS3_NEAR_CODE Bs3Cg1Destroy(PBS3CG1STATE pThis) 3156 3165 { 3157 3166 if (BS3_MODE_IS_PAGED(pThis->bMode)) … … 3186 3195 * @param bMode The mode being tested. 3187 3196 */ 3188 bool BS3_ CMN_NM(Bs3Cg1Init)(PBS3CG1STATE pThis, uint8_t bMode)3197 bool BS3_NEAR_CODE BS3_CMN_NM(Bs3Cg1Init)(PBS3CG1STATE pThis, uint8_t bMode) 3189 3198 { 3190 3199 BS3MEMKIND const enmMemKind = BS3_MODE_IS_RM_OR_V86(bMode) ? BS3MEMKIND_REAL … … 3294 3303 } 3295 3304 #endif 3305 BS3CG1_DPRINTF(("pbDataPg=%p %04x:%04x pbCodePg=%p %04x:%04x\n", 3306 pThis->pbDataPg, pThis->DataPgFar.sel, pThis->DataPgFar.off, 3307 pThis->pbCodePg, pThis->CodePgFar.sel, pThis->CodePgFar.off)); 3296 3308 3297 3309 /* … … 3407 3419 3408 3420 3409 static uint8_t BS3_ CMN_NM(Bs3Cg1WorkerInner)(PBS3CG1STATE pThis)3421 static uint8_t BS3_NEAR_CODE BS3_CMN_NM(Bs3Cg1WorkerInner)(PBS3CG1STATE pThis) 3410 3422 { 3411 3423 uint8_t iRing; … … 3445 3457 switch (pThis->cOperands) 3446 3458 { 3447 case 3: pThis->aenmOperands[3] = (BS3CG1OP)pThis->pabOperands[3];3448 case 2: pThis->aenmOperands[2] = (BS3CG1OP)pThis->pabOperands[2];3449 case 1: pThis->aenmOperands[1] = (BS3CG1OP)pThis->pabOperands[1];3450 case 0: pThis->aenmOperands[0] = (BS3CG1OP)pThis->pabOperands[0];3459 case 4: pThis->aenmOperands[3] = (BS3CG1OP)pThis->pabOperands[3]; 3460 case 3: pThis->aenmOperands[2] = (BS3CG1OP)pThis->pabOperands[2]; 3461 case 2: pThis->aenmOperands[1] = (BS3CG1OP)pThis->pabOperands[1]; 3462 case 1: pThis->aenmOperands[0] = (BS3CG1OP)pThis->pabOperands[0]; 3451 3463 } 3452 3464 3453 3465 switch (pThis->cbOpcodes) 3454 3466 { 3455 case 3: pThis->abOpcodes[3] = pThis->pabOpcodes[3];3456 case 2: pThis->abOpcodes[2] = pThis->pabOpcodes[2];3457 case 1: pThis->abOpcodes[1] = pThis->pabOpcodes[1];3458 case 0: pThis->abOpcodes[0] = pThis->pabOpcodes[0];3467 case 4: pThis->abOpcodes[3] = pThis->pabOpcodes[3]; 3468 case 3: pThis->abOpcodes[2] = pThis->pabOpcodes[2]; 3469 case 2: pThis->abOpcodes[1] = pThis->pabOpcodes[1]; 3470 case 1: pThis->abOpcodes[0] = pThis->pabOpcodes[0]; 3459 3471 } 3460 3472 … … 3599 3611 #if 0 3600 3612 /* (for debugging) */ 3601 if (bMode < BS3_MODE_PE32)3613 if (bMode >= BS3_MODE_PE16) 3602 3614 return BS3TESTDOMODE_SKIPPED; 3603 3615 #endif -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r66334 r66446 239 239 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMMemFirstMismatchingU8,8) 240 240 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMMemFirstNonZero,6) 241 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMCpuIdExSlow,32) 242 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMCpuId,20) 243 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMSetXcr0,8) 244 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMGetXcr0,0) 241 245 -include $(PATH_SUB_CURRENT)/bs3kit-autostubs.kmk # manually generated from headers, see bottom of this file. 242 246 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/VBoxBs3ObjConverter.cpp
r65928 r66446 71 71 /** Verbosity level. */ 72 72 static unsigned g_cVerbose = 0; 73 /** Indicates that it's output from the 16-bit watcom C or C++ compiler. 74 * We will do some massaging for fixup records when this is used. */ 75 static bool g_f16BitWatcomC = false; 73 76 74 77 … … 629 632 630 633 631 static bool omfWriter_SegDef(POMFWRITER pThis, uint8_t bSegAttr, uint32_t cbSeg, uint16_t idxSegName, uint16_t idxSegClass) 634 static bool omfWriter_SegDef(POMFWRITER pThis, uint8_t bSegAttr, uint32_t cbSeg, uint16_t idxSegName, uint16_t idxSegClass, 635 uint16_t idxOverlay = 1 /* NULL entry */) 632 636 { 633 637 return omfWriter_RecBegin(pThis, OMF_SEGDEF32) … … 636 640 && omfWriter_RecAddIdx(pThis, idxSegName) 637 641 && omfWriter_RecAddIdx(pThis, idxSegClass) 638 && omfWriter_RecAddIdx(pThis, 1) /* overlay name index = NULL entry */ 642 && omfWriter_RecAddIdx(pThis, idxOverlay) 643 && omfWriter_RecEndWithCrc(pThis); 644 } 645 646 static bool omfWriter_SegDef16(POMFWRITER pThis, uint8_t bSegAttr, uint32_t cbSeg, uint16_t idxSegName, uint16_t idxSegClass, 647 uint16_t idxOverlay = 1 /* NULL entry */) 648 { 649 Assert(cbSeg <= UINT16_MAX); 650 return omfWriter_RecBegin(pThis, OMF_SEGDEF16) 651 && omfWriter_RecAddU8(pThis, bSegAttr) 652 && omfWriter_RecAddU16(pThis, cbSeg) 653 && omfWriter_RecAddIdx(pThis, idxSegName) 654 && omfWriter_RecAddIdx(pThis, idxSegClass) 655 && omfWriter_RecAddIdx(pThis, idxOverlay) 639 656 && omfWriter_RecEndWithCrc(pThis); 640 657 } … … 3701 3718 const char *pchOverlay; 3702 3719 bool fUse32; 3720 bool f32bitRec; 3703 3721 } OMFSEGDEF; 3704 3722 typedef OMFSEGDEF *POMFSEGDEF; … … 3713 3731 uint8_t cchName; 3714 3732 uint16_t cSegDefs; 3715 uint16_t *p idxSegDefs;3733 uint16_t *paidxSegDefs; 3716 3734 } OMFGRPDEF; 3717 3735 typedef OMFGRPDEF *POMFGRPDEF; … … 3762 3780 3763 3781 /** 3782 * OMF details allocation that needs to be freed when done. 3783 */ 3784 typedef struct OMFDETAILSALLOC 3785 { 3786 /** Pointer to the next allocation. */ 3787 struct OMFDETAILSALLOC *pNext; 3788 /** The allocated bytes. */ 3789 uint8_t abData[RT_FLEXIBLE_ARRAY]; 3790 } OMFDETAILSALLOC; 3791 typedef OMFDETAILSALLOC *POMFDETAILSALLOC; 3792 3793 /** 3764 3794 * OMF conversion details. 3765 3795 * … … 3768 3798 typedef struct OMFDETAILS 3769 3799 { 3800 /** The input file name. */ 3801 const char *pszFile; 3802 3770 3803 /** Set if it has line numbers. */ 3771 3804 bool fLineNumbers; … … 3804 3837 /** The secondary class name. */ 3805 3838 const char *pszClass2; 3839 /** The main segment name, NULL if not applicable (CGROUP16). */ 3840 const char *pszSeg; 3806 3841 /** The name length. */ 3807 3842 uint8_t cchName; … … 3836 3871 /** Segment line numbers, indexed by segment number. */ 3837 3872 POMFSEGLINES paSegLines; 3873 3874 /** List of allocations that needs freeing. */ 3875 POMFDETAILSALLOC pAllocHead; 3838 3876 } OMFDETAILS; 3839 3877 typedef OMFDETAILS *POMFDETAILS; … … 3872 3910 } while (0) 3873 3911 3912 #define OMF_EXPLODE_LNAME(a_pOmfStuff, a_idxName, a_pchName, a_cchName, a_Name) \ 3913 do { \ 3914 if ((a_idxName) < (a_pOmfStuff)->cLNames) \ 3915 { \ 3916 a_cchName = (uint8_t)*(a_pOmfStuff)->papchLNames[(a_idxName)]; \ 3917 a_pchName = (a_pOmfStuff)->papchLNames[(a_idxName)] + 1; \ 3918 } \ 3919 else return error((a_pOmfStuff)->pszFile, "Invalid LNAME reference %#x in " #a_Name "!\n", a_idxName); \ 3920 } while (0) 3921 3922 3923 /** 3924 * Allocates memory that will be freed when we're done converting. 3925 * 3926 * @returns Pointer tot he memory. 3927 * @param pOmfStuff The OMF details data. 3928 * @param cbNeeded The amount of memory required. 3929 */ 3930 static void *omfDetails_Alloc(POMFDETAILS pOmfStuff, size_t cbNeeded) 3931 { 3932 POMFDETAILSALLOC pAlloc = (POMFDETAILSALLOC)malloc(RT_OFFSETOF(OMFDETAILSALLOC, abData[cbNeeded])); 3933 if (pAlloc) 3934 { 3935 pAlloc->pNext = pOmfStuff->pAllocHead; 3936 pOmfStuff->pAllocHead = pAlloc; 3937 return &pAlloc->abData[0]; 3938 } 3939 return NULL; 3940 } 3874 3941 3875 3942 /** … … 4074 4141 4075 4142 memset(pOmfStuff, 0, sizeof(*pOmfStuff)); 4143 pOmfStuff->pszFile = pszFile; 4076 4144 pOmfStuff->iDebSymNm = UINT16_MAX; 4077 4145 pOmfStuff->iSymbolsNm = UINT16_MAX; … … 4090 4158 4091 4159 /* Groups we seek. */ 4092 #define OMF_INIT_WANTED_GROUP(a_idx, a_szName, a_szClass1, a_szClass2, a_ idxReplace) \4160 #define OMF_INIT_WANTED_GROUP(a_idx, a_szName, a_szClass1, a_szClass2, a_pszSeg, a_idxReplace) \ 4093 4161 pOmfStuff->aGroups[a_idx].pszName = a_szName; \ 4094 4162 pOmfStuff->aGroups[a_idx].cchName = sizeof(a_szName) - 1; \ … … 4097 4165 pOmfStuff->aGroups[a_idx].pszClass2 = a_szClass2; \ 4098 4166 pOmfStuff->aGroups[a_idx].cchClass2 = sizeof(a_szClass2) - 1; \ 4167 pOmfStuff->aGroups[a_idx].pszSeg = a_pszSeg; \ 4099 4168 pOmfStuff->aGroups[a_idx].fNeeded = false; \ 4100 4169 pOmfStuff->aGroups[a_idx].idxGroup = UINT16_MAX; \ 4101 4170 pOmfStuff->aGroups[a_idx].idxName = UINT16_MAX; \ 4102 4171 pOmfStuff->aGroups[a_idx].idxReplaceGrp = a_idxReplace 4103 OMF_INIT_WANTED_GROUP(0, "CGROUP16", "BS3CLASS16CODE", "CODE", OMF_REPLACE_GRP_CGROUP16);4104 OMF_INIT_WANTED_GROUP(1, "BS3GROUPRMTEXT16", "BS3CLASS16RMCODE", "", OMF_REPLACE_GRP_RMCODE);4105 OMF_INIT_WANTED_GROUP(2, "BS3GROUPX0TEXT16", "BS3CLASS16X0CODE", "", OMF_REPLACE_GRP_X0CODE);4106 OMF_INIT_WANTED_GROUP(3, "BS3GROUPX1TEXT16", "BS3CLASS16X1CODE", "", OMF_REPLACE_GRP_X1CODE);4172 OMF_INIT_WANTED_GROUP(0, "CGROUP16", "BS3CLASS16CODE", "CODE", NULL, OMF_REPLACE_GRP_CGROUP16); 4173 OMF_INIT_WANTED_GROUP(1, "BS3GROUPRMTEXT16", "BS3CLASS16RMCODE", "", "BS3RMTEXT16", OMF_REPLACE_GRP_RMCODE); 4174 OMF_INIT_WANTED_GROUP(2, "BS3GROUPX0TEXT16", "BS3CLASS16X0CODE", "", "BS3X0TEXT16", OMF_REPLACE_GRP_X0CODE); 4175 OMF_INIT_WANTED_GROUP(3, "BS3GROUPX1TEXT16", "BS3CLASS16X1CODE", "", "BS3X1TEXT16", OMF_REPLACE_GRP_X1CODE); 4107 4176 4108 4177 /* … … 4143 4212 a_u32 = RT_MAKE_U32_FROM_U8(pbRec[offRec], pbRec[offRec + 1], pbRec[offRec + 2], pbRec[offRec + 3]); \ 4144 4213 offRec += 4; \ 4145 } while (0)4146 #define OMF_EXPLODE_LNAME(a_idxName, a_pchName, a_cchName, a_Name) \4147 do { \4148 if ((a_idxName) < pOmfStuff->cLNames) \4149 { \4150 a_cchName = (uint8_t)*pOmfStuff->papchLNames[(a_idxName)]; \4151 a_pchName = pOmfStuff->papchLNames[(a_idxName)] + 1; \4152 } \4153 else return error(pszFile, "Invalid LNAME reference %#x in " #a_Name "!\n", a_idxName); \4154 4214 } while (0) 4155 4215 … … 4308 4368 4309 4369 OMF_CHECK_RET(1 + (bRecType == OMF_SEGDEF16 ? 2 : 4) + 1 + 1 + 1, SEGDEF); 4310 pSegDef->bSegAttr = pbRec[offRec++]; 4311 pSegDef->fUse32 = pSegDef->bSegAttr & 1; 4370 pSegDef->f32bitRec = bRecType == OMF_SEGDEF32; 4371 pSegDef->bSegAttr = pbRec[offRec++]; 4372 pSegDef->fUse32 = pSegDef->bSegAttr & 1; 4312 4373 if ((pSegDef->bSegAttr >> 5) == 0) 4313 4374 { … … 4323 4384 OMF_READ_IDX(pSegDef->idxClass, SEGDEF); 4324 4385 OMF_READ_IDX(pSegDef->idxOverlay, SEGDEF); 4325 OMF_EXPLODE_LNAME(p SegDef->idxName, pSegDef->pchName, pSegDef->cchName, SEGDEF);4326 OMF_EXPLODE_LNAME(p SegDef->idxClass, pSegDef->pchClass, pSegDef->cchClass, SEGDEF);4327 OMF_EXPLODE_LNAME(p SegDef->idxOverlay, pSegDef->pchOverlay, pSegDef->cchOverlay, SEGDEF);4386 OMF_EXPLODE_LNAME(pOmfStuff, pSegDef->idxName, pSegDef->pchName, pSegDef->cchName, SEGDEF); 4387 OMF_EXPLODE_LNAME(pOmfStuff, pSegDef->idxClass, pSegDef->pchClass, pSegDef->cchClass, SEGDEF); 4388 OMF_EXPLODE_LNAME(pOmfStuff, pSegDef->idxOverlay, pSegDef->pchOverlay, pSegDef->cchOverlay, SEGDEF); 4328 4389 break; 4329 4390 } 4330 4391 4331 4392 /* 4332 * Must count segment definitions to figure the index of our segment.4393 * Must count segment definitions to figure the index of our group. 4333 4394 */ 4334 4395 case OMF_GRPDEF: … … 4338 4399 4339 4400 OMF_READ_IDX(pGrpDef->idxName, GRPDEF); 4340 OMF_EXPLODE_LNAME(p GrpDef->idxName, pGrpDef->pchName, pGrpDef->cchName, GRPDEF);4401 OMF_EXPLODE_LNAME(pOmfStuff, pGrpDef->idxName, pGrpDef->pchName, pGrpDef->cchName, GRPDEF); 4341 4402 4342 4403 unsigned j = RT_ELEMENTS(pOmfStuff->aGroups); … … 4349 4410 4350 4411 pGrpDef->cSegDefs = 0; 4351 pGrpDef->p idxSegDefs = NULL;4352 while (offRec + 2 + 1 < cbRec)4412 pGrpDef->paidxSegDefs = NULL; 4413 while (offRec + 2 + 1 <= cbRec) 4353 4414 { 4354 4415 if (pbRec[offRec] != 0xff) 4355 4416 return error(pszFile, "Unsupported GRPDEF member type: %#x\n", pbRec[offRec]); 4356 4417 offRec++; 4357 OMF_GROW_TABLE_RET_ERR(uint16_t, pGrpDef->p idxSegDefs, pGrpDef->cSegDefs, 16);4358 OMF_READ_IDX(pGrpDef->p idxSegDefs[pGrpDef->cSegDefs], GRPDEF);4418 OMF_GROW_TABLE_RET_ERR(uint16_t, pGrpDef->paidxSegDefs, pGrpDef->cSegDefs, 16); 4419 OMF_READ_IDX(pGrpDef->paidxSegDefs[pGrpDef->cSegDefs], GRPDEF); 4359 4420 pGrpDef->cSegDefs++; 4360 4421 } … … 4445 4506 4446 4507 /** 4447 * Writes the debug segment definitions (names too).4508 * Adds a LNAMES entry (returns existing). 4448 4509 * 4449 4510 * @returns success indicator. 4450 * @param pThis The OMF writer. 4511 * @param pOmfStuff The OMF stuff. 4512 * @param pszName The name to add. 4513 * @param pidxName Where to return the name index. 4514 */ 4515 static bool omfDetails_AddLName(POMFDETAILS pOmfStuff, const char *pszName, uint16_t *pidxName) 4516 { 4517 size_t const cchName = strlen(pszName); 4518 4519 /* 4520 * Check if we've already got the name. 4521 */ 4522 for (unsigned iName = 1; iName < pOmfStuff->cLNames; iName++) 4523 if ( pOmfStuff->papchLNames[iName][0] == cchName 4524 && memcmp(pOmfStuff->papchLNames[iName] + 1, pszName, cchName) == 0) 4525 { 4526 *pidxName = iName; 4527 return true; 4528 } 4529 4530 /* 4531 * Not found, append it. 4532 */ 4533 char *pszCopy = (char *)omfDetails_Alloc(pOmfStuff, cchName + 2); 4534 if (!pszCopy) 4535 return false; 4536 *(unsigned char *)&pszCopy[0] = (unsigned char)cchName; 4537 memcpy(pszCopy + 1, pszName, cchName + 1); 4538 4539 OMF_GROW_TABLE_RET_ERR(char *, pOmfStuff->papchLNames, pOmfStuff->cLNames, 16); 4540 pOmfStuff->papchLNames[pOmfStuff->cLNames] = (char *)pszCopy; 4541 *pidxName = pOmfStuff->cLNames; 4542 pOmfStuff->cLNames++; 4543 return true; 4544 } 4545 4546 4547 /** 4548 * Adds a SEGDEF (always adds a new one). 4549 * 4550 * @returns success indicator. 4551 * @param pOmfStuff The OMF stuff. 4552 * @param bSegAttr The OMF segment attributes. 4553 * @param cbSeg The segment size. 4554 * @param idxSegName The LNAMES index of the segment name. 4555 * @param idxSegClas The LNAMES index of the segment class. 4556 * @param idxOverlay The LNAMES index of the overlay name; pass 1. 4557 * @param fRec32 Set if SEGDEF32 should be emitted, clear for SEGDEF16. 4558 * @param pidxSeg Where to return the segment index. 4559 */ 4560 static bool omfDetails_AddSegDef(POMFDETAILS pOmfStuff, uint8_t bSegAttr, uint32_t cbSeg, uint16_t idxSegName, 4561 uint16_t idxSegClass, uint16_t idxOverlay, bool fRec32, uint16_t *pidxSeg) 4562 { 4563 Assert(cbSeg <= UINT16_MAX || fRec32); 4564 Assert(idxSegName < pOmfStuff->cLNames); 4565 Assert(idxSegClass < pOmfStuff->cLNames); 4566 4567 OMF_GROW_TABLE_RET_ERR(OMFSEGDEF, pOmfStuff->paSegDefs, pOmfStuff->cSegDefs, 16); 4568 POMFSEGDEF pSegDef = &pOmfStuff->paSegDefs[pOmfStuff->cSegDefs]; 4569 4570 pSegDef->bSegAttr = bSegAttr; 4571 pSegDef->fUse32 = bSegAttr & 1; 4572 pSegDef->f32bitRec = fRec32; 4573 pSegDef->cbSeg = cbSeg; 4574 pSegDef->idxName = idxSegName; 4575 pSegDef->idxClass = idxSegClass; 4576 pSegDef->idxOverlay = idxOverlay; 4577 4578 OMF_EXPLODE_LNAME(pOmfStuff, pSegDef->idxName, pSegDef->pchName, pSegDef->cchName, SEGDEF); 4579 OMF_EXPLODE_LNAME(pOmfStuff, pSegDef->idxClass, pSegDef->pchClass, pSegDef->cchClass, SEGDEF); 4580 OMF_EXPLODE_LNAME(pOmfStuff, pSegDef->idxOverlay, pSegDef->pchOverlay, pSegDef->cchOverlay, SEGDEF); 4581 4582 *pidxSeg = pOmfStuff->cSegDefs; 4583 pOmfStuff->cSegDefs++; 4584 return true; 4585 } 4586 4587 4588 /** 4589 * Adds a SEGDEF if not found. 4590 * 4591 * @returns success indicator. 4592 * @param pOmfStuff The OMF stuff. 4593 * @param bSegAttr The OMF segment attributes. 4594 * @param cbSeg The segment size. 4595 * @param idxSegName The LNAMES index of the segment name. 4596 * @param idxSegClas The LNAMES index of the segment class. 4597 * @param idxOverlay The LNAMES index of the overlay name; pass 1. 4598 * @param fRec32 Set if SEGDEF32 should be emitted, clear for SEGDEF16. 4599 * @param pidxSeg Where to return the segment index. 4600 */ 4601 static bool omfDetails_AddSegDefIfNeeded(POMFDETAILS pOmfStuff, uint8_t bSegAttr, uint32_t cbSeg, uint16_t idxSegName, 4602 uint16_t idxSegClass, uint16_t idxOverlay, bool fRec32, uint16_t *pidxSeg) 4603 { 4604 /* Search for name */ 4605 for (unsigned iSegDef = 1; iSegDef < pOmfStuff->cSegDefs; iSegDef++) 4606 { 4607 POMFSEGDEF pSegDef = &pOmfStuff->paSegDefs[iSegDef]; 4608 if (pSegDef->idxName == idxSegName) 4609 { 4610 if ( pSegDef->bSegAttr != bSegAttr 4611 || pSegDef->f32bitRec != fRec32 4612 || pSegDef->idxName != idxSegName 4613 || pSegDef->idxClass != idxSegClass 4614 || pSegDef->idxOverlay != idxOverlay) 4615 return error(pOmfStuff->pszFile, 4616 "Existing SEGDEF differs: bSegAttr=%#x vs %#x, f32bitRec=%d vs %d, idxName=%#x vs %#x, idxClass=%#x vs %#x, idxOverlay=%#x vs %#x\n", 4617 pSegDef->bSegAttr, bSegAttr, 4618 pSegDef->f32bitRec, fRec32, 4619 pSegDef->idxName, idxSegName, 4620 pSegDef->idxClass, idxSegClass, 4621 pSegDef->idxOverlay, idxOverlay); 4622 *pidxSeg = iSegDef; 4623 return true; 4624 } 4625 } 4626 return omfDetails_AddSegDef(pOmfStuff, bSegAttr, cbSeg, idxSegName, idxSegClass, idxOverlay, fRec32, pidxSeg); 4627 } 4628 4629 4630 /** 4631 * Looks up a GRPDEF in the . 4632 * 4633 * @returns Index (0..32K) if found, UINT16_MAX if not found. 4634 * @param pOmfStuff The OMF stuff. 4635 * @param pchName The name to look up. 4636 * @param cchName The length of the name. 4637 */ 4638 static uint16_t omfDetails_GrpDefLookupN(POMFDETAILS pOmfStuff, const char *pchName, size_t cchName) 4639 { 4640 unsigned iGrpDef = pOmfStuff->cGrpDefs; 4641 while (iGrpDef-- > 0) 4642 { 4643 if ( pOmfStuff->paGrpDefs[iGrpDef].cchName == cchName 4644 && memcmp(pOmfStuff->paGrpDefs[iGrpDef].pchName, pchName, cchName) == 0) 4645 return iGrpDef; 4646 } 4647 return UINT16_MAX; 4648 } 4649 4650 4651 /** 4652 * Adds an empty GRPDEF (always adds a new one). 4653 * 4654 * @returns success indicator. 4655 * @param pOmfStuff The OMF stuff. 4656 * @param idxGrpName The LNAMES index of the group name. 4657 * @param pidxGrp Where to return the group index. 4658 */ 4659 static bool omfDetails_AddGrpDef(POMFDETAILS pOmfStuff, uint16_t idxGrpName, uint16_t *pidxGrp) 4660 { 4661 Assert(idxGrpName < pOmfStuff->cLNames); 4662 4663 OMF_GROW_TABLE_RET_ERR(OMFGRPDEF, pOmfStuff->paGrpDefs, pOmfStuff->cGrpDefs, 8); 4664 POMFGRPDEF pGrpDef = &pOmfStuff->paGrpDefs[pOmfStuff->cGrpDefs]; 4665 4666 pGrpDef->idxName = idxGrpName; 4667 pGrpDef->cSegDefs = 0; 4668 pGrpDef->paidxSegDefs = NULL; 4669 4670 *pidxGrp = pOmfStuff->cGrpDefs; 4671 pOmfStuff->cGrpDefs++; 4672 return true; 4673 } 4674 4675 4676 /** 4677 * Adds a segment to an existing GRPDEF. 4678 * 4679 * @returns success indicator. 4680 * @param pOmfStuff The OMF stuff. 4681 * @param idxGrp The GRPDEF index of the group to append a member to. 4682 * @param idxSeg The SEGDEF index of the segment name. 4683 */ 4684 static bool omfDetails_AddSegToGrpDef(POMFDETAILS pOmfStuff, uint16_t idxGrp, uint16_t idxSeg) 4685 { 4686 Assert(idxGrp < pOmfStuff->cGrpDefs && idxGrp > 0); 4687 Assert(idxSeg < pOmfStuff->cSegDefs && idxSeg > 0); 4688 4689 POMFGRPDEF pGrpDef = &pOmfStuff->paGrpDefs[idxGrp]; 4690 OMF_GROW_TABLE_RET_ERR(uint16_t, pGrpDef->paidxSegDefs, pGrpDef->cSegDefs, 16); 4691 pGrpDef->paidxSegDefs[pGrpDef->cSegDefs] = idxSeg; 4692 pGrpDef->cSegDefs++; 4693 4694 return true; 4695 } 4696 4697 4698 /** 4699 * Marks 16-bit code segment groups that is used in the object file as needed. 4700 * 4701 * @param pOmfStuff The OMF stuff. 4702 */ 4703 static void convertOmfLookForNeededGroups(POMFDETAILS pOmfStuff) 4704 { 4705 /* 4706 * Consult the groups in question. We mark the groups which segments are 4707 * included in the segment definitions as needed. 4708 */ 4709 unsigned i = RT_ELEMENTS(pOmfStuff->aGroups); 4710 while (i-- > 0) 4711 if (pOmfStuff->aGroups[i].pszSeg) 4712 { 4713 const char * const pszSegNm = pOmfStuff->aGroups[i].pszSeg; 4714 size_t const cchSegNm = strlen(pszSegNm); 4715 for (unsigned iSegDef = 0; iSegDef < pOmfStuff->cSegDefs; iSegDef++) 4716 if ( pOmfStuff->paSegDefs[iSegDef].cchName == cchSegNm 4717 && memcmp(pOmfStuff->paSegDefs[iSegDef].pchName, pszSegNm, cchSegNm) == 0) 4718 { 4719 pOmfStuff->aGroups[i].fNeeded = true; 4720 break; 4721 } 4722 } 4723 } 4724 4725 4726 /** 4727 * Adds necessary group and segment definitions. 4728 * 4729 * @returns success indicator. 4730 * @param pOmfStuff The OMF stuff. 4731 */ 4732 static bool convertOmfAddNeededGrpDefs(POMFDETAILS pOmfStuff) 4733 { 4734 /* 4735 * Process the groups. 4736 */ 4737 unsigned j = RT_ELEMENTS(pOmfStuff->aGroups); 4738 while (j-- > 0) 4739 if (pOmfStuff->aGroups[j].fNeeded) 4740 { 4741 if (pOmfStuff->aGroups[j].idxName == UINT16_MAX) 4742 { 4743 Assert(pOmfStuff->aGroups[j].idxGroup == UINT16_MAX); 4744 if (!omfDetails_AddLName(pOmfStuff, pOmfStuff->aGroups[j].pszName, &pOmfStuff->aGroups[j].idxName)) 4745 return false; 4746 } 4747 if (pOmfStuff->aGroups[j].idxGroup == UINT16_MAX) 4748 { 4749 if (!omfDetails_AddGrpDef(pOmfStuff, pOmfStuff->aGroups[j].idxName, &pOmfStuff->aGroups[j].idxGroup)) 4750 return false; 4751 4752 if (pOmfStuff->aGroups[j].pszSeg) 4753 { 4754 /* We need the segment class name. */ 4755 uint16_t idxSegClass; 4756 if (!omfDetails_AddLName(pOmfStuff, pOmfStuff->aGroups[j].pszClass1, &idxSegClass)) 4757 return false; 4758 4759 /* Prep segment name buffer. */ 4760 size_t cchSegNm = strlen(pOmfStuff->aGroups[j].pszSeg); 4761 char szSegNm[256+16]; 4762 Assert(cchSegNm < 256); 4763 memcpy(szSegNm, pOmfStuff->aGroups[j].pszSeg, cchSegNm); 4764 4765 /* Add the three segments. */ 4766 static RTSTRTUPLE const s_aSuffixes[3] = { RT_STR_TUPLE("_START"), RT_STR_TUPLE(""), RT_STR_TUPLE("_END"), }; 4767 for (unsigned iSuffix = 0; iSuffix < RT_ELEMENTS(s_aSuffixes); iSuffix++) 4768 { 4769 uint16_t idxSegNm; 4770 memcpy(&szSegNm[cchSegNm], s_aSuffixes[iSuffix].psz, s_aSuffixes[iSuffix].cch + 1); 4771 if (!omfDetails_AddLName(pOmfStuff, szSegNm, &idxSegNm)) 4772 return false; 4773 uint8_t const fAlign = iSuffix == 1 ? OMF_SEG_ATTR_ALIGN_BYTE : OMF_SEG_ATTR_ALIGN_PARA; 4774 uint16_t idxSeg; 4775 if (!omfDetails_AddSegDefIfNeeded(pOmfStuff, fAlign | OMF_SEG_ATTR_COMB_PUBLIC | OMF_SEG_ATTR_USE16, 4776 0, idxSegNm, idxSegClass, 1, false /*fRec*/, &idxSeg)) 4777 return false; 4778 if (!omfDetails_AddSegToGrpDef(pOmfStuff, pOmfStuff->aGroups[j].idxGroup, idxSeg)) 4779 return false; 4780 } 4781 } 4782 } 4783 } 4784 4785 /* 4786 * Replace group references in the segment lines table. 4787 */ 4788 j = RT_ELEMENTS(pOmfStuff->aGroups); 4789 while (j-- > 0) 4790 if (pOmfStuff->aGroups[j].fNeeded) 4791 for (unsigned i = 0; i < pOmfStuff->cSegLines; i++) 4792 if (pOmfStuff->paSegLines[i].idxGrp == pOmfStuff->aGroups[j].idxReplaceGrp) 4793 pOmfStuff->paSegLines[i].idxGrp = pOmfStuff->aGroups[j].idxGroup; 4794 return true; 4795 } 4796 4797 4798 /** 4799 * Adds the debug segment definitions (names too) to the OMF state. 4800 * 4801 * @returns success indicator. 4451 4802 * @param pOmfStuff The OMF stuff with CV8 line number info. 4452 4803 */ 4453 static bool convertOmf WriteDebugSegDefs(POMFWRITER pThis,POMFDETAILS pOmfStuff)4804 static bool convertOmfAddDebugSegDefs(POMFDETAILS pOmfStuff) 4454 4805 { 4455 4806 if ( pOmfStuff->cSegLines == 0 … … 4458 4809 4459 4810 /* 4460 * Emit the LNAMES we need. 4461 */ 4462 #if 1 4811 * Add the names we need. 4812 */ 4463 4813 if ( pOmfStuff->iSymbolsNm == UINT16_MAX 4464 || pOmfStuff->iDebSymNm == UINT16_MAX) 4465 { 4466 if ( !omfWriter_LNamesBegin(pThis, true /*fAddZeroEntry*/) 4467 || ( pOmfStuff->iSymbolsNm == UINT16_MAX 4468 && !omfWriter_LNamesAdd(pThis, "$$SYMBOLS", &pOmfStuff->iSymbolsNm)) 4469 || ( pOmfStuff->iDebSymNm == UINT16_MAX 4470 && !omfWriter_LNamesAdd(pThis, "DEBSYM", &pOmfStuff->iDebSymNm)) 4471 || !omfWriter_LNamesEnd(pThis) ) 4472 return false; 4473 } 4474 #else 4475 if ( !omfWriter_LNamesBegin(pThis, true /*fAddZeroEntry*/) 4476 || !omfWriter_LNamesAdd(pThis, "$$SYMBOLS2", &pOmfStuff->iSymbolsNm) 4477 || !omfWriter_LNamesAdd(pThis, "DEBSYM2", &pOmfStuff->iDebSymNm) 4478 || !omfWriter_LNamesEnd(pThis) ) 4814 && !omfDetails_AddLName(pOmfStuff, "$$SYMBOLS", &pOmfStuff->iSymbolsNm)) 4479 4815 return false; 4480 #endif 4481 4482 /*4483 * Emit the segment definitions. 4484 */4485 pOmfStuff->iSymbolsSeg = pOmfStuff->cSegDefs++;4486 4816 if ( pOmfStuff->iDebSymNm == UINT16_MAX 4817 && !omfDetails_AddLName(pOmfStuff, "DEBSYM", &pOmfStuff->iDebSymNm)) 4818 return false; 4819 4820 /* 4821 * Add the segment definition. 4822 */ 4487 4823 uint8_t bSegAttr = 0; 4488 4824 bSegAttr |= 5 << 5; /* A: dword alignment */ … … 4499 4835 if (pOmfStuff->paSegLines[i].cFiles > 0) 4500 4836 cbSeg += 4 + 4 + pOmfStuff->paSegLines[i].cb; 4501 return omfWriter_SegDef(pThis, bSegAttr, cbSeg, pOmfStuff->iSymbolsNm, pOmfStuff->iDebSymNm); 4502 } 4503 4504 4505 /** 4506 * Writes additional segment group definitions. 4507 * 4508 * @returns success indicator. 4509 * @param pThis The OMF writer. 4510 * @param pOmfStuff The OMF stuff with CV8 line number info. 4511 */ 4512 static bool convertOmfWriteDebugGrpDefs(POMFWRITER pThis, POMFDETAILS pOmfStuff) 4513 { 4514 if (pOmfStuff->cSegLines == 0) 4515 return true; 4516 4517 /* 4518 * See what (if anything) we need. 4519 */ 4520 uint8_t cNames = 0; 4521 uint8_t cGroups = 0; 4522 unsigned j = RT_ELEMENTS(pOmfStuff->aGroups); 4523 while (j-- > 0) 4524 if (pOmfStuff->aGroups[j].fNeeded) 4525 { 4526 cNames += pOmfStuff->aGroups[j].idxName == UINT16_MAX; 4527 cGroups += pOmfStuff->aGroups[j].idxGroup == UINT16_MAX; 4528 } 4529 4530 /* 4531 * Add any names we need. 4532 */ 4533 if (cNames) 4534 { 4535 if (!omfWriter_LNamesBegin(pThis, true)) 4536 return false; 4537 j = RT_ELEMENTS(pOmfStuff->aGroups); 4538 while (j-- > 0) 4539 if ( pOmfStuff->aGroups[j].fNeeded 4540 && pOmfStuff->aGroups[j].idxName == UINT16_MAX) 4541 if (!omfWriter_LNamesAdd(pThis, pOmfStuff->aGroups[j].pszName, &pOmfStuff->aGroups[j].idxName)) 4542 return false; 4543 if (!omfWriter_LNamesEnd(pThis)) 4544 return false; 4545 } 4546 4547 /* 4548 * Add any groups we need. 4549 */ 4550 if (cNames) 4551 { 4552 uint16_t iGrp = pOmfStuff->cGrpDefs; /* Shouldn't update cGrpDefs as it governs paGrpDefs. */ 4553 j = RT_ELEMENTS(pOmfStuff->aGroups); 4554 while (j-- > 0) 4555 { 4556 if ( pOmfStuff->aGroups[j].fNeeded 4557 && pOmfStuff->aGroups[j].idxGroup == UINT16_MAX) 4558 { 4559 if ( !omfWriter_GrpDefBegin(pThis, pOmfStuff->aGroups[j].idxName) 4560 || !omfWriter_GrpDefEnd(pThis)) 4561 return false; 4562 pOmfStuff->aGroups[j].idxGroup = iGrp++; 4563 } 4564 } 4565 } 4566 4567 /* 4568 * Replace group references in the segment lines table. 4569 */ 4570 j = RT_ELEMENTS(pOmfStuff->aGroups); 4571 while (j-- > 0) 4572 if (pOmfStuff->aGroups[j].fNeeded) 4573 for (unsigned i = 0; i < pOmfStuff->cSegLines; i++) 4574 if (pOmfStuff->paSegLines[i].idxGrp == pOmfStuff->aGroups[j].idxReplaceGrp) 4575 pOmfStuff->paSegLines[i].idxGrp = pOmfStuff->aGroups[j].idxGroup; 4576 return true; 4837 return omfDetails_AddSegDef(pOmfStuff, bSegAttr, cbSeg, pOmfStuff->iSymbolsNm, pOmfStuff->iDebSymNm, 1 /*idxOverlay*/, 4838 true /*fRec32*/, &pOmfStuff->iSymbolsSeg); 4577 4839 } 4578 4840 … … 4589 4851 if (pOmfStuff->cSegLines == 0) 4590 4852 return true; 4853 Assert(pOmfStuff->iSymbolsSeg != UINT16_MAX); 4591 4854 4592 4855 /* Begin and write the CV version signature. */ … … 4680 4943 4681 4944 return omfWriter_LEDataEnd(pThis); 4945 } 4946 4947 4948 /** 4949 * Writes out all the segment group definitions. 4950 * 4951 * @returns success indicator. 4952 * @param pThis The OMF writer. 4953 * @param pOmfStuff The OMF stuff containing the segment defs. 4954 * @param pfFlushState Pointer to the flush state variable. 4955 */ 4956 static bool convertOmfWriteAllSegDefs(POMFWRITER pThis, POMFDETAILS pOmfStuff, int *pfFlushState) 4957 { 4958 if (*pfFlushState > 0) 4959 { 4960 for (unsigned iSegDef = 1; iSegDef < pOmfStuff->cSegDefs; iSegDef++) 4961 { 4962 if (!(pOmfStuff->paSegDefs[iSegDef].f32bitRec 4963 ? omfWriter_SegDef : omfWriter_SegDef16)(pThis, pOmfStuff->paSegDefs[iSegDef].bSegAttr, 4964 pOmfStuff->paSegDefs[iSegDef].cbSeg, 4965 pOmfStuff->paSegDefs[iSegDef].idxName, 4966 pOmfStuff->paSegDefs[iSegDef].idxClass, 4967 pOmfStuff->paSegDefs[iSegDef].idxOverlay)) 4968 return false; 4969 } 4970 *pfFlushState = -1; 4971 } 4972 return true; 4973 } 4974 4975 4976 /** 4977 * Writes out all the segment group definitions. 4978 * 4979 * @returns success indicator. 4980 * @param pThis The OMF writer. 4981 * @param pOmfStuff The OMF stuff containing the group defs. 4982 * @param pfFlushState Pointer to the flush state variable. 4983 */ 4984 static bool convertOmfWriteAllGrpDefs(POMFWRITER pThis, POMFDETAILS pOmfStuff, int *pfFlushState) 4985 { 4986 if (*pfFlushState > 0) 4987 { 4988 for (unsigned iGrpDef = 1; iGrpDef < pOmfStuff->cGrpDefs; iGrpDef++) 4989 { 4990 if (!omfWriter_GrpDefBegin(pThis, pOmfStuff->paGrpDefs[iGrpDef].idxName)) 4991 return false; 4992 for (unsigned iSegDef = 0; iSegDef < pOmfStuff->paGrpDefs[iGrpDef].cSegDefs; iSegDef++) 4993 if (!omfWriter_GrpDefAddSegDef(pThis, pOmfStuff->paGrpDefs[iGrpDef].paidxSegDefs[iSegDef])) 4994 return false; 4995 if (!omfWriter_GrpDefEnd(pThis)) 4996 return false; 4997 } 4998 *pfFlushState = -1; 4999 } 5000 return true; 4682 5001 } 4683 5002 … … 4695 5014 * @param pOmfStuff The OMF stuff we've gathered during the first pass, 4696 5015 * contains CV8 line number info if we converted anything. 4697 */ 4698 static bool convertOmfPassthru(POMFWRITER pThis, uint8_t const *pbFile, size_t cbFile, POMFDETAILS pOmfStuff) 4699 { 4700 bool const fConvertLineNumbers = true; 4701 bool fSeenTheAdr = false; 5016 * @param fConvertLineNumbers Whether we're converting line numbers and stuff. 5017 */ 5018 static bool convertOmfPassthru(POMFWRITER pThis, uint8_t const *pbFile, size_t cbFile, POMFDETAILS pOmfStuff, 5019 bool fConvertLineNumbers) 5020 { 5021 int fFlushLNames = 1; 5022 int fFlushSegDefs = 1; 5023 int fFlushGrpDefs = 1; 5024 bool fSeenTheAdr = false; 5025 bool fConvertFixupp = false; 5026 4702 5027 uint32_t off = 0; 4703 5028 while (off + 3 < cbFile) … … 4713 5038 if ((a_idx) & 0x80) \ 4714 5039 a_idx = (((a_idx) & 0x7f) << 8) | pbRec[offRec++]; \ 5040 } while (0) 5041 5042 #define OMF_PEEK_IDX(a_idx, a_offRec) \ 5043 do { \ 5044 a_idx = pbRec[a_offRec]; \ 5045 if ((a_idx) & 0x80) \ 5046 a_idx = (((a_idx) & 0x7f) << 8) | pbRec[(a_offRec) + 1]; \ 4715 5047 } while (0) 4716 5048 … … 4794 5126 4795 5127 /* 4796 * Remove borland source file changes. Also, emit our SEGDEF4797 * before the pass marker.5128 * Remove borland source file changes. Also, make sure the group 5129 * definitions are written out. 4798 5130 */ 4799 5131 case OMF_COMENT: 5132 if (pbRec[1] == OMF_CCLS_LINK_PASS_SEP) 5133 { 5134 Assert(fFlushSegDefs <= 0); 5135 if ( fFlushGrpDefs > 0 5136 && !convertOmfWriteAllGrpDefs(pThis, pOmfStuff, &fFlushGrpDefs)) 5137 return false; 5138 } 4800 5139 if (fConvertLineNumbers) 4801 {4802 5140 fSkip = pbRec[1] == OMF_CCLS_BORLAND_SRC_FILE; 4803 if (pbRec[1] == OMF_CCLS_LINK_PASS_SEP)4804 if ( !convertOmfWriteDebugSegDefs(pThis, pOmfStuff)4805 || !convertOmfWriteDebugGrpDefs(pThis, pOmfStuff))4806 return false;4807 }4808 5141 break; 4809 5142 4810 5143 /* 4811 * Redo these to the OMF writer is on top of the index thing.5144 * Redo these so the OMF writer is on top of the index thing. 4812 5145 */ 4813 5146 case OMF_LNAMES: 4814 if (!omfWriter_LNamesBegin(pThis, false /*fAddZeroEntry*/)) 5147 if (fFlushLNames >= 0) 5148 { 5149 if (!omfWriter_LNamesBegin(pThis, false /*fAddZeroEntry*/)) 5150 return false; 5151 if (!fFlushLNames) 5152 { 5153 while (offRec + 1 < cbRec) 5154 { 5155 uint8_t cch = pbRec[offRec]; 5156 const char *pch = (const char *)&pbRec[offRec + 1]; 5157 if (!omfWriter_LNamesAddN(pThis, pch, cch, NULL)) 5158 return false; 5159 offRec += cch + 1; 5160 } 5161 } 5162 else 5163 { 5164 /* Flush all LNAMES in one go. */ 5165 for (unsigned i = 1; i < pOmfStuff->cLNames; i++) 5166 if (!omfWriter_LNamesAddN(pThis, pOmfStuff->papchLNames[i] + 1, *pOmfStuff->papchLNames[i], NULL)) 5167 return false; 5168 fFlushLNames = -1; 5169 } 5170 if (!omfWriter_LNamesEnd(pThis)) 5171 return false; 5172 } 5173 fSkip = true; 5174 break; 5175 5176 /* 5177 * We may want to flush all the segments when we see the first one. 5178 */ 5179 case OMF_SEGDEF16: 5180 case OMF_SEGDEF32: 5181 fSkip = fFlushSegDefs != 0; 5182 if (!convertOmfWriteAllSegDefs(pThis, pOmfStuff, &fFlushSegDefs)) 4815 5183 return false; 4816 while (offRec + 1 < cbRec) 5184 break; 5185 5186 /* 5187 * We may want to flush all the groups when we see the first one. 5188 */ 5189 case OMF_GRPDEF: 5190 fSkip = fFlushGrpDefs != 0; 5191 if (!convertOmfWriteAllGrpDefs(pThis, pOmfStuff, &fFlushGrpDefs)) 5192 return false; 5193 break; 5194 5195 /* 5196 * Hook LEDATA to flush groups and figure out when to convert FIXUPP records. 5197 */ 5198 case OMF_LEDATA16: 5199 case OMF_LEDATA32: 5200 if ( fFlushGrpDefs > 0 5201 && !convertOmfWriteAllGrpDefs(pThis, pOmfStuff, &fFlushGrpDefs)) 5202 return false; 5203 fConvertFixupp = false; 5204 #if 0 5205 if ( g_f16BitWatcomC 5206 && bRecType == OMF_LEDATA16) 4817 5207 { 4818 uint8_t cch = pbRec[offRec]; 4819 const char *pch = (const char *)&pbRec[offRec + 1]; 4820 if (!omfWriter_LNamesAddN(pThis, pch, cch, NULL)) 4821 return false; 4822 offRec += cch + 1; 5208 /* Check if this is a code segment. */ 5209 uint16_t idxSeg; 5210 OMF_PEEK_IDX(idxSeg, offRec); 5211 4823 5212 } 4824 if (!omfWriter_LNamesEnd(pThis)) 4825 return false; 4826 4827 fSkip = true; 5213 #endif 5214 break; 5215 5216 5217 /* 5218 * Convert fixups for 16-bit code segments to groups. 5219 * Deals with switch table trouble. 5220 */ 5221 case OMF_FIXUPP16: 5222 if (fConvertFixupp) 5223 { 5224 /* Gave up on this for now, easier to drop the eyecatcher in the _START segments. */ 5225 } 4828 5226 break; 4829 5227 … … 4834 5232 case OMF_MODEND32: 4835 5233 if (fConvertLineNumbers) 4836 { 4837 if ( convertOmfWriteDebugSegDefs(pThis, pOmfStuff) 4838 && convertOmfWriteDebugGrpDefs(pThis, pOmfStuff) 4839 && convertOmfWriteDebugData(pThis, pOmfStuff)) 4840 { /* likely */ } 4841 else return false; 4842 } 5234 if (!convertOmfWriteDebugData(pThis, pOmfStuff)) 5235 return false; 4843 5236 break; 4844 5237 } … … 4885 5278 static bool convertOmfToOmf(const char *pszFile, uint8_t const *pbFile, size_t cbFile, FILE *pDst) 4886 5279 { 4887 /* 4888 * Collect line number information. 5280 bool const fConvertLineNumbers = true; 5281 5282 /* 5283 * Collect line number information, names, segment defintions, groups definitions and such. 4889 5284 */ 4890 5285 OMFDETAILS OmfStuff; … … 4892 5287 return false; 4893 5288 4894 /* 4895 * Instantiate the OMF writer and do pass-thru modifications. 4896 */ 4897 bool fRc; 4898 POMFWRITER pThis = omfWriter_Create(pszFile, 0, 0, pDst); 4899 if (pThis) 4900 { 4901 fRc = convertOmfPassthru(pThis, pbFile, cbFile, &OmfStuff); 4902 omfWriter_Destroy(pThis); 4903 } 4904 else 4905 fRc = false; 4906 5289 /* Mark groups for 16-bit code segments used by this object file as needed 5290 so we can reframe fixups to these segments correctly. */ 5291 convertOmfLookForNeededGroups(&OmfStuff); 5292 5293 /* Add debug segments definitions. */ 5294 bool fRc = true; 5295 if (fConvertLineNumbers) 5296 fRc = convertOmfAddDebugSegDefs(&OmfStuff); 5297 5298 /* Add any additional group defintions we may need (for 16-bit code segs). */ 5299 if (fRc) 5300 fRc = convertOmfAddNeededGrpDefs(&OmfStuff); 5301 if (fRc) 5302 { 5303 /* 5304 * Instantiate the OMF writer and do pass-thru modifications. 5305 */ 5306 POMFWRITER pThis = omfWriter_Create(pszFile, 0, 0, pDst); 5307 if (pThis) 5308 { 5309 fRc = convertOmfPassthru(pThis, pbFile, cbFile, &OmfStuff, fConvertLineNumbers); 5310 omfWriter_Destroy(pThis); 5311 } 5312 else 5313 fRc = false; 5314 } 4907 5315 4908 5316 /* … … 4920 5328 free(OmfStuff.paSrcInfo); 4921 5329 free(OmfStuff.pchStrTab); 5330 5331 while (OmfStuff.pAllocHead) 5332 { 5333 POMFDETAILSALLOC pFreeMe = OmfStuff.pAllocHead; 5334 OmfStuff.pAllocHead = OmfStuff.pAllocHead->pNext; 5335 free(pFreeMe); 5336 } 5337 4922 5338 return fRc; 4923 5339 } … … 5026 5442 /* Convert long options to short ones. */ 5027 5443 pszOpt--; 5028 if (!strcmp(pszOpt, "--verbose")) 5444 if (!strcmp(pszOpt, "--wcc")) 5445 pszOpt = "w"; 5446 else if (!strcmp(pszOpt, "--verbose")) 5029 5447 pszOpt = "v"; 5030 5448 else if (!strcmp(pszOpt, "--version")) … … 5044 5462 switch (*pszOpt++) 5045 5463 { 5464 case 'w': 5465 g_f16BitWatcomC = true; 5466 break; 5467 5046 5468 case 'v': 5047 5469 g_cVerbose++; -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-common.mac
r66054 r66446 159 159 section BS3RMTEXT16_START align=16 CLASS=BS3CLASS16RMCODE PUBLIC USE16 160 160 BS3_GLOBAL_DATA Bs3RmText16_StartOfSegment, 0 161 db 10,13,'eye-catcher: BS3RMTEXT16',10,13161 ;db 10,13,'eye-catcher: BS3RMTEXT16',10,13 - messes up switch in C code. Alt. is fConvertFixupp VBoxBs3ObjConverter.cpp. 162 162 BS3_BEGIN_RMTEXT16 163 163 section BS3RMTEXT16_END align=1 CLASS=BS3CLASS16RMCODE PUBLIC USE16 … … 171 171 section BS3X0TEXT16_START align=16 CLASS=BS3CLASS16X0CODE PUBLIC USE16 172 172 BS3_GLOBAL_DATA Bs3X0Text16_StartOfSegment, 0 173 db 10,13,'eye-catcher: BS3X0TEXT16',10,13173 ;db 10,13,'eye-catcher: BS3X0TEXT16',10,13 - messes up switch in C code. Alt. is fConvertFixupp VBoxBs3ObjConverter.cpp. 174 174 BS3_BEGIN_X0TEXT16 4 175 175 section BS3X0TEXT16_END align=16 CLASS=BS3CLASS16X0CODE PUBLIC USE16 … … 183 183 section BS3X1TEXT16_START align=16 CLASS=BS3CLASS16X1CODE PUBLIC USE16 184 184 BS3_GLOBAL_DATA Bs3X1Text16_StartOfSegment, 0 185 db 10,13,'eye-catcher: BS3X1TEXT16',10,13185 ;db 10,13,'eye-catcher: BS3X1TEXT16',10,13 - messes up switch in C code. Alt. is fConvertFixupp VBoxBs3ObjConverter.cpp. 186 186 BS3_BEGIN_X1TEXT16 4 187 187 section BS3X1TEXT16_END align=16 CLASS=BS3CLASS16X1CODE PUBLIC USE16 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
r66240 r66446 32 32 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeDataToFlat,4) 33 33 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelRealModeDataToProtFar16,4) 34 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxRestore,4) 35 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3ExtCtxSave,4) 34 36 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3SelFar32ToFlat32NoClobber,6) 35 37 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3RegCtxSaveEx,8) … … 81 83 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAllocEx) 82 84 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxFree) 83 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxRestore)84 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSave)85 85 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemFree) 86 86 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemGuardedTestPageFree) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r66240 r66446 2755 2755 * @remarks All GPRs preserved. 2756 2756 */ 2757 BS3_CMN_PROTO_ STUB(void,Bs3ExtCtxSave,(PBS3EXTCTX pExtCtx));2757 BS3_CMN_PROTO_FARSTUB(4, void, Bs3ExtCtxSave,(PBS3EXTCTX pExtCtx)); 2758 2758 2759 2759 /** … … 2763 2763 * @remarks All GPRs preserved. 2764 2764 */ 2765 BS3_CMN_PROTO_ STUB(void,Bs3ExtCtxRestore,(PBS3EXTCTX pExtCtx));2765 BS3_CMN_PROTO_FARSTUB(4, void, Bs3ExtCtxRestore,(PBS3EXTCTX pExtCtx)); 2766 2766 2767 2767 /**
Note:
See TracChangeset
for help on using the changeset viewer.