1 #ifndef ASM_X86__MICROCODE_H
2 #define ASM_X86__MICROCODE_H
3 
4 #include <xen/percpu.h>
5 
6 struct cpu_signature;
7 struct ucode_cpu_info;
8 
9 struct microcode_ops {
10     int (*microcode_resume_match)(unsigned int cpu, const void *mc);
11     int (*cpu_request_microcode)(unsigned int cpu, const void *buf,
12                                  size_t size);
13     int (*collect_cpu_info)(unsigned int cpu, struct cpu_signature *csig);
14     int (*apply_microcode)(unsigned int cpu);
15     int (*start_update)(void);
16 };
17 
18 struct cpu_signature {
19     unsigned int sig;
20     unsigned int pf;
21     unsigned int rev;
22 };
23 
24 struct ucode_cpu_info {
25     struct cpu_signature cpu_sig;
26     union {
27         struct microcode_intel *mc_intel;
28         struct microcode_amd *mc_amd;
29         void *mc_valid;
30     } mc;
31 };
32 
33 DECLARE_PER_CPU(struct ucode_cpu_info, ucode_cpu_info);
34 extern const struct microcode_ops *microcode_ops;
35 
36 #endif /* ASM_X86__MICROCODE_H */
37