1 /** @file
2   The definition for Microcode Shadow Info Hob.
3 
4   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5   SPDX-License-Identifier: BSD-2-Clause-Patent
6 **/
7 
8 
9 #ifndef _MICROCODE_SHADOW_INFO_HOB_H_
10 #define _MICROCODE_SHADOW_INFO_HOB_H_
11 
12 ///
13 /// The Global ID of a GUIDed HOB used to pass microcode shadow info to DXE Driver.
14 ///
15 #define EDKII_MICROCODE_SHADOW_INFO_HOB_GUID \
16   { \
17     0x658903f9, 0xda66, 0x460d, { 0x8b, 0xb0, 0x9d, 0x2d, 0xdf, 0x65, 0x44, 0x59 } \
18   }
19 
20 extern EFI_GUID gEdkiiMicrocodeShadowInfoHobGuid;
21 
22 typedef struct {
23   //
24   // An EFI_GUID that defines the contents of StorageContext.
25   //
26   GUID      StorageType;
27   //
28   // Number of the microcode patches which have been
29   // relocated to memory.
30   //
31   UINT64    MicrocodeCount;
32   //
33   // An array with MicrocodeCount elements that stores
34   // the shadowed microcode patch address in memory.
35   //
36   UINT64    MicrocodeAddrInMemory[0];
37   //
38   // A buffer which contains details about the storage information
39   // specific to StorageType.
40   //
41   // UINT8  StorageContext[];
42 } EDKII_MICROCODE_SHADOW_INFO_HOB;
43 
44 //
45 // An EDKII_MICROCODE_SHADOW_INFO_HOB with StorageType set to below GUID will have
46 // the StorageContext of a EFI_MICROCODE_STORAGE_TYPE_FLASH_CONTEXT strucutre.
47 //
48 #define EFI_MICROCODE_STORAGE_TYPE_FLASH_GUID \
49   { \
50     0x2cba01b3, 0xd391, 0x4598, { 0x8d, 0x89, 0xb7, 0xfc, 0x39, 0x22, 0xfd, 0x71 } \
51   }
52 
53 extern EFI_GUID gEdkiiMicrocodeStorageTypeFlashGuid;
54 
55 typedef struct {
56   //
57   // An array with MicrocodeCount elements that stores the original
58   // microcode patch address on flash. The address is placed in same
59   // order as the microcode patches in MicrocodeAddrInMemory.
60   //
61   UINT64  MicrocodeAddressInFlash[0];
62 } EFI_MICROCODE_STORAGE_TYPE_FLASH_CONTEXT;
63 
64 #endif
65