| 1 | /* $Id: cpuhlp.h,v 1.6 2001-07-08 07:19:26 sandervl Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | #ifndef _CPUHLP_H_ | 
|---|
| 4 | #define _CPUHLP_H_ | 
|---|
| 5 |  | 
|---|
| 6 | #include <float.h> | 
|---|
| 7 |  | 
|---|
| 8 | #ifdef __cplusplus | 
|---|
| 9 | extern "C" { | 
|---|
| 10 | #endif | 
|---|
| 11 |  | 
|---|
| 12 | #define BIT(a)  (1<<a) | 
|---|
| 13 |  | 
|---|
| 14 | #define CPUID_FPU_PRESENT               BIT(0) | 
|---|
| 15 | #define CPUID_VMMODE_EXTENSIONS         BIT(1) | 
|---|
| 16 | #define CPUID_DBG_EXTENSIONS            BIT(2) | 
|---|
| 17 | #define CPUID_PAGE_SIZE_EXTENSIONS      BIT(3) | 
|---|
| 18 | #define CPUID_TIME_STAMP_COUNTER        BIT(4) | 
|---|
| 19 | #define CPUID_K86_MODEL_REGS            BIT(5) | 
|---|
| 20 | #define CPUID_MACHINE_CHECK_EXCEPTION   BIT(7) | 
|---|
| 21 | #define CPUID_CMPXCHG8B_INSTRUCTION     BIT(8) | 
|---|
| 22 | #define CPUID_APIC                      BIT(9) | 
|---|
| 23 | #define CPUID_MEMORY_TYPE_RANGE_REGS    BIT(12) | 
|---|
| 24 | #define CPUID_GLOBAL_PAGING_EXTENSIONS  BIT(13) | 
|---|
| 25 | #define CPUID_CONDITIONAL_MOVE          BIT(15) | 
|---|
| 26 | #define CPUID_MMX                       BIT(23) | 
|---|
| 27 |  | 
|---|
| 28 | BOOL  CDECL SupportsCPUID(); | 
|---|
| 29 |  | 
|---|
| 30 | void  CDECL GetCPUVendorString(char *vendor); | 
|---|
| 31 | DWORD CDECL GetCPUFeatures(); | 
|---|
| 32 | DWORD CDECL GetCPUSignature(); | 
|---|
| 33 | void  CDECL GetTSC(LONG *high, LONG *low); | 
|---|
| 34 |  | 
|---|
| 35 | void  InitSystemInfo(int nrcpus); | 
|---|
| 36 |  | 
|---|
| 37 | extern DWORD CPUFeatures; | 
|---|
| 38 |  | 
|---|
| 39 | #if (__IBMC__ >= 360) || (__IBMCPP__ >= 360) | 
|---|
| 40 | #define CONTROL87(a,b)  __control87(a, b) | 
|---|
| 41 | #else | 
|---|
| 42 | #if (__IBMCPP__ == 300) || (__IBMC__ == 300) | 
|---|
| 43 | #define CONTROL87(a,b)  _control87(a, b) | 
|---|
| 44 | #else | 
|---|
| 45 | #error  CONTROL87 undefined | 
|---|
| 46 | #endif | 
|---|
| 47 | #endif | 
|---|
| 48 |  | 
|---|
| 49 | #ifdef __cplusplus | 
|---|
| 50 | } | 
|---|
| 51 | #endif | 
|---|
| 52 |  | 
|---|
| 53 | #endif /* _CPUHLP_H_ */ | 
|---|
| 54 |  | 
|---|