plan 9 kernel history: overview | file list | diff list

1998/0522/pc/archgeneric.c (diff list | history)

1998/0404/sys/src/9/pc/archgeneric.c:41,471998/0522/sys/src/9/pc/archgeneric.c:41,47 (short | long | prev | next)
change x86type to x86intel; add x86amd
rsc Fri Mar 4 12:44:25 2005
1997/0327    
	char*	name; 
} X86type; 
 
static X86type x86type[] = 
1998/0522    
static X86type x86intel[] = 
1992/0923    
{ 
1997/0327    
	{ 4,	0,	22,	"486DX", },	/* known chips */ 
	{ 4,	1,	22,	"486DX50", }, 
1998/0404/sys/src/9/pc/archgeneric.c:70,751998/0522/sys/src/9/pc/archgeneric.c:70,102
1997/0327    
	{ -1,	-1,	23,	"unknown", },	/* total default */ 
1992/0923    
}; 
1997/0327    
 
1998/0522    
/* 
 * The AMD processors all implement the CPUID instruction. 
 * The later ones also return the processor name via functions 
 * 0x80000002, 0x80000003 and 0x80000004 in registers AX, BX, CX 
 * and DX: 
 *	K5	"AMD-K5(tm) Processor" 
 *	K6	"AMD-K6tm w/ multimedia extensions" 
 *	K6 3D	"AMD-K6(tm) 3D processor" 
 *	K6 3D+	? 
 */ 
static X86type x86amd[] = 
{ 
	{ 5,	0,	23,	"AMD-K5", },	/* guesswork */ 
	{ 5,	1,	23,	"AMD-K5", },	/* guesswork */ 
	{ 5,	2,	23,	"AMD-K5", },	/* guesswork */ 
	{ 5,	3,	23,	"AMD-K5", },	/* guesswork */ 
	{ 5,	6,	23,	"AMD-K6", },	/* guesswork */ 
	{ 5,	7,	23,	"AMD-K6", },	/* guesswork */ 
	{ 5,	8,	23,	"AMD-K6 3D", },	/* guesswork */ 
	{ 5,	9,	23,	"AMD-K6 3D+", },/* guesswork */ 
 
	{ 4,	-1,	22,	"Am486", },	/* guesswork */ 
	{ 5,	-1,	23,	"AMD-K5/K6", },	/* guesswork */ 
 
	{ -1,	-1,	23,	"unknown", },	/* total default */ 
}; 
 
1997/0327    
void 
cpuidprint(void) 
{ 
1998/0404/sys/src/9/pc/archgeneric.c:93,1051998/0522/sys/src/9/pc/archgeneric.c:120,137
1998/0401    
	vlong mct; 
1997/0327    
 
	cpuid(m->cpuidid, &m->cpuidax, &m->cpuiddx); 
1998/0522    
	if(strncmp(m->cpuidid, "AuthenticAMD", 12) == 0) 
		t = x86amd; 
	else 
		t = x86intel; 
1997/0327    
	family = X86FAMILY(m->cpuidax); 
	model = X86MODEL(m->cpuidax); 
	for(t = x86type; t->name; t++){ 
1998/0522    
	while(t->name){ 
1997/0327    
		if((t->family == family && t->model == model) 
		|| (t->family == family && t->model == -1) 
		|| (t->family == -1)) 
			break; 
1998/0522    
		t++; 
1997/0327    
	} 
	m->cpuidtype = t->name; 
	i8253init(t->aalcycles); 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)