]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuMpPei/Microcode.h
UefiCpuPkg/CpuMpPei: Load microcode if found newer revision
[mirror_edk2.git] / UefiCpuPkg / CpuMpPei / Microcode.h
CommitLineData
ea0f431c
JF
1/** @file\r
2 Definitions for loading microcode on processors.\r
3\r
4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _CPU_MICROCODE_H_\r
16#define _CPU_MICROCODE_H_\r
17\r
18#define EFI_MSR_IA32_PLATFORM_ID 0x17\r
19#define EFI_MSR_IA32_BIOS_UPDT_TRIG 0x79\r
20#define EFI_MSR_IA32_BIOS_SIGN_ID 0x8b\r
21\r
22#define MAX_MICROCODE_DESCRIPTOR_LENGTH 100\r
23\r
24typedef struct {\r
25 VOID *MicrocodeData;\r
26 UINTN MicrocodeSize;\r
27 UINT32 ProcessorId;\r
28 BOOLEAN Load;\r
29} MICROCODE_INFO;\r
30\r
31//\r
32// Definition for IA32 microcode format\r
33//\r
34typedef struct {\r
35 UINT32 HeaderVersion;\r
36 UINT32 UpdateRevision;\r
37 UINT32 Date;\r
38 UINT32 ProcessorId;\r
39 UINT32 Checksum;\r
40 UINT32 LoaderRevision;\r
41 UINT32 ProcessorFlags;\r
42 UINT32 DataSize;\r
43 UINT32 TotalSize;\r
44 UINT8 Reserved[12];\r
45} EFI_CPU_MICROCODE_HEADER;\r
46\r
47typedef struct {\r
48 UINT32 ExtendedSignatureCount;\r
49 UINT32 ExtendedTableChecksum;\r
50 UINT8 Reserved[12];\r
51} EFI_CPU_MICROCODE_EXTENDED_TABLE_HEADER;\r
52\r
53typedef struct {\r
54 UINT32 ProcessorSignature;\r
55 UINT32 ProcessorFlag;\r
56 UINT32 ProcessorChecksum;\r
57} EFI_CPU_MICROCODE_EXTENDED_TABLE;\r
58\r
59/**\r
60 Detect whether specified processor can find matching microcode patch and load it.\r
61\r
62**/\r
63VOID\r
64MicrocodeDetect (\r
65 VOID\r
66 );\r
67\r
68#endif\r