| 241 | }; |
| 242 | |
| 243 | void |
| 244 | printcpuinfo(void) |
| 245 | { |
| 246 | u_int regs[4], i; |
| 247 | char *brand; |
| 248 | |
| 249 | printf("CPU: "); |
| 250 | #ifdef __i386__ |
| 251 | cpu_class = cpus[cpu].cpu_class; |
| 252 | strncpy(cpu_model, cpus[cpu].cpu_name, sizeof (cpu_model)); |
| 253 | #else |
| 254 | strncpy(cpu_model, "Hammer", sizeof (cpu_model)); |
| 255 | #endif |
| 256 | |
| 257 | /* Check for extended CPUID information and a processor name. */ |
| 258 | if (cpu_exthigh >= 0x80000004) { |
| 259 | brand = cpu_brand; |
| 260 | for (i = 0x80000002; i < 0x80000005; i++) { |
| 261 | do_cpuid(i, regs); |
| 262 | memcpy(brand, regs, sizeof(regs)); |
| 263 | brand += sizeof(regs); |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | switch (cpu_vendor_id) { |
| 268 | case CPU_VENDOR_INTEL: |
| 269 | #ifdef __i386__ |
| 270 | if ((cpu_id & 0xf00) > 0x300) { |
| 271 | u_int brand_index; |
| 272 | |
| 273 | cpu_model[0] = '\0'; |
| 274 | |
| 275 | switch (cpu_id & 0x3000) { |
| 276 | case 0x1000: |
| 277 | strcpy(cpu_model, "Overdrive "); |
| 278 | break; |
| 279 | case 0x2000: |
| 280 | strcpy(cpu_model, "Dual "); |
| 281 | break; |
| 282 | } |
| 283 | |
| 284 | switch (cpu_id & 0xf00) { |
| 285 | case 0x400: |
| 286 | strcat(cpu_model, "i486 "); |
| 287 | /* Check the particular flavor of 486 */ |
| 288 | switch (cpu_id & 0xf0) { |
| 289 | case 0x00: |
| 290 | case 0x10: |
| 291 | strcat(cpu_model, "DX"); |
| 292 | break; |
| 293 | case 0x20: |
| 294 | strcat(cpu_model, "SX"); |
| 295 | break; |
| 296 | case 0x30: |
| 297 | strcat(cpu_model, "DX2"); |
| 298 | break; |
| 299 | case 0x40: |
| 300 | strcat(cpu_model, "SL"); |
no test coverage detected