Changeset 10421 in vbox
- Timestamp:
- Jul 9, 2008 1:52:22 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 33081
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/linux/mp-linux.cpp
r10419 r10421 219 219 * @returns Max cpus. 220 220 */ 221 DECLINLINE(RTCPUID) rtMpLinuxMaxCpus(void) 222 { 221 static RTCPUID rtMpLinuxMaxCpus(void) 222 { 223 #if 0 /* this doesn't do the right thing :-/ */ 223 224 int cMax = sysconf(_SC_NPROCESSORS_CONF); 224 225 Assert(cMax >= 1); 225 226 return cMax; 227 #else 228 static uint32_t s_cMax = 0; 229 if (!s_cMax) 230 { 231 int cMax = 1; 232 for (unsigned iCpu = 0; iCpu < RTCPUSET_MAX_CPUS; iCpu++) 233 if (rtLinuxSysFsExists("devices/system/cpu/cpu%d", iCpu)) 234 cMax = iCpu + 1; 235 ASMAtomicUoWriteU32((uint32_t volatile *)&s_cMax, cMax); 236 return cMax; 237 } 238 return s_cMax; 239 #endif 226 240 } 227 241
Note:
See TracChangeset
for help on using the changeset viewer.