]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.c
BaseTool: Fixed the incorrect cache key.
[mirror_edk2.git] / UefiCpuPkg / CpuFeatures / CpuFeaturesDxe.c
index b0b186d36d6d4e2affe24db47bc14130b6648490..b5c2605d93c34c42cdba7e8cc07916f098d90619 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   CPU Features DXE driver to initialize CPU features.\r
 \r
-  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -19,6 +19,7 @@
 #include <Library/UefiLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/RegisterCpuFeaturesLib.h>\r
+#include <Library/HobLib.h>\r
 \r
 #include <Protocol/SmmConfiguration.h>\r
 #include <Guid/CpuFeaturesInitDone.h>\r
@@ -101,6 +102,25 @@ CpuFeaturesDxeInitialize (
   )\r
 {\r
   VOID        *Registration;\r
+  EFI_STATUS  Status;\r
+  EFI_HANDLE  Handle;\r
+\r
+  if (GetFirstGuidHob (&gEdkiiCpuFeaturesInitDoneGuid) != NULL) {\r
+    //\r
+    // Try to find HOB first. This HOB exist means CPU features have\r
+    // been initialized by CpuFeaturesPei driver, just install\r
+    // gEdkiiCpuFeaturesInitDoneGuid.\r
+    //\r
+    Handle = NULL;\r
+    Status = gBS->InstallProtocolInterface (\r
+                    &Handle,\r
+                    &gEdkiiCpuFeaturesInitDoneGuid,\r
+                    EFI_NATIVE_INTERFACE,\r
+                    NULL\r
+                    );\r
+    ASSERT_EFI_ERROR (Status);\r
+    return Status;\r
+  }\r
 \r
   if (PcdGetBool (PcdCpuFeaturesInitAfterSmmRelocation)) {\r
     //\r