VirtualBox

Changeset 15633 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Dec 17, 2008 3:08:11 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
41155
Message:

Smsw emlution (inactive).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r15632 r15633  
    22142214    return EMInterpretLMSW(pVM, pRegFrame, val);
    22152215}
     2216
     2217#ifdef EM_EMULATE_SMSW
     2218/**
     2219 * SMSW Emulation.
     2220 */
     2221static int emInterpretSmsw(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize)
     2222{
     2223    OP_PARAMVAL param1;
     2224    uint64_t    cr0 = CPUMGetGuestCR0(pVM);
     2225
     2226    int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, &param1, PARAM_SOURCE);
     2227    if(RT_FAILURE(rc))
     2228        return VERR_EM_INTERPRETER;
     2229
     2230    switch(param1.type)
     2231    {
     2232    case PARMTYPE_IMMEDIATE:
     2233        if(!(param1.flags & PARAM_VAL16))
     2234            return VERR_EM_INTERPRETER;
     2235        rc = DISWriteReg16(pRegFrame, pCpu->param1.base.reg_gen, cr0);
     2236        break;
     2237
     2238    case PARMTYPE_ADDRESS:
     2239    {
     2240        RTGCPTR pParam1;
     2241
     2242        /* Actually forced to 16 bits regardless of the operand size. */
     2243        if(!(param1.flags & PARAM_VAL16))
     2244            return VERR_EM_INTERPRETER;
     2245
     2246        pParam1 = (RTGCPTR)param1.val.val64;
     2247        pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1);
     2248
     2249        rc = emRamWrite(pVM, pParam1, &cr0, sizeof(uint16_t));
     2250        if (RT_FAILURE(rc))
     2251        {
     2252            AssertMsgFailed(("emRamWrite %RGv size=%d failed with %Rrc\n", pParam1, param1.size, rc));
     2253            return VERR_EM_INTERPRETER;
     2254        }
     2255        break;
     2256    }
     2257
     2258    default:
     2259        return VERR_EM_INTERPRETER;
     2260    }
     2261
     2262    LogFlow(("emInterpretSmsw %x\n", cr0));
     2263    return rc;
     2264}
     2265#endif
    22162266
    22172267/**
     
    30973147#endif
    30983148        INTERPRET_CASE(OP_LMSW,Lmsw);
     3149#ifdef EM_EMULATE_SMSW
     3150        INTERPRET_CASE(OP_SMSW,Smsw);
     3151#endif
    30993152        INTERPRET_CASE(OP_CLTS,Clts);
    31003153        INTERPRET_CASE(OP_MONITOR, Monitor);
Note: See TracChangeset for help on using the changeset viewer.

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