-/**\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
@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
@param[in] Option Whether to print the additional information.\r
**/\r
VOID\r
-EFIAPI\r
DisplaySELLogStatus (\r
UINT8 Key,\r
UINT8 Option\r
@param[in] Option Whether to print the additional information.\r
**/\r
VOID\r
-EFIAPI\r
DisplaySysEventLogHeaderFormat (\r
UINT8 Key,\r
UINT8 Option\r
}\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
}\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
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
@param[in] LogHeader Format informcation.\r
**/\r
VOID\r
-EFIAPI\r
DisplaySysEventLogHeader (\r
UINT8 LogHeaderFormat,\r
UINT8 *LogHeader\r
}\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
@param[in] LogAreaLength Length of the data.\r
**/\r
VOID\r
-EFIAPI\r
DisplaySysEventLogData (\r
UINT8 *LogData,\r
UINT16 LogAreaLength\r
//\r
Offset = 0;\r
Log = (LOG_RECORD_FORMAT *) LogData;\r
- while (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
+ while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) {\r
+\r
+ if (Log != NULL) {\r
+ //\r
+ // Display Event Log Record Information\r
+ //\r
+ DisplaySELTypes (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
+ //\r
+ // Get a Event Log Record\r
+ //\r
+ Log = (LOG_RECORD_FORMAT *) (LogData + Offset);\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
+ //\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
- 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