Dmitry Adamushko | d45de40 | 2008-08-20 00:22:26 +0200 | [diff] [blame] | 1 | #ifndef ASM_X86__MICROCODE_H |
| 2 | #define ASM_X86__MICROCODE_H |
| 3 | |
Dmitry Adamushko | 18dbc91 | 2008-09-23 12:08:44 +0200 | [diff] [blame^] | 4 | struct cpu_signature { |
| 5 | unsigned int sig; |
| 6 | unsigned int pf; |
| 7 | unsigned int rev; |
| 8 | }; |
Peter Oruba | 8d86f39 | 2008-07-28 18:44:21 +0200 | [diff] [blame] | 9 | |
Dmitry Adamushko | a0a29b6 | 2008-09-11 23:27:52 +0200 | [diff] [blame] | 10 | struct device; |
Dmitry Adamushko | d45de40 | 2008-08-20 00:22:26 +0200 | [diff] [blame] | 11 | |
Peter Oruba | 26bf7a4 | 2008-07-28 18:44:20 +0200 | [diff] [blame] | 12 | struct microcode_ops { |
Dmitry Adamushko | a0a29b6 | 2008-09-11 23:27:52 +0200 | [diff] [blame] | 13 | 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 Oruba | 26bf7a4 | 2008-07-28 18:44:20 +0200 | [diff] [blame] | 20 | }; |
| 21 | |
Dmitry Adamushko | d45de40 | 2008-08-20 00:22:26 +0200 | [diff] [blame] | 22 | struct ucode_cpu_info { |
| 23 | struct cpu_signature cpu_sig; |
| 24 | int valid; |
Dmitry Adamushko | 18dbc91 | 2008-09-23 12:08:44 +0200 | [diff] [blame^] | 25 | void *mc; |
Peter Oruba | c3b71bc | 2008-07-28 18:44:15 +0200 | [diff] [blame] | 26 | }; |
Dmitry Adamushko | d45de40 | 2008-08-20 00:22:26 +0200 | [diff] [blame] | 27 | extern struct ucode_cpu_info ucode_cpu_info[]; |
| 28 | |
Dmitry Adamushko | 18dbc91 | 2008-09-23 12:08:44 +0200 | [diff] [blame^] | 29 | #ifdef CONFIG_MICROCODE_INTEL |
| 30 | extern struct microcode_ops * __init init_intel_microcode(void); |
| 31 | #else |
| 32 | static 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 |
| 39 | extern struct microcode_ops * __init init_amd_microcode(void); |
| 40 | #else |
| 41 | static inline struct microcode_ops * __init init_amd_microcode(void) |
| 42 | { |
| 43 | return NULL; |
| 44 | } |
| 45 | #endif |
| 46 | |
Dmitry Adamushko | d45de40 | 2008-08-20 00:22:26 +0200 | [diff] [blame] | 47 | #endif /* ASM_X86__MICROCODE_H */ |