]> 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 9f5ae55d0c593c7c6501b7c7143061591e4edd3e..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
@@ -27,7 +27,6 @@
 #include "DxeStatusCode.h"\r
 \r
 /**\r
-  \r
   Dispatch initialization request to sub status code devices based on \r
   customized feature flags.\r
  \r
@@ -41,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
@@ -55,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
@@ -67,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
@@ -103,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
@@ -121,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
@@ -135,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