]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/MpInitLib/MpLib.h
UefiCpuPkg: Remove FIT based microcode shadow logic from MpInitLib.
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / MpLib.h
index 7c62d75accfb7335f44a2e84598fdb07c0639b76..455cb3f09acb28f0f0c6747067b4201ab982a9aa 100644 (file)
@@ -29,8 +29,7 @@
 #include <Library/MtrrLib.h>\r
 #include <Library/HobLib.h>\r
 \r
-#include <IndustryStandard/FirmwareInterfaceTable.h>\r
-\r
+#include <Guid/MicrocodePatchHob.h>\r
 \r
 #define WAKEUP_AP_SIGNAL SIGNATURE_32 ('S', 'T', 'A', 'P')\r
 \r
@@ -219,8 +218,6 @@ struct _CPU_MP_DATA {
   UINT64                         CpuInfoInHob;\r
   UINT32                         CpuCount;\r
   UINT32                         BspNumber;\r
-  UINT64                         MicrocodePatchAddress;\r
-  UINT64                         MicrocodePatchRegionSize;\r
   //\r
   // The above fields data will be passed from PEI to DXE\r
   // Please make sure the fields offset same in the different\r
@@ -264,6 +261,8 @@ struct _CPU_MP_DATA {
   UINT8                          Vector;\r
   BOOLEAN                        PeriodicMode;\r
   BOOLEAN                        TimerInterruptState;\r
+  UINT64                         MicrocodePatchAddress;\r
+  UINT64                         MicrocodePatchRegionSize;\r
 \r
   //\r
   // Whether need to use Init-Sipi-Sipi to wake up the APs.\r
@@ -599,6 +598,27 @@ ShadowMicrocodeUpdatePatch (
   IN OUT CPU_MP_DATA             *CpuMpData\r
   );\r
 \r
+/**\r
+  Get the cached microcode patch base address and size from the microcode patch\r
+  information cache HOB.\r
+\r
+  @param[out] Address       Base address of the microcode patches data.\r
+                            It will be updated if the microcode patch\r
+                            information cache HOB is found.\r
+  @param[out] RegionSize    Size of the microcode patches data.\r
+                            It will be updated if the microcode patch\r
+                            information cache HOB is found.\r
+\r
+  @retval  TRUE     The microcode patch information cache HOB is found.\r
+  @retval  FALSE    The microcode patch information cache HOB is not found.\r
+\r
+**/\r
+BOOLEAN\r
+GetMicrocodePatchInfoFromHob (\r
+  UINT64                         *Address,\r
+  UINT64                         *RegionSize\r
+  );\r
+\r
 /**\r
   Detect whether Mwait-monitor feature is supported.\r
 \r
@@ -634,5 +654,21 @@ GetProcessorNumber (
   OUT UINTN                    *ProcessorNumber\r
   );\r
 \r
+/**\r
+  This funtion will try to invoke platform specific microcode shadow logic to\r
+  relocate microcode update patches into memory.\r
+\r
+  @param[in] CpuMpData  The pointer to CPU MP Data structure.\r
+\r
+  @retval EFI_SUCCESS              Shadow microcode success.\r
+  @retval EFI_OUT_OF_RESOURCES     No enough resource to complete the operation.\r
+  @retval EFI_UNSUPPORTED          Can't find platform specific microcode shadow\r
+                                   PPI/Protocol.\r
+**/\r
+EFI_STATUS\r
+PlatformShadowMicrocode (\r
+  IN OUT CPU_MP_DATA             *CpuMpData\r
+  );\r
+\r
 #endif\r
 \r