Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112850
b: refs/heads/master
c: aef93c8
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Sep 14, 2008
1 parent f06c985 commit 428e70b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e38e05a85828dac23540cd007df5f20985388afc
refs/heads/master: aef93c8bd506a78983d91cd576a97fee6e934ac1
57 changes: 40 additions & 17 deletions trunk/arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,33 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
c->x86_power = cpuid_edx(0x80000007);

}

static void __cpuinit identify_cpu_without_cpuid(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_X86_32
int i;

/*
* First of all, decide if this is a 486 or higher
* It's a 486 if we can modify the AC flag
*/
if (flag_is_changeable_p(X86_EFLAGS_AC))
c->x86 = 4;
else
c->x86 = 3;

for (i = 0; i < X86_VENDOR_NUM; i++)
if (cpu_devs[i] && cpu_devs[i]->c_identify) {
c->x86_vendor_id[0] = 0;
cpu_devs[i]->c_identify(c);
if (c->x86_vendor_id[0]) {
get_cpu_vendor(c);
break;
}
}
#endif
}

/*
* Do minimum CPU detection early.
* Fields really needed: vendor, cpuid_level, family, model, mask,
Expand All @@ -503,13 +530,16 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
#endif
c->x86_cache_alignment = c->x86_clflush_size;

if (!have_cpuid_p())
return;

memset(&c->x86_capability, 0, sizeof c->x86_capability);

c->extended_cpuid_level = 0;

if (!have_cpuid_p())
identify_cpu_without_cpuid(c);

/* cyrix could have cpuid enabled via c_identify()*/
if (!have_cpuid())
return;

cpu_detect(c);

get_cpu_vendor(c);
Expand Down Expand Up @@ -583,10 +613,14 @@ static void __cpuinit detect_nopl(struct cpuinfo_x86 *c)

static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
{
c->extended_cpuid_level = 0;

if (!have_cpuid_p())
return;
identify_cpu_without_cpuid(c);

c->extended_cpuid_level = 0;
/* cyrix could have cpuid enabled via c_identify()*/
if (!have_cpuid())
return;

cpu_detect(c);

Expand Down Expand Up @@ -639,17 +673,6 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
c->x86_cache_alignment = c->x86_clflush_size;
memset(&c->x86_capability, 0, sizeof c->x86_capability);

if (!have_cpuid_p()) {
/*
* First of all, decide if this is a 486 or higher
* It's a 486 if we can modify the AC flag
*/
if (flag_is_changeable_p(X86_EFLAGS_AC))
c->x86 = 4;
else
c->x86 = 3;
}

generic_identify(c);

if (this_cpu->c_identify)
Expand Down

0 comments on commit 428e70b

Please sign in to comment.