]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
ShellPkg/Debug1CommandsLib: Fix bugs in func DisplaySysEventLogData
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / EventLogInfo.c
index a1e14678f34271cbe3bb19d02e9977a421608e4c..984c17889059e01d6046517c264e58b0a814b3f1 100644 (file)
@@ -1,18 +1,12 @@
-/**\r
+/** @file\r
   Module for clarifying the content of the smbios structure element info.\r
 \r
-  Copyright (c) 2005-2010, Intel Corporation. All rights reserved. <BR>\r
-  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
+  Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved. <BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
-#include "../UefiShellDebug1CommandsLib.h"\r
+#include "UefiShellDebug1CommandsLib.h"\r
 #include "PrintInfo.h"\r
 #include "QueryTable.h"\r
 #include "EventLogInfo.h"\r
@@ -24,7 +18,6 @@
   @param[in] Option Whether to print the additional information.\r
 **/\r
 VOID\r
-EFIAPI\r
 DisplaySELAccessMethod (\r
   IN CONST UINT8 Key,\r
   IN CONST UINT8 Option\r
@@ -76,7 +69,6 @@ DisplaySELAccessMethod (
   @param[in] Option Whether to print the additional information.\r
 **/\r
 VOID\r
-EFIAPI\r
 DisplaySELLogStatus (\r
   UINT8 Key,\r
   UINT8 Option\r
@@ -115,7 +107,6 @@ DisplaySELLogStatus (
   @param[in] Option Whether to print the additional information.\r
 **/\r
 VOID\r
-EFIAPI\r
 DisplaySysEventLogHeaderFormat (\r
   UINT8 Key,\r
   UINT8 Option\r
@@ -141,6 +132,12 @@ DisplaySysEventLogHeaderFormat (
   }\r
 }\r
 \r
+/**\r
+  Display the header information for SEL log items.\r
+\r
+  @param[in] Key      The information key.\r
+  @param[in] Option   The option index.\r
+**/\r
 VOID\r
 DisplaySELLogHeaderLen (\r
   UINT8 Key,\r
@@ -163,9 +160,14 @@ DisplaySELLogHeaderLen (
   }\r
 }\r
 \r
+/**\r
+  Display the header information for type 1 items.\r
+\r
+  @param[in] LogHeader      The buffer with the information.\r
+**/\r
 VOID\r
 DisplaySysEventLogHeaderType1 (\r
-  UINT8 *LogHeader\r
+  IN UINT8 *LogHeader\r
   )\r
 {\r
   LOG_HEADER_TYPE1_FORMAT *Header;\r
@@ -186,8 +188,8 @@ DisplaySysEventLogHeaderType1 (
     Header->OEMReserved[3],\r
     Header->OEMReserved[4]\r
    );\r
-  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->METW);\r
-  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->MECI);\r
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->Metw);\r
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->Meci);\r
   ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_ADDRESS), gShellDebug1HiiHandle, Header->CMOSAddress);\r
   ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_INDEX), gShellDebug1HiiHandle, Header->CMOSBitIndex);\r
   ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUM_STARTING_OFF), gShellDebug1HiiHandle, Header->StartingOffset);\r
@@ -209,7 +211,6 @@ DisplaySysEventLogHeaderType1 (
   @param[in] LogHeader        Format informcation.\r
 **/\r
 VOID\r
-EFIAPI\r
 DisplaySysEventLogHeader (\r
   UINT8 LogHeaderFormat,\r
   UINT8 *LogHeader\r
@@ -235,6 +236,12 @@ DisplaySysEventLogHeader (
   }\r
 }\r
 \r
+/**\r
+  Display the El Vdf information.\r
+\r
+  @param[in] ElVdfType    The information type.\r
+  @param[in] VarData      The information buffer.\r
+**/\r
 VOID\r
 DisplayElVdfInfo (\r
   UINT8 ElVdfType,\r
@@ -317,7 +324,6 @@ DisplayElVdfInfo (
   @param[in] LogAreaLength  Length of the data.\r
 **/\r
 VOID\r
-EFIAPI\r
 DisplaySysEventLogData (\r
   UINT8   *LogData,\r
   UINT16  LogAreaLength\r
@@ -341,16 +347,12 @@ DisplaySysEventLogData (
   Offset  = 0;\r
   Log     = (LOG_RECORD_FORMAT *) LogData;\r
   while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) {\r
-    //\r
-    // Get a Event Log Record\r
-    //\r
-    Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\r
 \r
     if (Log != NULL) {\r
       //\r
       // Display Event Log Record Information\r
       //\r
-      DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL);\r
+      DisplaySELTypes (Log->Type, SHOW_DETAIL);\r
       DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL);\r
 \r
       Offset += Log->Length;\r
@@ -367,6 +369,10 @@ DisplaySysEventLogData (
         Print (L"20");\r
       } else {\r
         ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);\r
+        //\r
+        // Get a Event Log Record\r
+        //\r
+        Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\r
         continue;\r
       }\r
 \r
@@ -385,11 +391,19 @@ DisplaySysEventLogData (
       // Display Variable Data Format\r
       //\r
       if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) {\r
+        //\r
+        // Get a Event Log Record\r
+        //\r
+        Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\r
         continue;\r
       }\r
 \r
       ElVdfType = Log->LogVariableData[0];\r
       DisplayElVdfInfo (ElVdfType, Log->LogVariableData);\r
+      //\r
+      // Get a Event Log Record\r
+      //\r
+      Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\r
     }\r
   }\r
 }\r