]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - arch/x86/lib/cpu.c
19f707992db22b3d2fdc5f8c9be85f63bf7aeb93
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / lib / cpu.c
1 #include <linux/types.h>
2 #include <linux/export.h>
3 #include <asm/cpu.h>
4
5 unsigned int x86_family(unsigned int sig)
6 {
7 unsigned int x86;
8
9 x86 = (sig >> 8) & 0xf;
10
11 if (x86 == 0xf)
12 x86 += (sig >> 20) & 0xff;
13
14 return x86;
15 }
16 EXPORT_SYMBOL_GPL(x86_family);
17
18 unsigned int x86_model(unsigned int sig)
19 {
20 unsigned int fam, model;
21
22 fam = x86_family(sig);
23
24 model = (sig >> 4) & 0xf;
25
26 if (fam >= 0x6)
27 model += ((sig >> 16) & 0xf) << 4;
28
29 return model;
30 }
31 EXPORT_SYMBOL_GPL(x86_model);
32
33 unsigned int x86_stepping(unsigned int sig)
34 {
35 return sig & 0xf;
36 }
37 EXPORT_SYMBOL_GPL(x86_stepping);