blob: c882664716c1d13e5678aa188fb0ccf75d50acca [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_MICROCODE_H
2#define _ASM_X86_MICROCODE_H
Dmitry Adamushkod45de402008-08-20 00:22:26 +02003
Dmitry Adamushko18dbc912008-09-23 12:08:44 +02004struct cpu_signature {
5 unsigned int sig;
6 unsigned int pf;
7 unsigned int rev;
8};
Peter Oruba8d86f392008-07-28 18:44:21 +02009
Dmitry Adamushkoa0a29b62008-09-11 23:27:52 +020010struct device;
Dmitry Adamushkod45de402008-08-20 00:22:26 +020011
Peter Oruba26bf7a42008-07-28 18:44:20 +020012struct microcode_ops {
Dmitry Adamushkoa0a29b62008-09-11 23:27:52 +020013 int (*request_microcode_user) (int cpu, const void __user *buf, size_t size);
14 int (*request_microcode_fw) (int cpu, struct device *device);
15
16 void (*apply_microcode) (int cpu);
17
18 int (*collect_cpu_info) (int cpu, struct cpu_signature *csig);
19 void (*microcode_fini_cpu) (int cpu);
Peter Oruba26bf7a42008-07-28 18:44:20 +020020};
21
Dmitry Adamushkod45de402008-08-20 00:22:26 +020022struct ucode_cpu_info {
23 struct cpu_signature cpu_sig;
24 int valid;
Dmitry Adamushko18dbc912008-09-23 12:08:44 +020025 void *mc;
Peter Orubac3b71bc2008-07-28 18:44:15 +020026};
Dmitry Adamushkod45de402008-08-20 00:22:26 +020027extern struct ucode_cpu_info ucode_cpu_info[];
28
Dmitry Adamushko18dbc912008-09-23 12:08:44 +020029#ifdef CONFIG_MICROCODE_INTEL
30extern struct microcode_ops * __init init_intel_microcode(void);
31#else
32static inline struct microcode_ops * __init init_intel_microcode(void)
33{
34 return NULL;
35}
36#endif /* CONFIG_MICROCODE_INTEL */
37
38#ifdef CONFIG_MICROCODE_AMD
39extern struct microcode_ops * __init init_amd_microcode(void);
40#else
41static inline struct microcode_ops * __init init_amd_microcode(void)
42{
43 return NULL;
44}
45#endif
46
H. Peter Anvin1965aae2008-10-22 22:26:29 -070047#endif /* _ASM_X86_MICROCODE_H */