diff options
Diffstat (limited to 'arch/x86/include/asm/microcode_intel.h')
-rw-r--r-- | arch/x86/include/asm/microcode_intel.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h new file mode 100644 index 000000000000..5356f927d411 --- /dev/null +++ b/arch/x86/include/asm/microcode_intel.h | |||
@@ -0,0 +1,85 @@ | |||
1 | #ifndef _ASM_X86_MICROCODE_INTEL_H | ||
2 | #define _ASM_X86_MICROCODE_INTEL_H | ||
3 | |||
4 | #include <asm/microcode.h> | ||
5 | |||
6 | struct microcode_header_intel { | ||
7 | unsigned int hdrver; | ||
8 | unsigned int rev; | ||
9 | unsigned int date; | ||
10 | unsigned int sig; | ||
11 | unsigned int cksum; | ||
12 | unsigned int ldrver; | ||
13 | unsigned int pf; | ||
14 | unsigned int datasize; | ||
15 | unsigned int totalsize; | ||
16 | unsigned int reserved[3]; | ||
17 | }; | ||
18 | |||
19 | struct microcode_intel { | ||
20 | struct microcode_header_intel hdr; | ||
21 | unsigned int bits[0]; | ||
22 | }; | ||
23 | |||
24 | /* microcode format is extended from prescott processors */ | ||
25 | struct extended_signature { | ||
26 | unsigned int sig; | ||
27 | unsigned int pf; | ||
28 | unsigned int cksum; | ||
29 | }; | ||
30 | |||
31 | struct extended_sigtable { | ||
32 | unsigned int count; | ||
33 | unsigned int cksum; | ||
34 | unsigned int reserved[3]; | ||
35 | struct extended_signature sigs[0]; | ||
36 | }; | ||
37 | |||
38 | #define DEFAULT_UCODE_DATASIZE (2000) | ||
39 | #define MC_HEADER_SIZE (sizeof(struct microcode_header_intel)) | ||
40 | #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) | ||
41 | #define EXT_HEADER_SIZE (sizeof(struct extended_sigtable)) | ||
42 | #define EXT_SIGNATURE_SIZE (sizeof(struct extended_signature)) | ||
43 | #define DWSIZE (sizeof(u32)) | ||
44 | |||
45 | #define get_totalsize(mc) \ | ||
46 | (((struct microcode_intel *)mc)->hdr.totalsize ? \ | ||
47 | ((struct microcode_intel *)mc)->hdr.totalsize : \ | ||
48 | DEFAULT_UCODE_TOTALSIZE) | ||
49 | |||
50 | #define get_datasize(mc) \ | ||
51 | (((struct microcode_intel *)mc)->hdr.datasize ? \ | ||
52 | ((struct microcode_intel *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE) | ||
53 | |||
54 | #define sigmatch(s1, s2, p1, p2) \ | ||
55 | (((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0)))) | ||
56 | |||
57 | #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE) | ||
58 | |||
59 | extern int | ||
60 | get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev); | ||
61 | extern int microcode_sanity_check(void *mc, int print_err); | ||
62 | extern int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev); | ||
63 | extern int | ||
64 | update_match_revision(struct microcode_header_intel *mc_header, int rev); | ||
65 | |||
66 | #ifdef CONFIG_MICROCODE_INTEL_EARLY | ||
67 | extern void __init load_ucode_intel_bsp(void); | ||
68 | extern void __cpuinit load_ucode_intel_ap(void); | ||
69 | extern void show_ucode_info_early(void); | ||
70 | #else | ||
71 | static inline __init void load_ucode_intel_bsp(void) {} | ||
72 | static inline __cpuinit void load_ucode_intel_ap(void) {} | ||
73 | static inline void show_ucode_info_early(void) {} | ||
74 | #endif | ||
75 | |||
76 | #if defined(CONFIG_MICROCODE_INTEL_EARLY) && defined(CONFIG_HOTPLUG_CPU) | ||
77 | extern int save_mc_for_early(u8 *mc); | ||
78 | #else | ||
79 | static inline int save_mc_for_early(u8 *mc) | ||
80 | { | ||
81 | return 0; | ||
82 | } | ||
83 | #endif | ||
84 | |||
85 | #endif /* _ASM_X86_MICROCODE_INTEL_H */ | ||