forked from luck/tmp_suning_uos_patched
5f0f1c1666
Mark i386-specific cpu identification functions as __cpuinit. They are all only called from arch/i386/common.c:identify_cpu() that already is marked as __cpuinit. Signed-off-by: Magnus Damm <magnus@valinux.co.jp> Signed-off-by: Andi Kleen <ak@suse.de>
71 lines
1.4 KiB
C
71 lines
1.4 KiB
C
#include <linux/kernel.h>
|
|
#include <linux/init.h>
|
|
#include <linux/string.h>
|
|
#include <asm/processor.h>
|
|
|
|
#include "cpu.h"
|
|
|
|
/*
|
|
* Detect a NexGen CPU running without BIOS hypercode new enough
|
|
* to have CPUID. (Thanks to Herbert Oppmann)
|
|
*/
|
|
|
|
static int __cpuinit deep_magic_nexgen_probe(void)
|
|
{
|
|
int ret;
|
|
|
|
__asm__ __volatile__ (
|
|
" movw $0x5555, %%ax\n"
|
|
" xorw %%dx,%%dx\n"
|
|
" movw $2, %%cx\n"
|
|
" divw %%cx\n"
|
|
" movl $0, %%eax\n"
|
|
" jnz 1f\n"
|
|
" movl $1, %%eax\n"
|
|
"1:\n"
|
|
: "=a" (ret) : : "cx", "dx" );
|
|
return ret;
|
|
}
|
|
|
|
static void __cpuinit init_nexgen(struct cpuinfo_x86 * c)
|
|
{
|
|
c->x86_cache_size = 256; /* A few had 1 MB... */
|
|
}
|
|
|
|
static void __cpuinit nexgen_identify(struct cpuinfo_x86 * c)
|
|
{
|
|
/* Detect NexGen with old hypercode */
|
|
if ( deep_magic_nexgen_probe() ) {
|
|
strcpy(c->x86_vendor_id, "NexGenDriven");
|
|
}
|
|
}
|
|
|
|
static struct cpu_dev nexgen_cpu_dev __cpuinitdata = {
|
|
.c_vendor = "Nexgen",
|
|
.c_ident = { "NexGenDriven" },
|
|
.c_models = {
|
|
{ .vendor = X86_VENDOR_NEXGEN,
|
|
.family = 5,
|
|
.model_names = { [1] = "Nx586" }
|
|
},
|
|
},
|
|
.c_init = init_nexgen,
|
|
.c_identify = nexgen_identify,
|
|
};
|
|
|
|
int __init nexgen_init_cpu(void)
|
|
{
|
|
cpu_devs[X86_VENDOR_NEXGEN] = &nexgen_cpu_dev;
|
|
return 0;
|
|
}
|
|
|
|
//early_arch_initcall(nexgen_init_cpu);
|
|
|
|
static int __init nexgen_exit_cpu(void)
|
|
{
|
|
cpu_devs[X86_VENDOR_NEXGEN] = NULL;
|
|
return 0;
|
|
}
|
|
|
|
late_initcall(nexgen_exit_cpu);
|