1 #ifndef _ASM_X86_MICROCODE_H
2 #define _ASM_X86_MICROCODE_H
12 enum ucode_state
{ UCODE_ERROR
, UCODE_OK
, UCODE_NFOUND
};
14 struct microcode_ops
{
15 enum ucode_state (*request_microcode_user
) (int cpu
,
16 const void __user
*buf
, size_t size
);
18 enum ucode_state (*request_microcode_fw
) (int cpu
, struct device
*,
21 void (*microcode_fini_cpu
) (int cpu
);
24 * The generic 'microcode_core' part guarantees that
25 * the callbacks below run on a target cpu when they
27 * See also the "Synchronization" section in microcode_core.c.
29 int (*apply_microcode
) (int cpu
);
30 int (*collect_cpu_info
) (int cpu
, struct cpu_signature
*csig
);
33 struct ucode_cpu_info
{
34 struct cpu_signature cpu_sig
;
38 extern struct ucode_cpu_info ucode_cpu_info
[];
40 #ifdef CONFIG_MICROCODE_INTEL
41 extern struct microcode_ops
* __init
init_intel_microcode(void);
43 static inline struct microcode_ops
* __init
init_intel_microcode(void)
47 #endif /* CONFIG_MICROCODE_INTEL */
49 #ifdef CONFIG_MICROCODE_AMD
50 extern struct microcode_ops
* __init
init_amd_microcode(void);
51 extern void __exit
exit_amd_microcode(void);
53 static inline struct microcode_ops
* __init
init_amd_microcode(void)
57 static inline void __exit
exit_amd_microcode(void) {}
60 #ifdef CONFIG_MICROCODE_EARLY
61 #define MAX_UCODE_COUNT 128
62 extern void __init
load_ucode_bsp(void);
63 extern void load_ucode_ap(void);
64 extern int __init
save_microcode_in_initrd(void);
66 static inline void __init
load_ucode_bsp(void) {}
67 static inline void load_ucode_ap(void) {}
68 static inline int __init
save_microcode_in_initrd(void)
74 #endif /* _ASM_X86_MICROCODE_H */