43#ifndef WWLIB_CPU_DETECT_H__
44#define WWLIB_CPU_DETECT_H__
50typedef signed __int64 sint64;
52typedef signed long long sint64;
55class CPUDetectInitClass;
215 unsigned cpuid_type);
219 static void Init_CPUID_Instruction();
220 static void Init_Processor_Speed();
221 static void Init_Processor_String();
222 static void Init_Processor_Manufacturer();
223 static void Init_Processor_Family();
224 static void Init_Processor_Features();
225 static void Init_Memory();
226 static void Init_OS();
228 static void Init_Intel_Processor_Type();
229 static void Init_AMD_Processor_Type();
230 static void Init_VIA_Processor_Type();
231 static void Init_Rise_Processor_Type();
233 static void Init_Cache();
235 static void Init_Processor_Log();
236 static void Init_Compact_Log();
238 static void Process_Cache_Info(
unsigned value);
239 static void Process_Extended_Cache_Info();
246 static int ProcessorType;
247 static int ProcessorFamily;
248 static int ProcessorModel;
249 static int ProcessorRevision;
250 static int ProcessorSpeed;
251 static sint64 ProcessorTicksPerSecond;
252 static double InvProcessorTicksPerSecond;
260 static unsigned FeatureBits;
261 static unsigned ExtendedFeatureBits;
264 static unsigned L2CacheSize;
265 static unsigned L2CacheLineSize;
266 static unsigned L2CacheSetAssociative;
269 static unsigned L1DataCacheSize;
270 static unsigned L1DataCacheLineSize;
271 static unsigned L1DataCacheSetAssociative;
274 static unsigned L1InstructionCacheSize;
275 static unsigned L1InstructionCacheLineSize;
276 static unsigned L1InstructionCacheSetAssociative;
279 static unsigned L1InstructionTraceCacheSize;
280 static unsigned L1InstructionTraceCacheSetAssociative;
282 static unsigned TotalPhysicalMemory;
283 static unsigned AvailablePhysicalMemory;
284 static unsigned TotalPageMemory;
285 static unsigned AvailablePageMemory;
286 static unsigned TotalVirtualMemory;
287 static unsigned AvailableVirtualMemory;
289 static unsigned OSVersionNumberMajor;
290 static unsigned OSVersionNumberMinor;
291 static unsigned OSVersionBuildNumber;
292 static unsigned OSVersionPlatformId;
295 static bool HasCPUIDInstruction;
296 static bool HasRDTSCInstruction;
297 static bool HasSSESupport;
298 static bool HasSSE2Support;
299 static bool HasCMOVSupport;
300 static bool HasMMXSupport;
301 static bool Has3DNowSupport;
302 static bool HasExtended3DNowSupport;
303 static char VendorID[20];
304 static char ProcessorString[48];
@ INTEL_PROCESSOR_80486SX
@ INTEL_PROCESSOR_80486DX2_WB
@ INTEL_PROCESSOR_CELERON_MODEL_8
@ INTEL_PROCESSOR_PENTIUM_MMX
@ INTEL_PROCESSOR_UNKNOWN
@ INTEL_PROCESSOR_80486DX4_WB
@ INTEL_PROCESSOR_80486SX2
@ INTEL_PROCESSOR_PENTIUM_II_MODEL_5
@ INTEL_PROCESSOR_PENTIUM_III_MODEL_8
@ INTEL_PROCESSOR_80486DX
@ INTEL_PROCESSOR_PENTIUM_III_MODEL_B
@ INTEL_PROCESSOR_PENTIUM_II_MODEL_3
@ INTEL_PROCESSOR_80486DX4
@ INTEL_PROCESSOR_PENTIUM_III_XEON_MODEL_7
@ INTEL_PROCESSOR_80486SL
@ INTEL_PROCESSOR_CELERON_MODEL_5
@ INTEL_PROCESSOR_PENTIUM_PRO_SAMPLE
@ INTEL_PROCESSOR_PENTIUM_III_XEON_MODEL_A
@ INTEL_PROCESSOR_PENTIUM
@ INTEL_PROCESSOR_PENTIUM_II_MODEL_4
@ INTEL_PROCESSOR_PENTIUM_II_OVERDRIVE
@ INTEL_PROCESSOR_PENTIUM_II_XEON_MODEL_5
@ INTEL_PROCESSOR_PENTIUM_PRO
@ INTEL_PROCESSOR_PENTIUM_III_MODEL_7
@ INTEL_PROCESSOR_PENTIUM_OVERDRIVE
@ INTEL_PROCESSOR_PENTIUM4
@ INTEL_PROCESSOR_PENTIUM_III_XEON_MODEL_8
@ INTEL_PROCESSOR_CELERON_MODEL_6
@ INTEL_PROCESSOR_80486DX2
static unsigned Get_Total_Physical_Memory()
static unsigned Get_Total_Virtual_Memory()
static AMDProcessorType Get_AMD_Processor()
ProcessorManufacturerType
static int Get_Processor_Speed()
static const char * Get_Processor_Manufacturer_Name()
static bool Has_CPUID_Instruction()
static IntelProcessorType Get_Intel_Processor()
static bool Has_3DNow_Instruction_Set()
static unsigned Get_L1_Instruction_Trace_Cache_Size()
static const StringClass & Get_Processor_Log()
static ProcessorManufacturerType Get_Processor_Manufacturer()
friend class CPUDetectInitClass
static sint64 Get_Processor_Ticks_Per_Second()
static RiseProcessorType Get_Rise_Processor()
static bool Has_CMOV_Instruction()
static unsigned Get_L2_Cache_Size()
static const char * Get_Processor_String()
static unsigned Get_Available_Page_File_Size()
static unsigned Get_Total_Page_File_Size()
static unsigned Get_L1_Data_Cache_Set_Associative()
@ VIA_PROCESSOR_CYRIX_III_SAMUEL
@ VIA_PROCESSOR_IDT_C6_WINCHIP2
@ VIA_PROCESSOR_IDT_C6_WINCHIP3
@ VIA_PROCESSOR_IDT_C6_WINCHIP
static unsigned Get_L1_Data_Cache_Size()
static unsigned Get_L1_Instruction_Trace_Cache_Set_Associative()
static unsigned Get_Processor_Type()
static unsigned Get_Available_Physical_Memory()
static bool Has_Extended_3DNow_Instruction_Set()
static unsigned Get_Available_Virtual_Memory()
static double Get_Inv_Processor_Ticks_Per_Second()
static unsigned Get_L1_Instruction_Cache_Line_Size()
static unsigned Get_L2_Cache_Line_Size()
static unsigned Get_L1_Instruction_Cache_Set_Associative()
static bool CPUID(unsigned &u_eax_, unsigned &u_ebx_, unsigned &u_ecx_, unsigned &u_edx_, unsigned cpuid_type)
static unsigned Get_Feature_Bits()
@ AMD_PROCESSOR_ATHLON_025
@ AMD_PROCESSOR_K6_MODEL7
@ AMD_PROCESSOR_K6_3_3DNOW_MODEL9
@ AMD_PROCESSOR_K5_MODEL0
@ AMD_PROCESSOR_K5_MODEL1
@ AMD_PROCESSOR_K6_2_3DNOW_MODEL8
@ AMD_PROCESSOR_ATHLON_018
@ AMD_PROCESSOR_K5_MODEL2
@ AMD_PROCESSOR_ATHLON_018_IL2
@ AMD_PROCESSOR_K6_3_PLUS
@ AMD_PROCESSOR_K6_MODEL6
@ AMD_PROCESSOR_K5_MODEL3
static bool Has_SSE_Instruction_Set()
static unsigned Get_L2_Cache_Set_Associative()
static bool Has_SSE2_Instruction_Set()
@ RISE_PROCESSOR_DRAGON2_025
@ RISE_PROCESSOR_DRAGON_018
@ RISE_PROCESSOR_DRAGON_025
@ RISE_PROCESSOR_DRAGON2_018
static unsigned Get_Extended_Feature_Bits()
static VIAProcessorType Get_VIA_Processor()
static const StringClass & Get_Compact_Log()
static unsigned Get_L1_Instruction_Cache_Size()
static bool Has_RDTSC_Instruction()
static unsigned Get_L1_Data_Cache_Line_Size()
static bool Has_MMX_Instruction_Set()
CPUIDStruct(unsigned cpuid_type)