summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdk8/cpu_rev.c
blob: 0c4c5f8fbdefd8bb9677d53b711fe086c3b26aaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* this is a shrunken cpuid. */

static unsigned int cpuid(unsigned int op)
{
	unsigned int ret;
	unsigned dummy2,dummy3,dummy4;

	asm volatile ( 
		"cpuid" 
		: "=a" (ret), "=b" (dummy2), "=c" (dummy3), "=d" (dummy4)
		: "a" (op)
		);

	return ret;
}

static int is_cpu_rev_a0(void)
{
	return (cpuid(1) & 0xffef) == 0x0f00;
}

static int is_cpu_pre_c0(void)
{
	return (cpuid(1) & 0xffef) < 0x0f48;
}

static int is_cpu_pre_b3(void)
{
	return (cpuid(1) & 0xffef) < 0x0f41;
}