Merge branch 'regmap-linus' into regmap-next
[deliverable/linux.git] / arch / x86 / include / asm / microcode.h
CommitLineData
1965aae3
PA
1#ifndef _ASM_X86_MICROCODE_H
2#define _ASM_X86_MICROCODE_H
d45de409 3
18dbc916
DA
4struct cpu_signature {
5 unsigned int sig;
6 unsigned int pf;
7 unsigned int rev;
8};
8d86f390 9
a0a29b62 10struct device;
d45de409 11
871b72dd
DA
12enum ucode_state { UCODE_ERROR, UCODE_OK, UCODE_NFOUND };
13
26bf7a48 14struct microcode_ops {
871b72dd
DA
15 enum ucode_state (*request_microcode_user) (int cpu,
16 const void __user *buf, size_t size);
a0a29b62 17
871b72dd
DA
18 enum ucode_state (*request_microcode_fw) (int cpu,
19 struct device *device);
a0a29b62 20
a0a29b62 21 void (*microcode_fini_cpu) (int cpu);
871b72dd
DA
22
23 /*
24 * The generic 'microcode_core' part guarantees that
25 * the callbacks below run on a target cpu when they
26 * are being called.
27 * See also the "Synchronization" section in microcode_core.c.
28 */
29 int (*apply_microcode) (int cpu);
30 int (*collect_cpu_info) (int cpu, struct cpu_signature *csig);
26bf7a48
PO
31};
32
d45de409 33struct ucode_cpu_info {
871b72dd
DA
34 struct cpu_signature cpu_sig;
35 int valid;
36 void *mc;
c3b71bce 37};
d45de409
DA
38extern struct ucode_cpu_info ucode_cpu_info[];
39
18dbc916
DA
40#ifdef CONFIG_MICROCODE_INTEL
41extern struct microcode_ops * __init init_intel_microcode(void);
42#else
43static inline struct microcode_ops * __init init_intel_microcode(void)
44{
45 return NULL;
46}
47#endif /* CONFIG_MICROCODE_INTEL */
48
49#ifdef CONFIG_MICROCODE_AMD
50extern struct microcode_ops * __init init_amd_microcode(void);
c7657ac0
BP
51
52static inline void get_ucode_data(void *to, const u8 *from, size_t n)
53{
54 memcpy(to, from, n);
55}
56
18dbc916
DA
57#else
58static inline struct microcode_ops * __init init_amd_microcode(void)
59{
60 return NULL;
61}
62#endif
63
1965aae3 64#endif /* _ASM_X86_MICROCODE_H */
This page took 0.343212 seconds and 5 git commands to generate.