fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / i386 / kernel / cpu / transmeta.c
index 4bb3c56..4056fb7 100644 (file)
@@ -1,14 +1,15 @@
 #include <linux/kernel.h>
+#include <linux/mm.h>
 #include <linux/init.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
 #include "cpu.h"
 
-static void __init init_transmeta(struct cpuinfo_x86 *c)
+static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
 {
        unsigned int cap_mask, uk, max, dummy;
        unsigned int cms_rev1, cms_rev2;
-       unsigned int cpu_rev, cpu_freq, cpu_flags;
+       unsigned int cpu_rev, cpu_freq, cpu_flags, new_cpu_rev;
        char cpu_info[65];
 
        get_model_name(c);      /* Same as AMD/Cyrix */
@@ -16,17 +17,24 @@ static void __init init_transmeta(struct cpuinfo_x86 *c)
 
        /* Print CMS and CPU revision */
        max = cpuid_eax(0x80860000);
+       cpu_rev = 0;
        if ( max >= 0x80860001 ) {
                cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags); 
-               printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
-                      (cpu_rev >> 24) & 0xff,
-                      (cpu_rev >> 16) & 0xff,
-                      (cpu_rev >> 8) & 0xff,
-                      cpu_rev & 0xff,
-                      cpu_freq);
+               if (cpu_rev != 0x02000000) {
+                       printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
+                               (cpu_rev >> 24) & 0xff,
+                               (cpu_rev >> 16) & 0xff,
+                               (cpu_rev >> 8) & 0xff,
+                               cpu_rev & 0xff,
+                               cpu_freq);
+               }
        }
        if ( max >= 0x80860002 ) {
-               cpuid(0x80860002, &dummy, &cms_rev1, &cms_rev2, &dummy);
+               cpuid(0x80860002, &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy);
+               if (cpu_rev == 0x02000000) {
+                       printk(KERN_INFO "CPU: Processor revision %08X, %u MHz\n",
+                               new_cpu_rev, cpu_freq);
+               }
                printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
                       (cms_rev1 >> 24) & 0xff,
                       (cms_rev1 >> 16) & 0xff,
@@ -69,12 +77,17 @@ static void __init init_transmeta(struct cpuinfo_x86 *c)
 #define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
         if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
                c->x86 = 6;
+
+#ifdef CONFIG_SYSCTL
+       /* randomize_va_space slows us down enormously;
+          it probably triggers retranslation of x86->native bytecode */
+       randomize_va_space = 0;
+#endif
 }
 
-static void transmeta_identify(struct cpuinfo_x86 * c)
+static void __cpuinit transmeta_identify(struct cpuinfo_x86 * c)
 {
        u32 xlvl;
-       generic_identify(c);
 
        /* Transmeta-defined flags: level 0x80860001 */
        xlvl = cpuid_eax(0x80860000);
@@ -84,7 +97,7 @@ static void transmeta_identify(struct cpuinfo_x86 * c)
        }
 }
 
-static struct cpu_dev transmeta_cpu_dev __initdata = {
+static struct cpu_dev transmeta_cpu_dev __cpuinitdata = {
        .c_vendor       = "Transmeta",
        .c_ident        = { "GenuineTMx86", "TransmetaCPU" },
        .c_init         = init_transmeta,
@@ -98,3 +111,11 @@ int __init transmeta_init_cpu(void)
 }
 
 //early_arch_initcall(transmeta_init_cpu);
+
+static int __init transmeta_exit_cpu(void)
+{
+       cpu_devs[X86_VENDOR_TRANSMETA] = NULL;
+       return 0;
+}
+
+late_initcall(transmeta_exit_cpu);