X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellDebug1CommandsLib%2FSmbiosView%2FEventLogInfo.c;h=984c17889059e01d6046517c264e58b0a814b3f1;hp=f0a9d54b7397a2675199d00d2183dd27688673d3;hb=fc7d997c35372126823c3b0acf7b67c45cbeea36;hpb=5d73d92f560b079f41f62e91d15ddc1fda897867 diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c index f0a9d54b73..984c178890 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c @@ -1,18 +1,12 @@ -/** +/** @file Module for clarifying the content of the smbios structure element info. - Copyright (c) 2005-2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#include "../UefiShellDebug1CommandsLib.h" +#include "UefiShellDebug1CommandsLib.h" #include "PrintInfo.h" #include "QueryTable.h" #include "EventLogInfo.h" @@ -24,7 +18,6 @@ @param[in] Option Whether to print the additional information. **/ VOID -EFIAPI DisplaySELAccessMethod ( IN CONST UINT8 Key, IN CONST UINT8 Option @@ -76,7 +69,6 @@ DisplaySELAccessMethod ( @param[in] Option Whether to print the additional information. **/ VOID -EFIAPI DisplaySELLogStatus ( UINT8 Key, UINT8 Option @@ -115,7 +107,6 @@ DisplaySELLogStatus ( @param[in] Option Whether to print the additional information. **/ VOID -EFIAPI DisplaySysEventLogHeaderFormat ( UINT8 Key, UINT8 Option @@ -141,6 +132,12 @@ DisplaySysEventLogHeaderFormat ( } } +/** + Display the header information for SEL log items. + + @param[in] Key The information key. + @param[in] Option The option index. +**/ VOID DisplaySELLogHeaderLen ( UINT8 Key, @@ -163,9 +160,14 @@ DisplaySELLogHeaderLen ( } } +/** + Display the header information for type 1 items. + + @param[in] LogHeader The buffer with the information. +**/ VOID DisplaySysEventLogHeaderType1 ( - UINT8 *LogHeader + IN UINT8 *LogHeader ) { LOG_HEADER_TYPE1_FORMAT *Header; @@ -186,8 +188,8 @@ DisplaySysEventLogHeaderType1 ( Header->OEMReserved[3], Header->OEMReserved[4] ); - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->METW); - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->MECI); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->Metw); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->Meci); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_ADDRESS), gShellDebug1HiiHandle, Header->CMOSAddress); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_INDEX), gShellDebug1HiiHandle, Header->CMOSBitIndex); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUM_STARTING_OFF), gShellDebug1HiiHandle, Header->StartingOffset); @@ -209,7 +211,6 @@ DisplaySysEventLogHeaderType1 ( @param[in] LogHeader Format informcation. **/ VOID -EFIAPI DisplaySysEventLogHeader ( UINT8 LogHeaderFormat, UINT8 *LogHeader @@ -235,6 +236,12 @@ DisplaySysEventLogHeader ( } } +/** + Display the El Vdf information. + + @param[in] ElVdfType The information type. + @param[in] VarData The information buffer. +**/ VOID DisplayElVdfInfo ( UINT8 ElVdfType, @@ -317,7 +324,6 @@ DisplayElVdfInfo ( @param[in] LogAreaLength Length of the data. **/ VOID -EFIAPI DisplaySysEventLogData ( UINT8 *LogData, UINT16 LogAreaLength @@ -340,55 +346,64 @@ DisplaySysEventLogData ( // Offset = 0; Log = (LOG_RECORD_FORMAT *) LogData; - while (Log->Type != END_OF_LOG && Offset < LogAreaLength) { - // - // Get a Event Log Record - // - Log = (LOG_RECORD_FORMAT *) (LogData + Offset); - - // - // Display Event Log Record Information - // - DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL); - DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL); - - Offset += Log->Length; - - // - // Display Log Header Date/Time Fields - // These fields contain the BCD representation of the date and time - // (as read from CMOS) of the occurrence of the event - // So Print as hex and represent decimal - // - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_DATE), gShellDebug1HiiHandle); - if (Log != NULL && Log->Year >= 80 && Log->Year <= 99) { - Print (L"19"); - } else if (Log != NULL && Log->Year <= 79) { - Print (L"20"); - } else { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle); - continue; + while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) { + + if (Log != NULL) { + // + // Display Event Log Record Information + // + DisplaySELTypes (Log->Type, SHOW_DETAIL); + DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL); + + Offset += Log->Length; + // + // Display Log Header Date/Time Fields + // These fields contain the BCD representation of the date and time + // (as read from CMOS) of the occurrence of the event + // So Print as hex and represent decimal + // + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_DATE), gShellDebug1HiiHandle); + if (Log != NULL && Log->Year >= 80 && Log->Year <= 99) { + Print (L"19"); + } else if (Log != NULL && Log->Year <= 79) { + Print (L"20"); + } else { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle); + // + // Get a Event Log Record + // + Log = (LOG_RECORD_FORMAT *) (LogData + Offset); + continue; + } + + ShellPrintHiiEx(-1,-1,NULL, + STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TIME_SIX_VARS), + gShellDebug1HiiHandle, + Log->Year, + Log->Month, + Log->Day, + Log->Hour, + Log->Minute, + Log->Second + ); + + // + // Display Variable Data Format + // + if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) { + // + // Get a Event Log Record + // + Log = (LOG_RECORD_FORMAT *) (LogData + Offset); + continue; + } + + ElVdfType = Log->LogVariableData[0]; + DisplayElVdfInfo (ElVdfType, Log->LogVariableData); + // + // Get a Event Log Record + // + Log = (LOG_RECORD_FORMAT *) (LogData + Offset); } - - ShellPrintHiiEx(-1,-1,NULL, - STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TIME_SIX_VARS), - gShellDebug1HiiHandle, - Log->Year, - Log->Month, - Log->Day, - Log->Hour, - Log->Minute, - Log->Second - ); - - // - // Display Variable Data Format - // - if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) { - continue; - } - - ElVdfType = Log->LogVariableData[0]; - DisplayElVdfInfo (ElVdfType, Log->LogVariableData); } }