Update PeiReportStatusCodeLib instance, which will support report data prior to...
authoryshang1 <yshang1@de2fecce-e211-0410-80a6-f3fac2684e05>
Sun, 3 Feb 2008 03:53:58 +0000 (03:53 +0000)
committeryshang1 <yshang1@de2fecce-e211-0410-80a6-f3fac2684e05>
Sun, 3 Feb 2008 03:53:58 +0000 (03:53 +0000)
git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@4665 de2fecce-e211-0410-80a6-f3fac2684e05

edk2/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
edk2/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
edk2/Nt32Pkg/Nt32Pkg.dsc

index a860c7a..aeee6c1 100644 (file)
@@ -24,6 +24,8 @@
   EDK_RELEASE_VERSION            = 0x00020000\r
   EFI_SPECIFICATION_VERSION      = 0x00020000\r
 \r
+  CONSTRUCTOR                    = PeiReportStatusCodeLibConstructor\r
+\r
 \r
 #\r
 # The following information is for reference only and not required by the build tools.\r
@@ -46,6 +48,7 @@
   BaseMemoryLib\r
   BaseLib\r
   DebugLib\r
+  OemHookStatusCodeLib\r
 \r
 \r
 [Guids]\r
index 2d08ccd..c79d93e 100644 (file)
@@ -22,6 +22,7 @@
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/PeiServicesTablePointerLib.h>\r
+#include< Library/OemHookStatusCodeLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
 #include <DebugInfo.h>\r
 //\r
 #define MAX_EXTENDED_DATA_SIZE  0x200\r
 \r
+\r
+/**\r
+  The constructor function initializes the OEM hooked status\r
+  code device.\r
+  \r
+  @param  FfsHeader   Pointer to FFS header the loaded driver.\r
+  @param  PeiServices Pointer to the PEI services.\r
+\r
+  @return  Status of initialization of OEM hook status code\r
+           device.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiReportStatusCodeLibConstructor (\r
+  IN EFI_PEI_FILE_HANDLE  FileHandle,\r
+  IN EFI_PEI_SERVICES     **PeiServices\r
+  )\r
+{\r
+  return OemHookStatusCodeInitialize ();\r
+}\r
+\r
+\r
 /**\r
   Internal worker function that reports a status code through the Status Code Protocol\r
 \r
@@ -65,16 +89,21 @@ InternalReportStatusCode (
   )\r
 {\r
   CONST EFI_PEI_SERVICES  **PeiServices;\r
+  EFI_STATUS              Status;\r
 \r
   PeiServices = (CONST EFI_PEI_SERVICES  **) GetPeiServicesTablePointer ();\r
-  return (*PeiServices)->ReportStatusCode (\r
-                           PeiServices,\r
-                           Type,\r
-                           Value,\r
-                           Instance,\r
-                           (EFI_GUID *)CallerId,\r
-                           Data\r
-                           );\r
+  Status =  (*PeiServices)->ReportStatusCode (\r
+                             PeiServices,\r
+                             Type,\r
+                             Value,\r
+                             Instance,\r
+                             (EFI_GUID *)CallerId,\r
+                             Data\r
+                             );\r
+  if (Status == EFI_NOT_AVAILABLE_YET) {\r
+    return OemHookStatusCodeReport (Type, Value, Instance, (EFI_GUID *) CallerId, Data);\r
+  }\r
+  return Status;\r
 }\r
 \r
 \r
index 98e0520..d8f5cd7 100644 (file)
   MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
   PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
+  OemHookStatusCodeLib|IntelFrameworkModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf\r
   PeCoffGetEntryPointLib|Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf\r
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r