- O2, enums, and switch statements work in romcc
[coreboot.git] / src / northbridge / amd / amdk8 / cpu_rev.c
1 /* this is a shrunken cpuid. */
2
3 static unsigned int cpuid(unsigned int op)
4 {
5         unsigned int ret;
6         unsigned dummy2,dummy3,dummy4;
7
8         asm volatile ( 
9                 "cpuid" 
10                 : "=a" (ret), "=b" (dummy2), "=c" (dummy3), "=d" (dummy4)
11                 : "a" (op)
12                 );
13
14         return ret;
15 }
16
17 static int is_cpu_rev_a0(void)
18 {
19         return (cpuid(1) & 0xffff) == 0x0f10;
20 }
21
22 static int is_cpu_pre_c0(void)
23 {
24         return (cpuid(1) & 0xffef) < 0x0f48;
25 }