Changeset 76fca31 in mainline for kernel/arch/ia32/src/cpu/cpu.c
- Timestamp:
- 2008-12-16T19:02:07Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5ae4443
- Parents:
- 8fe5980
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/cpu/cpu.c
r8fe5980 r76fca31 66 66 static char *vendor_str[] = { 67 67 "Unknown Vendor", 68 "A uthenticAMD",69 " GenuineIntel"68 "AMD", 69 "Intel" 70 70 }; 71 71 … … 78 78 : 79 79 : 80 : "%eax"80 : "%eax" 81 81 ); 82 82 } … … 90 90 : 91 91 : 92 : "%eax"92 : "%eax" 93 93 ); 94 94 } … … 141 141 * Check for AMD processor. 142 142 */ 143 if (info.cpuid_ebx==AMD_CPUID_EBX && info.cpuid_ecx==AMD_CPUID_ECX && info.cpuid_edx==AMD_CPUID_EDX) { 143 if ((info.cpuid_ebx == AMD_CPUID_EBX) 144 && (info.cpuid_ecx == AMD_CPUID_ECX) 145 && (info.cpuid_edx == AMD_CPUID_EDX)) 144 146 CPU->arch.vendor = VendorAMD; 145 } 146 147 147 148 /* 148 149 * Check for Intel processor. 149 150 */ 150 if (info.cpuid_ebx==INTEL_CPUID_EBX && info.cpuid_ecx==INTEL_CPUID_ECX && info.cpuid_edx==INTEL_CPUID_EDX) { 151 if ((info.cpuid_ebx == INTEL_CPUID_EBX) 152 && (info.cpuid_ecx == INTEL_CPUID_ECX) 153 && (info.cpuid_edx == INTEL_CPUID_EDX)) 151 154 CPU->arch.vendor = VendorIntel; 152 } 153 155 154 156 cpuid(1, &info); 155 CPU->arch.family = (info.cpuid_eax >>8)&0xf;156 CPU->arch.model = (info.cpuid_eax >>4)&0xf;157 CPU->arch.stepping = (info.cpuid_eax >>0)&0xf;157 CPU->arch.family = (info.cpuid_eax >> 8) & 0x0f; 158 CPU->arch.model = (info.cpuid_eax >> 4) & 0x0f; 159 CPU->arch.stepping = (info.cpuid_eax >> 0) & 0x0f; 158 160 } 159 161 } 160 162 161 void cpu_print_report(cpu_t* m)163 void cpu_print_report(cpu_t* cpu) 162 164 { 163 printf("cpu% d: (%s family=%d model=%d stepping=%d) %dMHz\n",164 m->id, vendor_str[m->arch.vendor], m->arch.family, m->arch.model, m->arch.stepping,165 m->frequency_mhz);165 printf("cpu%u: (%s family=%u model=%u stepping=%u) %" PRIu16 " MHz\n", 166 cpu->id, vendor_str[cpu->arch.vendor], cpu->arch.family, 167 cpu->arch.model, cpu->arch.stepping, cpu->frequency_mhz); 166 168 } 167 169
Note:
See TracChangeset
for help on using the changeset viewer.