ia64/xen-unstable

view xen/include/asm-x86/microcode.h @ 18499:3eb7a0cfffc2

x86, microcode: More code cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Sep 16 13:09:04 2008 +0100 (2008-09-16)
parents 087b8b29b6b2
children fb0dc8143932
line source
1 #ifndef ASM_X86__MICROCODE_H
2 #define ASM_X86__MICROCODE_H
4 struct cpu_signature;
6 struct microcode_ops {
7 int (*get_matching_microcode)(void *mc, int cpu);
8 int (*cpu_request_microcode)(int cpu, const void *buf, size_t size);
9 int (*collect_cpu_info)(int cpu_num, struct cpu_signature *csig);
10 int (*apply_microcode)(int cpu);
11 };
13 struct microcode_header_intel {
14 unsigned int hdrver;
15 unsigned int rev;
16 unsigned int date;
17 unsigned int sig;
18 unsigned int cksum;
19 unsigned int ldrver;
20 unsigned int pf;
21 unsigned int datasize;
22 unsigned int totalsize;
23 unsigned int reserved[3];
24 };
26 struct microcode_intel {
27 struct microcode_header_intel hdr;
28 unsigned int bits[0];
29 };
31 /* microcode format is extended from prescott processors */
32 struct extended_signature {
33 unsigned int sig;
34 unsigned int pf;
35 unsigned int cksum;
36 };
38 struct extended_sigtable {
39 unsigned int count;
40 unsigned int cksum;
41 unsigned int reserved[3];
42 struct extended_signature sigs[0];
43 };
45 struct equiv_cpu_entry {
46 unsigned int installed_cpu;
47 unsigned int fixed_errata_mask;
48 unsigned int fixed_errata_compare;
49 unsigned int equiv_cpu;
50 };
52 struct microcode_header_amd {
53 unsigned int data_code;
54 unsigned int patch_id;
55 unsigned char mc_patch_data_id[2];
56 unsigned char mc_patch_data_len;
57 unsigned char init_flag;
58 unsigned int mc_patch_data_checksum;
59 unsigned int nb_dev_id;
60 unsigned int sb_dev_id;
61 unsigned char processor_rev_id[2];
62 unsigned char nb_rev_id;
63 unsigned char sb_rev_id;
64 unsigned char bios_api_rev;
65 unsigned char reserved1[3];
66 unsigned int match_reg[8];
67 };
69 struct microcode_amd {
70 struct microcode_header_amd hdr;
71 unsigned int mpb[0];
72 };
74 struct cpu_signature {
75 unsigned int sig;
76 unsigned int pf;
77 unsigned int rev;
78 };
80 struct ucode_cpu_info {
81 struct cpu_signature cpu_sig;
82 int valid;
83 union {
84 struct microcode_intel *mc_intel;
85 struct microcode_amd *mc_amd;
86 void *valid_mc;
87 } mc;
88 };
90 extern struct ucode_cpu_info ucode_cpu_info[];
91 extern const struct microcode_ops *microcode_ops;
93 #endif /* ASM_X86__MICROCODE_H */