MdePkg: introduce standalone MM entry point library implementation
[mirror_edk2.git] / IntelFsp2WrapperPkg / FspWrapperNotifyDxe / FspWrapperNotifyDxe.c
index a692632..a2fe18c 100644 (file)
@@ -27,6 +27,8 @@
 #include <Library/HobLib.h>\r
 #include <FspStatusCode.h>\r
 \r
+#define   FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION     BIT16\r
+\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI * ADD_PERFORMANCE_RECORDS)(\r
@@ -236,6 +238,7 @@ FspWrapperNotifyDxeEntryPoint (
   EFI_EVENT  ReadyToBootEvent;\r
   VOID       *Registration;\r
   EFI_EVENT  ProtocolNotifyEvent;\r
+  UINT32     FspApiMask;\r
 \r
   //\r
   // Load this driver's image to memory\r
@@ -245,14 +248,17 @@ FspWrapperNotifyDxeEntryPoint (
     return EFI_SUCCESS;\r
   }\r
 \r
-  ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (\r
-                          &gEfiPciEnumerationCompleteProtocolGuid,\r
-                          TPL_CALLBACK,\r
-                          OnPciEnumerationComplete,\r
-                          NULL,\r
-                          &Registration\r
-                          );\r
-  ASSERT (ProtocolNotifyEvent != NULL);\r
+  FspApiMask = PcdGet32 (PcdSkipFspApi);\r
+  if ((FspApiMask & FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION) == 0) {\r
+    ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (\r
+                            &gEfiPciEnumerationCompleteProtocolGuid,\r
+                            TPL_CALLBACK,\r
+                            OnPciEnumerationComplete,\r
+                            NULL,\r
+                            &Registration\r
+                            );\r
+    ASSERT (ProtocolNotifyEvent != NULL);\r
+  }\r
 \r
   Status = EfiCreateEventReadyToBootEx (\r
              TPL_CALLBACK,\r