summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDmitry Adamushko <dmitry.adamushko@gmail.com>2008-09-23 12:08:44 +0200
committerIngo Molnar <mingo@elte.hu>2008-09-23 12:21:42 +0200
commit18dbc9160507dc7df998e00cd1dcd7889557307b (patch)
tree81262b57db5de63267762083a54a37558d8555f0 /include
parenta1c75cc5018f17ff6d80ce45a13435b1536f76db (diff)
downloadlinux-18dbc9160507dc7df998e00cd1dcd7889557307b.tar.gz
linux-18dbc9160507dc7df998e00cd1dcd7889557307b.tar.bz2
linux-18dbc9160507dc7df998e00cd1dcd7889557307b.zip
x86: moved microcode.c to microcode_intel.c
Combine both generic and arch-specific parts of microcode into a single module (arch-specific parts are config-dependent). Also while we are at it, move arch-specific parts from microcode.h into their respective arch-specific .c files. Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com> Cc: "Peter Oruba" <peter.oruba@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/microcode.h99
1 files changed, 24 insertions, 75 deletions
diff --git a/include/asm-x86/microcode.h b/include/asm-x86/microcode.h
index e2887facdb4a..62c793bb70ca 100644
--- a/include/asm-x86/microcode.h
+++ b/include/asm-x86/microcode.h
@@ -1,10 +1,12 @@
#ifndef ASM_X86__MICROCODE_H
#define ASM_X86__MICROCODE_H
-extern int microcode_init(void *opaque, struct module *module);
-extern void microcode_exit(void);
+struct cpu_signature {
+ unsigned int sig;
+ unsigned int pf;
+ unsigned int rev;
+};
-struct cpu_signature;
struct device;
struct microcode_ops {
@@ -17,82 +19,29 @@ struct microcode_ops {
void (*microcode_fini_cpu) (int cpu);
};
-struct microcode_header_intel {
- unsigned int hdrver;
- unsigned int rev;
- unsigned int date;
- unsigned int sig;
- unsigned int cksum;
- unsigned int ldrver;
- unsigned int pf;
- unsigned int datasize;
- unsigned int totalsize;
- unsigned int reserved[3];
-};
-
-struct microcode_intel {
- struct microcode_header_intel hdr;
- unsigned int bits[0];
-};
-
-/* microcode format is extended from prescott processors */
-struct extended_signature {
- unsigned int sig;
- unsigned int pf;
- unsigned int cksum;
-};
-
-struct extended_sigtable {
- unsigned int count;
- unsigned int cksum;
- unsigned int reserved[3];
- struct extended_signature sigs[0];
-};
-
-struct equiv_cpu_entry {
- unsigned int installed_cpu;
- unsigned int fixed_errata_mask;
- unsigned int fixed_errata_compare;
- unsigned int equiv_cpu;
-};
-
-struct microcode_header_amd {
- unsigned int data_code;
- unsigned int patch_id;
- unsigned char mc_patch_data_id[2];
- unsigned char mc_patch_data_len;
- unsigned char init_flag;
- unsigned int mc_patch_data_checksum;
- unsigned int nb_dev_id;
- unsigned int sb_dev_id;
- unsigned char processor_rev_id[2];
- unsigned char nb_rev_id;
- unsigned char sb_rev_id;
- unsigned char bios_api_rev;
- unsigned char reserved1[3];
- unsigned int match_reg[8];
-};
-
-struct microcode_amd {
- struct microcode_header_amd hdr;
- unsigned int mpb[0];
-};
-
-struct cpu_signature {
- unsigned int sig;
- unsigned int pf;
- unsigned int rev;
-};
-
struct ucode_cpu_info {
struct cpu_signature cpu_sig;
int valid;
- union {
- struct microcode_intel *mc_intel;
- struct microcode_amd *mc_amd;
- void *valid_mc;
- } mc;
+ void *mc;
};
extern struct ucode_cpu_info ucode_cpu_info[];
+#ifdef CONFIG_MICROCODE_INTEL
+extern struct microcode_ops * __init init_intel_microcode(void);
+#else
+static inline struct microcode_ops * __init init_intel_microcode(void)
+{
+ return NULL;
+}
+#endif /* CONFIG_MICROCODE_INTEL */
+
+#ifdef CONFIG_MICROCODE_AMD
+extern struct microcode_ops * __init init_amd_microcode(void);
+#else
+static inline struct microcode_ops * __init init_amd_microcode(void)
+{
+ return NULL;
+}
+#endif
+
#endif /* ASM_X86__MICROCODE_H */