Improved processor identification for some VIA C3 models.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15558 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-12-16 11:55:01 +00:00
parent e4857dd34d
commit 348c7214f5
4 changed files with 29 additions and 15 deletions
+4 -2
View File
@@ -477,8 +477,10 @@ typedef enum cpu_types {
B_CPU_IDT_WINCHIP_C6 = 0x1354, B_CPU_IDT_WINCHIP_C6 = 0x1354,
B_CPU_IDT_WINCHIP_2 = 0x1358, B_CPU_IDT_WINCHIP_2 = 0x1358,
B_CPU_IDT_WINCHIP_3, B_CPU_IDT_WINCHIP_3,
B_CPU_VIA_EDEN = 0x1367, B_CPU_VIA_C3_SAMUEL = 0x1366,
B_CPU_VIA_EDEN_EZRA_T = 0x1368, B_CPU_VIA_C3_SAMUEL_2 = 0x1367,
B_CPU_VIA_C3_EZRA_T = 0x1368,
B_CPU_VIA_C3_NEHEMIAH = 0x1369,
/* Transmeta */ /* Transmeta */
B_CPU_TRANSMETA_x86 = 0x1600, B_CPU_TRANSMETA_x86 = 0x1600,
+23 -11
View File
@@ -16,8 +16,9 @@ extern "C" {
#endif #endif
const char *get_cpu_vendor_string(enum cpu_types type); const char *get_cpu_vendor_string(enum cpu_types type);
const char *get_cpu_model_string(enum cpu_types type); const char *get_cpu_model_string(system_info *info);
void get_cpu_type(char *vendorBuffer, size_t vendorSize, char *modelBuffer, size_t modelSize); void get_cpu_type(char *vendorBuffer, size_t vendorSize,
char *modelBuffer, size_t modelSize);
int32 get_rounded_cpu_speed(void); int32 get_rounded_cpu_speed(void);
#ifdef __cplusplus #ifdef __cplusplus
@@ -59,10 +60,10 @@ get_cpu_vendor_string(enum cpu_types type)
const char * const char *
get_cpu_model_string(enum cpu_types type) get_cpu_model_string(system_info *info)
{ {
// Determine CPU type // Determine CPU type
switch (type) { switch (info->cpu_type) {
#if __POWERPC__ #if __POWERPC__
case B_CPU_PPC_603: case B_CPU_PPC_603:
return "603"; return "603";
@@ -156,9 +157,20 @@ get_cpu_model_string(enum cpu_types type)
return "WinChip C6"; return "WinChip C6";
case B_CPU_IDT_WINCHIP_2: case B_CPU_IDT_WINCHIP_2:
return "WinChip 2"; return "WinChip 2";
case B_CPU_VIA_EDEN: case B_CPU_VIA_C3_SAMUEL:
case B_CPU_VIA_EDEN_EZRA_T: return "C3 Samuel";
return "Eden"; case B_CPU_VIA_C3_SAMUEL_2:
// stepping identified the model
if ((info->cpu_revision & 0xf) < 8)
return "C3 Eden/Samuel 2";
return "C3 Ezra";
case B_CPU_VIA_C3_EZRA_T:
return "C3 Ezra-T";
case B_CPU_VIA_C3_NEHEMIAH:
// stepping identified the model
if ((info->cpu_revision & 0xf) < 8)
return "C3 Nehemiah";
return "C3 Eden-N";
/* Cyrix/VIA */ /* Cyrix/VIA */
case B_CPU_CYRIX_GXm: case B_CPU_CYRIX_GXm:
@@ -193,7 +205,7 @@ get_cpu_type(char *vendorBuffer, size_t vendorSize, char *modelBuffer, size_t mo
if (vendor == NULL) if (vendor == NULL)
vendor = "Unknown"; vendor = "Unknown";
model = get_cpu_model_string(info.cpu_type); model = get_cpu_model_string(&info);
if (model == NULL) if (model == NULL)
model = "Unknown"; model = "Unknown";
@@ -212,14 +224,14 @@ get_cpu_type(char *vendorBuffer, size_t vendorSize, char *modelBuffer, size_t mo
int32 int32
get_rounded_cpu_speed(void) get_rounded_cpu_speed(void)
{ {
system_info sys_info; system_info info;
int target, frac, delta; int target, frac, delta;
int freqs[] = { 100, 50, 25, 75, 33, 67, 20, 40, 60, 80, 10, 30, 70, 90 }; int freqs[] = { 100, 50, 25, 75, 33, 67, 20, 40, 60, 80, 10, 30, 70, 90 };
uint x; uint x;
get_system_info(&sys_info); get_system_info(&info);
target = sys_info.cpu_clock_speed / 1000000; target = info.cpu_clock_speed / 1000000;
frac = target % 100; frac = target % 100;
delta = -frac; delta = -frac;
+1 -1
View File
@@ -196,7 +196,7 @@ AboutView::AboutView(const BRect &rect)
BString cpuType; BString cpuType;
cpuType << get_cpu_vendor_string(systemInfo.cpu_type) cpuType << get_cpu_vendor_string(systemInfo.cpu_type)
<< " " << get_cpu_model_string(systemInfo.cpu_type); << " " << get_cpu_model_string(&systemInfo);
r.OffsetBy(0, labelHeight); r.OffsetBy(0, labelHeight);
r.bottom = r.top + textHeight; r.bottom = r.top + textHeight;
+1 -1
View File
@@ -494,7 +494,7 @@ static void
dump_cpus(system_info *info) dump_cpus(system_info *info)
{ {
const char *vendor = get_cpu_vendor_string(info->cpu_type); const char *vendor = get_cpu_vendor_string(info->cpu_type);
const char *model = get_cpu_model_string(info->cpu_type); const char *model = get_cpu_model_string(info);
int32 cpu; int32 cpu;
if (model == NULL && vendor == NULL) if (model == NULL && vendor == NULL)