Merge git://git.infradead.org/iommu-2.6
[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 {
d1c84f79
AH
15 void (*init)(struct device *device);
16 void (*fini)(void);
871b72dd
DA
17 enum ucode_state (*request_microcode_user) (int cpu,
18 const void __user *buf, size_t size);
a0a29b62 19
871b72dd
DA
20 enum ucode_state (*request_microcode_fw) (int cpu,
21 struct device *device);
a0a29b62 22
a0a29b62 23 void (*microcode_fini_cpu) (int cpu);
871b72dd
DA
24
25 /*
26 * The generic 'microcode_core' part guarantees that
27 * the callbacks below run on a target cpu when they
28 * are being called.
29 * See also the "Synchronization" section in microcode_core.c.
30 */
31 int (*apply_microcode) (int cpu);
32 int (*collect_cpu_info) (int cpu, struct cpu_signature *csig);
26bf7a48
PO
33};
34
d45de409 35struct ucode_cpu_info {
871b72dd
DA
36 struct cpu_signature cpu_sig;
37 int valid;
38 void *mc;
c3b71bce 39};
d45de409
DA
40extern struct ucode_cpu_info ucode_cpu_info[];
41
18dbc916
DA
42#ifdef CONFIG_MICROCODE_INTEL
43extern struct microcode_ops * __init init_intel_microcode(void);
44#else
45static inline struct microcode_ops * __init init_intel_microcode(void)
46{
47 return NULL;
48}
49#endif /* CONFIG_MICROCODE_INTEL */
50
51#ifdef CONFIG_MICROCODE_AMD
52extern struct microcode_ops * __init init_amd_microcode(void);
53#else
54static inline struct microcode_ops * __init init_amd_microcode(void)
55{
56 return NULL;
57}
58#endif
59
1965aae3 60#endif /* _ASM_X86_MICROCODE_H */
This page took 0.115816 seconds and 5 git commands to generate.