VirtualBox

Changeset 19382 in vbox for trunk/src


Ignore:
Timestamp:
May 5, 2009 2:56:15 PM (16 years ago)
Author:
vboxsync
Message:

Introduced GVMMR0RegisterVCpu. (not used yet; untested)

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

Legend:

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

    r19381 r19382  
    10541054}
    10551055
     1056/**
     1057 * Register a new VCPU EMT thread (VCPU 0 is automatically registered during VM creation)
     1058 *
     1059 * @returns VBox status code
     1060 * @param   pVM             The shared VM structure (the ring-0 mapping).
     1061 * @param   idCpu           VCPU id
     1062 */
     1063GVMMR0DECL(int) GVMMR0RegisterVCpu(PVM pVM, unsigned idCpu)
     1064{
     1065    AssertReturn(idCpu < pVM->cCPUs, VERR_INVALID_CPU_ID);
     1066
     1067    /*
     1068     * Validate the VM structure, state and handle.
     1069     */
     1070    PGVMM   pGVMM;
     1071    PGVM    pGVM;
     1072    PGVMCPU pCurGVCpu;
     1073
     1074    int rc = gvmmR0ByVMAndEMT(pVM, idCpu, &pGVM, &pGVMM);
     1075    if (RT_FAILURE(rc))
     1076        return rc;
     1077
     1078    AssertReturn(!pGVM->aCpus[idCpu].hEMT, VERR_ACCESS_DENIED);
     1079
     1080    pGVM->aCpus[idCpu].hEMT = RTThreadNativeSelf();
     1081    return VINF_SUCCESS;
     1082}
    10561083
    10571084/**
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r19381 r19382  
    743743            return GVMMR0DestroyVM(pVM);
    744744
     745        case VMMR0_DO_GVMM_REGISTER_VMCPU:
     746            if (!pVM)
     747                return VERR_INVALID_PARAMETER;
     748            return GVMMR0RegisterVCpu(pVM, idCpu);
     749
    745750        case VMMR0_DO_GVMM_SCHED_HALT:
    746751            if (pReqHdr)
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