Changeset 19385 in vbox
- Timestamp:
- May 5, 2009 3:43:14 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 46891
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r19382 r19385 1054 1054 } 1055 1055 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. 1058 1061 * 1059 1062 * @returns VBox status code 1060 1063 * @param pVM The shared VM structure (the ring-0 mapping). 1061 * @param idCpu VCPU id 1064 * @param idCpu VCPU id. 1062 1065 */ 1063 1066 GVMMR0DECL(int) GVMMR0RegisterVCpu(PVM pVM, unsigned idCpu) 1064 1067 { 1065 AssertReturn(idCpu < pVM->cCPUs, VERR_INVALID_CPU_ID);1068 AssertReturn(idCpu != 0, VERR_NOT_OWNER); 1066 1069 1067 1070 /* 1068 1071 * Validate the VM structure, state and handle. 1069 1072 */ 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 */); 1075 1076 if (RT_FAILURE(rc)) 1076 1077 return rc; 1077 1078 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); 1079 1081 1080 1082 pGVM->aCpus[idCpu].hEMT = RTThreadNativeSelf(); 1081 1083 return VINF_SUCCESS; 1082 1084 } 1085 1083 1086 1084 1087 /**
Note:
See TracChangeset
for help on using the changeset viewer.