]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update directory/file names for status code PEIM.
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 27 Apr 2009 09:09:45 +0000 (09:09 +0000)
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 27 Apr 2009 09:09:45 +0000 (09:09 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8187 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c [deleted file]
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.h [deleted file]
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf [deleted file]
IntelFrameworkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c
IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.c [new file with mode: 0644]
IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.h [new file with mode: 0644]
IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf [new file with mode: 0644]

index 809b62f9c0973ad4bad468efefc314eb7062fa5a..446f70f8fe4064d8ca5ac8defe75e8e7294a35ba 100644 (file)
@@ -12,7 +12,7 @@
 \r
 **/\r
 \r
-#include "PeiStatusCode.h"\r
+#include "StatusCodePei.h"\r
 \r
 /**\r
   Worker function to create one memory status code GUID'ed HOB,\r
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c
deleted file mode 100644 (file)
index 726ae5b..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/** @file\r
-  Status code PEIM which produces Status Code PPI.\r
-\r
-  Copyright (c) 2006 - 2009, Intel Corporation\r
-  All rights reserved. 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
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "PeiStatusCode.h"\r
-\r
-EFI_PEI_PROGRESS_CODE_PPI     mStatusCodePpi = {\r
-  ReportDispatcher\r
-  };\r
-\r
-EFI_PEI_PPI_DESCRIPTOR        mStatusCodePpiDescriptor = {\r
-  EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
-  &gEfiPeiStatusCodePpiGuid,\r
-  &mStatusCodePpi\r
-  };\r
-\r
-/**\r
-  Publishes an interface that allows PEIMs to report status codes.\r
-\r
-  This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().\r
-  It publishes an interface that allows PEIMs to report status codes.\r
-\r
-  @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
-  @param  CodeType         Indicates the type of status code being reported.\r
-  @param  Value            Describes the current status of a hardware or\r
-                           software entity. This includes information about the class and\r
-                           subclass that is used to classify the entity as well as an operation.\r
-                           For progress codes, the operation is the current activity.\r
-                           For error codes, it is the exception.For debug codes,it is not defined at this time.\r
-  @param  Instance         The enumeration of a hardware or software entity within\r
-                           the system. A system may contain multiple entities that match a class/subclass\r
-                           pairing. The instance differentiates between them. An instance of 0 indicates\r
-                           that instance information is unavailable, not meaningful, or not relevant.\r
-                           Valid instance numbers start with 1.\r
-  @param  CallerId         This optional parameter may be used to identify the caller.\r
-                           This parameter allows the status code driver to apply different rules to\r
-                           different callers.\r
-  @param  Data             This optional parameter may be used to pass additional data.\r
-\r
-  @retval EFI_SUCCESS      The function completed successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ReportDispatcher (\r
-  IN CONST EFI_PEI_SERVICES         **PeiServices,\r
-  IN EFI_STATUS_CODE_TYPE           CodeType,\r
-  IN EFI_STATUS_CODE_VALUE          Value,\r
-  IN UINT32                         Instance,\r
-  IN CONST EFI_GUID                 *CallerId OPTIONAL,\r
-  IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
-  )\r
-{\r
-  if (FeaturePcdGet (PcdStatusCodeUseSerial)) {\r
-    SerialStatusCodeReportWorker (\r
-      CodeType,\r
-      Value,\r
-      Instance,\r
-      CallerId,\r
-      Data\r
-      );\r
-  }\r
-  if (FeaturePcdGet (PcdStatusCodeUseMemory)) {\r
-    MemoryStatusCodeReportWorker (\r
-      CodeType,\r
-      Value,\r
-      Instance\r
-      );\r
-  }\r
-  if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
-    //\r
-    // Call OEM hook status code library API to report status code to OEM device\r
-    //\r
-    OemHookStatusCodeReport (\r
-      CodeType,\r
-      Value,\r
-      Instance,\r
-      (EFI_GUID *)CallerId,\r
-      (EFI_STATUS_CODE_DATA *)Data\r
-      );\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Entry point of Status Code PEIM.\r
-  \r
-  This function is the entry point of this Status Code PEIM.\r
-  It initializes supported status code devices according to PCD settings,\r
-  and installs Status Code PPI.\r
-\r
-  @param  FileHandle  Handle of the file being invoked.\r
-  @param  PeiServices Describes the list of possible PEI Services.\r
-\r
-  @retval EFI_SUCESS  The entry point of DXE IPL PEIM executes successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiStatusCodeDriverEntry (\r
-  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices\r
-  )\r
-{\r
-  EFI_STATUS                  Status;\r
-\r
-  //\r
-  // Dispatch initialization request to sub-statuscode-devices.\r
-  // If enable UseSerial, then initialize serial port.\r
-  // if enable UseMemory, then initialize memory status code worker.\r
-  // if enable UseOEM, then initialize Oem status code.\r
-  //\r
-  if (FeaturePcdGet (PcdStatusCodeUseSerial)) {\r
-    Status = SerialPortInitialize();\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-  if (FeaturePcdGet (PcdStatusCodeUseMemory)) {\r
-    Status = MemoryStatusCodeInitializeWorker ();\r
-    ASSERT_EFI_ERROR  (Status);\r
-  }\r
-  if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
-    Status = OemHookStatusCodeInitialize ();\r
-    ASSERT_EFI_ERROR  (Status);\r
-  }\r
-\r
-  //\r
-  // Install Status Code PPI.\r
-  // It serves the PEI Service ReportStatusCode.\r
-  //\r
-  Status = PeiServicesInstallPpi (&mStatusCodePpiDescriptor);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.h b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.h
deleted file mode 100644 (file)
index a609393..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/** @file\r
-  Internal include file for Status Code PEIM.\r
-\r
-  Copyright (c) 2006 - 2009, Intel Corporation\r
-  All rights reserved. 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
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef __PEI_STATUS_CODE_H__\r
-#define __PEI_STATUS_CODE_H__\r
-\r
-\r
-\r
-#include <FrameworkPei.h>\r
-#include <FrameworkModulePei.h>\r
-#include <Guid/MemoryStatusCodeRecord.h>\r
-#include <Guid/StatusCodeDataTypeId.h>\r
-#include <Ppi/StatusCode.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-#include <Library/SerialPortLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/OemHookStatusCodeLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-\r
-/**\r
-  Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
-\r
-  @param  CodeType         Indicates the type of status code being reported.\r
-  @param  Value            Describes the current status of a hardware or\r
-                           software entity. This includes information about the class and\r
-                           subclass that is used to classify the entity as well as an operation.\r
-                           For progress codes, the operation is the current activity.\r
-                           For error codes, it is the exception.For debug codes,it is not defined at this time.\r
-  @param  Instance         The enumeration of a hardware or software entity within\r
-                           the system. A system may contain multiple entities that match a class/subclass\r
-                           pairing. The instance differentiates between them. An instance of 0 indicates\r
-                           that instance information is unavailable, not meaningful, or not relevant.\r
-                           Valid instance numbers start with 1.\r
-  @param  CallerId         This optional parameter may be used to identify the caller.\r
-                           This parameter allows the status code driver to apply different rules to\r
-                           different callers.\r
-  @param  Data             This optional parameter may be used to pass additional data.\r
-\r
-  @retval EFI_SUCCESS      Status code reported to serial I/O successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-SerialStatusCodeReportWorker (\r
-  IN EFI_STATUS_CODE_TYPE           CodeType,\r
-  IN EFI_STATUS_CODE_VALUE          Value,\r
-  IN UINT32                         Instance,\r
-  IN CONST EFI_GUID                 *CallerId,\r
-  IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
-  );\r
-\r
-\r
-/**\r
-  Create the first memory status code GUID'ed HOB as initialization for memory status code worker.\r
-\r
-  @retval EFI_SUCCESS  The GUID'ed HOB is created successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-MemoryStatusCodeInitializeWorker (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Report status code into GUID'ed HOB.\r
-\r
-  This function reports status code into GUID'ed HOB. If not all packets are full, then\r
-  write status code into available entry. Otherwise, create a new packet for it.\r
-\r
-  @param  CodeType         Indicates the type of status code being reported.\r
-  @param  Value            Describes the current status of a hardware or\r
-                           software entity. This includes information about the class and\r
-                           subclass that is used to classify the entity as well as an operation.\r
-                           For progress codes, the operation is the current activity.\r
-                           For error codes, it is the exception.For debug codes,it is not defined at this time.\r
-  @param  Instance         The enumeration of a hardware or software entity within\r
-                           the system. A system may contain multiple entities that match a class/subclass\r
-                           pairing. The instance differentiates between them. An instance of 0 indicates\r
-                           that instance information is unavailable, not meaningful, or not relevant.\r
-                           Valid instance numbers start with 1.\r
-\r
-  @retval EFI_SUCCESS      The function always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-MemoryStatusCodeReportWorker (\r
-  IN EFI_STATUS_CODE_TYPE     CodeType,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance\r
-  );\r
-\r
-/**\r
-  Publishes an interface that allows PEIMs to report status codes.\r
-\r
-  This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().\r
-  It publishes an interface that allows PEIMs to report status codes.\r
-\r
-  @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
-  @param  CodeType         Indicates the type of status code being reported.\r
-  @param  Value            Describes the current status of a hardware or\r
-                           software entity. This includes information about the class and\r
-                           subclass that is used to classify the entity as well as an operation.\r
-                           For progress codes, the operation is the current activity.\r
-                           For error codes, it is the exception.For debug codes,it is not defined at this time.\r
-  @param  Instance         The enumeration of a hardware or software entity within\r
-                           the system. A system may contain multiple entities that match a class/subclass\r
-                           pairing. The instance differentiates between them. An instance of 0 indicates\r
-                           that instance information is unavailable, not meaningful, or not relevant.\r
-                           Valid instance numbers start with 1.\r
-  @param  CallerId         This optional parameter may be used to identify the caller.\r
-                           This parameter allows the status code driver to apply different rules to\r
-                           different callers.\r
-  @param  Data             This optional parameter may be used to pass additional data.\r
-\r
-  @retval EFI_SUCCESS      The function completed successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ReportDispatcher (\r
-  IN CONST EFI_PEI_SERVICES         **PeiServices,\r
-  IN EFI_STATUS_CODE_TYPE           CodeType,\r
-  IN EFI_STATUS_CODE_VALUE          Value,\r
-  IN UINT32                         Instance,\r
-  IN CONST EFI_GUID                 *CallerId OPTIONAL,\r
-  IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
-  );\r
-\r
-#endif\r
-\r
-\r
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf
deleted file mode 100644 (file)
index 15ab9dc..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#/** @file\r
-#  Status code PEIM which produces Status Code PPI.\r
-#\r
-#  Copyright (c) 2006 - 2009, Intel Corporation.\r
-#\r
-#  All rights reserved. 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
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-#**/\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = StatusCodePei\r
-  FILE_GUID                      = 1EC0F53A-FDE0-4576-8F25-7A1A410F58EB\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  EFI_SPECIFICATION_VERSION      = 0x00020000\r
-  ENTRY_POINT                    = PeiStatusCodeDriverEntry\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources.common]\r
-  PeiStatusCode.c\r
-  MemoryStausCodeWorker.c\r
-  SerialStatusCodeWorker.c\r
-  PeiStatusCode.h\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  PeimEntryPoint\r
-  OemHookStatusCodeLib\r
-  PeiServicesLib\r
-  PcdLib\r
-  HobLib\r
-  SerialPortLib\r
-  ReportStatusCodeLib\r
-  PrintLib\r
-  DebugLib\r
-  BaseLib\r
-\r
-\r
-[Guids]\r
-  gMemoryStatusCodeRecordGuid                   # SOMETIMES_CONSUMED\r
-\r
-\r
-[Ppis]\r
-  gEfiPeiStatusCodePpiGuid                      # PPI ALWAYS_CONSUMED\r
-\r
-\r
-[FeaturePcd.common]\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseOEM\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial\r
-\r
-\r
-[Pcd.common]\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize\r
-\r
-[Depex]\r
-  TRUE\r
index 7a618d9e1b26468a68f2d6e8f275323ca6c1ac91..1784f4ebc55d7012baacdfbf771a61343ecf6428 100644 (file)
@@ -11,7 +11,7 @@
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 **/\r
 \r
-#include "PeiStatusCode.h"\r
+#include "StatusCodePei.h"\r
 \r
 /**\r
   Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.c b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.c
new file mode 100644 (file)
index 0000000..caedbbf
--- /dev/null
@@ -0,0 +1,146 @@
+/** @file\r
+  Status code PEIM which produces Status Code PPI.\r
+\r
+  Copyright (c) 2006 - 2009, Intel Corporation\r
+  All rights reserved. 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
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "StatusCodePei.h"\r
+\r
+EFI_PEI_PROGRESS_CODE_PPI     mStatusCodePpi = {\r
+  ReportDispatcher\r
+  };\r
+\r
+EFI_PEI_PPI_DESCRIPTOR        mStatusCodePpiDescriptor = {\r
+  EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
+  &gEfiPeiStatusCodePpiGuid,\r
+  &mStatusCodePpi\r
+  };\r
+\r
+/**\r
+  Publishes an interface that allows PEIMs to report status codes.\r
+\r
+  This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().\r
+  It publishes an interface that allows PEIMs to report status codes.\r
+\r
+  @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param  CodeType         Indicates the type of status code being reported.\r
+  @param  Value            Describes the current status of a hardware or\r
+                           software entity. This includes information about the class and\r
+                           subclass that is used to classify the entity as well as an operation.\r
+                           For progress codes, the operation is the current activity.\r
+                           For error codes, it is the exception.For debug codes,it is not defined at this time.\r
+  @param  Instance         The enumeration of a hardware or software entity within\r
+                           the system. A system may contain multiple entities that match a class/subclass\r
+                           pairing. The instance differentiates between them. An instance of 0 indicates\r
+                           that instance information is unavailable, not meaningful, or not relevant.\r
+                           Valid instance numbers start with 1.\r
+  @param  CallerId         This optional parameter may be used to identify the caller.\r
+                           This parameter allows the status code driver to apply different rules to\r
+                           different callers.\r
+  @param  Data             This optional parameter may be used to pass additional data.\r
+\r
+  @retval EFI_SUCCESS      The function completed successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ReportDispatcher (\r
+  IN CONST EFI_PEI_SERVICES         **PeiServices,\r
+  IN EFI_STATUS_CODE_TYPE           CodeType,\r
+  IN EFI_STATUS_CODE_VALUE          Value,\r
+  IN UINT32                         Instance,\r
+  IN CONST EFI_GUID                 *CallerId OPTIONAL,\r
+  IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
+  )\r
+{\r
+  if (FeaturePcdGet (PcdStatusCodeUseSerial)) {\r
+    SerialStatusCodeReportWorker (\r
+      CodeType,\r
+      Value,\r
+      Instance,\r
+      CallerId,\r
+      Data\r
+      );\r
+  }\r
+  if (FeaturePcdGet (PcdStatusCodeUseMemory)) {\r
+    MemoryStatusCodeReportWorker (\r
+      CodeType,\r
+      Value,\r
+      Instance\r
+      );\r
+  }\r
+  if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+    //\r
+    // Call OEM hook status code library API to report status code to OEM device\r
+    //\r
+    OemHookStatusCodeReport (\r
+      CodeType,\r
+      Value,\r
+      Instance,\r
+      (EFI_GUID *)CallerId,\r
+      (EFI_STATUS_CODE_DATA *)Data\r
+      );\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Entry point of Status Code PEIM.\r
+  \r
+  This function is the entry point of this Status Code PEIM.\r
+  It initializes supported status code devices according to PCD settings,\r
+  and installs Status Code PPI.\r
+\r
+  @param  FileHandle  Handle of the file being invoked.\r
+  @param  PeiServices Describes the list of possible PEI Services.\r
+\r
+  @retval EFI_SUCESS  The entry point of DXE IPL PEIM executes successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiStatusCodeDriverEntry (\r
+  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices\r
+  )\r
+{\r
+  EFI_STATUS                  Status;\r
+\r
+  //\r
+  // Dispatch initialization request to sub-statuscode-devices.\r
+  // If enable UseSerial, then initialize serial port.\r
+  // if enable UseMemory, then initialize memory status code worker.\r
+  // if enable UseOEM, then initialize Oem status code.\r
+  //\r
+  if (FeaturePcdGet (PcdStatusCodeUseSerial)) {\r
+    Status = SerialPortInitialize();\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
+  if (FeaturePcdGet (PcdStatusCodeUseMemory)) {\r
+    Status = MemoryStatusCodeInitializeWorker ();\r
+    ASSERT_EFI_ERROR  (Status);\r
+  }\r
+  if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+    Status = OemHookStatusCodeInitialize ();\r
+    ASSERT_EFI_ERROR  (Status);\r
+  }\r
+\r
+  //\r
+  // Install Status Code PPI.\r
+  // It serves the PEI Service ReportStatusCode.\r
+  //\r
+  Status = PeiServicesInstallPpi (&mStatusCodePpiDescriptor);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.h b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.h
new file mode 100644 (file)
index 0000000..a609393
--- /dev/null
@@ -0,0 +1,148 @@
+/** @file\r
+  Internal include file for Status Code PEIM.\r
+\r
+  Copyright (c) 2006 - 2009, Intel Corporation\r
+  All rights reserved. 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
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __PEI_STATUS_CODE_H__\r
+#define __PEI_STATUS_CODE_H__\r
+\r
+\r
+\r
+#include <FrameworkPei.h>\r
+#include <FrameworkModulePei.h>\r
+#include <Guid/MemoryStatusCodeRecord.h>\r
+#include <Guid/StatusCodeDataTypeId.h>\r
+#include <Ppi/StatusCode.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/SerialPortLib.h>\r
+#include <Library/HobLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/PeiServicesLib.h>\r
+#include <Library/OemHookStatusCodeLib.h>\r
+#include <Library/PeimEntryPoint.h>\r
+\r
+/**\r
+  Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
+\r
+  @param  CodeType         Indicates the type of status code being reported.\r
+  @param  Value            Describes the current status of a hardware or\r
+                           software entity. This includes information about the class and\r
+                           subclass that is used to classify the entity as well as an operation.\r
+                           For progress codes, the operation is the current activity.\r
+                           For error codes, it is the exception.For debug codes,it is not defined at this time.\r
+  @param  Instance         The enumeration of a hardware or software entity within\r
+                           the system. A system may contain multiple entities that match a class/subclass\r
+                           pairing. The instance differentiates between them. An instance of 0 indicates\r
+                           that instance information is unavailable, not meaningful, or not relevant.\r
+                           Valid instance numbers start with 1.\r
+  @param  CallerId         This optional parameter may be used to identify the caller.\r
+                           This parameter allows the status code driver to apply different rules to\r
+                           different callers.\r
+  @param  Data             This optional parameter may be used to pass additional data.\r
+\r
+  @retval EFI_SUCCESS      Status code reported to serial I/O successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+SerialStatusCodeReportWorker (\r
+  IN EFI_STATUS_CODE_TYPE           CodeType,\r
+  IN EFI_STATUS_CODE_VALUE          Value,\r
+  IN UINT32                         Instance,\r
+  IN CONST EFI_GUID                 *CallerId,\r
+  IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  Create the first memory status code GUID'ed HOB as initialization for memory status code worker.\r
+\r
+  @retval EFI_SUCCESS  The GUID'ed HOB is created successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+MemoryStatusCodeInitializeWorker (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Report status code into GUID'ed HOB.\r
+\r
+  This function reports status code into GUID'ed HOB. If not all packets are full, then\r
+  write status code into available entry. Otherwise, create a new packet for it.\r
+\r
+  @param  CodeType         Indicates the type of status code being reported.\r
+  @param  Value            Describes the current status of a hardware or\r
+                           software entity. This includes information about the class and\r
+                           subclass that is used to classify the entity as well as an operation.\r
+                           For progress codes, the operation is the current activity.\r
+                           For error codes, it is the exception.For debug codes,it is not defined at this time.\r
+  @param  Instance         The enumeration of a hardware or software entity within\r
+                           the system. A system may contain multiple entities that match a class/subclass\r
+                           pairing. The instance differentiates between them. An instance of 0 indicates\r
+                           that instance information is unavailable, not meaningful, or not relevant.\r
+                           Valid instance numbers start with 1.\r
+\r
+  @retval EFI_SUCCESS      The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+MemoryStatusCodeReportWorker (\r
+  IN EFI_STATUS_CODE_TYPE     CodeType,\r
+  IN EFI_STATUS_CODE_VALUE    Value,\r
+  IN UINT32                   Instance\r
+  );\r
+\r
+/**\r
+  Publishes an interface that allows PEIMs to report status codes.\r
+\r
+  This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().\r
+  It publishes an interface that allows PEIMs to report status codes.\r
+\r
+  @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param  CodeType         Indicates the type of status code being reported.\r
+  @param  Value            Describes the current status of a hardware or\r
+                           software entity. This includes information about the class and\r
+                           subclass that is used to classify the entity as well as an operation.\r
+                           For progress codes, the operation is the current activity.\r
+                           For error codes, it is the exception.For debug codes,it is not defined at this time.\r
+  @param  Instance         The enumeration of a hardware or software entity within\r
+                           the system. A system may contain multiple entities that match a class/subclass\r
+                           pairing. The instance differentiates between them. An instance of 0 indicates\r
+                           that instance information is unavailable, not meaningful, or not relevant.\r
+                           Valid instance numbers start with 1.\r
+  @param  CallerId         This optional parameter may be used to identify the caller.\r
+                           This parameter allows the status code driver to apply different rules to\r
+                           different callers.\r
+  @param  Data             This optional parameter may be used to pass additional data.\r
+\r
+  @retval EFI_SUCCESS      The function completed successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ReportDispatcher (\r
+  IN CONST EFI_PEI_SERVICES         **PeiServices,\r
+  IN EFI_STATUS_CODE_TYPE           CodeType,\r
+  IN EFI_STATUS_CODE_VALUE          Value,\r
+  IN UINT32                         Instance,\r
+  IN CONST EFI_GUID                 *CallerId OPTIONAL,\r
+  IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
+  );\r
+\r
+#endif\r
+\r
+\r
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
new file mode 100644 (file)
index 0000000..fade2de
--- /dev/null
@@ -0,0 +1,74 @@
+#/** @file\r
+#  Status code PEIM which produces Status Code PPI.\r
+#\r
+#  Copyright (c) 2006 - 2009, Intel Corporation.\r
+#\r
+#  All rights reserved. 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
+#  http://opensource.org/licenses/bsd-license.php\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = StatusCodePei\r
+  FILE_GUID                      = 1EC0F53A-FDE0-4576-8F25-7A1A410F58EB\r
+  MODULE_TYPE                    = PEIM\r
+  VERSION_STRING                 = 1.0\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+  ENTRY_POINT                    = PeiStatusCodeDriverEntry\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+  StatusCodePei.c\r
+  StatusCodePei.h\r
+  MemoryStausCodeWorker.c\r
+  SerialStatusCodeWorker.c\r
+\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
+  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
+\r
+[LibraryClasses]\r
+  PeimEntryPoint\r
+  OemHookStatusCodeLib\r
+  PeiServicesLib\r
+  PcdLib\r
+  HobLib\r
+  SerialPortLib\r
+  ReportStatusCodeLib\r
+  PrintLib\r
+  DebugLib\r
+  BaseLib\r
+\r
+\r
+[Guids]\r
+  gMemoryStatusCodeRecordGuid                   ## SOMETIMES_CONSUMES ## HOB\r
+\r
+\r
+[Ppis]\r
+  gEfiPeiStatusCodePpiGuid                      ## PRODUCES\r
+\r
+\r
+[FeaturePcd.common]\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseOEM\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial\r
+\r
+\r
+[Pcd.common]\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize\r
+\r
+[Depex]\r
+  TRUE\r