| Summary: | Adding VIA C3 capability printout in i386/identcpu.c | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Mikael Kullberg <hula> |
| Component: | i386 | Assignee: | Ceri Davies <ceri> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 5.1-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->closed Duplicate of i386/57546. Responsible Changed From-To: gnats-admin->ceri Take from gnats-admin. |
CPU info reports VIA C3 unknown on boot. Also, the VIA specific features aren't listed Fix: Here's a patch that prints the information. It doesn't store it anywhere though, so you can't do any checks later to activate the VIA specific features. Anyone used to adding new variables to the kernel could perhaps give me some pointers on how to do that. I'm specifically working on getting the VIA RNG into /dev/random. *** /usr/src/sys/i386/i386/identcpu.c Wed Apr 30 14:23:58 2003 --- identcpu.c Fri Oct 3 18:19:08 2003 *************** *** 78,83 **** --- 78,84 ---- static void identifycyrix(void); #if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) static void print_AMD_features(void); + static void print_C3_features(void); #endif static void print_AMD_info(void); static void print_AMD_assoc(int i); *************** *** 535,540 **** --- 536,544 ---- case 0x670: strcpy(cpu_model, "VIA C3 Samuel 2"); break; + case 0x690: + strcpy(cpu_model, "VIA C3 Nehemiah"); + break; default: strcpy(cpu_model, "VIA/IDT Unknown"); } *************** *** 664,669 **** --- 668,676 ---- if (strcmp(cpu_vendor, "AuthenticAMD") == 0 && cpu_exthigh >= 0x80000001) print_AMD_features(); + if (strcmp(cpu_vendor, "CentaurHauls") == 0 && + (cpu_id & 0xff0) == 0x690) + print_C3_features(); } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { printf(" DIR=0x%04x", cyrix_did); printf(" Stepping=%u", (cyrix_did & 0xf000) >> 12); *************** *** 1082,1087 **** --- 1089,1113 ---- "\0403DNow!" ); } + + static void + print_C3_features(void) + { + u_int regs[4]; + + do_cpuid(0xC0000000, regs); + if (regs[0] >= 0xC0000001) { + do_cpuid(0xC0000001, regs); + printf("\n Via C3 Features=0x%b", regs[3], + "\020" + "\001AIS" /* Alternate instruction set */ + "\003XSTORE" /* Random number generator */ + "\004LH" /* Long haul */ + "\005FEMMS" /* Via 3dnow! extensions */ + ); + } + } + #endif /* How-To-Repeat: Boot a Nehemiah system