]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
ShellPkg: Update header file including style
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / EventLogInfo.c
index f0a9d54b7397a2675199d00d2183dd27688673d3..b40276dee7ae0e6b07ce78fc92f9462557c2333d 100644 (file)
@@ -1,7 +1,7 @@
-/**\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
+  Copyright (c) 2005 - 2011, 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
@@ -12,7 +12,7 @@
 \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 +24,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 +75,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 +113,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 +138,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 +166,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 +194,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 +217,6 @@ DisplaySysEventLogHeaderType1 (
   @param[in] LogHeader        Format informcation.\r
 **/\r
 VOID\r
-EFIAPI\r
 DisplaySysEventLogHeader (\r
   UINT8 LogHeaderFormat,\r
   UINT8 *LogHeader\r
@@ -235,6 +242,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 +330,6 @@ DisplayElVdfInfo (
   @param[in] LogAreaLength  Length of the data.\r
 **/\r
 VOID\r
-EFIAPI\r
 DisplaySysEventLogData (\r
   UINT8   *LogData,\r
   UINT16  LogAreaLength\r
@@ -340,55 +352,56 @@ DisplaySysEventLogData (
   //\r
   Offset  = 0;\r
   Log     = (LOG_RECORD_FORMAT *) LogData;\r
-  while (Log->Type != END_OF_LOG && Offset < LogAreaLength) {\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
-    //\r
-    // Display Event Log Record Information\r
-    //\r
-    DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL);\r
-    DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL);\r
-\r
-    Offset += Log->Length;\r
-\r
-    //\r
-    // Display Log Header Date/Time Fields\r
-    // These fields contain the BCD representation of the date and time\r
-    // (as read from CMOS) of the occurrence of the event\r
-    // So Print as hex and represent decimal\r
-    //\r
-    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_DATE), gShellDebug1HiiHandle);\r
-    if (Log != NULL && Log->Year >= 80 && Log->Year <= 99) {\r
-      Print (L"19");\r
-    } else if (Log != NULL && Log->Year <= 79) {\r
-      Print (L"20");\r
-    } else {\r
-      ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);\r
-      continue;\r
-    }\r
-\r
-    ShellPrintHiiEx(-1,-1,NULL,\r
-      STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TIME_SIX_VARS),\r
-      gShellDebug1HiiHandle,\r
-      Log->Year,\r
-      Log->Month,\r
-      Log->Day,\r
-      Log->Hour,\r
-      Log->Minute,\r
-      Log->Second\r
-     );\r
-\r
-    //\r
-    // Display Variable Data Format\r
-    //\r
-    if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) {\r
-      continue;\r
+    if (Log != NULL) {\r
+      //\r
+      // Display Event Log Record Information\r
+      //\r
+      DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL);\r
+      DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL);\r
+\r
+      Offset += Log->Length;\r
+      //\r
+      // Display Log Header Date/Time Fields\r
+      // These fields contain the BCD representation of the date and time\r
+      // (as read from CMOS) of the occurrence of the event\r
+      // So Print as hex and represent decimal\r
+      //\r
+      ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_DATE), gShellDebug1HiiHandle);\r
+      if (Log != NULL && Log->Year >= 80 && Log->Year <= 99) {\r
+        Print (L"19");\r
+      } else if (Log != NULL && Log->Year <= 79) {\r
+        Print (L"20");\r
+      } else {\r
+        ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);\r
+        continue;\r
+      }\r
+\r
+      ShellPrintHiiEx(-1,-1,NULL,\r
+        STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TIME_SIX_VARS),\r
+        gShellDebug1HiiHandle,\r
+        Log->Year,\r
+        Log->Month,\r
+        Log->Day,\r
+        Log->Hour,\r
+        Log->Minute,\r
+        Log->Second\r
+       );\r
+\r
+      //\r
+      // Display Variable Data Format\r
+      //\r
+      if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) {\r
+        continue;\r
+      }\r
+\r
+      ElVdfType = Log->LogVariableData[0];\r
+      DisplayElVdfInfo (ElVdfType, Log->LogVariableData);\r
     }\r
-\r
-    ElVdfType = Log->LogVariableData[0];\r
-    DisplayElVdfInfo (ElVdfType, Log->LogVariableData);\r
   }\r
 }\r