VirtualBox

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


Ignore:
Timestamp:
Oct 6, 2008 4:27:16 PM (16 years ago)
Author:
vboxsync
Message:

Knut-compatibility fixes

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

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

    r13013 r13020  
    25792579        /* In X2APIC specification this range is reserved for APIC control. */
    25802580        if ((pRegFrame->ecx >= MSR_IA32_APIC_START) && (pRegFrame->ecx < MSR_IA32_APIC_END))
    2581         {
    2582             rc = PDMApicRDMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, &val);
    2583         }
     2581            rc = PDMApicReadMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, &val);
    25842582        else
    2585         {
    25862583            /* We should actually trigger a #GP here, but don't as that might cause more trouble. */
    25872584            val = 0;
    2588             break;
    2589         }
     2585        break;
    25902586    }
    25912587    Log(("EMInterpretRdmsr %s (%x) -> val=%VX64\n", emMSRtoString(pRegFrame->ecx), pRegFrame->ecx, val));
     
    27282724        /* In X2APIC specification this range is reserved for APIC control. */
    27292725        if ((pRegFrame->ecx >=  MSR_IA32_APIC_START) && (pRegFrame->ecx <  MSR_IA32_APIC_END))
    2730         {
    2731             return PDMApicWRMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, val);
    2732         }
     2726            return PDMApicWriteMSR(pVM, VMMGetCpuId(pVM), pRegFrame->ecx, val);
     2727
    27332728        /* We should actually trigger a #GP here, but don't as that might cause more trouble. */
    27342729        break;
  • trunk/src/VBox/VMM/VMMAll/PDMAll.cpp

    r13013 r13020  
    254254
    255255/**
    256  * WRMSR in APIC range.
     256 * Write MSR in APIC range.
    257257 *
    258258 * @returns VBox status code.
     
    262262 * @param   u64Value        Value to write.
    263263 */
    264 VMMDECL(int) PDMApicWRMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)
    265 {
    266     if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
    267     {
    268         Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnWRMSR));
    269         pdmLock(pVM);
    270         pVM->pdm.s.Apic.CTX_SUFF(pfnWRMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, u64Value);
    271         pdmUnlock(pVM);
    272         return VINF_SUCCESS;
    273     }
    274     return VERR_PDM_NO_APIC_INSTANCE;
    275 }
    276 
    277 /**
    278  * RDMSR in APIC range.
     264VMMDECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)
     265{
     266    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     267    {
     268        Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnWriteMSR));
     269        pdmLock(pVM);
     270        pVM->pdm.s.Apic.CTX_SUFF(pfnWriteMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, u64Value);
     271        pdmUnlock(pVM);
     272        return VINF_SUCCESS;
     273    }
     274    return VERR_PDM_NO_APIC_INSTANCE;
     275}
     276
     277/**
     278 * Read MSR in APIC range.
    279279 *
    280280 * @returns VBox status code.
     
    284284 * @param   pu64Value       Value read.
    285285 */
    286 VMMDECL(int) PDMApicRDMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)
    287 {
    288     if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
    289     {
    290         Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnRDMSR));
    291         pdmLock(pVM);
    292         pVM->pdm.s.Apic.CTX_SUFF(pfnRDMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, pu64Value);
     286VMMDECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)
     287{
     288    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     289    {
     290        Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnReadMSR));
     291        pdmLock(pVM);
     292        pVM->pdm.s.Apic.CTX_SUFF(pfnReadMSR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), iCpu, u32Reg, pu64Value);
    293293        pdmUnlock(pVM);
    294294        return VINF_SUCCESS;
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