Changeset 1820 for trunk/src/kernel32/cpu.cpp
- Timestamp:
- Nov 23, 1999, 9:01:18 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/cpu.cpp
r1815 r1820 1 /* $Id: cpu.cpp,v 1. 1 1999-11-23 19:31:35sandervl Exp $ */1 /* $Id: cpu.cpp,v 1.2 1999-11-23 20:01:17 sandervl Exp $ */ 2 2 /* 3 3 * Odin win32 CPU apis … … 25 25 26 26 static BYTE PF[64] = {0,}; 27 28 //****************************************************************************** 29 //****************************************************************************** 30 void InitSystemInfo( )27 static nrCPUs = 1; 28 //****************************************************************************** 29 //****************************************************************************** 30 void InitSystemInfo(int nrcpus) 31 31 { 32 32 SYSTEM_INFO si; 33 33 34 nrCPUs = nrcpus; 34 35 GetSystemInfo(&si); 35 36 } … … 58 59 static SYSTEM_INFO cachedsi; 59 60 HKEY xhkey=0,hkey; 61 HKEY fpukey=0, xhfpukey; 60 62 char buf[20]; 61 63 DWORD features, signature; … … 83 85 cachedsi.lpMaximumApplicationAddress = (void *)0x7FFFFFFF; 84 86 cachedsi.dwActiveProcessorMask = 1; 85 cachedsi.dwNumberOfProcessors = 1;87 cachedsi.dwNumberOfProcessors = nrCPUs; 86 88 cachedsi.dwProcessorType = PROCESSOR_INTEL_386; 87 89 cachedsi.dwAllocationGranularity = 0x10000; … … 154 156 //Create FPU key if one is present 155 157 if (features & CPUID_FPU_PRESENT) { 156 HKEY fpukey;157 if (RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS) {158 dprintf(("Unable to register FPU information\n"));158 if (i == 0) { 159 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS) 160 dprintf(("Unable to register FPU information\n")); 159 161 } 160 else RegCloseKey(fpukey); 162 // Create a new processor subkey 163 if(fpukey) { 164 sprintf(buf,"%d",i); 165 RegCreateKeyA(fpukey,buf,&xhfpukey); 166 } 161 167 } 162 168 … … 169 175 if (hkey) 170 176 RegCloseKey(hkey); 177 if (xhfpukey) 178 RegCloseKey(xhfpukey); 179 if (fpukey) 180 RegCloseKey(fpukey); 181 171 182 } 172 183
Note:
See TracChangeset
for help on using the changeset viewer.