blob: 19f707992db22b3d2fdc5f8c9be85f63bf7aeb93 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#include <linux/types.h>
2#include <linux/export.h>
3#include <asm/cpu.h>
4
5unsigned 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}
16EXPORT_SYMBOL_GPL(x86_family);
17
18unsigned 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}
31EXPORT_SYMBOL_GPL(x86_model);
32
33unsigned int x86_stepping(unsigned int sig)
34{
35 return sig & 0xf;
36}
37EXPORT_SYMBOL_GPL(x86_stepping);