at v2.6.33-rc2 60 lines 1.4 kB view raw
1#ifndef _ASM_X86_MICROCODE_H 2#define _ASM_X86_MICROCODE_H 3 4struct cpu_signature { 5 unsigned int sig; 6 unsigned int pf; 7 unsigned int rev; 8}; 9 10struct device; 11 12enum ucode_state { UCODE_ERROR, UCODE_OK, UCODE_NFOUND }; 13 14struct microcode_ops { 15 void (*init)(struct device *device); 16 void (*fini)(void); 17 enum ucode_state (*request_microcode_user) (int cpu, 18 const void __user *buf, size_t size); 19 20 enum ucode_state (*request_microcode_fw) (int cpu, 21 struct device *device); 22 23 void (*microcode_fini_cpu) (int cpu); 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); 33}; 34 35struct ucode_cpu_info { 36 struct cpu_signature cpu_sig; 37 int valid; 38 void *mc; 39}; 40extern struct ucode_cpu_info ucode_cpu_info[]; 41 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 60#endif /* _ASM_X86_MICROCODE_H */