Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / arch / x86 / kernel / cpu / nexgen.c
blob961fbe1a748fc290b15cc151833bb6177f422085
1 #include <linux/kernel.h>
2 #include <linux/init.h>
3 #include <linux/string.h>
4 #include <asm/processor.h>
6 #include "cpu.h"
8 /*
9 * Detect a NexGen CPU running without BIOS hypercode new enough
10 * to have CPUID. (Thanks to Herbert Oppmann)
13 static int __cpuinit deep_magic_nexgen_probe(void)
15 int ret;
17 __asm__ __volatile__ (
18 " movw $0x5555, %%ax\n"
19 " xorw %%dx,%%dx\n"
20 " movw $2, %%cx\n"
21 " divw %%cx\n"
22 " movl $0, %%eax\n"
23 " jnz 1f\n"
24 " movl $1, %%eax\n"
25 "1:\n"
26 : "=a" (ret) : : "cx", "dx" );
27 return ret;
30 static void __cpuinit init_nexgen(struct cpuinfo_x86 * c)
32 c->x86_cache_size = 256; /* A few had 1 MB... */
35 static void __cpuinit nexgen_identify(struct cpuinfo_x86 * c)
37 /* Detect NexGen with old hypercode */
38 if ( deep_magic_nexgen_probe() ) {
39 strcpy(c->x86_vendor_id, "NexGenDriven");
43 static struct cpu_dev nexgen_cpu_dev __cpuinitdata = {
44 .c_vendor = "Nexgen",
45 .c_ident = { "NexGenDriven" },
46 .c_models = {
47 { .vendor = X86_VENDOR_NEXGEN,
48 .family = 5,
49 .model_names = { [1] = "Nx586" }
52 .c_init = init_nexgen,
53 .c_identify = nexgen_identify,
56 int __init nexgen_init_cpu(void)
58 cpu_devs[X86_VENDOR_NEXGEN] = &nexgen_cpu_dev;
59 return 0;