]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code Scrub for Status Code PEIM.
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 27 Apr 2009 08:47:07 +0000 (08:47 +0000)
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 27 Apr 2009 08:47:07 +0000 (08:47 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8186 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.h
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf
IntelFrameworkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c

index c8ebabbec574eb484ca069e2b49ad2e09b537648..809b62f9c0973ad4bad468efefc314eb7062fa5a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  Memory status code worker in PEI.\r
+  PEI memory status code worker.\r
 \r
-  Copyright (c) 2006, Intel Corporation\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
   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
-  Module Name:  MemoryStatusCodeWorker.c\r
-\r
 **/\r
 \r
 #include "PeiStatusCode.h"\r
 \r
 /**\r
-  Create one memory status code GUID'ed HOB, use PacketIndex\r
-  to identify the packet.\r
+  Worker function to create one memory status code GUID'ed HOB,\r
+  using PacketIndex to identify the packet.\r
 \r
   @param   PacketIndex    Index of records packet.\r
 \r
-  @return                 Always return pointer of memory status code packet.\r
+  @return  Pointer to the memory status code packet.\r
 \r
 **/\r
 MEMORY_STATUSCODE_PACKET_HEADER *\r
@@ -35,30 +33,23 @@ CreateMemoryStatusCodePacket (
   //\r
   // Build GUID'ed HOB with PCD defined size.\r
   //\r
-  PacketHeader =\r
-    (MEMORY_STATUSCODE_PACKET_HEADER *) BuildGuidHob (\r
-                                          &gMemoryStatusCodeRecordGuid,\r
-                                          PcdGet16 (PcdStatusCodeMemorySize) *\r
-                                          1024 +\r
-                                          sizeof (MEMORY_STATUSCODE_PACKET_HEADER)\r
-                                          );\r
+  PacketHeader = BuildGuidHob (\r
+                   &gMemoryStatusCodeRecordGuid,\r
+                   PcdGet16 (PcdStatusCodeMemorySize) * 1024 + sizeof (MEMORY_STATUSCODE_PACKET_HEADER)\r
+                   );\r
   ASSERT (PacketHeader != NULL);\r
 \r
-  PacketHeader->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024)/ sizeof (MEMORY_STATUSCODE_RECORD);\r
+  PacketHeader->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);\r
   PacketHeader->PacketIndex      = PacketIndex;\r
   PacketHeader->RecordIndex      = 0;\r
 \r
   return PacketHeader;\r
 }\r
 \r
-\r
-\r
 /**\r
-  Initialize memory status code.\r
-  Create one GUID'ed HOB with PCD defined size. If create required size\r
-  GUID'ed HOB failed, then ASSERT().\r
+  Create the first memory status code GUID'ed HOB as initialization for memory status code worker.\r
 \r
-  @return           The function always return EFI_SUCCESS\r
+  @retval EFI_SUCCESS  The GUID'ed HOB is created successfully.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -76,23 +67,24 @@ MemoryStatusCodeInitializeWorker (
 \r
 \r
 /**\r
-  Report status code into GUID'ed HOB..\r
+  Report status code into GUID'ed HOB.\r
 \r
-  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\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  Value         Describes the current status of a hardware or software entity.\r
-                        This included information about the class and subclass that is used to classify the entity\r
-                        as well as an operation.  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
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\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
-  @param  Instance      The enumeration of a hardware or software entity within the system.\r
-                        A system may contain multiple entities that match a class/subclass pairing.\r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable,\r
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
-\r
-  @return               The function always return EFI_SUCCESS.\r
+  @retval EFI_SUCCESS      The function always return EFI_SUCCESS.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -105,11 +97,14 @@ MemoryStatusCodeReportWorker (
 \r
   EFI_PEI_HOB_POINTERS              Hob;\r
   MEMORY_STATUSCODE_PACKET_HEADER   *PacketHeader;\r
-  MEMORY_STATUSCODE_RECORD          *Record     = NULL;\r
-  UINT16                            PacketIndex = 0;;\r
+  MEMORY_STATUSCODE_RECORD          *Record;\r
+  UINT16                            PacketIndex;\r
+\r
+  Record      = NULL;\r
+  PacketIndex = 0;\r
 \r
   //\r
-  // Journal GUID'ed HOBs to find empty record entry, if found, then save status code in it.\r
+  // Journal GUID'ed HOBs to find empty record entry. if found, then save status code in it.\r
   // otherwise, create a new GUID'ed HOB.\r
   //\r
   Hob.Raw = GetFirstGuidHob (&gMemoryStatusCodeRecordGuid);\r
@@ -132,9 +127,9 @@ MemoryStatusCodeReportWorker (
     Hob.Raw = GetNextGuidHob (&gMemoryStatusCodeRecordGuid, Hob.Raw);\r
   }\r
 \r
-  if (NULL == Record) {\r
+  if (Record == NULL) {\r
     //\r
-    // In order to save status code , create new packet.\r
+    // No available entry found, so create new packet.\r
     //\r
     PacketHeader = CreateMemoryStatusCodePacket (PacketIndex);\r
 \r
index cd6b5e5033a86322b99b0924e7690c048f9a9e1e..726ae5b72bfec6977dc2ca16d41d7d324e2932a7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  Generic PeiStatusCode Module.\r
+  Status code PEIM which produces Status Code PPI.\r
 \r
-  Copyright (c) 2006, Intel Corporation\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
   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
-  Module Name:  PeiStatusCode.c\r
-\r
 **/\r
 \r
 #include "PeiStatusCode.h"\r
 \r
-EFI_PEI_PROGRESS_CODE_PPI     mStatusCodePpi           = {\r
+EFI_PEI_PROGRESS_CODE_PPI     mStatusCodePpi = {\r
   ReportDispatcher\r
   };\r
 \r
@@ -27,40 +25,38 @@ EFI_PEI_PPI_DESCRIPTOR        mStatusCodePpiDescriptor = {
   };\r
 \r
 /**\r
-  Report status code to all supported device.\r
-\r
-\r
-  @param  PeiServices\r
-\r
-  @param  CodeType      Indicates the type of status code being reported.\r
-                        The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
-  @param  Value         Describes the current status of a hardware or software entity.\r
-                        This includes information about the class and subclass that is used to classify the entity\r
-                        as well as an operation.  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
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.\r
-                        A system may contain multiple entities that match a class/subclass pairing.\r
-                        The instance differentiates between them.  An instance of 0 indicates that instance\r
-                        information is unavailable, not meaningful, or not relevant.  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 different callers.\r
-  @param  Data          This optional parameter may be used to pass additional data.\r
-                        Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below.\r
-                        The contents of this data type may have additional GUID-specific data.  The standard GUIDs and\r
-                        their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.\r
-\r
-  @return               Always return EFI_SUCCESS.\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 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
@@ -82,6 +78,9 @@ ReportDispatcher (
       );\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
@@ -95,13 +94,16 @@ ReportDispatcher (
 }\r
 \r
 /**\r
-  Initialize PEI status codes and publish the status code\r
-  PPI.\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
-  @return                  The function always returns success.\r
+  @retval EFI_SUCESS  The entry point of DXE IPL PEIM executes successfully.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -133,9 +135,9 @@ PeiStatusCodeDriverEntry (
   }\r
 \r
   //\r
-  // Install PeiStatusCodePpi.\r
-  // PeiServices use this Ppi to output status code.\r
-  // use library\r
+  // Install Status Code PPI.\r
+  // It serves the PEI Service ReportStatusCode.\r
+  //\r
   Status = PeiServicesInstallPpi (&mStatusCodePpiDescriptor);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
index 9493a49c074af3f1a15f91010fa7e136cd7ed292..a609393e99ea7546a2b58402f56ab6cd827ad8fb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  Heade file of status code PEIM\r
+  Internal include file for Status Code PEIM.\r
 \r
-  Copyright (c) 2006, Intel Corporation\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
 /**\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.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
-\r
-  @param  Value         Describes the current status of a hardware or software entity.\r
-                        This included information about the class and subclass that is used to classify the entity\r
-                        as well as an operation.  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
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
-\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.\r
-                        A system may contain multiple entities that match a class/subclass pairing.\r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable,\r
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
-\r
-\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 different callers.\r
-                        Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.\r
-\r
-\r
-  @param  Data          This optional parameter may be used to pass additional data\r
-\r
-  @return               The function always return EFI_SUCCESS.\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 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
-  Initialize memory status code.\r
-  Create one GUID'ed HOB with PCD defined size. If create required size\r
-  GUID'ed HOB failed, then ASSERT().\r
+  Create the first memory status code GUID'ed HOB as initialization for memory status code worker.\r
 \r
-  @return           The function always return EFI_SUCCESS\r
+  @retval EFI_SUCCESS  The GUID'ed HOB is created successfully.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -89,21 +81,22 @@ MemoryStatusCodeInitializeWorker (
 /**\r
   Report status code into GUID'ed HOB.\r
 \r
-  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\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  Value         Describes the current status of a hardware or software entity.\r
-                        This included information about the class and subclass that is used to classify the entity\r
-                        as well as an operation.  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
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\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
-  @param  Instance      The enumeration of a hardware or software entity within the system.\r
-                        A system may contain multiple entities that match a class/subclass pairing.\r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable,\r
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
-\r
-  @return               The function always return EFI_SUCCESS.\r
+  @retval EFI_SUCCESS      The function always return EFI_SUCCESS.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -114,44 +107,42 @@ MemoryStatusCodeReportWorker (
   );\r
 \r
 /**\r
-  Report status code to all supported device.\r
-\r
-\r
-  @param  PeiServices\r
-\r
-  @param  Type          Indicates the type of status code being reported.\r
-                        The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
-  @param  Value         Describes the current status of a hardware or software entity.\r
-                        This includes information about the class and subclass that is used to classify the entity\r
-                        as well as an operation.  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
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.\r
-                        A system may contain multiple entities that match a class/subclass pairing.\r
-                        The instance differentiates between them.  An instance of 0 indicates that instance\r
-                        information is unavailable, not meaningful, or not relevant.  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 different callers.\r
-  @param  Data          This optional parameter may be used to pass additional data.\r
-                        Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below.\r
-                        The contents of this data type may have additional GUID-specific data.  The standard GUIDs and\r
-                        their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.\r
-\r
-  @return               Always return EFI_SUCCESS.\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     Type,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance,\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 //__PEI_STATUS_CODE_H__\r
+#endif\r
 \r
 \r
index af9cdfc875d2ec77e4fcbb9bdb07e61198ec7478..15ab9dc737c8fcae303a0a72efda324f0b32cd45 100644 (file)
@@ -1,7 +1,6 @@
 #/** @file\r
-#  Generic Status code Pei driver\r
+#  Status code PEIM which produces Status Code PPI.\r
 #\r
-#  Customized output devices based on feature flags.\r
 #  Copyright (c) 2006 - 2009, Intel Corporation.\r
 #\r
 #  All rights reserved. This program and the accompanying materials\r
@@ -16,7 +15,7 @@
 \r
 [Defines]\r
   INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PeiStatusCode\r
+  BASE_NAME                      = StatusCodePei\r
   FILE_GUID                      = 1EC0F53A-FDE0-4576-8F25-7A1A410F58EB\r
   MODULE_TYPE                    = PEIM\r
   VERSION_STRING                 = 1.0\r
@@ -38,7 +37,6 @@
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
   IntelFrameworkPkg/IntelFrameworkPkg.dec\r
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
 \r
index 111f9e3f2cb4670aecdb19ab9a202f610a10319f..7a618d9e1b26468a68f2d6e8f275323ca6c1ac91 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Serial I/O status code reporting worker.\r
 \r
-  Copyright (c) 2006, Intel Corporation\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
 /**\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.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
-\r
-  @param  Value         Describes the current status of a hardware or software entity.\r
-                        This included information about the class and subclass that is used to classify the entity\r
-                        as well as an operation.  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
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
-\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.\r
-                        A system may contain multiple entities that match a class/subclass pairing.\r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable,\r
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
-\r
-\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 different callers.\r
-                        Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.\r
-\r
-\r
-  @param  Data          This optional parameter may be used to pass additional data\r
-\r
-  @return               The function always return EFI_SUCCESS.\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 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
@@ -98,10 +92,6 @@ SerialStatusCodeReportWorker (
                   Instance\r
                   );\r
 \r
-    //\r
-    // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
-    //\r
-\r
     if (CallerId != NULL) {\r
       CharCount += AsciiSPrint (\r
                      &Buffer[CharCount - 1],\r
@@ -126,6 +116,9 @@ SerialStatusCodeReportWorker (
                    "\n\r"\r
                    );\r
   } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
+    //\r
+    // Print PROGRESS information into output buffer.\r
+    //\r
     CharCount = AsciiSPrint (\r
                   Buffer,\r
                   EFI_STATUS_CODE_DATA_MAX_SIZE,\r
@@ -134,6 +127,9 @@ SerialStatusCodeReportWorker (
                   Instance\r
                   );\r
   } else {\r
+    //\r
+    // Code type is not defined.\r
+    //\r
     CharCount = AsciiSPrint (\r
                   Buffer,\r
                   EFI_STATUS_CODE_DATA_MAX_SIZE,\r
@@ -145,7 +141,7 @@ SerialStatusCodeReportWorker (
   }\r
 \r
   //\r
-  // Callout to SerialPort Lib function to do print.\r
+  // Call SerialPort Lib function to do print.\r
   //\r
   SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
 \r