VirtualBox

Changeset 19385 in vbox


Ignore:
Timestamp:
May 5, 2009 3:43:14 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
46891
Message:

GVMMR0RegisterVCpu: use gvmmR0ByVM instead of gvmmR0ByVMAndEMT as we're not EMT0 (still untested).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp

    r19382 r19385  
    10541054}
    10551055
    1056 /**
    1057  * Register a new VCPU EMT thread (VCPU 0 is automatically registered during VM creation)
     1056
     1057/**
     1058 * Registers the calling thread as the EMT of a Virtual CPU.
     1059 *
     1060 * Note that VCPU 0 is automatically registered during VM creation.
    10581061 *
    10591062 * @returns VBox status code
    10601063 * @param   pVM             The shared VM structure (the ring-0 mapping).
    1061  * @param   idCpu           VCPU id
     1064 * @param   idCpu           VCPU id.
    10621065 */
    10631066GVMMR0DECL(int) GVMMR0RegisterVCpu(PVM pVM, unsigned idCpu)
    10641067{
    1065     AssertReturn(idCpu < pVM->cCPUs, VERR_INVALID_CPU_ID);
     1068    AssertReturn(idCpu != 0, VERR_NOT_OWNER);
    10661069
    10671070    /*
    10681071     * Validate the VM structure, state and handle.
    10691072     */
    1070     PGVMM   pGVMM;
    1071     PGVM    pGVM;
    1072     PGVMCPU pCurGVCpu;
    1073 
    1074     int rc = gvmmR0ByVMAndEMT(pVM, idCpu, &pGVM, &pGVMM);
     1073    PGVM pGVM;
     1074    PGVMM pGVMM;
     1075    int rc = gvmmR0ByVM(pVM, &pGVM, &pGVMM, false /* fTakeUsedLock */);
    10751076    if (RT_FAILURE(rc))
    10761077        return rc;
    10771078
    1078     AssertReturn(!pGVM->aCpus[idCpu].hEMT, VERR_ACCESS_DENIED);
     1079    AssertReturn(idCpu < pVM->cCPUs, VERR_INVALID_CPU_ID);
     1080    AssertReturn(pGVM->aCpus[idCpu].hEMT == NIL_RTNATIVETHREAD, VERR_ACCESS_DENIED);
    10791081
    10801082    pGVM->aCpus[idCpu].hEMT = RTThreadNativeSelf();
    10811083    return VINF_SUCCESS;
    10821084}
     1085
    10831086
    10841087/**
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