]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.c
Code Scrub for Status Code Runtime Dxe driver.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / StatusCode / Dxe / DxeStatusCode.c
index 27ea8dcd1c9fdbc3f78f4e477b48eee550a55b31..55ae84a5388abcd0d6d7a981e5b0b26986cbde49 100644 (file)
@@ -13,7 +13,7 @@
   DXE       -> This driver\r
   RT        -> This driver\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:  DxeStatusCode.c\r
-\r
 **/\r
 \r
 #include "DxeStatusCode.h"\r
 \r
 /**\r
-  \r
   Dispatch initialization request to sub status code devices based on \r
   customized feature flags.\r
  \r
@@ -43,7 +40,7 @@ InitializationDispatcherWorker (
   EFI_STATUS                        Status;\r
   MEMORY_STATUSCODE_PACKET_HEADER   *PacketHeader;\r
   MEMORY_STATUSCODE_RECORD          *Record;\r
-  UINTN                             ExpectedPacketIndex = 0;\r
+  UINTN                             ExpectedPacketIndex;\r
   UINTN                             Index;\r
   VOID                              *HobStart;\r
 \r
@@ -57,6 +54,9 @@ InitializationDispatcherWorker (
     ASSERT_EFI_ERROR (Status);\r
   }\r
   if (FeaturePcdGet (PcdStatusCodeUseHardSerial)) {\r
+    //\r
+    // Call Serial Port Lib API to initialize serial port.\r
+    //\r
     Status = SerialPortInitialize ();\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
@@ -69,18 +69,22 @@ InitializationDispatcherWorker (
     ASSERT_EFI_ERROR (Status);\r
   }\r
   if (FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+    //\r
+    // Call OEM hook status code library API to initialize OEM device for status code.\r
+    //\r
     Status = OemHookStatusCodeInitialize ();\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
   //\r
-  // Replay Status code which saved in GUID'ed HOB to all supported device. \r
+  // Replay Status code which saved in GUID'ed HOB to all supported devices\r
   //\r
 \r
   // \r
   // Journal GUID'ed HOBs to find all record entry, if found, \r
   // then output record to support replay device.\r
   //\r
+  ExpectedPacketIndex = 0;\r
   Hob.Raw   = GetFirstGuidHob (&gMemoryStatusCodeRecordGuid);\r
   HobStart  = Hob.Raw;\r
   while (Hob.Raw != NULL) {\r
@@ -105,7 +109,6 @@ InitializationDispatcherWorker (
         if (FeaturePcdGet (PcdStatusCodeReplayInRuntimeMemory) &&\r
             FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {\r
           RtMemoryStatusCodeReportWorker (\r
-            gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE],\r
             Record[Index].CodeType,\r
             Record[Index].Value,\r
             Record[Index].Instance\r
@@ -123,6 +126,9 @@ InitializationDispatcherWorker (
         }\r
         if (FeaturePcdGet (PcdStatusCodeReplayInOEM) &&\r
             FeaturePcdGet (PcdStatusCodeUseOEM)) {\r
+          //\r
+          // Call OEM hook status code library API to report status code to OEM device\r
+          //\r
           OemHookStatusCodeReport (\r
             Record[Index].CodeType,\r
             Record[Index].Value,\r
@@ -137,7 +143,7 @@ InitializationDispatcherWorker (
       //\r
       // See whether there is gap of packet or not\r
       //\r
-      if (NULL != HobStart) {\r
+      if (HobStart != NULL) {\r
         HobStart  = NULL;\r
         Hob.Raw   = HobStart;\r
         continue;\r