diff options
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/microcode.h | 87 | ||||
-rw-r--r-- | include/asm-x86/processor.h | 35 |
2 files changed, 87 insertions, 35 deletions
diff --git a/include/asm-x86/microcode.h b/include/asm-x86/microcode.h new file mode 100644 index 000000000000..18b2aeec2adf --- /dev/null +++ b/include/asm-x86/microcode.h | |||
@@ -0,0 +1,87 @@ | |||
1 | extern int microcode_init(void *opaque, struct module *module); | ||
2 | extern void microcode_exit(void); | ||
3 | |||
4 | struct microcode_ops { | ||
5 | long (*get_next_ucode)(void **mc, long offset); | ||
6 | long (*microcode_get_next_ucode)(void **mc, long offset); | ||
7 | int (*get_matching_microcode)(void *mc, int cpu); | ||
8 | int (*apply_microcode_check_cpu)(int cpu); | ||
9 | int (*microcode_sanity_check)(void *mc); | ||
10 | int (*cpu_request_microcode)(int cpu); | ||
11 | void (*collect_cpu_info)(int cpu_num); | ||
12 | void (*apply_microcode)(int cpu); | ||
13 | void (*microcode_fini_cpu)(int cpu); | ||
14 | void (*clear_patch)(void *data); | ||
15 | }; | ||
16 | |||
17 | struct microcode_header_intel { | ||
18 | unsigned int hdrver; | ||
19 | unsigned int rev; | ||
20 | unsigned int date; | ||
21 | unsigned int sig; | ||
22 | unsigned int cksum; | ||
23 | unsigned int ldrver; | ||
24 | unsigned int pf; | ||
25 | unsigned int datasize; | ||
26 | unsigned int totalsize; | ||
27 | unsigned int reserved[3]; | ||
28 | }; | ||
29 | |||
30 | struct microcode_intel { | ||
31 | struct microcode_header_intel hdr; | ||
32 | unsigned int bits[0]; | ||
33 | }; | ||
34 | |||
35 | /* microcode format is extended from prescott processors */ | ||
36 | struct extended_signature { | ||
37 | unsigned int sig; | ||
38 | unsigned int pf; | ||
39 | unsigned int cksum; | ||
40 | }; | ||
41 | |||
42 | struct extended_sigtable { | ||
43 | unsigned int count; | ||
44 | unsigned int cksum; | ||
45 | unsigned int reserved[3]; | ||
46 | struct extended_signature sigs[0]; | ||
47 | }; | ||
48 | |||
49 | struct equiv_cpu_entry { | ||
50 | unsigned int installed_cpu; | ||
51 | unsigned int fixed_errata_mask; | ||
52 | unsigned int fixed_errata_compare; | ||
53 | unsigned int equiv_cpu; | ||
54 | }; | ||
55 | |||
56 | struct microcode_header_amd { | ||
57 | unsigned int data_code; | ||
58 | unsigned int patch_id; | ||
59 | unsigned char mc_patch_data_id[2]; | ||
60 | unsigned char mc_patch_data_len; | ||
61 | unsigned char init_flag; | ||
62 | unsigned int mc_patch_data_checksum; | ||
63 | unsigned int nb_dev_id; | ||
64 | unsigned int sb_dev_id; | ||
65 | unsigned char processor_rev_id[2]; | ||
66 | unsigned char nb_rev_id; | ||
67 | unsigned char sb_rev_id; | ||
68 | unsigned char bios_api_rev; | ||
69 | unsigned char reserved1[3]; | ||
70 | unsigned int match_reg[8]; | ||
71 | }; | ||
72 | |||
73 | struct microcode_amd { | ||
74 | struct microcode_header_amd hdr; | ||
75 | unsigned int mpb[0]; | ||
76 | }; | ||
77 | |||
78 | struct ucode_cpu_info { | ||
79 | int valid; | ||
80 | unsigned int sig; | ||
81 | unsigned int pf; | ||
82 | unsigned int rev; | ||
83 | union { | ||
84 | struct microcode_intel *mc_intel; | ||
85 | struct microcode_amd *mc_amd; | ||
86 | } mc; | ||
87 | }; | ||
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 5f58da401b43..58a76f69ee31 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -561,41 +561,6 @@ static inline void clear_in_cr4(unsigned long mask) | |||
561 | write_cr4(cr4); | 561 | write_cr4(cr4); |
562 | } | 562 | } |
563 | 563 | ||
564 | struct microcode_header { | ||
565 | unsigned int hdrver; | ||
566 | unsigned int rev; | ||
567 | unsigned int date; | ||
568 | unsigned int sig; | ||
569 | unsigned int cksum; | ||
570 | unsigned int ldrver; | ||
571 | unsigned int pf; | ||
572 | unsigned int datasize; | ||
573 | unsigned int totalsize; | ||
574 | unsigned int reserved[3]; | ||
575 | }; | ||
576 | |||
577 | struct microcode { | ||
578 | struct microcode_header hdr; | ||
579 | unsigned int bits[0]; | ||
580 | }; | ||
581 | |||
582 | typedef struct microcode microcode_t; | ||
583 | typedef struct microcode_header microcode_header_t; | ||
584 | |||
585 | /* microcode format is extended from prescott processors */ | ||
586 | struct extended_signature { | ||
587 | unsigned int sig; | ||
588 | unsigned int pf; | ||
589 | unsigned int cksum; | ||
590 | }; | ||
591 | |||
592 | struct extended_sigtable { | ||
593 | unsigned int count; | ||
594 | unsigned int cksum; | ||
595 | unsigned int reserved[3]; | ||
596 | struct extended_signature sigs[0]; | ||
597 | }; | ||
598 | |||
599 | typedef struct { | 564 | typedef struct { |
600 | unsigned long seg; | 565 | unsigned long seg; |
601 | } mm_segment_t; | 566 | } mm_segment_t; |