Changeset 21916 for trunk/src/kernel32/cpu.cpp
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/src/kernel32/cpu.cpp
r21343 r21916 28 28 29 29 static BYTE PF[64] = {0,}; 30 static nrCPUs= 1;30 static int nrCPUs = 1; 31 31 static SYSTEM_INFO cachedsi = {0}; 32 32 … … 53 53 * Note that there is a hierarchy for every processor installed, so this 54 54 * supports multiprocessor systems. This is done like Win95 does it, I think. 55 * 55 * 56 56 * It also creates a cached flag array for IsProcessorFeaturePresent(). 57 57 * … … 104 104 } 105 105 106 if(SupportsCPUID()) 106 if(SupportsCPUID()) 107 107 { 108 for(int i=0;i<cachedsi.dwNumberOfProcessors;i++) 108 for(int i=0;i<cachedsi.dwNumberOfProcessors;i++) 109 109 { 110 110 // Create a new processor subkey … … 153 153 154 154 Sleep(32); //sleep for about 32 ms 155 155 156 156 GetTSC((LONG *)&tsc2.LowPart, &tsc2.HighPart); 157 157 QueryPerformanceCounter(&time2); … … 167 167 tmp1 = (double)tsc1.LowPart + (double)tsc1.HighPart*4.0*1024.0*1024.0; 168 168 clockticks = tmp - tmp1; 169 if(millisec > 0) 169 if(millisec > 0) 170 170 {//make sure we have something valid here 171 171 tmp = 1000 / millisec; … … 199 199 if (features & CPUID_FPU_PRESENT) { 200 200 if (i == 0) { 201 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS) 201 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS) 202 202 dprintf(("Unable to register FPU information\n")); 203 203 } … … 208 208 } 209 209 } 210 210 211 211 } //for each cpu 212 212 }
Note:
See TracChangeset
for help on using the changeset viewer.