VirtualBox

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


Ignore:
Timestamp:
Nov 4, 2008 4:12:57 PM (16 years ago)
Author:
vboxsync
Message:

Moving data around

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

Legend:

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

    r13025 r13791  
    142142}
    143143
     144#ifndef IN_GC
     145/**
     146 * Returns the VMCPU id of the current EMT thread.
     147 *
     148 * @param   pVM         The VM to operate on.
     149 */
     150VMMDECL(RTCPUID) HWACCMGetVMCPUId(PVM pVM)
     151{
     152    /* @todo */
     153    Assert(pVM->cCPUs == 1);
     154    return 0;
     155}
     156#endif
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r12989 r13791  
    3030#include <VBox/vm.h>
    3131#include <VBox/err.h>
     32#include <VBox/hwaccm.h>
    3233
    3334#include <VBox/log.h>
     
    6768    Assert(pVM);
    6869
    69     /*
    70      * Try take the lock.
     70    RTCPUID idCPU = VM_GET_VMCPUID(pVM);
     71
     72    /*
     73     * Try to take the lock.
    7174     */
    7275    if (ASMAtomicCmpXchgS32(&pCritSect->s.Core.cLockers, 0, -1))
    7376    {
    7477        pCritSect->s.Core.cNestings = 1;
    75         ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVM->NativeThreadEMT);
     78        Assert(pVM->aCpu[idCPU].hNativeThread);
     79        ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVM->aCpu[idCPU].hNativeThread);
    7680        STAM_PROFILE_ADV_START(&pCritSect->s.StatLocked, l);
    7781        return VINF_SUCCESS;
     
    8185     * Nested?
    8286     */
    83     if (pCritSect->s.Core.NativeThreadOwner == pVM->NativeThreadEMT)
     87    if (pCritSect->s.Core.NativeThreadOwner == pVM->aCpu[idCPU].hNativeThread)
    8488    {
    8589        pCritSect->s.Core.cNestings++;
     
    159163    PVM pVM = pCritSect->s.CTX_SUFF(pVM);
    160164    Assert(pVM);
    161     Assert(pCritSect->s.Core.NativeThreadOwner == pVM->NativeThreadEMT);
     165    AssertMsg(pCritSect->s.Core.NativeThreadOwner == pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread, ("Owner %RX64 emt=%RX64\n", pCritSect->s.Core.NativeThreadOwner, pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread));
    162166
    163167    /*
     
    183187
    184188        /* darn, someone raced in on us. */
    185         ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVM->NativeThreadEMT);
     189        Assert(pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread);
     190        ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread);
    186191        STAM_PROFILE_ADV_START(&pCritSect->s.StatLocked, l);
    187192    }
     
    217222    PVM pVM = pCritSect->s.CTX_SUFF(pVM);
    218223    Assert(pVM);
    219     return pCritSect->s.Core.NativeThreadOwner == pVM->NativeThreadEMT;
     224    return pCritSect->s.Core.NativeThreadOwner == pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread;
    220225#endif
    221226}
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