Changeset 852
- Timestamp:
- 08/21/08 21:45:43 (3 years ago)
- Files:
-
- 1 modified
-
Whitix/trunk/arch/i386/kernel/cpuid.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/trunk/arch/i386/kernel/cpuid.c
r587 r852 19 19 #include <i386/cpuid.h> 20 20 #include <print.h> 21 #include <module.h> 21 22 22 23 /* Saves the edx value of CPUID level 1. Used to check for RDTSC, SYSENTER and other instructions. 23 24 * Needs to be adjusted for multicore systems. */ 24 25 DWORD features=0; 26 DWORD maxLevel=0; 25 27 26 28 DWORD CpuIdSupports(DWORD mask) … … 51 53 } 52 54 55 void CpuIdVendorId(char* str) 56 { 57 DWORD eax; 58 59 CpuId(0, &eax, (DWORD*)&str[0], (DWORD*)&str[8], (DWORD*)&str[4]); 60 } 61 62 SYMBOL_EXPORT(CpuIdVendorId); 63 64 void CpuIdName(char* str) 65 { 66 ZeroMemory(str, 48); 67 68 if (maxLevel > 0x80000004) 69 { 70 CpuId(0x80000002, (DWORD*)&str[0], (DWORD*)&str[4], (DWORD*)&str[8], (DWORD*)&str[12]); 71 CpuId(0x80000003, (DWORD*)&str[16], (DWORD*)&str[20], (DWORD*)&str[24], (DWORD*)&str[28]); 72 CpuId(0x80000004, (DWORD*)&str[32], (DWORD*)&str[36], (DWORD*)&str[40], (DWORD*)&str[44]); 73 } 74 } 75 76 SYMBOL_EXPORT(CpuIdName); 77 78 DWORD* CpuIdFeatures() 79 { 80 return &features; 81 } 82 83 SYMBOL_EXPORT(CpuIdFeatures); 84 53 85 /*********************************************************************** 54 86 * … … 65 97 { 66 98 char str[12]; 67 DWORD maxLevel;68 99 DWORD eax,ebx,ecx; /* Used to ignore values. */ 69 100
