Changeset 30241 in vbox
- Timestamp:
- Jun 16, 2010 12:33:44 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
include/VBox/hwaccm.h (modified) (1 diff)
-
src/VBox/VMM/VMMAll/VMMAll.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMR0/HWACCMR0.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/hwaccm.h
r28800 r30241 102 102 VMMR0DECL(int) HWACCMR0LeaveSwitcher(PVM pVM, bool fVTxDisabled); 103 103 104 VMMR0DECL(PVMCPU) HWACCMR0GetVMCPU(PVM pVM);105 VMMR0DECL(VMCPUID) HWACCMR0GetVMCPUId(PVM pVM);106 107 104 VMMR0DECL(void) HWACCMR0SavePendingIOPortWrite(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext, unsigned uPort, unsigned uAndVal, unsigned cbSize); 108 105 VMMR0DECL(void) HWACCMR0SavePendingIOPortRead(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext, unsigned uPort, unsigned uAndVal, unsigned cbSize); -
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r30160 r30241 59 59 if (pVM->cCpus == 1) 60 60 return 0; 61 return HWACCMR0GetVMCPUId(pVM); 61 62 /* RTMpCpuId had better be cheap. */ 63 RTCPUID idHostCpu = RTMpCpuId(); 64 65 /** @todo optimize for large number of VCPUs when that becomes more common. */ 66 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 67 { 68 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 69 70 if (pVCpu->idHostCpu == idHostCpu) 71 return pVCpu->idCpu; 72 } 73 return NIL_VMCPUID; 62 74 63 75 #else /* RC: Always EMT(0) */ … … 86 98 if (pVM->cCpus == 1) 87 99 return &pVM->aCpus[0]; 88 return HWACCMR0GetVMCPU(pVM); 100 101 /* RTMpCpuId had better be cheap. */ 102 RTCPUID idHostCpu = RTMpCpuId(); 103 104 /** @todo optimize for large number of VCPUs when that becomes more common. */ 105 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 106 { 107 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 108 109 if (pVCpu->idHostCpu == idHostCpu) 110 return pVCpu; 111 } 112 return NULL; 89 113 90 114 #else /* RC: Always EMT(0) */ -
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r30106 r30241 1317 1317 { 1318 1318 return &HWACCMR0Globals.aCpuInfo[idCpu]; 1319 }1320 1321 /**1322 * Returns the VMCPU of the current EMT thread.1323 *1324 * @param pVM The VM to operate on.1325 */1326 VMMR0DECL(PVMCPU) HWACCMR0GetVMCPU(PVM pVM)1327 {1328 /* RTMpCpuId had better be cheap. */1329 RTCPUID idHostCpu = RTMpCpuId();1330 1331 /** @todo optimize for large number of VCPUs when that becomes more common. */1332 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)1333 {1334 PVMCPU pVCpu = &pVM->aCpus[idCpu];1335 1336 if (pVCpu->hwaccm.s.idEnteredCpu == idHostCpu)1337 return pVCpu;1338 }1339 return NULL;1340 }1341 1342 /**1343 * Returns the VMCPU id of the current EMT thread.1344 *1345 * @param pVM The VM to operate on.1346 */1347 VMMR0DECL(VMCPUID) HWACCMR0GetVMCPUId(PVM pVM)1348 {1349 PVMCPU pVCpu = HWACCMR0GetVMCPU(pVM);1350 if (pVCpu)1351 return pVCpu->idCpu;1352 1353 return 0;1354 1319 } 1355 1320
Note:
See TracChangeset
for help on using the changeset viewer.

