VirtualBox

Ignore:
Timestamp:
May 25, 2017 9:29:48 AM (8 years ago)
Author:
vboxsync
Message:

bs3-cpu-generated-1: cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c

    r67077 r67078  
    23112311
    23122312
    2313 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_MODRM_Mb_RO(PBS3CG1STATE pThis, unsigned iEncoding)
     2313static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_MODRM_Msomething(PBS3CG1STATE pThis, unsigned iEncoding)
    23142314{
    23152315    unsigned off;
    2316     if (iEncoding == 0)
    2317     {
    2318         off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)) - 1;
    2319         off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off,
    2320                                        (pThis->abCurInstr[off] & X86_MODRM_REG_MASK) >> X86_MODRM_REG_SHIFT,
    2321                                        1, 0, BS3CG1OPLOC_MEM);
    2322     }
    2323     else
    2324         return 0;
    2325     pThis->cbCurInstr = off;
    2326     return iEncoding + 1;
    2327 }
    2328 
    2329 
    2330 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_MODRM_Md_RO(PBS3CG1STATE pThis, unsigned iEncoding)
    2331 {
    2332     unsigned off;
    2333     if (iEncoding == 0)
    2334     {
    2335         off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)) - 1;
    2336         off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off,
    2337                                        (pThis->abCurInstr[off] & X86_MODRM_REG_MASK) >> X86_MODRM_REG_SHIFT,
    2338                                        4, 0, BS3CG1OPLOC_MEM);
    2339     }
    2340     else
    2341         return 0;
    2342     pThis->cbCurInstr = off;
    2343     return iEncoding + 1;
    2344 }
    2345 
    2346 
    2347 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_MODRM_Md_WO(PBS3CG1STATE pThis, unsigned iEncoding)
    2348 {
    2349     unsigned off;
    2350     if (iEncoding == 0)
    2351     {
    2352         off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)) - 1;
    2353         off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off,
    2354                                        (pThis->abCurInstr[off] & X86_MODRM_REG_MASK) >> X86_MODRM_REG_SHIFT,
    2355                                        4, 0, BS3CG1OPLOC_MEM_WO);
    2356     }
    2357     else
    2358         return 0;
     2316    switch (iEncoding)
     2317    {
     2318        case 0:
     2319            off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)) - 1;
     2320            off = Bs3Cfg1EncodeMemMod0DispWithDefaultsAndNoReg(pThis, off);
     2321            break;
     2322        default:
     2323            return 0;
     2324    }
    23592325    pThis->cbCurInstr = off;
    23602326    return iEncoding + 1;
     
    39823948            return Bs3Cg1EncodeNext_MODRM_Gv_RO_Ma(pThis, iEncoding);
    39833949
    3984         case BS3CG1ENC_MODRM_Mb_RO:
    3985             return Bs3Cg1EncodeNext_MODRM_Mb_RO(pThis, iEncoding);
    3986         case BS3CG1ENC_MODRM_Md_RO:
    3987             return Bs3Cg1EncodeNext_MODRM_Md_RO(pThis, iEncoding);
    3988         case BS3CG1ENC_MODRM_Md_WO:
    3989             return Bs3Cg1EncodeNext_MODRM_Md_WO(pThis, iEncoding);
    3990 
    39913950        case BS3CG1ENC_FIXED:
    39923951            return Bs3Cg1EncodeNext_FIXED(pThis, iEncoding);
     
    43344293
    43354294        case BS3CG1ENC_MODRM_Mb_RO:
    4336             pThis->iRmOp             = 0;
    4337             pThis->aOperands[0].cbOp = 1;
    4338             pThis->aOperands[0].enmLocation = BS3CG1OPLOC_MEM;
     4295            pThis->pfnEncoder                   = Bs3Cg1EncodeNext_MODRM_Msomething;
     4296            pThis->iRmOp                        = 0;
     4297            pThis->aOperands[0].cbOp            = 1;
     4298            pThis->aOperands[0].enmLocation     = BS3CG1OPLOC_MEM;
     4299            pThis->aOperands[0].enmLocationMem  = BS3CG1OPLOC_MEM;
    43394300            break;
    43404301
    43414302        case BS3CG1ENC_MODRM_Md_RO:
    4342             pThis->iRmOp             = 0;
    4343             pThis->aOperands[0].cbOp = 4;
    4344             pThis->aOperands[0].enmLocation = BS3CG1OPLOC_MEM;
     4303            pThis->pfnEncoder                   = Bs3Cg1EncodeNext_MODRM_Msomething;
     4304            pThis->iRmOp                        = 0;
     4305            pThis->aOperands[0].cbOp            = 4;
     4306            pThis->aOperands[0].enmLocation     = BS3CG1OPLOC_MEM;
     4307            pThis->aOperands[0].enmLocationMem  = BS3CG1OPLOC_MEM;
    43454308            break;
    43464309
    43474310        case BS3CG1ENC_MODRM_Md_WO:
    4348             pThis->iRmOp             = 0;
    4349             pThis->aOperands[0].cbOp = 4;
    4350             pThis->aOperands[0].enmLocation = BS3CG1OPLOC_MEM_WO;
     4311            pThis->pfnEncoder                   = Bs3Cg1EncodeNext_MODRM_Msomething;
     4312            pThis->iRmOp                        = 0;
     4313            pThis->aOperands[0].cbOp            = 4;
     4314            pThis->aOperands[0].enmLocation     = BS3CG1OPLOC_MEM_WO;
     4315            pThis->aOperands[0].enmLocationMem  = BS3CG1OPLOC_MEM_WO;
    43514316            break;
    43524317
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette