]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Include/Ppi/ShadowMicrocode.h
UefiCpuPkg: Remove FIT based microcode shadow logic from MpInitLib.
[mirror_edk2.git] / UefiCpuPkg / Include / Ppi / ShadowMicrocode.h
diff --git a/UefiCpuPkg/Include/Ppi/ShadowMicrocode.h b/UefiCpuPkg/Include/Ppi/ShadowMicrocode.h
new file mode 100644 (file)
index 0000000..be48965
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  This file declares EDKII Shadow Microcode PPI.\r
+\r
+  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef __PPI_SHADOW_MICROCODE_H__\r
+#define __PPI_SHADOW_MICROCODE_H__\r
+\r
+#define EDKII_PEI_SHADOW_MICROCODE_PPI_GUID \\r
+  { \\r
+    0x430f6965, 0x9a69, 0x41c5, { 0x93, 0xed, 0x8b, 0xf0, 0x64, 0x35, 0xc1, 0xc6 } \\r
+  }\r
+\r
+typedef struct _EDKII_PEI_SHADOW_MICROCODE_PPI  EDKII_PEI_SHADOW_MICROCODE_PPI;\r
+\r
+typedef struct {\r
+  UINT32         ProcessorSignature;\r
+  UINT8          PlatformId;\r
+} EDKII_PEI_MICROCODE_CPU_ID;\r
+\r
+/**\r
+  Shadow microcode update patches to memory.\r
+\r
+  The function is used for shadowing microcode update patches to a continuous memory.\r
+  It shall allocate memory buffer and only shadow the microcode patches for those\r
+  processors specified by MicrocodeCpuId array. The checksum verification may be\r
+  skiped in this function so the caller must perform checksum verification before\r
+  using the microcode patches in returned memory buffer.\r
+\r
+  @param[in]  This                 The PPI instance pointer.\r
+  @param[in]  CpuIdCount           Number of elements in MicrocodeCpuId array.\r
+  @param[in]  MicrocodeCpuId       A pointer to an array of EDKII_PEI_MICROCODE_CPU_ID\r
+                                   structures.\r
+  @param[out] BufferSize           Pointer to receive the total size of Buffer.\r
+  @param[out] Buffer               Pointer to receive address of allocated memory\r
+                                   with microcode patches data in it.\r
+\r
+  @retval EFI_SUCCESS              The microcode has been shadowed to memory.\r
+  @retval EFI_OUT_OF_RESOURCES     The operation fails due to lack of resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EDKII_PEI_SHADOW_MICROCODE) (\r
+  IN  EDKII_PEI_SHADOW_MICROCODE_PPI        *This,\r
+  IN  UINTN                                 CpuIdCount,\r
+  IN  EDKII_PEI_MICROCODE_CPU_ID            *MicrocodeCpuId,\r
+  OUT UINTN                                 *BufferSize,\r
+  OUT VOID                                  **Buffer\r
+  );\r
+\r
+///\r
+/// This PPI is installed by some platform or chipset-specific PEIM that\r
+/// abstracts handling microcode shadow support.\r
+///\r
+struct _EDKII_PEI_SHADOW_MICROCODE_PPI {\r
+  EDKII_PEI_SHADOW_MICROCODE          ShadowMicrocode;\r
+};\r
+\r
+extern EFI_GUID gEdkiiPeiShadowMicrocodePpiGuid;\r
+\r
+#endif\r
+\r