blob: 62c793bb70cacf0fd7abd4d1d96057b6a5d77ed6 [file] [log] [blame]
Dmitry Adamushkod45de402008-08-20 00:22:26 +02001#ifndef ASM_X86__MICROCODE_H
2#define ASM_X86__MICROCODE_H
3
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
Dmitry Adamushkod45de402008-08-20 00:22:26 +020047#endif /* ASM_X86__MICROCODE_H */