What to do: 1. Delete VariableInfo in SecurityPkg after it merged to VariableInfo in MdeModulePkg.
Why to do: 1. Remove code duplication and reduce maintenance effort. The functionality of VariableInfo in SecurityPkg has covered VariableInfo in MdeModulePkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.z...@intel.com> Reviewed-by: Jiewen Yao <jiewen....@intel.com> Reviewed-by: Liming Gao <liming....@intel.com> --- .../Application/VariableInfo/VariableInfo.c | 265 --------------------- .../Application/VariableInfo/VariableInfo.inf | 63 ----- .../Application/VariableInfo/VariableInfo.uni | Bin 2902 -> 0 bytes .../Application/VariableInfo/VariableInfoExtra.uni | Bin 1360 -> 0 bytes SecurityPkg/SecurityPkg.dsc | 1 - 5 files changed, 329 deletions(-) delete mode 100644 SecurityPkg/Application/VariableInfo/VariableInfo.c delete mode 100644 SecurityPkg/Application/VariableInfo/VariableInfo.inf delete mode 100644 SecurityPkg/Application/VariableInfo/VariableInfo.uni delete mode 100644 SecurityPkg/Application/VariableInfo/VariableInfoExtra.uni diff --git a/SecurityPkg/Application/VariableInfo/VariableInfo.c b/SecurityPkg/Application/VariableInfo/VariableInfo.c deleted file mode 100644 index 0c1ee4b..0000000 --- a/SecurityPkg/Application/VariableInfo/VariableInfo.c +++ /dev/null @@ -1,265 +0,0 @@ -/** @file - If the Variable services have PcdVariableCollectStatistics set to TRUE then - this utility will print out the statistics information. You can use console - redirection to capture the data. - -Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> -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. - -**/ - -#include <Uefi.h> -#include <Library/UefiLib.h> -#include <Library/UefiApplicationEntryPoint.h> -#include <Library/BaseMemoryLib.h> - -#include <Library/BaseLib.h> -#include <Library/MemoryAllocationLib.h> -#include <Library/DebugLib.h> -#include <Library/UefiBootServicesTableLib.h> - -#include <Guid/AuthenticatedVariableFormat.h> -#include <Guid/SmmVariableCommon.h> -#include <Protocol/SmmCommunication.h> -#include <Protocol/SmmVariable.h> - -extern EFI_GUID gEfiVariableGuid; -EFI_SMM_COMMUNICATION_PROTOCOL *mSmmCommunication = NULL; - -/** - - This function get the variable statistics data from SMM variable driver. - - @param[in, out] SmmCommunicateHeader In input, a pointer to a collection of data that will - be passed into an SMM environment. In output, a pointer - to a collection of data that comes from an SMM environment. - @param[in, out] SmmCommunicateSize The size of the SmmCommunicateHeader. - - @retval EFI_SUCCESS Get the statistics data information. - @retval EFI_NOT_FOUND Not found. - @retval EFI_BUFFER_TO_SMALL DataSize is too small for the result. - -**/ -EFI_STATUS -EFIAPI -GetVariableStatisticsData ( - IN OUT EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader, - IN OUT UINTN *SmmCommunicateSize - ) -{ - EFI_STATUS Status; - SMM_VARIABLE_COMMUNICATE_HEADER *SmmVariableFunctionHeader; - - CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProtocolGuid); - SmmCommunicateHeader->MessageLength = *SmmCommunicateSize - OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data); - - SmmVariableFunctionHeader = (SMM_VARIABLE_COMMUNICATE_HEADER *) &SmmCommunicateHeader->Data[0]; - SmmVariableFunctionHeader->Function = SMM_VARIABLE_FUNCTION_GET_STATISTICS; - - Status = mSmmCommunication->Communicate (mSmmCommunication, SmmCommunicateHeader, SmmCommunicateSize); - ASSERT_EFI_ERROR (Status); - - Status = SmmVariableFunctionHeader->ReturnStatus; - return Status; -} - - -/** - - This function get and print the variable statistics data from SMM variable driver. - - @retval EFI_SUCCESS Print the statistics information successfully. - @retval EFI_NOT_FOUND Not found the statistics information. - -**/ -EFI_STATUS -PrintInfoFromSmm ( - VOID - ) -{ - EFI_STATUS Status; - VARIABLE_INFO_ENTRY *VariableInfo; - EFI_SMM_COMMUNICATE_HEADER *CommBuffer; - UINTN RealCommSize; - UINTN CommSize; - SMM_VARIABLE_COMMUNICATE_HEADER *FunctionHeader; - EFI_SMM_VARIABLE_PROTOCOL *Smmvariable; - - - Status = gBS->LocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID **) &Smmvariable); - if (EFI_ERROR (Status)) { - return Status; - } - - Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication); - if (EFI_ERROR (Status)) { - return Status; - } - - CommSize = SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE; - RealCommSize = CommSize; - CommBuffer = AllocateZeroPool (CommSize); - ASSERT (CommBuffer != NULL); - - Print (L"Non-Volatile SMM Variables:\n"); - do { - Status = GetVariableStatisticsData (CommBuffer, &CommSize); - if (Status == EFI_BUFFER_TOO_SMALL) { - FreePool (CommBuffer); - CommBuffer = AllocateZeroPool (CommSize); - ASSERT (CommBuffer != NULL); - RealCommSize = CommSize; - Status = GetVariableStatisticsData (CommBuffer, &CommSize); - } - - if (EFI_ERROR (Status) || (CommSize <= SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE)) { - break; - } - - if (CommSize < RealCommSize) { - CommSize = RealCommSize; - } - - FunctionHeader = (SMM_VARIABLE_COMMUNICATE_HEADER *) CommBuffer->Data; - VariableInfo = (VARIABLE_INFO_ENTRY *) FunctionHeader->Data; - - if (!VariableInfo->Volatile) { - Print ( - L"%g R%03d(%03d) W%03d D%03d:%s\n", - &VariableInfo->VendorGuid, - VariableInfo->ReadCount, - VariableInfo->CacheCount, - VariableInfo->WriteCount, - VariableInfo->DeleteCount, - (CHAR16 *)(VariableInfo + 1) - ); - } - } while (TRUE); - - Print (L"Volatile SMM Variables:\n"); - ZeroMem (CommBuffer, CommSize); - do { - Status = GetVariableStatisticsData (CommBuffer, &CommSize); - if (Status == EFI_BUFFER_TOO_SMALL) { - FreePool (CommBuffer); - CommBuffer = AllocateZeroPool (CommSize); - ASSERT (CommBuffer != NULL); - RealCommSize = CommSize; - Status = GetVariableStatisticsData (CommBuffer, &CommSize); - } - - if (EFI_ERROR (Status) || (CommSize <= SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE)) { - break; - } - - if (CommSize < RealCommSize) { - CommSize = RealCommSize; - } - - FunctionHeader = (SMM_VARIABLE_COMMUNICATE_HEADER *) CommBuffer->Data; - VariableInfo = (VARIABLE_INFO_ENTRY *) FunctionHeader->Data; - - if (VariableInfo->Volatile) { - Print ( - L"%g R%03d(%03d) W%03d D%03d:%s\n", - &VariableInfo->VendorGuid, - VariableInfo->ReadCount, - VariableInfo->CacheCount, - VariableInfo->WriteCount, - VariableInfo->DeleteCount, - (CHAR16 *)(VariableInfo + 1) - ); - } - } while (TRUE); - - FreePool (CommBuffer); - return Status; -} - -/** - The user Entry Point for Application. The user code starts with this function - as the real entry point for the image goes into a library that calls this - function. - - @param[in] ImageHandle The firmware allocated handle for the EFI image. - @param[in] SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The entry point is executed successfully. - @retval other Some error occurs when executing this entry point. - -**/ -EFI_STATUS -EFIAPI -UefiMain ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - VARIABLE_INFO_ENTRY *VariableInfo; - VARIABLE_INFO_ENTRY *Entry; - - Status = EfiGetSystemConfigurationTable (&gEfiVariableGuid, (VOID **)&Entry); - if (EFI_ERROR (Status) || (Entry == NULL)) { - Status = EfiGetSystemConfigurationTable (&gEfiAuthenticatedVariableGuid, (VOID **)&Entry); - } - - if (EFI_ERROR (Status) || (Entry == NULL)) { - Status = PrintInfoFromSmm (); - if (!EFI_ERROR (Status)) { - return Status; - } - } - - if (!EFI_ERROR (Status) && (Entry != NULL)) { - Print (L"Non-Volatile EFI Variables:\n"); - VariableInfo = Entry; - do { - if (!VariableInfo->Volatile) { - Print ( - L"%g R%03d(%03d) W%03d D%03d:%s\n", - &VariableInfo->VendorGuid, - VariableInfo->ReadCount, - VariableInfo->CacheCount, - VariableInfo->WriteCount, - VariableInfo->DeleteCount, - VariableInfo->Name - ); - } - - VariableInfo = VariableInfo->Next; - } while (VariableInfo != NULL); - - Print (L"Volatile EFI Variables:\n"); - VariableInfo = Entry; - do { - if (VariableInfo->Volatile) { - Print ( - L"%g R%03d(%03d) W%03d D%03d:%s\n", - &VariableInfo->VendorGuid, - VariableInfo->ReadCount, - VariableInfo->CacheCount, - VariableInfo->WriteCount, - VariableInfo->DeleteCount, - VariableInfo->Name - ); - } - VariableInfo = VariableInfo->Next; - } while (VariableInfo != NULL); - - } else { - Print (L"Warning: Variable Dxe driver doesn't enable the feature of statistical information!\n"); - Print (L"If you want to see this info, please:\n"); - Print (L" 1. Set PcdVariableCollectStatistics as TRUE\n"); - Print (L" 2. Rebuild Variable Dxe driver\n"); - Print (L" 3. Run \"VariableInfo\" cmd again\n"); - } - - return Status; -} diff --git a/SecurityPkg/Application/VariableInfo/VariableInfo.inf b/SecurityPkg/Application/VariableInfo/VariableInfo.inf deleted file mode 100644 index d4a771a..0000000 --- a/SecurityPkg/Application/VariableInfo/VariableInfo.inf +++ /dev/null @@ -1,63 +0,0 @@ -## @file -# A shell application that displays statistical information about variable usage -# -# This application can display statistical information about variable usage for SMM variable -# driver and non-SMM variable driver. -# Note that if Variable Dxe driver doesn't enable the feature by setting PcdVariableCollectStatistics -# as TRUE, the application will not display variable statistical information. -# -# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> -# 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. -# -## - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = VariableInfo - MODULE_UNI_FILE = VariableInfo.uni - FILE_GUID = B9EF901F-A2A2-4fc8-8D2B-3A2E07B301CC - MODULE_TYPE = UEFI_APPLICATION - VERSION_STRING = 1.0 - ENTRY_POINT = UefiMain - -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 X64 IPF EBC -# - -[Sources] - VariableInfo.c - - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - SecurityPkg/SecurityPkg.dec - -[LibraryClasses] - UefiApplicationEntryPoint - UefiLib - UefiBootServicesTableLib - BaseMemoryLib - MemoryAllocationLib - -[Protocols] - gEfiSmmCommunicationProtocolGuid ## SOMETIMES_CONSUMES - - ## UNDEFINED # Used to do smm communication - ## SOMETIMES_CONSUMES - gEfiSmmVariableProtocolGuid - -[Guids] - gEfiAuthenticatedVariableGuid ## SOMETIMES_CONSUMES ## SystemTable - gEfiVariableGuid ## CONSUMES ## SystemTable - -[UserExtensions.TianoCore."ExtraFiles"] - VariableInfoExtra.uni - \ No newline at end of file diff --git a/SecurityPkg/Application/VariableInfo/VariableInfo.uni b/SecurityPkg/Application/VariableInfo/VariableInfo.uni deleted file mode 100644 index e2f214b6150a43fb3ea329d33e48474a7d29d8fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2902 zcmdUxTW=FV42AuS#D5sI4_wqHfOr8RL`nlhKvJa%El*W$Z6l>kwAu9X=Yj8dl1wf{ z&<CWV)$YuCJofRiJ-a`D6s>51`zcqjcXn!h8(7aC+5@CoD{+tQ9NB;?Sj$FS1N1t~ zbH<@vBG1v$d$2CDvFo(#mYMeFQ(evCPTA_S^OXIWT`bvZSsUrZtzEH_p(&Y=1>|Gi z&K6K6v<*<m`(~U%ExgMp{~g9KjWF1uedP+a8c{;u^+>OXEb|C1K^Z_RhIcpaS1e*E z?kg<huFB5bIZN5;gD2RxHCFfS#x)mh$?_2C82^tv8$D(z6SAs|obpueC*aU~o4kwB z9x~<ol57P#pklgfp5Nm^mDOW4C&txE885`s^2|1@ZcQuO4mM{9HdW;{-ecX0#r5i3 z&&FLVA@QB^sF+4@psbw1k^DX;z9)<?>>1Z9X1mk3=l0TLslb!6rOuFr3>$i;E-SE7 zn#PlCtJ=l8_|Civx>m3^wg*pd=j<hPsYgcW4?!p&7g$kesNxc<9Z(Nh8~NJpJeRRw z<xibCz<08*epMC3GeQ+3WU@Q6uiahOX?Zs&N2#hNjw1HJ42gKrDG@t6q7*XC`rwVH zkXDCY-?M#tRMbAwFKBeI5wRq!*M44fcnaNew0-ntQMTfl63>j>qi*~86#XhM4YXn} zOr{wU<{NgeVp`@U_}Qm^X;1g-<ckq1^9if!C?^xI{bW{!#dxHjd2|J$&&X$Sh5Ip* zHnDW6xn=JKtekTvFAe)dZ>d}BR<n;hOMYrqU^2j^Ms;9?`f4&OJHJh<GM15xiD)5l zU!k7MXdJrb8Z*_go?DEvE2~?Kd;YGsodrxstjlW6Jq9~MtM16E$SYWtjhcI}^Cs+) z$!7yy>Bwu;`hc#ye`oy6ijeCpDNnt`D9Uy`x09?_;NpO4lFxm*Y{uJc4E`l8x?D2d z+b|z%CZ2<lzY{Fgu+hX?*-k(tzQk+^wi@8sbZvXL$kv3K)psy>CG28LNX4m6vHSVW z-kNjscf6>o4q-$UcQDW7@3{FhFY3|%?eAdu>z>ZgyZ#jf>ijN$1IO^b>ia(Y4Tym; L$nM);K&tCs^3CL< diff --git a/SecurityPkg/Application/VariableInfo/VariableInfoExtra.uni b/SecurityPkg/Application/VariableInfo/VariableInfoExtra.uni deleted file mode 100644 index b7fd354c459bbe399b3f4476ac90e64ffd83ec19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1360 zcmZ9MTW=Ck6ovP*iT`0zU(~eV?a3G;*ik3e4xwQ6iEt~Ogfe8HRs8YlxAvI}5W>0a z%i8O#v(Nnd+qSkv{GaoS?1SA{W=osfV|#>EzV9}+0_)f&?n!J#RF3C@af*G3_YXNU zY*)7R=#?#O!+uP(>>r6;;hXzdp;vS8uWjeK3%eyUvZtUwV}4~X?4`YCbyn}**ePpq z5$2M$DipT%af~(diY+`H{EE;i0=AeH<ZbvD_P{u^mc6sC_3eFq_J-X6Mwy>yO?(bY z!O8AGsm`}0V($AXtaE&8_wC4&77-S)Qax$81g*iB!pfGCQ&uZyCfzE0WzWhA53F@d z)r~}UPlmh&85NUI>&{tMC}O6_tky?L<lJYI*X0h+*<T!RX}JD!EvAfOcX-+i4nh=% zpqFZG*z432c<$eeRMn|(u!kEG=ikH}b2`)|Xt^V5Qs(ES0%Ek?(^Y-6<tE;GFXya+ zwu&!Y=@zFixS#fs_8Tk{n9u0B!|E+iZuvKg4D5@=u<6k~seNYb*f;hGN=9g@d4M&c zzlN-0*LP@_%rW)|TR>>EPw3~Eh$}}<S*edTo-hkns3*)_-)nce$LSisP*blM*)>sp zXLgA_0aX~OSMReEciB{PK&)a^HAH<PR@Hwpf5ju_dVg_QC7dF*A2m*co}fjKZc@#2 zURkAEHAnvKX}evvCw0GscN4T5mFo6D>DMP1ft`Xn1V6SByrjJDA|UCF2<4u6;k}~! oKO<iJ6eBg&mFh%&OZ5K2JJstu{`Q40PWbwD=z%r)LaF}$0qSPb+yDRo diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc index fd74ec1..d1a5333 100644 --- a/SecurityPkg/SecurityPkg.dsc +++ b/SecurityPkg/SecurityPkg.dsc @@ -136,7 +136,6 @@ # # Application # - SecurityPkg/Application/VariableInfo/VariableInfo.inf SecurityPkg/Application/RngTest/RngTest.inf # -- 1.9.5.msysgit.0 ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel