- Added support in system info for extended cpu family and model.
- Take extended family and model into account when generating the cpu type and revision. - Added Intel Core 2 Extreme to the cpu list. Please review. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24509 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -455,6 +455,7 @@ typedef enum cpu_types {
|
||||
B_CPU_INTEL_PENTIUM_IV_MODEL_2,
|
||||
B_CPU_INTEL_PENTIUM_IV_MODEL_3,
|
||||
B_CPU_INTEL_PENTIUM_IV_MODEL_4,
|
||||
B_CPU_INTEL_PENTIUM_CORE_2_EXTREME = 0x1467,
|
||||
|
||||
/* AMD */
|
||||
|
||||
|
||||
@@ -189,8 +189,10 @@ typedef struct arch_cpu_info {
|
||||
const char *vendor_name;
|
||||
int type;
|
||||
int family;
|
||||
int extended_family;
|
||||
int stepping;
|
||||
int model;
|
||||
int extended_model;
|
||||
char feature_string[256];
|
||||
|
||||
// local TSS for this cpu
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
@@ -48,7 +49,14 @@ get_cpu_vendor_string(enum cpu_types type)
|
||||
return "VIA";
|
||||
return "IDT";
|
||||
case B_CPU_RISE_x86:
|
||||
return "Rise";
|
||||
// TODO(bga): There is a conflict between new Intel
|
||||
// CPUs that sets extended model bits and the RISE
|
||||
// CPUs. For now we check for it here but there is
|
||||
// probably a better solution.
|
||||
if (type == B_CPU_INTEL_PENTIUM_CORE_2_EXTREME)
|
||||
return "Intel";
|
||||
else
|
||||
return "Rise";
|
||||
case B_CPU_TRANSMETA_x86:
|
||||
return "Transmeta";
|
||||
|
||||
@@ -115,6 +123,8 @@ get_cpu_model_string(system_info *info)
|
||||
case B_CPU_INTEL_PENTIUM_IV_MODEL_3:
|
||||
case B_CPU_INTEL_PENTIUM_IV_MODEL_4:
|
||||
return "Pentium 4";
|
||||
case B_CPU_INTEL_PENTIUM_CORE_2_EXTREME:
|
||||
return "Core 2 Extreme";
|
||||
|
||||
/* AMD */
|
||||
case B_CPU_AMD_K5_MODEL_0:
|
||||
|
||||
@@ -356,10 +356,15 @@ detect_cpu(int curr_cpu)
|
||||
get_current_cpuid(&cpuid, 1);
|
||||
cpu->arch.type = cpuid.eax_1.type;
|
||||
cpu->arch.family = cpuid.eax_1.family;
|
||||
cpu->arch.extended_family = cpuid.eax_1.extended_family;
|
||||
cpu->arch.model = cpuid.eax_1.model;
|
||||
cpu->arch.extended_model = cpuid.eax_1.extended_model;
|
||||
cpu->arch.stepping = cpuid.eax_1.stepping;
|
||||
dprintf("CPU %d: type %d family %d model %d stepping %d, string '%s'\n",
|
||||
curr_cpu, cpu->arch.type, cpu->arch.family, cpu->arch.model, cpu->arch.stepping, vendor_str);
|
||||
dprintf("CPU %d: type %d family %d extended_family %d model %d "
|
||||
"extended_model %d stepping %d, string '%s'\n",
|
||||
curr_cpu, cpu->arch.type, cpu->arch.family,
|
||||
cpu->arch.extended_family, cpu->arch.model,
|
||||
cpu->arch.extended_model, cpu->arch.stepping, vendor_str);
|
||||
|
||||
// figure out what vendor we have here
|
||||
|
||||
|
||||
@@ -115,9 +115,13 @@ arch_system_info_init(struct kernel_args *args)
|
||||
}
|
||||
|
||||
if (base != B_CPU_x86)
|
||||
model = (cpu->arch.family << 4) + cpu->arch.model;
|
||||
model = (cpu->arch.extended_family << 14) +
|
||||
(cpu->arch.extended_model << 10) + (cpu->arch.family << 4) +
|
||||
cpu->arch.model;
|
||||
|
||||
sCpuRevision = (cpu->arch.type << 12)
|
||||
sCpuRevision = (cpu->arch.extended_family << 18)
|
||||
| (cpu->arch.extended_model << 14)
|
||||
| (cpu->arch.type << 12)
|
||||
| (cpu->arch.family << 8)
|
||||
| (cpu->arch.model << 4)
|
||||
| cpu->arch.stepping;
|
||||
|
||||
Reference in New Issue
Block a user