aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86/lib
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2012-02-25 23:51:12 +0100
committerPeter Stuge <peter@stuge.se>2012-03-20 15:13:09 +0100
commit06253cd9a5742078386f355a06c0f13bebbcc5ce (patch)
tree07228b3b106b9edcbe7083d4fbaef8530c05ccdc /src/arch/x86/lib
parent06c04299c1420fa94a1a53cc36c9d91a5e31a22a (diff)
Avoid using CPUID in SMBIOS tables. Check for CPUID otherwise claim 486 class cpu.
Change-Id: Ic7c4452a1b55bae0cefee118003540ec39ef9fd4 Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Reviewed-on: http://review.coreboot.org/683 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'src/arch/x86/lib')
-rw-r--r--src/arch/x86/lib/cpu.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/arch/x86/lib/cpu.c b/src/arch/x86/lib/cpu.c
index a7f7b322c0..fac523f902 100644
--- a/src/arch/x86/lib/cpu.c
+++ b/src/arch/x86/lib/cpu.c
@@ -31,9 +31,8 @@ static inline int flag_is_changeable_p(uint32_t flag)
return ((f1^f2) & flag) != 0;
}
-
/* Probe for the CPUID instruction */
-static int have_cpuid_p(void)
+int cpu_have_cpuid(void)
{
return flag_is_changeable_p(X86_EFLAGS_ID);
}
@@ -141,7 +140,7 @@ static int cpu_cpuid_extended_level(void)
int cpu_phys_address_size(void)
{
- if (!(have_cpuid_p()))
+ if (!(cpu_have_cpuid()))
return 32;
if (cpu_cpuid_extended_level() >= 0x80000008)
@@ -159,7 +158,7 @@ static void identify_cpu(struct device *cpu)
vendor_name[0] = '\0'; /* Unset */
/* Find the id and vendor_name */
- if (!have_cpuid_p()) {
+ if (!cpu_have_cpuid()) {
/* Its a 486 if we can modify the AC flag */
if (flag_is_changeable_p(X86_EFLAGS_AC)) {
cpu->device = 0x00000400; /* 486 */
@@ -175,7 +174,7 @@ static void identify_cpu(struct device *cpu)
memcpy(vendor_name, "NexGenDriven", 13);
}
}
- if (have_cpuid_p()) {
+ if (cpu_have_cpuid()) {
int cpuid_level;
struct cpuid_result result;
result = cpuid(0x00000000);