Changeset 31356 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Aug 4, 2010 12:59:29 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64405
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r31353 r31356 27 27 #include <VBox/param.h> 28 28 #include <iprt/thread.h> 29 #include <iprt/mp.h> 29 30 30 31 … … 59 60 if (pVM->cCpus == 1) 60 61 return 0; 62 63 /* Search first by host cpu id (most common case) 64 * and then by native thread id (page fusion case). 65 */ 66 /* RTMpCpuId had better be cheap. */ 67 RTCPUID idHostCpu = RTMpCpuId(); 68 69 /** @todo optimize for large number of VCPUs when that becomes more common. */ 70 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 71 { 72 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 73 74 if (pVCpu->idHostCpu == idHostCpu) 75 return pVCpu->idCpu; 76 } 61 77 62 78 /* RTThreadGetNativeSelf had better be cheap. */ … … 99 115 return &pVM->aCpus[0]; 100 116 117 /* Search first by host cpu id (most common case) 118 * and then by native thread id (page fusion case). 119 */ 120 121 /* RTMpCpuId had better be cheap. */ 122 RTCPUID idHostCpu = RTMpCpuId(); 123 124 /** @todo optimize for large number of VCPUs when that becomes more common. */ 125 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 126 { 127 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 128 129 if (pVCpu->idHostCpu == idHostCpu) 130 return pVCpu; 131 } 132 101 133 /* RTThreadGetNativeSelf had better be cheap. */ 102 134 RTNATIVETHREAD hThread = RTThreadNativeSelf();
Note:
See TracChangeset
for help on using the changeset viewer.