From af1a266670d040d2f4083ff309d732d648afba2a Mon Sep 17 00:00:00 2001 From: Angelos Mouzakitis Date: Tue, 10 Oct 2023 14:33:42 +0000 Subject: Add submodule dependency files Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec --- .../UefiHandleParsingLib/UefiHandleParsingLib.c | 3726 ++++++++++++++++++++ .../UefiHandleParsingLib/UefiHandleParsingLib.h | 294 ++ .../UefiHandleParsingLib/UefiHandleParsingLib.inf | 334 ++ .../UefiHandleParsingLib/UefiHandleParsingLib.uni | 506 +++ 4 files changed, 4860 insertions(+) create mode 100644 roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c create mode 100644 roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h create mode 100644 roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf create mode 100644 roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni (limited to 'roms/edk2/ShellPkg/Library/UefiHandleParsingLib') diff --git a/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c new file mode 100644 index 000000000..500a95a89 --- /dev/null +++ b/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c @@ -0,0 +1,3726 @@ +/** @file + Provides interface to advanced shell functionality for parsing both handle and protocol database. + + Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+ (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
+ (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "UefiHandleParsingLib.h" +#include "IndustryStandard/Acpi10.h" +#include "IndustryStandard/Pci.h" +#include +#include + +EFI_HII_HANDLE mHandleParsingHiiHandle = NULL; +HANDLE_INDEX_LIST mHandleList = {{{NULL,NULL},0,0},0}; +GUID_INFO_BLOCK *mGuidList; +UINTN mGuidListCount; + +/** + Function to find the file name associated with a LoadedImageProtocol. + + @param[in] LoadedImage An instance of LoadedImageProtocol. + + @retval A string representation of the file name associated + with LoadedImage, or NULL if no name can be found. +**/ +CHAR16* +FindLoadedImageFileName ( + IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage + ) +{ + EFI_GUID *NameGuid; + EFI_STATUS Status; + EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; + VOID *Buffer; + UINTN BufferSize; + UINT32 AuthenticationStatus; + + if ((LoadedImage == NULL) || (LoadedImage->FilePath == NULL)) { + return NULL; + } + + NameGuid = EfiGetNameGuidFromFwVolDevicePathNode((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)LoadedImage->FilePath); + + if (NameGuid == NULL) { + return NULL; + } + + // + // Get the FirmwareVolume2Protocol of the device handle that this image was loaded from. + // + Status = gBS->HandleProtocol (LoadedImage->DeviceHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID**) &Fv); + + // + // FirmwareVolume2Protocol is PI, and is not required to be available. + // + if (EFI_ERROR (Status)) { + return NULL; + } + + // + // Read the user interface section of the image. + // + Buffer = NULL; + Status = Fv->ReadSection(Fv, NameGuid, EFI_SECTION_USER_INTERFACE, 0, &Buffer, &BufferSize, &AuthenticationStatus); + + if (EFI_ERROR (Status)) { + return NULL; + } + + // + // ReadSection returns just the section data, without any section header. For + // a user interface section, the only data is the file name. + // + return Buffer; +} + +/** + Function to translate the EFI_MEMORY_TYPE into a string. + + @param[in] Memory The memory type. + + @retval A string representation of the type allocated from BS Pool. +**/ +CHAR16* +ConvertMemoryType ( + IN CONST EFI_MEMORY_TYPE Memory + ) +{ + CHAR16 *RetVal; + RetVal = NULL; + + switch (Memory) { + case EfiReservedMemoryType: StrnCatGrow(&RetVal, NULL, L"EfiReservedMemoryType", 0); break; + case EfiLoaderCode: StrnCatGrow(&RetVal, NULL, L"EfiLoaderCode", 0); break; + case EfiLoaderData: StrnCatGrow(&RetVal, NULL, L"EfiLoaderData", 0); break; + case EfiBootServicesCode: StrnCatGrow(&RetVal, NULL, L"EfiBootServicesCode", 0); break; + case EfiBootServicesData: StrnCatGrow(&RetVal, NULL, L"EfiBootServicesData", 0); break; + case EfiRuntimeServicesCode: StrnCatGrow(&RetVal, NULL, L"EfiRuntimeServicesCode", 0); break; + case EfiRuntimeServicesData: StrnCatGrow(&RetVal, NULL, L"EfiRuntimeServicesData", 0); break; + case EfiConventionalMemory: StrnCatGrow(&RetVal, NULL, L"EfiConventionalMemory", 0); break; + case EfiUnusableMemory: StrnCatGrow(&RetVal, NULL, L"EfiUnusableMemory", 0); break; + case EfiACPIReclaimMemory: StrnCatGrow(&RetVal, NULL, L"EfiACPIReclaimMemory", 0); break; + case EfiACPIMemoryNVS: StrnCatGrow(&RetVal, NULL, L"EfiACPIMemoryNVS", 0); break; + case EfiMemoryMappedIO: StrnCatGrow(&RetVal, NULL, L"EfiMemoryMappedIO", 0); break; + case EfiMemoryMappedIOPortSpace: StrnCatGrow(&RetVal, NULL, L"EfiMemoryMappedIOPortSpace", 0); break; + case EfiPalCode: StrnCatGrow(&RetVal, NULL, L"EfiPalCode", 0); break; + case EfiMaxMemoryType: StrnCatGrow(&RetVal, NULL, L"EfiMaxMemoryType", 0); break; + default: ASSERT(FALSE); + } + return (RetVal); +} + +/** + Function to translate the EFI_GRAPHICS_PIXEL_FORMAT into a string. + + @param[in] Fmt The format type. + + @retval A string representation of the type allocated from BS Pool. +**/ +CHAR16* +ConvertPixelFormat ( + IN CONST EFI_GRAPHICS_PIXEL_FORMAT Fmt + ) +{ + CHAR16 *RetVal; + RetVal = NULL; + + switch (Fmt) { + case PixelRedGreenBlueReserved8BitPerColor: StrnCatGrow(&RetVal, NULL, L"PixelRedGreenBlueReserved8BitPerColor", 0); break; + case PixelBlueGreenRedReserved8BitPerColor: StrnCatGrow(&RetVal, NULL, L"PixelBlueGreenRedReserved8BitPerColor", 0); break; + case PixelBitMask: StrnCatGrow(&RetVal, NULL, L"PixelBitMask", 0); break; + case PixelBltOnly: StrnCatGrow(&RetVal, NULL, L"PixelBltOnly", 0); break; + case PixelFormatMax: StrnCatGrow(&RetVal, NULL, L"PixelFormatMax", 0); break; + default: ASSERT(FALSE); + } + return (RetVal); +} + +/** + Constructor for the library. + + @param[in] ImageHandle Ignored. + @param[in] SystemTable Ignored. + + @retval EFI_SUCCESS The operation was successful. +**/ +EFI_STATUS +EFIAPI +HandleParsingLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + mGuidListCount = 0; + mGuidList = NULL; + + // + // Do nothing with mHandleParsingHiiHandle. Initialize HII as needed. + // + return (EFI_SUCCESS); +} + +/** + Initialization function for HII packages. + +**/ +VOID +HandleParsingHiiInit (VOID) +{ + if (mHandleParsingHiiHandle == NULL) { + mHandleParsingHiiHandle = HiiAddPackages (&gHandleParsingHiiGuid, gImageHandle, UefiHandleParsingLibStrings, NULL); + ASSERT (mHandleParsingHiiHandle != NULL); + } +} + +/** + Destructor for the library. free any resources. + + @param[in] ImageHandle Ignored. + @param[in] SystemTable Ignored. + + @retval EFI_SUCCESS The operation was successful. +**/ +EFI_STATUS +EFIAPI +HandleParsingLibDestructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + UINTN LoopCount; + + for (LoopCount = 0; mGuidList != NULL && LoopCount < mGuidListCount; LoopCount++) { + SHELL_FREE_NON_NULL(mGuidList[LoopCount].GuidId); + } + + SHELL_FREE_NON_NULL(mGuidList); + if (mHandleParsingHiiHandle != NULL) { + HiiRemovePackages(mHandleParsingHiiHandle); + } + return (EFI_SUCCESS); +} + +/** + Function to dump information about LoadedImage. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has LoadedImage installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A poitner to a string containing the information. +**/ +CHAR16* +EFIAPI +LoadedImageProtocolDumpInformation( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; + EFI_STATUS Status; + CHAR16 *RetVal; + CHAR16 *Temp; + CHAR16 *FileName; + CHAR8 *PdbFileName; + CHAR16 *FilePath; + CHAR16 *CodeType; + CHAR16 *DataType; + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiLoadedImageProtocolGuid, + (VOID**)&LoadedImage, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return NULL; + } + + FileName = FindLoadedImageFileName(LoadedImage); + FilePath = ConvertDevicePathToText(LoadedImage->FilePath, TRUE, TRUE); + if (!Verbose) { + if (FileName == NULL) { + FileName = FilePath; + } else { + SHELL_FREE_NON_NULL(FilePath); + } + return FileName; + } + + HandleParsingHiiInit(); + RetVal = NULL; + if (FileName != NULL) { + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUMP_NAME), NULL); + + if (Temp != NULL) { + RetVal = CatSPrint(NULL, Temp, FileName); + } + + SHELL_FREE_NON_NULL(Temp); + SHELL_FREE_NON_NULL(FileName); + } + + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUMP_MAIN), NULL); + if (Temp == NULL) { + return NULL; + } + PdbFileName = PeCoffLoaderGetPdbPointer (LoadedImage->ImageBase); + DataType = ConvertMemoryType(LoadedImage->ImageDataType); + CodeType = ConvertMemoryType(LoadedImage->ImageCodeType); + + RetVal = CatSPrint( + RetVal, + Temp, + LoadedImage->Revision, + LoadedImage->ParentHandle, + LoadedImage->SystemTable, + LoadedImage->DeviceHandle, + FilePath, + PdbFileName, + LoadedImage->LoadOptionsSize, + LoadedImage->LoadOptions, + LoadedImage->ImageBase, + LoadedImage->ImageSize, + CodeType, + DataType, + LoadedImage->Unload + ); + + + SHELL_FREE_NON_NULL(Temp); + SHELL_FREE_NON_NULL(FilePath); + SHELL_FREE_NON_NULL(CodeType); + SHELL_FREE_NON_NULL(DataType); + + return RetVal; +} + +/** + Function to dump information about GOP. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has LoadedImage installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A poitner to a string containing the information. +**/ +CHAR16* +EFIAPI +GraphicsOutputProtocolDumpInformation( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; + EFI_STATUS Status; + CHAR16 *RetVal; + CHAR16 *Temp; + CHAR16 *Fmt; + CHAR16 *TempRetVal; + UINTN GopInfoSize; + UINT32 Mode; + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *GopInfo; + + if (!Verbose) { + return (CatSPrint(NULL, L"GraphicsOutput")); + } + + HandleParsingHiiInit(); + + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_GOP_DUMP_MAIN), NULL); + if (Temp == NULL) { + return NULL; + } + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiGraphicsOutputProtocolGuid, + (VOID**)&GraphicsOutput, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + SHELL_FREE_NON_NULL (Temp); + return NULL; + } + + Fmt = ConvertPixelFormat(GraphicsOutput->Mode->Info->PixelFormat); + + RetVal = CatSPrint( + NULL, + Temp, + GraphicsOutput->Mode->MaxMode, + GraphicsOutput->Mode->Mode, + GraphicsOutput->Mode->FrameBufferBase, + (UINT64)GraphicsOutput->Mode->FrameBufferSize, + (UINT64)GraphicsOutput->Mode->SizeOfInfo, + GraphicsOutput->Mode->Info->Version, + GraphicsOutput->Mode->Info->HorizontalResolution, + GraphicsOutput->Mode->Info->VerticalResolution, + Fmt, + GraphicsOutput->Mode->Info->PixelsPerScanLine, + GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.RedMask, + GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.GreenMask, + GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.BlueMask + ); + + SHELL_FREE_NON_NULL (Temp); + + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_GOP_RES_LIST_MAIN), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL (RetVal); + goto EXIT; + } + + TempRetVal = CatSPrint (RetVal, Temp); + SHELL_FREE_NON_NULL (RetVal); + if (TempRetVal == NULL) { + goto EXIT; + } + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (Temp); + + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_GOP_RES_LIST_ENTRY), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL (RetVal); + goto EXIT; + } + + + for (Mode = 0; Mode < GraphicsOutput->Mode->MaxMode; Mode++) { + Status = GraphicsOutput->QueryMode ( + GraphicsOutput, + Mode, + &GopInfoSize, + &GopInfo + ); + if (EFI_ERROR (Status)) { + continue; + } + + TempRetVal = CatSPrint ( + RetVal, + Temp, + Mode, + GopInfo->HorizontalResolution, + GopInfo->VerticalResolution + ); + + SHELL_FREE_NON_NULL (GopInfo); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } + + +EXIT: + SHELL_FREE_NON_NULL(Temp); + SHELL_FREE_NON_NULL(Fmt); + + return RetVal; +} + +/** + Function to dump information about EDID Discovered Protocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has LoadedImage installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +EdidDiscoveredProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_EDID_DISCOVERED_PROTOCOL *EdidDiscovered; + EFI_STATUS Status; + CHAR16 *RetVal; + CHAR16 *Temp; + CHAR16 *TempRetVal; + + if (!Verbose) { + return (CatSPrint (NULL, L"EDIDDiscovered")); + } + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiEdidDiscoveredProtocolGuid, + (VOID**)&EdidDiscovered, + NULL, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return NULL; + } + + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_EDID_DISCOVERED_MAIN), NULL); + if (Temp == NULL) { + return NULL; + } + + RetVal = CatSPrint (NULL, Temp, EdidDiscovered->SizeOfEdid); + SHELL_FREE_NON_NULL (Temp); + + if (EdidDiscovered->SizeOfEdid != 0) { + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_EDID_DISCOVERED_DATA), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL (RetVal); + return NULL; + } + TempRetVal = CatSPrint (RetVal, Temp); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + + TempRetVal = CatSDumpHex (RetVal, 4, 0, EdidDiscovered->SizeOfEdid, EdidDiscovered->Edid); + RetVal = TempRetVal; + } + return RetVal; +} + +/** + Function to dump information about EDID Active Protocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has LoadedImage installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +EdidActiveProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_EDID_ACTIVE_PROTOCOL *EdidActive; + EFI_STATUS Status; + CHAR16 *RetVal; + CHAR16 *Temp; + CHAR16 *TempRetVal; + + if (!Verbose) { + return (CatSPrint (NULL, L"EDIDActive")); + } + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiEdidActiveProtocolGuid, + (VOID**)&EdidActive, + NULL, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return NULL; + } + + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_EDID_ACTIVE_MAIN), NULL); + if (Temp == NULL) { + return NULL; + } + + RetVal = CatSPrint (NULL, Temp, EdidActive->SizeOfEdid); + SHELL_FREE_NON_NULL (Temp); + + if (EdidActive->SizeOfEdid != 0) { + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_EDID_ACTIVE_DATA), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL (RetVal); + return NULL; + } + TempRetVal = CatSPrint (RetVal, Temp); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + + TempRetVal = CatSDumpHex (RetVal, 4, 0, EdidActive->SizeOfEdid, EdidActive->Edid); + RetVal = TempRetVal; + } + return RetVal; +} + +/** + Function to dump information about PciRootBridgeIo. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has PciRootBridgeIo installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A poitner to a string containing the information. +**/ +CHAR16* +EFIAPI +PciRootBridgeIoDumpInformation( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; + EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Configuration; + UINT64 Supports; + UINT64 Attributes; + CHAR16 *Temp; + CHAR16 *Temp2; + CHAR16 *RetVal; + EFI_STATUS Status; + + RetVal = NULL; + + if (!Verbose) { + return (CatSPrint(NULL, L"PciRootBridgeIo")); + } + + HandleParsingHiiInit(); + + Status = gBS->HandleProtocol( + TheHandle, + &gEfiPciRootBridgeIoProtocolGuid, + (VOID**)&PciRootBridgeIo); + + if (EFI_ERROR(Status)) { + return NULL; + } + + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_PH), NULL); + if (Temp == NULL) { + return NULL; + } + Temp2 = CatSPrint(NULL, Temp, PciRootBridgeIo->ParentHandle); + FreePool(Temp); + RetVal = Temp2; + Temp2 = NULL; + + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_SEG), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL(RetVal); + return NULL; + } + Temp2 = CatSPrint(RetVal, Temp, PciRootBridgeIo->SegmentNumber); + FreePool(Temp); + FreePool(RetVal); + RetVal = Temp2; + Temp2 = NULL; + + Supports = 0; + Attributes = 0; + Status = PciRootBridgeIo->GetAttributes (PciRootBridgeIo, &Supports, &Attributes); + if (!EFI_ERROR(Status)) { + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_ATT), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL(RetVal); + return NULL; + } + Temp2 = CatSPrint(RetVal, Temp, Attributes); + FreePool(Temp); + FreePool(RetVal); + RetVal = Temp2; + Temp2 = NULL; + + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_SUPPORTS), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL(RetVal); + return NULL; + } + Temp2 = CatSPrint(RetVal, Temp, Supports); + FreePool(Temp); + FreePool(RetVal); + RetVal = Temp2; + Temp2 = NULL; + } + + Configuration = NULL; + Status = PciRootBridgeIo->Configuration (PciRootBridgeIo, (VOID **) &Configuration); + if (!EFI_ERROR(Status) && Configuration != NULL) { + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_TITLE), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL(RetVal); + return NULL; + } + Temp2 = CatSPrint(RetVal, Temp, Supports); + FreePool(Temp); + FreePool(RetVal); + RetVal = Temp2; + Temp2 = NULL; + while (Configuration->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) { + Temp = NULL; + switch (Configuration->ResType) { + case ACPI_ADDRESS_SPACE_TYPE_MEM: + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_MEM), NULL); + break; + case ACPI_ADDRESS_SPACE_TYPE_IO: + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_IO), NULL); + break; + case ACPI_ADDRESS_SPACE_TYPE_BUS: + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_BUS), NULL); + break; + } + if (Temp != NULL) { + Temp2 = CatSPrint(RetVal, L"\r\n%s", Temp); + FreePool(Temp); + FreePool(RetVal); + RetVal = Temp2; + Temp2 = NULL; + } + + Temp2 = CatSPrint(RetVal, + L"%%H%02x %016lx %016lx %02x%%N", + Configuration->SpecificFlag, + Configuration->AddrRangeMin, + Configuration->AddrRangeMax, + Configuration->AddrSpaceGranularity + ); + FreePool(RetVal); + RetVal = Temp2; + Temp2 = NULL; + Configuration++; + } + } + return (RetVal); +} + +/** + Function to dump information about SimpleTextOut. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has SimpleTextOut installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A poitner to a string containing the information. +**/ +CHAR16* +EFIAPI +TxtOutProtocolDumpInformation( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Dev; + INTN Index; + UINTN Col; + UINTN Row; + EFI_STATUS Status; + CHAR16 *RetVal; + UINTN Size; + CHAR16 *Temp; + UINTN NewSize; + + if (!Verbose) { + return (NULL); + } + + HandleParsingHiiInit(); + + RetVal = NULL; + Size = 0; + + Status = gBS->HandleProtocol( + TheHandle, + &gEfiSimpleTextOutProtocolGuid, + (VOID**)&Dev); + + ASSERT_EFI_ERROR(Status); + ASSERT (Dev != NULL && Dev->Mode != NULL); + + Size = (Dev->Mode->MaxMode + 1) * 80; + RetVal = AllocateZeroPool(Size); + + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_TXT_OUT_DUMP_HEADER), NULL); + if (Temp != NULL) { + UnicodeSPrint(RetVal, Size, Temp, Dev, Dev->Mode->Attribute); + FreePool(Temp); + } + + // + // Dump TextOut Info + // + Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_TXT_OUT_DUMP_LINE), NULL); + for (Index = 0; Index < Dev->Mode->MaxMode; Index++) { + Status = Dev->QueryMode (Dev, Index, &Col, &Row); + NewSize = Size - StrSize(RetVal); + UnicodeSPrint( + RetVal + StrLen(RetVal), + NewSize, + Temp == NULL?L"":Temp, + Index == Dev->Mode->Mode ? L'*' : L' ', + Index, + !EFI_ERROR(Status)?(INTN)Col:-1, + !EFI_ERROR(Status)?(INTN)Row:-1 + ); + } + FreePool(Temp); + return (RetVal); +} + +STATIC CONST UINTN VersionStringSize = 60; + +/** + Function to dump information about EfiDriverSupportedEfiVersion protocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A poitner to a string containing the information. +**/ +CHAR16* +EFIAPI +DriverEfiVersionProtocolDumpInformation( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL *DriverEfiVersion; + EFI_STATUS Status; + CHAR16 *RetVal; + + Status = gBS->HandleProtocol( + TheHandle, + &gEfiDriverSupportedEfiVersionProtocolGuid, + (VOID**)&DriverEfiVersion); + + ASSERT_EFI_ERROR(Status); + + RetVal = AllocateZeroPool(VersionStringSize); + if (RetVal != NULL) { + UnicodeSPrint (RetVal, VersionStringSize, L"0x%08x", DriverEfiVersion->FirmwareVersion); + } + return (RetVal); +} +/** + Function to convert device path to string. + + This will allocate the return buffer from boot services pool. + + @param[in] DevPath Pointer to device path instance. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + @param[in] Length Maximum allowed text length of the device path. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +ConvertDevicePathToShortText( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath, + IN CONST BOOLEAN Verbose, + IN CONST UINTN Length + ) +{ + CHAR16 *Temp; + CHAR16 *Temp2; + UINTN Size; + + // + // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line) + // + Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE); + if (!Verbose && Temp != NULL && StrLen(Temp) > Length) { + Temp2 = NULL; + Size = 0; + Temp2 = StrnCatGrow(&Temp2, &Size, L"..", 0); + Temp2 = StrnCatGrow(&Temp2, &Size, Temp+(StrLen(Temp) - (Length - 2)), 0); + FreePool(Temp); + Temp = Temp2; + } + return (Temp); +} + +/** + Function to dump protocol information. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + @param[in] Protocol The protocol is needed to dump. + + @retval A pointer to a string containing the information. +**/ +STATIC CHAR16* +EFIAPI +DevicePathProtocolDumpInformationEx ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose, + IN EFI_GUID *Protocol +) +{ + EFI_DEVICE_PATH_PROTOCOL *DevPath; + CHAR16 *DevPathStr; + CHAR16 *DevPathStrTemp; + UINTN Size; + EFI_STATUS Status; + DevPathStr = NULL; + DevPathStrTemp = NULL; + Status = gBS->OpenProtocol(TheHandle, Protocol, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (!EFI_ERROR(Status)) { + DevPathStr = ConvertDevicePathToShortText (DevPath, Verbose, 30); + if (Verbose) { + Size = StrSize(DevPathStr) + sizeof(CHAR16) * 2; + DevPathStrTemp = AllocateZeroPool (Size); + if (DevPathStrTemp != NULL) { + StrnCatS (DevPathStrTemp, Size/sizeof(CHAR16), L" ", 2); + StrnCatS (DevPathStrTemp, Size/sizeof(CHAR16), DevPathStr, StrLen (DevPathStr)); + } + FreePool (DevPathStr); + DevPathStr = DevPathStrTemp; + } + gBS->CloseProtocol(TheHandle, Protocol, gImageHandle, NULL); + } + return DevPathStr; +} + +/** + Function to dump information about DevicePath protocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +DevicePathProtocolDumpInformation( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + return DevicePathProtocolDumpInformationEx (TheHandle, Verbose, &gEfiDevicePathProtocolGuid); +} + +/** + Function to dump information about LoadedImageDevicePath protocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +LoadedImageDevicePathProtocolDumpInformation( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + return DevicePathProtocolDumpInformationEx (TheHandle, Verbose, &gEfiLoadedImageDevicePathProtocolGuid); +} + +/** + Function to dump information about BusSpecificDriverOverride protocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +BusSpecificDriverOverrideProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + CHAR16 *GetString; + CHAR16 *RetVal; + CHAR16 *TempRetVal; + EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *BusSpecificDriverOverride; + EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; + EFI_HANDLE ImageHandle; + UINTN Size; + + if (!Verbose) { + return NULL; + } + Size = 0; + GetString = NULL; + RetVal = NULL; + TempRetVal = NULL; + ImageHandle = 0; + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiBusSpecificDriverOverrideProtocolGuid, + (VOID**)&BusSpecificDriverOverride, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return NULL; + } + HandleParsingHiiInit (); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_BSDO_DUMP_MAIN), NULL); + if (GetString == NULL) { + return NULL; + } + do { + Status = BusSpecificDriverOverride->GetDriver ( + BusSpecificDriverOverride, + &ImageHandle + ); + if (!EFI_ERROR (Status)) { + Status = gBS->HandleProtocol ( + ImageHandle, + &gEfiLoadedImageProtocolGuid, + (VOID **) &LoadedImage + ); + if(!EFI_ERROR (Status)) { + TempRetVal = CatSPrint ( + TempRetVal, + GetString, + ConvertHandleToHandleIndex (ImageHandle), + ConvertDevicePathToText (LoadedImage->FilePath, TRUE, TRUE) + ); + StrnCatGrow (&RetVal, &Size, TempRetVal, 0); + SHELL_FREE_NON_NULL (TempRetVal); + } + } + } while (!EFI_ERROR (Status)); + + SHELL_FREE_NON_NULL (GetString); + return RetVal; +} + +/** + Function to dump information about BlockIo protocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +BlockIoProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + EFI_BLOCK_IO_PROTOCOL *BlockIo; + EFI_BLOCK_IO_MEDIA *BlockMedia; + CHAR16 *GetString; + CHAR16 *RetVal; + + if (!Verbose) { + return NULL; + } + GetString = NULL; + RetVal = NULL; + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiBlockIoProtocolGuid, + (VOID**)&BlockIo, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return NULL; + } + BlockMedia = BlockIo->Media; + // + // Per spec: + // The function (ReadBlocks) must return EFI_NO_MEDIA or + // EFI_MEDIA_CHANGED even if LBA, BufferSize, or Buffer are invalid so the caller can probe + // for changes in media state. + // + BlockIo->ReadBlocks ( + BlockIo, + BlockIo->Media->MediaId, + 0, + 0, + NULL + ); + + HandleParsingHiiInit (); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_BLOCKIO_INFO), NULL); + if (GetString == NULL) { + return NULL; + } + RetVal = CatSPrint ( + RetVal, + GetString, + BlockMedia->RemovableMedia ? L"Removable " : L"Fixed ", + BlockMedia->MediaPresent ? L"" : L"not-present ", + BlockMedia->MediaId, + BlockMedia->BlockSize, + BlockMedia->LastBlock, + MultU64x32 (BlockMedia->LastBlock + 1, BlockMedia->BlockSize), + BlockMedia->LogicalPartition ? L"partition" : L"raw", + BlockMedia->ReadOnly ? L"ro" : L"rw", + BlockMedia->WriteCaching ? L"cached" : L"!cached" + ); + + SHELL_FREE_NON_NULL (GetString); + return RetVal; +} + +/** + Function to dump information about DebugSupport Protocol. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +DebugSupportProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport; + CHAR16 *GetString; + CHAR16 *RetVal; + + if (!Verbose) { + return NULL; + } + GetString = NULL; + RetVal = NULL; + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiDebugSupportProtocolGuid, + (VOID**)&DebugSupport, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return NULL; + } + HandleParsingHiiInit (); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_DEBUGSUPPORT_INFO), NULL); + if (GetString == NULL) { + return NULL; + } + // + // Dump Debug support info + // + switch (DebugSupport->Isa) { + case (IsaIa32): + RetVal = CatSPrint (RetVal, GetString, L"IA-32"); + break; + case (IsaIpf): + RetVal = CatSPrint (RetVal, GetString, L"IPF"); + break; + case (IsaEbc): + RetVal = CatSPrint (RetVal, GetString, L"EBC"); + break; + default: + SHELL_FREE_NON_NULL (GetString); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_DEBUGSUPPORT_UNKNOWN), NULL); + RetVal = GetString != NULL ? CatSPrint (RetVal, GetString, DebugSupport->Isa) : NULL; + break; + } + + SHELL_FREE_NON_NULL (GetString); + return RetVal; +} + +/** + Function to dump information about PciIoProtocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has PciRootBridgeIo installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A poitner to a string containing the information. +**/ +CHAR16* +EFIAPI +PciIoProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + EFI_PCI_IO_PROTOCOL *PciIo; + PCI_TYPE00 Pci; + UINTN Segment; + UINTN Bus; + UINTN Device; + UINTN Function; + UINTN Index; + CHAR16 *GetString; + CHAR16 *TempRetVal; + CHAR16 *RetVal; + + if (!Verbose) { + return (NULL); + } + RetVal = NULL; + GetString = NULL; + TempRetVal = NULL; + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiPciIoProtocolGuid, + (VOID**)&PciIo, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR(Status)) { + return NULL; + } + PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0, sizeof (Pci), &Pci); + PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function); + HandleParsingHiiInit (); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIIO_DUMP_MAIN), NULL); + if (GetString == NULL) { + return NULL; + } + RetVal = CatSPrint ( + NULL, + GetString, + Segment, + Bus, + Device, + Function, + PciIo->RomSize, + PciIo->RomImage, + Pci.Hdr.VendorId, + Pci.Hdr.DeviceId, + Pci.Hdr.ClassCode[0], + Pci.Hdr.ClassCode[1], + Pci.Hdr.ClassCode[2] + ); + for (Index = 0; Index < sizeof (Pci); Index ++) { + if ((Index % 0x10) == 0) { + TempRetVal = CatSPrint (RetVal, L"\r\n %02x", *((UINT8 *) (&Pci) + Index)); + } else { + TempRetVal = CatSPrint (RetVal, L"%02x", *((UINT8 *) (&Pci) + Index)); + } + FreePool (RetVal); + RetVal = TempRetVal; + TempRetVal = NULL; + } + + FreePool(GetString); + return RetVal; +} + +/** + Function to dump information about UsbIoProtocol. + + This will allocate the return buffer from boot services pool. + + @param[in] TheHandle The handle that has PciRootBridgeIo installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A poitner to a string containing the information. +**/ +CHAR16* +EFIAPI +UsbIoProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + EFI_USB_IO_PROTOCOL *UsbIo; + EFI_USB_INTERFACE_DESCRIPTOR InterfaceDesc; + CHAR16 *GetString; + CHAR16 *RetVal; + + if (!Verbose) { + return (NULL); + } + RetVal = NULL; + GetString = NULL; + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiUsbIoProtocolGuid, + (VOID**)&UsbIo, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR(Status)) { + return NULL; + } + UsbIo->UsbGetInterfaceDescriptor (UsbIo, &InterfaceDesc); + HandleParsingHiiInit (); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_USBIO_DUMP_MAIN), NULL); + if (GetString == NULL) { + return NULL; + } + RetVal = CatSPrint ( + NULL, + GetString, + InterfaceDesc.InterfaceNumber, + InterfaceDesc.InterfaceClass, + InterfaceDesc.InterfaceSubClass, + InterfaceDesc.InterfaceProtocol + ); + + FreePool (GetString); + return RetVal; +} + +/** + Function to dump information about EfiAdapterInformation Protocol. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +AdapterInformationDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + EFI_ADAPTER_INFORMATION_PROTOCOL *EfiAdptrInfoProtocol; + UINTN InfoTypesBufferCount; + UINTN GuidIndex; + EFI_GUID *InfoTypesBuffer; + CHAR16 *GuidStr; + CHAR16 *TempStr; + CHAR16 *RetVal; + CHAR16 *TempRetVal; + VOID *InformationBlock; + UINTN InformationBlockSize; + + if (!Verbose) { + return (CatSPrint(NULL, L"AdapterInfo")); + } + + InfoTypesBuffer = NULL; + InformationBlock = NULL; + + + Status = gBS->OpenProtocol ( + (EFI_HANDLE) (TheHandle), + &gEfiAdapterInformationProtocolGuid, + (VOID **) &EfiAdptrInfoProtocol, + NULL, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return NULL; + } + + // + // Get a list of supported information types for this instance of the protocol. + // + Status = EfiAdptrInfoProtocol->GetSupportedTypes ( + EfiAdptrInfoProtocol, + &InfoTypesBuffer, + &InfoTypesBufferCount + ); + RetVal = NULL; + if (EFI_ERROR (Status)) { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_GET_SUPP_TYPES_FAILED), NULL); + if (TempStr != NULL) { + RetVal = CatSPrint (NULL, TempStr, Status); + } else { + goto ERROR_EXIT; + } + } else { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_SUPP_TYPE_HEADER), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + RetVal = CatSPrint (NULL, TempStr); + SHELL_FREE_NON_NULL (TempStr); + + for (GuidIndex = 0; GuidIndex < InfoTypesBufferCount; GuidIndex++) { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_GUID_NUMBER), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint (RetVal, TempStr, (GuidIndex + 1), &InfoTypesBuffer[GuidIndex]); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_GUID_STRING), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + + if (CompareGuid (&InfoTypesBuffer[GuidIndex], &gEfiAdapterInfoMediaStateGuid)) { + TempRetVal = CatSPrint (RetVal, TempStr, L"gEfiAdapterInfoMediaStateGuid"); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else if (CompareGuid (&InfoTypesBuffer[GuidIndex], &gEfiAdapterInfoNetworkBootGuid)) { + TempRetVal = CatSPrint (RetVal, TempStr, L"gEfiAdapterInfoNetworkBootGuid"); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else if (CompareGuid (&InfoTypesBuffer[GuidIndex], &gEfiAdapterInfoSanMacAddressGuid)) { + TempRetVal = CatSPrint (RetVal, TempStr, L"gEfiAdapterInfoSanMacAddressGuid"); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else if (CompareGuid (&InfoTypesBuffer[GuidIndex], &gEfiAdapterInfoUndiIpv6SupportGuid)) { + TempRetVal = CatSPrint (RetVal, TempStr, L"gEfiAdapterInfoUndiIpv6SupportGuid"); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else { + + GuidStr = GetStringNameFromGuid (&InfoTypesBuffer[GuidIndex], NULL); + if (GuidStr == NULL) { + TempRetVal = CatSPrint (RetVal, TempStr, L"UnknownInfoType"); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + + SHELL_FREE_NON_NULL (TempStr); + SHELL_FREE_NON_NULL(GuidStr); + // + // So that we never have to pass this UnknownInfoType to the parsing function "GetInformation" service of AIP + // + continue; + } else { + TempRetVal = CatSPrint (RetVal, TempStr, GuidStr); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL(GuidStr); + } + } + + SHELL_FREE_NON_NULL (TempStr); + + Status = EfiAdptrInfoProtocol->GetInformation ( + EfiAdptrInfoProtocol, + &InfoTypesBuffer[GuidIndex], + &InformationBlock, + &InformationBlockSize + ); + + if (EFI_ERROR (Status)) { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_GETINFO_FAILED), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint (RetVal, TempStr, Status); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else { + if (CompareGuid (&InfoTypesBuffer[GuidIndex], &gEfiAdapterInfoMediaStateGuid)) { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_MEDIA_STATE), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint ( + RetVal, + TempStr, + ((EFI_ADAPTER_INFO_MEDIA_STATE *)InformationBlock)->MediaState, + ((EFI_ADAPTER_INFO_MEDIA_STATE *)InformationBlock)->MediaState + ); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else if (CompareGuid (&InfoTypesBuffer[GuidIndex], &gEfiAdapterInfoNetworkBootGuid)) { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_NETWORK_BOOT_INFO), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint ( + RetVal, + TempStr, + ((EFI_ADAPTER_INFO_NETWORK_BOOT *)InformationBlock)->iScsiIpv4BootCapablity, + ((EFI_ADAPTER_INFO_NETWORK_BOOT *)InformationBlock)->iScsiIpv6BootCapablity, + ((EFI_ADAPTER_INFO_NETWORK_BOOT *)InformationBlock)->FCoeBootCapablity, + ((EFI_ADAPTER_INFO_NETWORK_BOOT *)InformationBlock)->OffloadCapability, + ((EFI_ADAPTER_INFO_NETWORK_BOOT *)InformationBlock)->iScsiMpioCapability, + ((EFI_ADAPTER_INFO_NETWORK_BOOT *)InformationBlock)->iScsiIpv4Boot, + ((EFI_ADAPTER_INFO_NETWORK_BOOT *)InformationBlock)->iScsiIpv6Boot, + ((EFI_ADAPTER_INFO_NETWORK_BOOT *)InformationBlock)->FCoeBoot + ); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else if (CompareGuid (&InfoTypesBuffer[GuidIndex], &gEfiAdapterInfoSanMacAddressGuid) == TRUE) { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_SAN_MAC_ADDRESS_INFO), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint ( + RetVal, + TempStr, + ((EFI_ADAPTER_INFO_SAN_MAC_ADDRESS *)InformationBlock)->SanMacAddress.Addr[0], + ((EFI_ADAPTER_INFO_SAN_MAC_ADDRESS *)InformationBlock)->SanMacAddress.Addr[1], + ((EFI_ADAPTER_INFO_SAN_MAC_ADDRESS *)InformationBlock)->SanMacAddress.Addr[2], + ((EFI_ADAPTER_INFO_SAN_MAC_ADDRESS *)InformationBlock)->SanMacAddress.Addr[3], + ((EFI_ADAPTER_INFO_SAN_MAC_ADDRESS *)InformationBlock)->SanMacAddress.Addr[4], + ((EFI_ADAPTER_INFO_SAN_MAC_ADDRESS *)InformationBlock)->SanMacAddress.Addr[5] + ); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else if (CompareGuid (&InfoTypesBuffer[GuidIndex], &gEfiAdapterInfoUndiIpv6SupportGuid) == TRUE) { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_UNDI_IPV6_INFO), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + + TempRetVal = CatSPrint ( + RetVal, + TempStr, + ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *)InformationBlock)->Ipv6Support + ); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } else { + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_UNKNOWN_INFO_TYPE), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint (RetVal, TempStr, &InfoTypesBuffer[GuidIndex]); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } + } + SHELL_FREE_NON_NULL (TempStr); + SHELL_FREE_NON_NULL (InformationBlock); + } + } + + SHELL_FREE_NON_NULL (InfoTypesBuffer); + return RetVal; + +ERROR_EXIT: + SHELL_FREE_NON_NULL (RetVal); + SHELL_FREE_NON_NULL (InfoTypesBuffer); + SHELL_FREE_NON_NULL (InformationBlock); + return NULL; +} + +/** + Function to dump information about EFI_FIRMWARE_MANAGEMENT_PROTOCOL Protocol. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +FirmwareManagementDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + EFI_FIRMWARE_MANAGEMENT_PROTOCOL *EfiFwMgmtProtocol; + EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo; + EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1 *ImageInfoV1; + EFI_FIRMWARE_IMAGE_DESCRIPTOR_V2 *ImageInfoV2; + UINT64 AttributeSetting; + UINTN ImageInfoSize; + UINTN DescriptorSize; + UINT32 DescriptorVersion; + UINT32 PackageVersion; + UINT8 DescriptorCount; + UINT8 Index; + UINT8 Index1; + UINT8 ImageCount; + CHAR16 *PackageVersionName; + CHAR16 *TempStr; + CHAR16 *RetVal; + CHAR16 *TempRetVal; + CHAR16 *AttributeSettingStr; + BOOLEAN Found; + BOOLEAN AttributeSupported; + + // + // Initialize local variables + // + ImageCount = 0; + ImageInfoSize = 1; + AttributeSetting = 0; + Found = FALSE; + AttributeSupported = FALSE; + ImageInfo = NULL; + ImageInfoV1 = NULL; + ImageInfoV2 = NULL; + PackageVersionName = NULL; + RetVal = NULL; + TempRetVal = NULL; + TempStr = NULL; + AttributeSettingStr = NULL; + + if (!Verbose) { + return (CatSPrint(NULL, L"FirmwareManagement")); + } + + Status = gBS->OpenProtocol ( + (EFI_HANDLE) (TheHandle), + &gEfiFirmwareManagementProtocolGuid, + (VOID **) &EfiFwMgmtProtocol, + NULL, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return NULL; + } + + Status = EfiFwMgmtProtocol->GetImageInfo ( + EfiFwMgmtProtocol, + &ImageInfoSize, + ImageInfo, + &DescriptorVersion, + &DescriptorCount, + &DescriptorSize, + &PackageVersion, + &PackageVersionName + ); + + if (Status == EFI_BUFFER_TOO_SMALL) { + ImageInfo = AllocateZeroPool (ImageInfoSize); + + if (ImageInfo == NULL) { + Status = EFI_OUT_OF_RESOURCES; + } else { + Status = EfiFwMgmtProtocol->GetImageInfo ( + EfiFwMgmtProtocol, + &ImageInfoSize, + ImageInfo, + &DescriptorVersion, + &DescriptorCount, + &DescriptorSize, + &PackageVersion, + &PackageVersionName + ); + } + } + + if (EFI_ERROR (Status)) { + goto ERROR_EXIT; + } + + // + // Decode Image Descriptor data only if its version is supported + // + if (DescriptorVersion <= EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION) { + + if (ImageInfo == NULL) { + goto ERROR_EXIT; + } + + ImageInfoV1 = (EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1 *)ImageInfo; + ImageInfoV2 = (EFI_FIRMWARE_IMAGE_DESCRIPTOR_V2 *)ImageInfo; + + // + // Set ImageInfoSize in return buffer + // + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_IMAGE_INFO_SIZE), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + RetVal = CatSPrint (NULL, TempStr, ImageInfoSize); + SHELL_FREE_NON_NULL (TempStr); + + // + // Set DescriptorVersion in return buffer + // + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_DESCRIPTOR_VERSION), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint (RetVal, TempStr, DescriptorVersion); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + + // + // Set DescriptorCount in return buffer + // + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_DESCRIPTOR_COUNT), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint (RetVal, TempStr, DescriptorCount); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + + + // + // Set DescriptorSize in return buffer + // + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_DESCRIPTOR_SIZE), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint (RetVal, TempStr, DescriptorSize); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + + // + // Set PackageVersion in return buffer + // + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_PACKAGE_VERSION), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint (RetVal, TempStr, PackageVersion); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + + // + // Set PackageVersionName in return buffer + // + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_PACKAGE_VERSION_NAME), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint (RetVal, TempStr, PackageVersionName); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + + for (Index = 0; Index < DescriptorCount; Index++) { + // + // First check if Attribute is supported + // and generate a string for AttributeSetting field + // + SHELL_FREE_NON_NULL (AttributeSettingStr); + AttributeSupported = FALSE; + AttributeSetting = 0; + if (DescriptorVersion == EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1) { + if (ImageInfoV1[Index].AttributesSupported != 0x0) { + AttributeSupported = TRUE; + AttributeSetting = ImageInfoV1[Index].AttributesSetting; + } + } else if (DescriptorVersion == EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2) { + if (ImageInfoV2[Index].AttributesSupported != 0x0) { + AttributeSupported = TRUE; + AttributeSetting = ImageInfoV2[Index].AttributesSetting; + } + } else { + if (ImageInfo[Index].AttributesSupported != 0x0) { + AttributeSupported = TRUE; + AttributeSetting = ImageInfo[Index].AttributesSetting; + } + } + + if (!AttributeSupported) { + AttributeSettingStr = CatSPrint (NULL, L"None"); + } else { + AttributeSettingStr = CatSPrint (NULL, L"("); + + if ((AttributeSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) != 0x0) { + TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_IMAGE_UPDATABLE"); + SHELL_FREE_NON_NULL (AttributeSettingStr); + AttributeSettingStr = TempRetVal; + } + if ((AttributeSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) != 0x0) { + TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_RESET_REQUIRED"); + SHELL_FREE_NON_NULL (AttributeSettingStr); + AttributeSettingStr = TempRetVal; + } + if ((AttributeSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) != 0x0) { + TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED"); + SHELL_FREE_NON_NULL (AttributeSettingStr); + AttributeSettingStr = TempRetVal; + } + if ((AttributeSetting & IMAGE_ATTRIBUTE_IN_USE) != 0x0) { + TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_IN_USE"); + SHELL_FREE_NON_NULL (AttributeSettingStr); + AttributeSettingStr = TempRetVal; + } + if ((AttributeSetting & IMAGE_ATTRIBUTE_UEFI_IMAGE) != 0x0) { + TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_UEFI_IMAGE"); + SHELL_FREE_NON_NULL (AttributeSettingStr); + AttributeSettingStr = TempRetVal; + } + TempRetVal = CatSPrint (AttributeSettingStr, L" )"); + SHELL_FREE_NON_NULL (AttributeSettingStr); + AttributeSettingStr = TempRetVal; + } + + if (DescriptorVersion == EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1) { + if (ImageInfoV1[Index].ImageIndex != 0x0) { + ImageCount++; + } + + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_IMAGE_DESCRIPTOR_INFO_V1), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint ( + RetVal, + TempStr, + Index, + ImageInfoV1[Index].ImageIndex, + &ImageInfoV1[Index].ImageTypeId, + ImageInfoV1[Index].ImageId, + ImageInfoV1[Index].ImageIdName, + ImageInfoV1[Index].Version, + ImageInfoV1[Index].VersionName, + ImageInfoV1[Index].Size, + ImageInfoV1[Index].AttributesSupported, + AttributeSettingStr, + ImageInfoV1[Index].Compatibilities + ); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + } else if (DescriptorVersion == EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2) { + if (ImageInfoV2[Index].ImageIndex != 0x0) { + ImageCount++; + } + + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_IMAGE_DESCRIPTOR_INFO_V2), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint ( + RetVal, + TempStr, + Index, + ImageInfoV2[Index].ImageIndex, + &ImageInfoV2[Index].ImageTypeId, + ImageInfoV2[Index].ImageId, + ImageInfoV2[Index].ImageIdName, + ImageInfoV2[Index].Version, + ImageInfoV2[Index].VersionName, + ImageInfoV2[Index].Size, + ImageInfoV2[Index].AttributesSupported, + AttributeSettingStr, + ImageInfoV2[Index].Compatibilities, + ImageInfoV2[Index].LowestSupportedImageVersion + ); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + } else { + if (ImageInfo[Index].ImageIndex != 0x0) { + ImageCount++; + } + + TempStr = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_FMP_IMAGE_DESCRIPTOR_INFO), NULL); + if (TempStr == NULL) { + goto ERROR_EXIT; + } + TempRetVal = CatSPrint ( + RetVal, + TempStr, + Index, + ImageInfo[Index].ImageIndex, + &ImageInfo[Index].ImageTypeId, + ImageInfo[Index].ImageId, + ImageInfo[Index].ImageIdName, + ImageInfo[Index].Version, + ImageInfo[Index].VersionName, + ImageInfo[Index].Size, + ImageInfo[Index].AttributesSupported, + AttributeSettingStr, + ImageInfo[Index].Compatibilities, + ImageInfo[Index].LowestSupportedImageVersion, + ImageInfo[Index].LastAttemptVersion, + ImageInfo[Index].LastAttemptStatus, + ImageInfo[Index].HardwareInstance + ); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (TempStr); + } + } + } + + if (ImageCount > 0) { + for (Index=0; IndexOpenProtocol ( + TheHandle, + &gEfiPartitionInfoProtocolGuid, + (VOID**)&PartitionInfo, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return NULL; + } + + HandleParsingHiiInit (); + + switch (PartitionInfo->Type) { + case PARTITION_TYPE_OTHER: + PartitionType = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_TYPE_OTHER), NULL); + break; + case PARTITION_TYPE_MBR: + PartitionType = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_TYPE_MBR), NULL); + break; + case PARTITION_TYPE_GPT: + PartitionType = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_TYPE_GPT), NULL); + break; + default: + PartitionType = NULL; + break; + } + if (PartitionType == NULL) { + return NULL; + } + + if (PartitionInfo->System == 1) { + EfiSystemPartition = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_EFI_SYS_PART), NULL); + } else { + EfiSystemPartition = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_NOT_EFI_SYS_PART), NULL); + } + if (EfiSystemPartition == NULL) { + SHELL_FREE_NON_NULL (PartitionType); + return NULL; + } + + RetVal = CatSPrint ( + NULL, + L"%s\r\n%s", + PartitionType, + EfiSystemPartition + ); + + SHELL_FREE_NON_NULL (EfiSystemPartition); + SHELL_FREE_NON_NULL (PartitionType); + return RetVal; +} + +// +// Put the information on the NT32 protocol GUIDs here so we are not dependant on the Nt32Pkg +// +#define LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID \ + { \ + 0x58c518b1, 0x76f3, 0x11d4, { 0xbc, 0xea, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ + } + +#define LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID \ + { \ + 0x96eb4ad6, 0xa32a, 0x11d4, { 0xbc, 0xfd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ + } + +#define LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID \ + { \ + 0xc95a93d, 0xa006, 0x11d4, { 0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ + } +STATIC CONST EFI_GUID WinNtThunkProtocolGuid = LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID; +STATIC CONST EFI_GUID WinNtIoProtocolGuid = LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID; +STATIC CONST EFI_GUID WinNtSerialPortGuid = LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID; + +// +// Deprecated protocols we dont want to link from IntelFrameworkModulePkg +// +#define LOCAL_EFI_ISA_IO_PROTOCOL_GUID \ + { \ + 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ + } +#define LOCAL_EFI_ISA_ACPI_PROTOCOL_GUID \ + { \ + 0x64a892dc, 0x5561, 0x4536, { 0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55 } \ + } +STATIC CONST EFI_GUID EfiIsaIoProtocolGuid = LOCAL_EFI_ISA_IO_PROTOCOL_GUID; +STATIC CONST EFI_GUID EfiIsaAcpiProtocolGuid = LOCAL_EFI_ISA_ACPI_PROTOCOL_GUID; + + +STATIC CONST GUID_INFO_BLOCK mGuidStringListNT[] = { + {STRING_TOKEN(STR_WINNT_THUNK), (EFI_GUID*)&WinNtThunkProtocolGuid, NULL}, + {STRING_TOKEN(STR_WINNT_DRIVER_IO), (EFI_GUID*)&WinNtIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_WINNT_SERIAL_PORT), (EFI_GUID*)&WinNtSerialPortGuid, NULL}, + {0, NULL, NULL}, +}; + +STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = { + {STRING_TOKEN(STR_LOADED_IMAGE), &gEfiLoadedImageProtocolGuid, LoadedImageProtocolDumpInformation}, + {STRING_TOKEN(STR_DEVICE_PATH), &gEfiDevicePathProtocolGuid, DevicePathProtocolDumpInformation}, + {STRING_TOKEN(STR_IMAGE_PATH), &gEfiLoadedImageDevicePathProtocolGuid, LoadedImageDevicePathProtocolDumpInformation}, + {STRING_TOKEN(STR_DEVICE_PATH_UTIL), &gEfiDevicePathUtilitiesProtocolGuid, NULL}, + {STRING_TOKEN(STR_DEVICE_PATH_TXT), &gEfiDevicePathToTextProtocolGuid, NULL}, + {STRING_TOKEN(STR_DEVICE_PATH_FTXT), &gEfiDevicePathFromTextProtocolGuid, NULL}, + {STRING_TOKEN(STR_DEVICE_PATH_PC), &gEfiPcAnsiGuid, NULL}, + {STRING_TOKEN(STR_DEVICE_PATH_VT100), &gEfiVT100Guid, NULL}, + {STRING_TOKEN(STR_DEVICE_PATH_VT100P), &gEfiVT100PlusGuid, NULL}, + {STRING_TOKEN(STR_DEVICE_PATH_VTUTF8), &gEfiVTUTF8Guid, NULL}, + {STRING_TOKEN(STR_DRIVER_BINDING), &gEfiDriverBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_PLATFORM_OVERRIDE), &gEfiPlatformDriverOverrideProtocolGuid, NULL}, + {STRING_TOKEN(STR_BUS_OVERRIDE), &gEfiBusSpecificDriverOverrideProtocolGuid, BusSpecificDriverOverrideProtocolDumpInformation}, + {STRING_TOKEN(STR_DRIVER_DIAG), &gEfiDriverDiagnosticsProtocolGuid, NULL}, + {STRING_TOKEN(STR_DRIVER_DIAG2), &gEfiDriverDiagnostics2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_DRIVER_CN), &gEfiComponentNameProtocolGuid, NULL}, + {STRING_TOKEN(STR_DRIVER_CN2), &gEfiComponentName2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_PLAT_DRV_CFG), &gEfiPlatformToDriverConfigurationProtocolGuid, NULL}, + {STRING_TOKEN(STR_DRIVER_VERSION), &gEfiDriverSupportedEfiVersionProtocolGuid, DriverEfiVersionProtocolDumpInformation}, + {STRING_TOKEN(STR_TXT_IN), &gEfiSimpleTextInProtocolGuid, NULL}, + {STRING_TOKEN(STR_TXT_IN_EX), &gEfiSimpleTextInputExProtocolGuid, NULL}, + {STRING_TOKEN(STR_TXT_OUT), &gEfiSimpleTextOutProtocolGuid, TxtOutProtocolDumpInformation}, + {STRING_TOKEN(STR_SIM_POINTER), &gEfiSimplePointerProtocolGuid, NULL}, + {STRING_TOKEN(STR_ABS_POINTER), &gEfiAbsolutePointerProtocolGuid, NULL}, + {STRING_TOKEN(STR_SERIAL_IO), &gEfiSerialIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_GRAPHICS_OUTPUT), &gEfiGraphicsOutputProtocolGuid, GraphicsOutputProtocolDumpInformation}, + {STRING_TOKEN(STR_EDID_DISCOVERED), &gEfiEdidDiscoveredProtocolGuid, EdidDiscoveredProtocolDumpInformation}, + {STRING_TOKEN(STR_EDID_ACTIVE), &gEfiEdidActiveProtocolGuid, EdidActiveProtocolDumpInformation}, + {STRING_TOKEN(STR_EDID_OVERRIDE), &gEfiEdidOverrideProtocolGuid, NULL}, + {STRING_TOKEN(STR_CON_IN), &gEfiConsoleInDeviceGuid, NULL}, + {STRING_TOKEN(STR_CON_OUT), &gEfiConsoleOutDeviceGuid, NULL}, + {STRING_TOKEN(STR_STD_ERR), &gEfiStandardErrorDeviceGuid, NULL}, + {STRING_TOKEN(STR_LOAD_FILE), &gEfiLoadFileProtocolGuid, NULL}, + {STRING_TOKEN(STR_LOAD_FILE2), &gEfiLoadFile2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_SIMPLE_FILE_SYS), &gEfiSimpleFileSystemProtocolGuid, NULL}, + {STRING_TOKEN(STR_TAPE_IO), &gEfiTapeIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_DISK_IO), &gEfiDiskIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_BLK_IO), &gEfiBlockIoProtocolGuid, BlockIoProtocolDumpInformation}, + {STRING_TOKEN(STR_UC), &gEfiUnicodeCollationProtocolGuid, NULL}, + {STRING_TOKEN(STR_UC2), &gEfiUnicodeCollation2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_PCIRB_IO), &gEfiPciRootBridgeIoProtocolGuid, PciRootBridgeIoDumpInformation}, + {STRING_TOKEN(STR_PCI_IO), &gEfiPciIoProtocolGuid, PciIoProtocolDumpInformation}, + {STRING_TOKEN(STR_SCSI_PT), &gEfiScsiPassThruProtocolGuid, NULL}, + {STRING_TOKEN(STR_SCSI_IO), &gEfiScsiIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_SCSI_PT_EXT), &gEfiExtScsiPassThruProtocolGuid, NULL}, + {STRING_TOKEN(STR_ISCSI), &gEfiIScsiInitiatorNameProtocolGuid, NULL}, + {STRING_TOKEN(STR_USB_IO), &gEfiUsbIoProtocolGuid, UsbIoProtocolDumpInformation}, + {STRING_TOKEN(STR_USB_HC), &gEfiUsbHcProtocolGuid, NULL}, + {STRING_TOKEN(STR_USB_HC2), &gEfiUsb2HcProtocolGuid, NULL}, + {STRING_TOKEN(STR_DEBUG_SUPPORT), &gEfiDebugSupportProtocolGuid, DebugSupportProtocolDumpInformation}, + {STRING_TOKEN(STR_DEBUG_PORT), &gEfiDebugPortProtocolGuid, NULL}, + {STRING_TOKEN(STR_DECOMPRESS), &gEfiDecompressProtocolGuid, NULL}, + {STRING_TOKEN(STR_ACPI_TABLE), &gEfiAcpiTableProtocolGuid, NULL}, + {STRING_TOKEN(STR_EBC_INTERPRETER), &gEfiEbcProtocolGuid, NULL}, + {STRING_TOKEN(STR_SNP), &gEfiSimpleNetworkProtocolGuid, NULL}, + {STRING_TOKEN(STR_NII), &gEfiNetworkInterfaceIdentifierProtocolGuid, NULL}, + {STRING_TOKEN(STR_NII_31), &gEfiNetworkInterfaceIdentifierProtocolGuid_31, NULL}, + {STRING_TOKEN(STR_PXE_BC), &gEfiPxeBaseCodeProtocolGuid, NULL}, + {STRING_TOKEN(STR_PXE_CB), &gEfiPxeBaseCodeCallbackProtocolGuid, NULL}, + {STRING_TOKEN(STR_BIS), &gEfiBisProtocolGuid, NULL}, + {STRING_TOKEN(STR_MNP_SB), &gEfiManagedNetworkServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_MNP), &gEfiManagedNetworkProtocolGuid, NULL}, + {STRING_TOKEN(STR_ARP_SB), &gEfiArpServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_ARP), &gEfiArpProtocolGuid, NULL}, + {STRING_TOKEN(STR_DHCPV4_SB), &gEfiDhcp4ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_DHCPV4), &gEfiDhcp4ProtocolGuid, NULL}, + {STRING_TOKEN(STR_TCPV4_SB), &gEfiTcp4ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_TCPV4), &gEfiTcp4ProtocolGuid, NULL}, + {STRING_TOKEN(STR_IPV4_SB), &gEfiIp4ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_IPV4), &gEfiIp4ProtocolGuid, NULL}, + {STRING_TOKEN(STR_IPV4_CFG), &gEfiIp4ConfigProtocolGuid, NULL}, + {STRING_TOKEN(STR_IPV4_CFG2), &gEfiIp4Config2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_UDPV4_SB), &gEfiUdp4ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_UDPV4), &gEfiUdp4ProtocolGuid, NULL}, + {STRING_TOKEN(STR_MTFTPV4_SB), &gEfiMtftp4ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_MTFTPV4), &gEfiMtftp4ProtocolGuid, NULL}, + {STRING_TOKEN(STR_AUTH_INFO), &gEfiAuthenticationInfoProtocolGuid, NULL}, + {STRING_TOKEN(STR_HASH_SB), &gEfiHashServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_HASH), &gEfiHashProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_FONT), &gEfiHiiFontProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_STRING), &gEfiHiiStringProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_IMAGE), &gEfiHiiImageProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_DATABASE), &gEfiHiiDatabaseProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_CONFIG_ROUT), &gEfiHiiConfigRoutingProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_CONFIG_ACC), &gEfiHiiConfigAccessProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_FORM_BROWSER2), &gEfiFormBrowser2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_DRIVER_FAM_OVERRIDE), &gEfiDriverFamilyOverrideProtocolGuid, NULL}, + {STRING_TOKEN(STR_PCD), &gPcdProtocolGuid, NULL}, + {STRING_TOKEN(STR_TCG), &gEfiTcgProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_PACKAGE_LIST), &gEfiHiiPackageListProtocolGuid, NULL}, + +// +// the ones under this are deprecated by the current UEFI Spec, but may be found anyways... +// + {STRING_TOKEN(STR_SHELL_INTERFACE), &gEfiShellInterfaceGuid, NULL}, + {STRING_TOKEN(STR_SHELL_ENV2), &gEfiShellEnvironment2Guid, NULL}, + {STRING_TOKEN(STR_SHELL_ENV), &gEfiShellEnvironment2Guid, NULL}, + {STRING_TOKEN(STR_DEVICE_IO), &gEfiDeviceIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_UGA_DRAW), &gEfiUgaDrawProtocolGuid, NULL}, + {STRING_TOKEN(STR_UGA_IO), &gEfiUgaIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_ESP), &gEfiPartTypeSystemPartGuid, NULL}, + {STRING_TOKEN(STR_GPT_NBR), &gEfiPartTypeLegacyMbrGuid, NULL}, + {STRING_TOKEN(STR_DRIVER_CONFIG), &gEfiDriverConfigurationProtocolGuid, NULL}, + {STRING_TOKEN(STR_DRIVER_CONFIG2), &gEfiDriverConfiguration2ProtocolGuid, NULL}, + +// +// these are using local (non-global) definitions to reduce package dependancy. +// + {STRING_TOKEN(STR_ISA_IO), (EFI_GUID*)&EfiIsaIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_ISA_ACPI), (EFI_GUID*)&EfiIsaAcpiProtocolGuid, NULL}, + +// +// the ones under this are GUID identified structs, not protocols +// + {STRING_TOKEN(STR_FILE_INFO), &gEfiFileInfoGuid, NULL}, + {STRING_TOKEN(STR_FILE_SYS_INFO), &gEfiFileSystemInfoGuid, NULL}, + +// +// the ones under this are misc GUIDS. +// + {STRING_TOKEN(STR_EFI_GLOBAL_VARIABLE), &gEfiGlobalVariableGuid, NULL}, + +// +// UEFI 2.2 +// + {STRING_TOKEN(STR_IP6_SB), &gEfiIp6ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_IP6), &gEfiIp6ProtocolGuid, NULL}, + {STRING_TOKEN(STR_IP6_CONFIG), &gEfiIp6ConfigProtocolGuid, NULL}, + {STRING_TOKEN(STR_MTFTP6_SB), &gEfiMtftp6ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_MTFTP6), &gEfiMtftp6ProtocolGuid, NULL}, + {STRING_TOKEN(STR_DHCP6_SB), &gEfiDhcp6ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_DHCP6), &gEfiDhcp6ProtocolGuid, NULL}, + {STRING_TOKEN(STR_UDP6_SB), &gEfiUdp6ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_UDP6), &gEfiUdp6ProtocolGuid, NULL}, + {STRING_TOKEN(STR_TCP6_SB), &gEfiTcp6ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_TCP6), &gEfiTcp6ProtocolGuid, NULL}, + {STRING_TOKEN(STR_VLAN_CONFIG), &gEfiVlanConfigProtocolGuid, NULL}, + {STRING_TOKEN(STR_EAP), &gEfiEapProtocolGuid, NULL}, + {STRING_TOKEN(STR_EAP_MGMT), &gEfiEapManagementProtocolGuid, NULL}, + {STRING_TOKEN(STR_FTP4_SB), &gEfiFtp4ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_FTP4), &gEfiFtp4ProtocolGuid, NULL}, + {STRING_TOKEN(STR_IP_SEC_CONFIG), &gEfiIpSecConfigProtocolGuid, NULL}, + {STRING_TOKEN(STR_DH), &gEfiDriverHealthProtocolGuid, NULL}, + {STRING_TOKEN(STR_DEF_IMG_LOAD), &gEfiDeferredImageLoadProtocolGuid, NULL}, + {STRING_TOKEN(STR_USER_CRED), &gEfiUserCredentialProtocolGuid, NULL}, + {STRING_TOKEN(STR_USER_MNGR), &gEfiUserManagerProtocolGuid, NULL}, + {STRING_TOKEN(STR_ATA_PASS_THRU), &gEfiAtaPassThruProtocolGuid, NULL}, + +// +// UEFI 2.3 +// + {STRING_TOKEN(STR_FW_MGMT), &gEfiFirmwareManagementProtocolGuid, FirmwareManagementDumpInformation}, + {STRING_TOKEN(STR_IP_SEC), &gEfiIpSecProtocolGuid, NULL}, + {STRING_TOKEN(STR_IP_SEC2), &gEfiIpSec2ProtocolGuid, NULL}, + +// +// UEFI 2.3.1 +// + {STRING_TOKEN(STR_KMS), &gEfiKmsProtocolGuid, NULL}, + {STRING_TOKEN(STR_BLK_IO2), &gEfiBlockIo2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_SSC), &gEfiStorageSecurityCommandProtocolGuid, NULL}, + {STRING_TOKEN(STR_UCRED2), &gEfiUserCredential2ProtocolGuid, NULL}, + +// +// UEFI 2.4 +// + {STRING_TOKEN(STR_DISK_IO2), &gEfiDiskIo2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_ADAPTER_INFO), &gEfiAdapterInformationProtocolGuid, AdapterInformationDumpInformation}, + +// +// UEFI2.5 +// + {STRING_TOKEN(STR_TLS_SB), &gEfiTlsServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_TLS), &gEfiTlsProtocolGuid, NULL}, + {STRING_TOKEN(STR_TLS_CONFIG), &gEfiTlsConfigurationProtocolGuid, NULL}, + {STRING_TOKEN(STR_SUPPLICANT_SB), &gEfiSupplicantServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_SUPPLICANT), &gEfiSupplicantProtocolGuid, NULL}, + +// +// UEFI2.6 +// + {STRING_TOKEN(STR_WIFI2), &gEfiWiFi2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_RAMDISK), &gEfiRamDiskProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_ID), &gEfiHiiImageDecoderProtocolGuid, NULL}, + {STRING_TOKEN(STR_HII_IE), &gEfiHiiImageExProtocolGuid, NULL}, + {STRING_TOKEN(STR_SD_MPT), &gEfiSdMmcPassThruProtocolGuid, NULL}, + {STRING_TOKEN(STR_ERASE_BLOCK), &gEfiEraseBlockProtocolGuid, NULL}, + +// +// UEFI2.7 +// + {STRING_TOKEN(STR_BLUETOOTH_ATTR), &gEfiBluetoothAttributeProtocolGuid, NULL}, + {STRING_TOKEN(STR_BLUETOOTH_ATTR_SB), &gEfiBluetoothAttributeServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_BLUETOOTH_LE_CONFIG), &gEfiBluetoothLeConfigProtocolGuid, NULL}, + {STRING_TOKEN(STR_UFS_DEV_CONFIG), &gEfiUfsDeviceConfigProtocolGuid, NULL}, + {STRING_TOKEN(STR_HTTP_BOOT_CALL), &gEfiHttpBootCallbackProtocolGuid, NULL}, + {STRING_TOKEN(STR_RESET_NOTI), &gEfiResetNotificationProtocolGuid, NULL}, + {STRING_TOKEN(STR_PARTITION_INFO), &gEfiPartitionInfoProtocolGuid, PartitionInfoProtocolDumpInformation}, + {STRING_TOKEN(STR_HII_POPUP), &gEfiHiiPopupProtocolGuid, NULL}, + +// +// PI Spec ones +// + {STRING_TOKEN(STR_IDE_CONT_INIT), &gEfiIdeControllerInitProtocolGuid, NULL}, + {STRING_TOKEN(STR_DISK_INFO), &gEfiDiskInfoProtocolGuid, NULL}, + +// +// PI Spec 1.0 +// + {STRING_TOKEN(STR_BDS_ARCH), &gEfiBdsArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_CPU_ARCH), &gEfiCpuArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MET_ARCH), &gEfiMetronomeArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MON_ARCH), &gEfiMonotonicCounterArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_RTC_ARCH), &gEfiRealTimeClockArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_RESET_ARCH), &gEfiResetArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_RT_ARCH), &gEfiRuntimeArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_SEC_ARCH), &gEfiSecurityArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_TIMER_ARCH), &gEfiTimerArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_VAR_ARCH), &gEfiVariableWriteArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_V_ARCH), &gEfiVariableArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_SECP), &gEfiSecurityPolicyProtocolGuid, NULL}, + {STRING_TOKEN(STR_WDT_ARCH), &gEfiWatchdogTimerArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_SCR), &gEfiStatusCodeRuntimeProtocolGuid, NULL}, + {STRING_TOKEN(STR_SMB_HC), &gEfiSmbusHcProtocolGuid, NULL}, + {STRING_TOKEN(STR_FV_2), &gEfiFirmwareVolume2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_FV_BLOCK), &gEfiFirmwareVolumeBlockProtocolGuid, NULL}, + {STRING_TOKEN(STR_CAP_ARCH), &gEfiCapsuleArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MP_SERVICE), &gEfiMpServiceProtocolGuid, NULL}, + {STRING_TOKEN(STR_HBRAP), &gEfiPciHostBridgeResourceAllocationProtocolGuid, NULL}, + {STRING_TOKEN(STR_PCIP), &gEfiPciPlatformProtocolGuid, NULL}, + {STRING_TOKEN(STR_PCIO), &gEfiPciOverrideProtocolGuid, NULL}, + {STRING_TOKEN(STR_PCIE), &gEfiPciEnumerationCompleteProtocolGuid, NULL}, + {STRING_TOKEN(STR_IPCID), &gEfiIncompatiblePciDeviceSupportProtocolGuid, NULL}, + {STRING_TOKEN(STR_PCIHPI), &gEfiPciHotPlugInitProtocolGuid, NULL}, + {STRING_TOKEN(STR_PCIHPR), &gEfiPciHotPlugRequestProtocolGuid, NULL}, + {STRING_TOKEN(STR_SMBIOS), &gEfiSmbiosProtocolGuid, NULL}, + {STRING_TOKEN(STR_S3_SAVE), &gEfiS3SaveStateProtocolGuid, NULL}, + {STRING_TOKEN(STR_S3_S_SMM), &gEfiS3SmmSaveStateProtocolGuid, NULL}, + {STRING_TOKEN(STR_RSC), &gEfiRscHandlerProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_RSC), &gEfiSmmRscHandlerProtocolGuid, NULL}, + {STRING_TOKEN(STR_ACPI_SDT), &gEfiAcpiSdtProtocolGuid, NULL}, + {STRING_TOKEN(STR_SIO), &gEfiSioProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_CPU2), &gEfiSmmCpuIo2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_BASE2), &gEfiSmmBase2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_ACC_2), &gEfiSmmAccess2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_CON_2), &gEfiSmmControl2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_CONFIG), &gEfiSmmConfigurationProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_RTL), &gEfiSmmReadyToLockProtocolGuid, NULL}, + {STRING_TOKEN(STR_DS_RTL), &gEfiDxeSmmReadyToLockProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_COMM), &gEfiSmmCommunicationProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_STAT), &gEfiSmmStatusCodeProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_CPU), &gEfiSmmCpuProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_PCIRBIO), &gEfiSmmPciRootBridgeIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_SWD), &gEfiSmmSwDispatch2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_SXD), &gEfiSmmSxDispatch2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_PTD2), &gEfiSmmPeriodicTimerDispatch2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_UD2), &gEfiSmmUsbDispatch2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_GD2), &gEfiSmmGpiDispatch2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_SBD2), &gEfiSmmStandbyButtonDispatch2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_PBD2), &gEfiSmmPowerButtonDispatch2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S_ITD2), &gEfiSmmIoTrapDispatch2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_PCD), &gEfiPcdProtocolGuid, NULL}, + {STRING_TOKEN(STR_FVB2), &gEfiFirmwareVolumeBlock2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_CPUIO2), &gEfiCpuIo2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_LEGACY_R2), &gEfiLegacyRegion2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_S2ARCH), &gEfiSecurity2ArchProtocolGuid, NULL}, + {STRING_TOKEN(STR_EODXE), &gEfiSmmEndOfDxeProtocolGuid, NULL}, + {STRING_TOKEN(STR_ISAHC), &gEfiIsaHcProtocolGuid, NULL}, + {STRING_TOKEN(STR_ISAHC_B), &gEfiIsaHcServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_SIO_C), &gEfiSioControlProtocolGuid, NULL}, + {STRING_TOKEN(STR_GET_PCD), &gEfiGetPcdInfoProtocolGuid, NULL}, + {STRING_TOKEN(STR_I2C_M), &gEfiI2cMasterProtocolGuid, NULL}, + {STRING_TOKEN(STR_I2CIO), &gEfiI2cIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_I2CEN), &gEfiI2cEnumerateProtocolGuid, NULL}, + {STRING_TOKEN(STR_I2C_H), &gEfiI2cHostProtocolGuid, NULL}, + {STRING_TOKEN(STR_I2C_BCM), &gEfiI2cBusConfigurationManagementProtocolGuid, NULL}, + {STRING_TOKEN(STR_TCG2), &gEfiTcg2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_TIMESTAMP), &gEfiTimestampProtocolGuid, NULL}, + {STRING_TOKEN(STR_RNG), &gEfiRngProtocolGuid, NULL}, + {STRING_TOKEN(STR_NVMEPT), &gEfiNvmExpressPassThruProtocolGuid, NULL}, + {STRING_TOKEN(STR_H2_SB), &gEfiHash2ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_HASH2), &gEfiHash2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_BIO_C), &gEfiBlockIoCryptoProtocolGuid, NULL}, + {STRING_TOKEN(STR_SCR), &gEfiSmartCardReaderProtocolGuid, NULL}, + {STRING_TOKEN(STR_SCE), &gEfiSmartCardEdgeProtocolGuid, NULL}, + {STRING_TOKEN(STR_USB_FIO), &gEfiUsbFunctionIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_BC_HC), &gEfiBluetoothHcProtocolGuid, NULL}, + {STRING_TOKEN(STR_BC_IO_SB), &gEfiBluetoothIoServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_BC_IO), &gEfiBluetoothIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_BC_C), &gEfiBluetoothConfigProtocolGuid, NULL}, + {STRING_TOKEN(STR_REG_EXP), &gEfiRegularExpressionProtocolGuid, NULL}, + {STRING_TOKEN(STR_B_MGR_P), &gEfiBootManagerPolicyProtocolGuid, NULL}, + {STRING_TOKEN(STR_CKH), &gEfiConfigKeywordHandlerProtocolGuid, NULL}, + {STRING_TOKEN(STR_WIFI), &gEfiWiFiProtocolGuid, NULL}, + {STRING_TOKEN(STR_EAP_M), &gEfiEapManagement2ProtocolGuid, NULL}, + {STRING_TOKEN(STR_EAP_C), &gEfiEapConfigurationProtocolGuid, NULL}, + {STRING_TOKEN(STR_PKCS7), &gEfiPkcs7VerifyProtocolGuid, NULL}, + {STRING_TOKEN(STR_NET_DNS4_SB), &gEfiDns4ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_NET_DNS4), &gEfiDns4ProtocolGuid, NULL}, + {STRING_TOKEN(STR_NET_DNS6_SB), &gEfiDns6ServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_NET_DNS6), &gEfiDns6ProtocolGuid, NULL}, + {STRING_TOKEN(STR_NET_HTTP_SB), &gEfiHttpServiceBindingProtocolGuid, NULL}, + {STRING_TOKEN(STR_NET_HTTP), &gEfiHttpProtocolGuid, NULL}, + {STRING_TOKEN(STR_NET_HTTP_U), &gEfiHttpUtilitiesProtocolGuid, NULL}, + {STRING_TOKEN(STR_REST), &gEfiRestProtocolGuid, NULL}, + +// +// PI 1.5 +// + {STRING_TOKEN(STR_MM_EOD), &gEfiMmEndOfDxeProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_ITD), &gEfiMmIoTrapDispatchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_PBD), &gEfiMmPowerButtonDispatchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_SBD), &gEfiMmStandbyButtonDispatchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_GD), &gEfiMmGpiDispatchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_UD), &gEfiMmUsbDispatchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_PTD), &gEfiMmPeriodicTimerDispatchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_SXD), &gEfiMmSxDispatchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_SWD), &gEfiMmSwDispatchProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_PRBI), &gEfiMmPciRootBridgeIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_CPU), &gEfiMmCpuProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_STACODE), &gEfiMmStatusCodeProtocolGuid, NULL}, + {STRING_TOKEN(STR_DXEMM_RTL), &gEfiDxeMmReadyToLockProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_CONFIG), &gEfiMmConfigurationProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_RTL), &gEfiMmReadyToLockProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_CONTROL), &gEfiMmControlProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_ACCESS), &gEfiMmAccessProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_BASE), &gEfiMmBaseProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_CPUIO), &gEfiMmCpuIoProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_RH), &gEfiMmRscHandlerProtocolGuid, NULL}, + {STRING_TOKEN(STR_MM_COM), &gEfiMmCommunicationProtocolGuid, NULL}, + +// +// UEFI Shell Spec 2.0 +// + {STRING_TOKEN(STR_SHELL_PARAMETERS), &gEfiShellParametersProtocolGuid, NULL}, + {STRING_TOKEN(STR_SHELL), &gEfiShellProtocolGuid, NULL}, + +// +// UEFI Shell Spec 2.1 +// + {STRING_TOKEN(STR_SHELL_DYNAMIC), &gEfiShellDynamicCommandProtocolGuid, NULL}, + +// +// Misc +// + {STRING_TOKEN(STR_PCDINFOPROT), &gGetPcdInfoProtocolGuid, NULL}, + +// +// terminator +// + {0, NULL, NULL}, +}; + +/** + Function to get the node for a protocol or struct from it's GUID. + + if Guid is NULL, then ASSERT. + + @param[in] Guid The GUID to look for the name of. + + @return The node. +**/ +CONST GUID_INFO_BLOCK * +InternalShellGetNodeFromGuid( + IN CONST EFI_GUID* Guid + ) +{ + CONST GUID_INFO_BLOCK *ListWalker; + UINTN LoopCount; + + ASSERT(Guid != NULL); + + for (LoopCount = 0, ListWalker = mGuidList; mGuidList != NULL && LoopCount < mGuidListCount; LoopCount++, ListWalker++) { + if (CompareGuid(ListWalker->GuidId, Guid)) { + return (ListWalker); + } + } + + if (PcdGetBool(PcdShellIncludeNtGuids)) { + for (ListWalker = mGuidStringListNT ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) { + if (CompareGuid(ListWalker->GuidId, Guid)) { + return (ListWalker); + } + } + } + for (ListWalker = mGuidStringList ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) { + if (CompareGuid(ListWalker->GuidId, Guid)) { + return (ListWalker); + } + } + return (NULL); +} + +/** +Function to add a new GUID/Name mapping. + +@param[in] Guid The Guid +@param[in] NameID The STRING id of the HII string to use +@param[in] DumpFunc The pointer to the dump function + + +@retval EFI_SUCCESS The operation was sucessful +@retval EFI_OUT_OF_RESOURCES A memory allocation failed +@retval EFI_INVALID_PARAMETER Guid NameId was invalid +**/ +EFI_STATUS +InsertNewGuidNameMapping( + IN CONST EFI_GUID *Guid, + IN CONST EFI_STRING_ID NameID, + IN CONST DUMP_PROTOCOL_INFO DumpFunc OPTIONAL + ) +{ + ASSERT (Guid != NULL); + ASSERT (NameID != 0); + + mGuidList = ReallocatePool ( + mGuidListCount * sizeof (GUID_INFO_BLOCK), + (mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK), + mGuidList + ); + if (mGuidList == NULL) { + mGuidListCount = 0; + return (EFI_OUT_OF_RESOURCES); + } + mGuidListCount++; + + mGuidList[mGuidListCount - 1].GuidId = AllocateCopyPool (sizeof (EFI_GUID), Guid); + mGuidList[mGuidListCount - 1].StringId = NameID; + mGuidList[mGuidListCount - 1].DumpInfo = DumpFunc; + + if (mGuidList[mGuidListCount - 1].GuidId == NULL) { + return (EFI_OUT_OF_RESOURCES); + } + + return (EFI_SUCCESS); +} + +/** + Function to add a new GUID/Name mapping. + + This cannot overwrite an existing mapping. + + @param[in] Guid The Guid + @param[in] TheName The Guid's name + @param[in] Lang RFC4646 language code list or NULL + + @retval EFI_SUCCESS The operation was sucessful + @retval EFI_ACCESS_DENIED There was a duplicate + @retval EFI_OUT_OF_RESOURCES A memory allocation failed + @retval EFI_INVALID_PARAMETER Guid or TheName was NULL +**/ +EFI_STATUS +EFIAPI +AddNewGuidNameMapping( + IN CONST EFI_GUID *Guid, + IN CONST CHAR16 *TheName, + IN CONST CHAR8 *Lang OPTIONAL + ) +{ + EFI_STRING_ID NameID; + + HandleParsingHiiInit(); + + if (Guid == NULL || TheName == NULL){ + return (EFI_INVALID_PARAMETER); + } + + if ((InternalShellGetNodeFromGuid(Guid)) != NULL) { + return (EFI_ACCESS_DENIED); + } + + NameID = HiiSetString(mHandleParsingHiiHandle, 0, (CHAR16*)TheName, Lang); + if (NameID == 0) { + return (EFI_OUT_OF_RESOURCES); + } + + return (InsertNewGuidNameMapping(Guid, NameID, NULL)); +} + +/** + Function to get the name of a protocol or struct from it's GUID. + + if Guid is NULL, then ASSERT. + + @param[in] Guid The GUID to look for the name of. + @param[in] Lang The language to use. + + @return pointer to string of the name. The caller + is responsible to free this memory. +**/ +CHAR16* +EFIAPI +GetStringNameFromGuid( + IN CONST EFI_GUID *Guid, + IN CONST CHAR8 *Lang OPTIONAL + ) +{ + CONST GUID_INFO_BLOCK *Id; + + HandleParsingHiiInit(); + + Id = InternalShellGetNodeFromGuid(Guid); + if (Id == NULL) { + return NULL; + } + return HiiGetString (mHandleParsingHiiHandle, Id->StringId, Lang); +} + +/** + Function to dump protocol information from a handle. + + This function will return a allocated string buffer containing the + information. The caller is responsible for freeing the memory. + + If Guid is NULL, ASSERT(). + If TheHandle is NULL, ASSERT(). + + @param[in] TheHandle The handle to dump information from. + @param[in] Guid The GUID of the protocol to dump. + @param[in] Verbose TRUE for extra info. FALSE otherwise. + + @return The pointer to string. + @retval NULL An error was encountered. +**/ +CHAR16* +EFIAPI +GetProtocolInformationDump( + IN CONST EFI_HANDLE TheHandle, + IN CONST EFI_GUID *Guid, + IN CONST BOOLEAN Verbose + ) +{ + CONST GUID_INFO_BLOCK *Id; + + ASSERT(TheHandle != NULL); + ASSERT(Guid != NULL); + + if (TheHandle == NULL || Guid == NULL) { + return (NULL); + } + + Id = InternalShellGetNodeFromGuid(Guid); + if (Id != NULL && Id->DumpInfo != NULL) { + return (Id->DumpInfo(TheHandle, Verbose)); + } + return (NULL); +} + +/** + Function to get the Guid for a protocol or struct based on it's string name. + + do not modify the returned Guid. + + @param[in] Name The pointer to the string name. + @param[in] Lang The pointer to the language code. + @param[out] Guid The pointer to the Guid. + + @retval EFI_SUCCESS The operation was sucessful. +**/ +EFI_STATUS +EFIAPI +GetGuidFromStringName( + IN CONST CHAR16 *Name, + IN CONST CHAR8 *Lang OPTIONAL, + OUT EFI_GUID **Guid + ) +{ + CONST GUID_INFO_BLOCK *ListWalker; + CHAR16 *String; + UINTN LoopCount; + + HandleParsingHiiInit(); + + ASSERT(Guid != NULL); + if (Guid == NULL) { + return (EFI_INVALID_PARAMETER); + } + *Guid = NULL; + + if (PcdGetBool(PcdShellIncludeNtGuids)) { + for (ListWalker = mGuidStringListNT ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) { + String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang); + if (Name != NULL && String != NULL && StringNoCaseCompare (&Name, &String) == 0) { + *Guid = ListWalker->GuidId; + } + SHELL_FREE_NON_NULL(String); + if (*Guid != NULL) { + return (EFI_SUCCESS); + } + } + } + for (ListWalker = mGuidStringList ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) { + String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang); + if (Name != NULL && String != NULL && StringNoCaseCompare (&Name, &String) == 0) { + *Guid = ListWalker->GuidId; + } + SHELL_FREE_NON_NULL(String); + if (*Guid != NULL) { + return (EFI_SUCCESS); + } + } + + for (LoopCount = 0, ListWalker = mGuidList; mGuidList != NULL && LoopCount < mGuidListCount; LoopCount++, ListWalker++) { + String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang); + if (Name != NULL && String != NULL && StringNoCaseCompare (&Name, &String) == 0) { + *Guid = ListWalker->GuidId; + } + SHELL_FREE_NON_NULL(String); + if (*Guid != NULL) { + return (EFI_SUCCESS); + } + } + + return (EFI_NOT_FOUND); +} + +/** + Get best support language for this driver. + + First base on the user input language to search, second base on the current + platform used language to search, third get the first language from the + support language list. The caller need to free the buffer of the best language. + + @param[in] SupportedLanguages The support languages for this driver. + @param[in] InputLanguage The user input language. + @param[in] Iso639Language Whether get language for ISO639. + + @return The best support language for this driver. +**/ +CHAR8 * +EFIAPI +GetBestLanguageForDriver ( + IN CONST CHAR8 *SupportedLanguages, + IN CONST CHAR8 *InputLanguage, + IN BOOLEAN Iso639Language + ) +{ + CHAR8 *LanguageVariable; + CHAR8 *BestLanguage; + + GetVariable2 (Iso639Language ? L"Lang" : L"PlatformLang", &gEfiGlobalVariableGuid, (VOID**)&LanguageVariable, NULL); + + BestLanguage = GetBestLanguage( + SupportedLanguages, + Iso639Language, + (InputLanguage != NULL) ? InputLanguage : "", + (LanguageVariable != NULL) ? LanguageVariable : "", + SupportedLanguages, + NULL + ); + + if (LanguageVariable != NULL) { + FreePool (LanguageVariable); + } + + return BestLanguage; +} + +/** + Function to retrieve the driver name (if possible) from the ComponentName or + ComponentName2 protocol + + @param[in] TheHandle The driver handle to get the name of. + @param[in] Language The language to use. + + @retval NULL The name could not be found. + @return A pointer to the string name. Do not de-allocate the memory. +**/ +CONST CHAR16* +EFIAPI +GetStringNameFromHandle( + IN CONST EFI_HANDLE TheHandle, + IN CONST CHAR8 *Language + ) +{ + EFI_COMPONENT_NAME2_PROTOCOL *CompNameStruct; + EFI_STATUS Status; + CHAR16 *RetVal; + CHAR8 *BestLang; + + BestLang = NULL; + + Status = gBS->OpenProtocol( + TheHandle, + &gEfiComponentName2ProtocolGuid, + (VOID**)&CompNameStruct, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (!EFI_ERROR(Status)) { + BestLang = GetBestLanguageForDriver (CompNameStruct->SupportedLanguages, Language, FALSE); + Status = CompNameStruct->GetDriverName(CompNameStruct, BestLang, &RetVal); + if (BestLang != NULL) { + FreePool (BestLang); + BestLang = NULL; + } + if (!EFI_ERROR(Status)) { + return (RetVal); + } + } + Status = gBS->OpenProtocol( + TheHandle, + &gEfiComponentNameProtocolGuid, + (VOID**)&CompNameStruct, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (!EFI_ERROR(Status)) { + BestLang = GetBestLanguageForDriver (CompNameStruct->SupportedLanguages, Language, FALSE); + Status = CompNameStruct->GetDriverName(CompNameStruct, BestLang, &RetVal); + if (BestLang != NULL) { + FreePool (BestLang); + } + if (!EFI_ERROR(Status)) { + return (RetVal); + } + } + return (NULL); +} + +/** + Function to initialize the file global mHandleList object for use in + vonverting handles to index and index to handle. + + @retval EFI_SUCCESS The operation was successful. +**/ +EFI_STATUS +InternalShellInitHandleList( + VOID + ) +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN HandleCount; + HANDLE_LIST *ListWalker; + + if (mHandleList.NextIndex != 0) { + return EFI_SUCCESS; + } + InitializeListHead(&mHandleList.List.Link); + mHandleList.NextIndex = 1; + Status = gBS->LocateHandleBuffer ( + AllHandles, + NULL, + NULL, + &HandleCount, + &HandleBuffer + ); + ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { + return (Status); + } + for (mHandleList.NextIndex = 1 ; mHandleList.NextIndex <= HandleCount ; mHandleList.NextIndex++){ + ListWalker = AllocateZeroPool(sizeof(HANDLE_LIST)); + if (ListWalker != NULL) { + ListWalker->TheHandle = HandleBuffer[mHandleList.NextIndex - 1]; + ListWalker->TheIndex = mHandleList.NextIndex; + InsertTailList (&mHandleList.List.Link, &ListWalker->Link); + } + } + FreePool(HandleBuffer); + return (EFI_SUCCESS); +} + +/** + Function to retrieve the human-friendly index of a given handle. If the handle + does not have a index one will be automatically assigned. The index value is valid + until the termination of the shell application. + + @param[in] TheHandle The handle to retrieve an index for. + + @retval 0 A memory allocation failed. + @return The index of the handle. + +**/ +UINTN +EFIAPI +ConvertHandleToHandleIndex( + IN CONST EFI_HANDLE TheHandle + ) +{ + EFI_STATUS Status; + EFI_GUID **ProtocolBuffer; + UINTN ProtocolCount; + HANDLE_LIST *ListWalker; + + if (TheHandle == NULL) { + return 0; + } + + InternalShellInitHandleList(); + + for (ListWalker = (HANDLE_LIST*)GetFirstNode(&mHandleList.List.Link) + ; !IsNull(&mHandleList.List.Link,&ListWalker->Link) + ; ListWalker = (HANDLE_LIST*)GetNextNode(&mHandleList.List.Link,&ListWalker->Link) + ){ + if (ListWalker->TheHandle == TheHandle) { + // + // Verify that TheHandle is still present in the Handle Database + // + Status = gBS->ProtocolsPerHandle(TheHandle, &ProtocolBuffer, &ProtocolCount); + if (EFI_ERROR (Status)) { + // + // TheHandle is not present in the Handle Database, so delete from the handle list + // + RemoveEntryList (&ListWalker->Link); + return 0; + } + FreePool (ProtocolBuffer); + return (ListWalker->TheIndex); + } + } + + // + // Verify that TheHandle is valid handle + // + Status = gBS->ProtocolsPerHandle(TheHandle, &ProtocolBuffer, &ProtocolCount); + if (EFI_ERROR (Status)) { + // + // TheHandle is not valid, so do not add to handle list + // + return 0; + } + FreePool (ProtocolBuffer); + + ListWalker = AllocateZeroPool(sizeof(HANDLE_LIST)); + if (ListWalker == NULL) { + return 0; + } + ListWalker->TheHandle = TheHandle; + ListWalker->TheIndex = mHandleList.NextIndex++; + InsertTailList(&mHandleList.List.Link,&ListWalker->Link); + return (ListWalker->TheIndex); +} + + + +/** + Function to retrieve the EFI_HANDLE from the human-friendly index. + + @param[in] TheIndex The index to retrieve the EFI_HANDLE for. + + @retval NULL The index was invalid. + @return The EFI_HANDLE that index represents. + +**/ +EFI_HANDLE +EFIAPI +ConvertHandleIndexToHandle( + IN CONST UINTN TheIndex + ) +{ + EFI_STATUS Status; + EFI_GUID **ProtocolBuffer; + UINTN ProtocolCount; + HANDLE_LIST *ListWalker; + + InternalShellInitHandleList(); + + if (TheIndex >= mHandleList.NextIndex) { + return NULL; + } + + for (ListWalker = (HANDLE_LIST*)GetFirstNode(&mHandleList.List.Link) + ; !IsNull(&mHandleList.List.Link,&ListWalker->Link) + ; ListWalker = (HANDLE_LIST*)GetNextNode(&mHandleList.List.Link,&ListWalker->Link) + ){ + if (ListWalker->TheIndex == TheIndex && ListWalker->TheHandle != NULL) { + // + // Verify that LinkWalker->TheHandle is valid handle + // + Status = gBS->ProtocolsPerHandle(ListWalker->TheHandle, &ProtocolBuffer, &ProtocolCount); + if (!EFI_ERROR (Status)) { + FreePool (ProtocolBuffer); + } else { + // + // TheHandle is not valid, so do not add to handle list + // + ListWalker->TheHandle = NULL; + } + return (ListWalker->TheHandle); + } + } + return NULL; +} + +/** + Gets all the related EFI_HANDLEs based on the mask supplied. + + This function scans all EFI_HANDLES in the UEFI environment's handle database + and returns the ones with the specified relationship (Mask) to the specified + controller handle. + + If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT. + If MatchingHandleCount is NULL, then ASSERT. + + If MatchingHandleBuffer is not NULL upon a successful return the memory must be + caller freed. + + @param[in] DriverBindingHandle The handle with Driver Binding protocol on it. + @param[in] ControllerHandle The handle with Device Path protocol on it. + @param[in] MatchingHandleCount The pointer to UINTN that specifies the number of HANDLES in + MatchingHandleBuffer. + @param[out] MatchingHandleBuffer On a successful return, a buffer of MatchingHandleCount + EFI_HANDLEs with a terminating NULL EFI_HANDLE. + @param[out] HandleType An array of type information. + + @retval EFI_SUCCESS The operation was successful, and any related handles + are in MatchingHandleBuffer. + @retval EFI_NOT_FOUND No matching handles were found. + @retval EFI_INVALID_PARAMETER A parameter was invalid or out of range. +**/ +EFI_STATUS +EFIAPI +ParseHandleDatabaseByRelationshipWithType ( + IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL, + IN CONST EFI_HANDLE ControllerHandle OPTIONAL, + IN UINTN *HandleCount, + OUT EFI_HANDLE **HandleBuffer, + OUT UINTN **HandleType + ) +{ + EFI_STATUS Status; + UINTN HandleIndex; + EFI_GUID **ProtocolGuidArray; + UINTN ArrayCount; + UINTN ProtocolIndex; + EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo; + UINTN OpenInfoCount; + UINTN OpenInfoIndex; + UINTN ChildIndex; + INTN DriverBindingHandleIndex; + + ASSERT(HandleCount != NULL); + ASSERT(HandleBuffer != NULL); + ASSERT(HandleType != NULL); + ASSERT(DriverBindingHandle != NULL || ControllerHandle != NULL); + + *HandleCount = 0; + *HandleBuffer = NULL; + *HandleType = NULL; + + // + // Retrieve the list of all handles from the handle database + // + Status = gBS->LocateHandleBuffer ( + AllHandles, + NULL, + NULL, + HandleCount, + HandleBuffer + ); + if (EFI_ERROR (Status)) { + return (Status); + } + + *HandleType = AllocateZeroPool (*HandleCount * sizeof (UINTN)); + if (*HandleType == NULL) { + SHELL_FREE_NON_NULL (*HandleBuffer); + *HandleCount = 0; + return EFI_OUT_OF_RESOURCES; + } + + DriverBindingHandleIndex = -1; + for (HandleIndex = 0; HandleIndex < *HandleCount; HandleIndex++) { + if (DriverBindingHandle != NULL && (*HandleBuffer)[HandleIndex] == DriverBindingHandle) { + DriverBindingHandleIndex = (INTN)HandleIndex; + } + } + + for (HandleIndex = 0; HandleIndex < *HandleCount; HandleIndex++) { + // + // Retrieve the list of all the protocols on each handle + // + Status = gBS->ProtocolsPerHandle ( + (*HandleBuffer)[HandleIndex], + &ProtocolGuidArray, + &ArrayCount + ); + if (EFI_ERROR (Status)) { + continue; + } + + for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) { + + // + // Set the bit describing what this handle has + // + if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiLoadedImageProtocolGuid) ) { + (*HandleType)[HandleIndex] |= (UINTN)HR_IMAGE_HANDLE; + } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverBindingProtocolGuid) ) { + (*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_BINDING_HANDLE; + } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfiguration2ProtocolGuid)) { + (*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_CONFIGURATION_HANDLE; + } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfigurationProtocolGuid) ) { + (*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_CONFIGURATION_HANDLE; + } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnostics2ProtocolGuid) ) { + (*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_DIAGNOSTICS_HANDLE; + } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnosticsProtocolGuid) ) { + (*HandleType)[HandleIndex] |= (UINTN)HR_DRIVER_DIAGNOSTICS_HANDLE; + } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentName2ProtocolGuid) ) { + (*HandleType)[HandleIndex] |= (UINTN)HR_COMPONENT_NAME_HANDLE; + } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentNameProtocolGuid) ) { + (*HandleType)[HandleIndex] |= (UINTN)HR_COMPONENT_NAME_HANDLE; + } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDevicePathProtocolGuid) ) { + (*HandleType)[HandleIndex] |= (UINTN)HR_DEVICE_HANDLE; + } + // + // Retrieve the list of agents that have opened each protocol + // + Status = gBS->OpenProtocolInformation ( + (*HandleBuffer)[HandleIndex], + ProtocolGuidArray[ProtocolIndex], + &OpenInfo, + &OpenInfoCount + ); + if (EFI_ERROR (Status)) { + continue; + } + + if (ControllerHandle == NULL) { + // + // ControllerHandle == NULL and DriverBindingHandle != NULL. + // Return information on all the controller handles that the driver specified by DriverBindingHandle is managing + // + for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { + if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle && (OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) { + (*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE); + if (DriverBindingHandleIndex != -1) { + (*HandleType)[DriverBindingHandleIndex] |= (UINTN)HR_DEVICE_DRIVER; + } + } + if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle && (OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { + (*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE); + if (DriverBindingHandleIndex != -1) { + (*HandleType)[DriverBindingHandleIndex] |= (UINTN)(HR_BUS_DRIVER | HR_DEVICE_DRIVER); + } + for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) { + if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) { + (*HandleType)[ChildIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CHILD_HANDLE); + } + } + } + } + } + if (DriverBindingHandle == NULL && ControllerHandle != NULL) { + if (ControllerHandle == (*HandleBuffer)[HandleIndex]) { + (*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE); + for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { + if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) { + for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) { + if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) { + (*HandleType)[ChildIndex] |= (UINTN)HR_DEVICE_DRIVER; + } + } + } + if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { + for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) { + if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) { + (*HandleType)[ChildIndex] |= (UINTN)(HR_BUS_DRIVER | HR_DEVICE_DRIVER); + } + if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) { + (*HandleType)[ChildIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CHILD_HANDLE); + } + } + } + } + } else { + for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { + if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { + if (OpenInfo[OpenInfoIndex].ControllerHandle == ControllerHandle) { + (*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_PARENT_HANDLE); + } + } + } + } + } + if (DriverBindingHandle != NULL && ControllerHandle != NULL) { + if (ControllerHandle == (*HandleBuffer)[HandleIndex]) { + (*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE); + for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { + if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) { + if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle) { + if (DriverBindingHandleIndex != -1) { + (*HandleType)[DriverBindingHandleIndex] |= (UINTN)HR_DEVICE_DRIVER; + } + } + } + if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { + if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle) { + for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) { + if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) { + (*HandleType)[ChildIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_CHILD_HANDLE); + } + } + } + + for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) { + if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) { + (*HandleType)[ChildIndex] |= (UINTN)(HR_BUS_DRIVER | HR_DEVICE_DRIVER); + } + } + } + } + } else { + for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { + if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { + if (OpenInfo[OpenInfoIndex].ControllerHandle == ControllerHandle) { + (*HandleType)[HandleIndex] |= (UINTN)(HR_DEVICE_HANDLE | HR_PARENT_HANDLE); + } + } + } + } + } + FreePool (OpenInfo); + } + FreePool (ProtocolGuidArray); + } + return EFI_SUCCESS; +} + +/** + Gets all the related EFI_HANDLEs based on the single EFI_HANDLE and the mask + supplied. + + This function will scan all EFI_HANDLES in the UEFI environment's handle database + and return all the ones with the specified relationship (Mask) to the specified + controller handle. + + If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT. + If MatchingHandleCount is NULL, then ASSERT. + + If MatchingHandleBuffer is not NULL upon a sucessful return the memory must be + caller freed. + + @param[in] DriverBindingHandle Handle to a object with Driver Binding protocol + on it. + @param[in] ControllerHandle Handle to a device with Device Path protocol on it. + @param[in] Mask Mask of what relationship(s) is desired. + @param[in] MatchingHandleCount Poitner to UINTN specifying number of HANDLES in + MatchingHandleBuffer. + @param[out] MatchingHandleBuffer On a sucessful return a buffer of MatchingHandleCount + EFI_HANDLEs and a terminating NULL EFI_HANDLE. + + @retval EFI_SUCCESS The operation was sucessful and any related handles + are in MatchingHandleBuffer; + @retval EFI_NOT_FOUND No matching handles were found. + @retval EFI_INVALID_PARAMETER A parameter was invalid or out of range. +**/ +EFI_STATUS +EFIAPI +ParseHandleDatabaseByRelationship ( + IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL, + IN CONST EFI_HANDLE ControllerHandle OPTIONAL, + IN CONST UINTN Mask, + IN UINTN *MatchingHandleCount, + OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL + ) +{ + EFI_STATUS Status; + UINTN HandleCount; + EFI_HANDLE *HandleBuffer; + UINTN *HandleType; + UINTN HandleIndex; + + ASSERT(MatchingHandleCount != NULL); + ASSERT(DriverBindingHandle != NULL || ControllerHandle != NULL); + + if ((Mask & HR_VALID_MASK) != Mask) { + return (EFI_INVALID_PARAMETER); + } + + if ((Mask & HR_CHILD_HANDLE) != 0 && DriverBindingHandle == NULL) { + return (EFI_INVALID_PARAMETER); + } + + *MatchingHandleCount = 0; + if (MatchingHandleBuffer != NULL) { + *MatchingHandleBuffer = NULL; + } + + HandleBuffer = NULL; + HandleType = NULL; + + Status = ParseHandleDatabaseByRelationshipWithType ( + DriverBindingHandle, + ControllerHandle, + &HandleCount, + &HandleBuffer, + &HandleType + ); + if (!EFI_ERROR (Status)) { + // + // Count the number of handles that match the attributes in Mask + // + for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { + if ((HandleType[HandleIndex] & Mask) == Mask) { + (*MatchingHandleCount)++; + } + } + // + // If no handles match the attributes in Mask then return EFI_NOT_FOUND + // + if (*MatchingHandleCount == 0) { + Status = EFI_NOT_FOUND; + } else { + + if (MatchingHandleBuffer == NULL) { + // + // Someone just wanted the count... + // + Status = EFI_SUCCESS; + } else { + // + // Allocate a handle buffer for the number of handles that matched the attributes in Mask + // + *MatchingHandleBuffer = AllocateZeroPool ((*MatchingHandleCount +1)* sizeof (EFI_HANDLE)); + if (*MatchingHandleBuffer == NULL) { + Status = EFI_OUT_OF_RESOURCES; + } else { + for (HandleIndex = 0, *MatchingHandleCount = 0 + ; HandleIndex < HandleCount + ; HandleIndex++ + ) { + // + // Fill the allocated buffer with the handles that matched the attributes in Mask + // + if ((HandleType[HandleIndex] & Mask) == Mask) { + (*MatchingHandleBuffer)[(*MatchingHandleCount)++] = HandleBuffer[HandleIndex]; + } + } + + // + // Make the last one NULL + // + (*MatchingHandleBuffer)[*MatchingHandleCount] = NULL; + + Status = EFI_SUCCESS; + } // *MatchingHandleBuffer == NULL (ELSE) + } // MacthingHandleBuffer == NULL (ELSE) + } // *MatchingHandleCount == 0 (ELSE) + } // no error on ParseHandleDatabaseByRelationshipWithType + + if (HandleBuffer != NULL) { + FreePool (HandleBuffer); + } + + if (HandleType != NULL) { + FreePool (HandleType); + } + + ASSERT ((MatchingHandleBuffer == NULL) || + (*MatchingHandleCount == 0 && *MatchingHandleBuffer == NULL) || + (*MatchingHandleCount != 0 && *MatchingHandleBuffer != NULL)); + return Status; +} + +/** + Gets handles for any child controllers of the passed in controller. + + @param[in] ControllerHandle The handle of the "parent controller" + @param[out] MatchingHandleCount Pointer to the number of handles in + MatchingHandleBuffer on return. + @param[out] MatchingHandleBuffer Buffer containing handles on a successful + return. + + + @retval EFI_SUCCESS The operation was sucessful. +**/ +EFI_STATUS +EFIAPI +ParseHandleDatabaseForChildControllers( + IN CONST EFI_HANDLE ControllerHandle, + OUT UINTN *MatchingHandleCount, + OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL + ) +{ + EFI_STATUS Status; + UINTN HandleIndex; + UINTN DriverBindingHandleCount; + EFI_HANDLE *DriverBindingHandleBuffer; + UINTN DriverBindingHandleIndex; + UINTN ChildControllerHandleCount; + EFI_HANDLE *ChildControllerHandleBuffer; + UINTN ChildControllerHandleIndex; + EFI_HANDLE *HandleBufferForReturn; + + if (MatchingHandleCount == NULL) { + return (EFI_INVALID_PARAMETER); + } + *MatchingHandleCount = 0; + + Status = PARSE_HANDLE_DATABASE_UEFI_DRIVERS ( + ControllerHandle, + &DriverBindingHandleCount, + &DriverBindingHandleBuffer + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Get a buffer big enough for all the controllers. + // + HandleBufferForReturn = GetHandleListByProtocol(NULL); + if (HandleBufferForReturn == NULL) { + FreePool (DriverBindingHandleBuffer); + return (EFI_NOT_FOUND); + } + + for (DriverBindingHandleIndex = 0; DriverBindingHandleIndex < DriverBindingHandleCount; DriverBindingHandleIndex++) { + Status = PARSE_HANDLE_DATABASE_MANAGED_CHILDREN ( + DriverBindingHandleBuffer[DriverBindingHandleIndex], + ControllerHandle, + &ChildControllerHandleCount, + &ChildControllerHandleBuffer + ); + if (EFI_ERROR (Status)) { + continue; + } + + for (ChildControllerHandleIndex = 0; + ChildControllerHandleIndex < ChildControllerHandleCount; + ChildControllerHandleIndex++ + ) { + for (HandleIndex = 0; HandleIndex < *MatchingHandleCount; HandleIndex++) { + if (HandleBufferForReturn[HandleIndex] == ChildControllerHandleBuffer[ChildControllerHandleIndex]) { + break; + } + } + if (HandleIndex >= *MatchingHandleCount) { + HandleBufferForReturn[(*MatchingHandleCount)++] = ChildControllerHandleBuffer[ChildControllerHandleIndex]; + } + } + + FreePool (ChildControllerHandleBuffer); + } + + FreePool (DriverBindingHandleBuffer); + + if (MatchingHandleBuffer == NULL || *MatchingHandleCount == 0) { + // + // The caller is not interested in the actual handles, or we've found none. + // + FreePool (HandleBufferForReturn); + HandleBufferForReturn = NULL; + } + + if (MatchingHandleBuffer != NULL) { + *MatchingHandleBuffer = HandleBufferForReturn; + } + + ASSERT ((MatchingHandleBuffer == NULL) || + (*MatchingHandleCount == 0 && *MatchingHandleBuffer == NULL) || + (*MatchingHandleCount != 0 && *MatchingHandleBuffer != NULL)); + + return (EFI_SUCCESS); +} + +/** + Appends 1 buffer to another buffer. This will re-allocate the destination buffer + if necessary to fit all of the data. + + If DestinationBuffer is NULL, then ASSERT(). + + @param[in, out] DestinationBuffer The pointer to the pointer to the buffer to append onto. + @param[in, out] DestinationSize The pointer to the size of DestinationBuffer. + @param[in] SourceBuffer The pointer to the buffer to append onto DestinationBuffer. + @param[in] SourceSize The number of bytes of SourceBuffer to append. + + @retval NULL A memory allocation failed. + @retval NULL A parameter was invalid. + @return A pointer to (*DestinationBuffer). +**/ +VOID* +BuffernCatGrow ( + IN OUT VOID **DestinationBuffer, + IN OUT UINTN *DestinationSize, + IN VOID *SourceBuffer, + IN UINTN SourceSize + ) +{ + UINTN LocalDestinationSize; + UINTN LocalDestinationFinalSize; + + ASSERT(DestinationBuffer != NULL); + + if (SourceSize == 0 || SourceBuffer == NULL) { + return (*DestinationBuffer); + } + + if (DestinationSize == NULL) { + LocalDestinationSize = 0; + } else { + LocalDestinationSize = *DestinationSize; + } + + LocalDestinationFinalSize = LocalDestinationSize + SourceSize; + + if (DestinationSize != NULL) { + *DestinationSize = LocalDestinationSize; + } + + if (LocalDestinationSize == 0) { + // allcoate + *DestinationBuffer = AllocateZeroPool(LocalDestinationFinalSize); + } else { + // reallocate + *DestinationBuffer = ReallocatePool(LocalDestinationSize, LocalDestinationFinalSize, *DestinationBuffer); + } + + ASSERT(*DestinationBuffer != NULL); + + // copy + return (CopyMem(((UINT8*)(*DestinationBuffer)) + LocalDestinationSize, SourceBuffer, SourceSize)); +} + +/** + Gets handles for any child devices produced by the passed in driver. + + @param[in] DriverHandle The handle of the driver. + @param[in] MatchingHandleCount Pointer to the number of handles in + MatchingHandleBuffer on return. + @param[out] MatchingHandleBuffer Buffer containing handles on a successful + return. + @retval EFI_SUCCESS The operation was sucessful. + @sa ParseHandleDatabaseByRelationship +**/ +EFI_STATUS +EFIAPI +ParseHandleDatabaseForChildDevices( + IN CONST EFI_HANDLE DriverHandle, + IN UINTN *MatchingHandleCount, + OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL + ) +{ + EFI_HANDLE *Buffer; + EFI_HANDLE *Buffer2; + UINTN Count1; + UINTN Count2; + UINTN HandleIndex; + EFI_STATUS Status; + UINTN HandleBufferSize; + + ASSERT(MatchingHandleCount != NULL); + + HandleBufferSize = 0; + Buffer = NULL; + Buffer2 = NULL; + *MatchingHandleCount = 0; + + Status = PARSE_HANDLE_DATABASE_DEVICES ( + DriverHandle, + &Count1, + &Buffer + ); + if (!EFI_ERROR (Status)) { + for (HandleIndex = 0; HandleIndex < Count1; HandleIndex++) { + // + // now find the children + // + Status = PARSE_HANDLE_DATABASE_MANAGED_CHILDREN ( + DriverHandle, + Buffer[HandleIndex], + &Count2, + &Buffer2 + ); + if (EFI_ERROR(Status)) { + break; + } + // + // save out required and optional data elements + // + *MatchingHandleCount += Count2; + if (MatchingHandleBuffer != NULL) { + *MatchingHandleBuffer = BuffernCatGrow((VOID**)MatchingHandleBuffer, &HandleBufferSize, Buffer2, Count2 * sizeof(Buffer2[0])); + } + + // + // free the memory + // + if (Buffer2 != NULL) { + FreePool(Buffer2); + } + } + } + + if (Buffer != NULL) { + FreePool(Buffer); + } + return (Status); +} + +/** + Function to get all handles that support a given protocol or all handles. + + @param[in] ProtocolGuid The guid of the protocol to get handles for. If NULL + then the function will return all handles. + + @retval NULL A memory allocation failed. + @return A NULL terminated list of handles. +**/ +EFI_HANDLE* +EFIAPI +GetHandleListByProtocol ( + IN CONST EFI_GUID *ProtocolGuid OPTIONAL + ) +{ + EFI_HANDLE *HandleList; + UINTN Size; + EFI_STATUS Status; + + Size = 0; + HandleList = NULL; + + // + // We cannot use LocateHandleBuffer since we need that NULL item on the ends of the list! + // + if (ProtocolGuid == NULL) { + Status = gBS->LocateHandle(AllHandles, NULL, NULL, &Size, HandleList); + if (Status == EFI_BUFFER_TOO_SMALL) { + HandleList = AllocateZeroPool(Size + sizeof(EFI_HANDLE)); + if (HandleList == NULL) { + return (NULL); + } + Status = gBS->LocateHandle(AllHandles, NULL, NULL, &Size, HandleList); + HandleList[Size/sizeof(EFI_HANDLE)] = NULL; + } + } else { + Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)ProtocolGuid, NULL, &Size, HandleList); + if (Status == EFI_BUFFER_TOO_SMALL) { + HandleList = AllocateZeroPool(Size + sizeof(EFI_HANDLE)); + if (HandleList == NULL) { + return (NULL); + } + Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)ProtocolGuid, NULL, &Size, HandleList); + HandleList[Size/sizeof(EFI_HANDLE)] = NULL; + } + } + if (EFI_ERROR(Status)) { + if (HandleList != NULL) { + FreePool(HandleList); + } + return (NULL); + } + return (HandleList); +} + +/** + Function to get all handles that support some protocols. + + @param[in] ProtocolGuids A NULL terminated list of protocol GUIDs. + + @retval NULL A memory allocation failed. + @retval NULL ProtocolGuids was NULL. + @return A NULL terminated list of EFI_HANDLEs. +**/ +EFI_HANDLE* +EFIAPI +GetHandleListByProtocolList ( + IN CONST EFI_GUID **ProtocolGuids + ) +{ + EFI_HANDLE *HandleList; + UINTN Size; + UINTN TotalSize; + UINTN TempSize; + EFI_STATUS Status; + CONST EFI_GUID **GuidWalker; + EFI_HANDLE *HandleWalker1; + EFI_HANDLE *HandleWalker2; + + Size = 0; + HandleList = NULL; + TotalSize = sizeof(EFI_HANDLE); + + for (GuidWalker = ProtocolGuids ; GuidWalker != NULL && *GuidWalker != NULL ; GuidWalker++,Size = 0){ + Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)(*GuidWalker), NULL, &Size, NULL); + if (Status == EFI_BUFFER_TOO_SMALL) { + TotalSize += Size; + } + } + + // + // No handles were found... + // + if (TotalSize == sizeof(EFI_HANDLE)) { + return (NULL); + } + + HandleList = AllocateZeroPool(TotalSize); + if (HandleList == NULL) { + return (NULL); + } + + Size = 0; + for (GuidWalker = ProtocolGuids ; GuidWalker != NULL && *GuidWalker != NULL ; GuidWalker++){ + TempSize = TotalSize - Size; + Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)(*GuidWalker), NULL, &TempSize, HandleList+(Size/sizeof(EFI_HANDLE))); + + // + // Allow for missing protocols... Only update the 'used' size upon success. + // + if (!EFI_ERROR(Status)) { + Size += TempSize; + } + } + ASSERT(HandleList[(TotalSize/sizeof(EFI_HANDLE))-1] == NULL); + + for (HandleWalker1 = HandleList ; HandleWalker1 != NULL && *HandleWalker1 != NULL ; HandleWalker1++) { + for (HandleWalker2 = HandleWalker1 + 1; HandleWalker2 != NULL && *HandleWalker2 != NULL ; HandleWalker2++) { + if (*HandleWalker1 == *HandleWalker2) { + // + // copy memory back 1 handle width. + // + CopyMem(HandleWalker2, HandleWalker2 + 1, TotalSize - ((HandleWalker2-HandleList+1)*sizeof(EFI_HANDLE))); + } + } + } + + return (HandleList); +} + +/** + Return all supported GUIDs. + + @param[out] Guids The buffer to return all supported GUIDs. + @param[in, out] Count On input, the count of GUIDs the buffer can hold, + On output, the count of GUIDs to return. + + @retval EFI_INVALID_PARAMETER Count is NULL. + @retval EFI_BUFFER_TOO_SMALL Buffer is not enough to hold all GUIDs. + @retval EFI_SUCCESS GUIDs are returned successfully. +**/ +EFI_STATUS +EFIAPI +GetAllMappingGuids ( + OUT EFI_GUID *Guids, + IN OUT UINTN *Count + ) +{ + UINTN GuidCount; + UINTN NtGuidCount; + UINTN Index; + + if (Count == NULL) { + return EFI_INVALID_PARAMETER; + } + + NtGuidCount = 0; + if (PcdGetBool (PcdShellIncludeNtGuids)) { + NtGuidCount = ARRAY_SIZE (mGuidStringListNT) - 1; + } + GuidCount = ARRAY_SIZE (mGuidStringList) - 1; + + if (*Count < NtGuidCount + GuidCount + mGuidListCount) { + *Count = NtGuidCount + GuidCount + mGuidListCount; + return EFI_BUFFER_TOO_SMALL; + } + + for (Index = 0; Index < NtGuidCount; Index++) { + CopyGuid (&Guids[Index], mGuidStringListNT[Index].GuidId); + } + + for (Index = 0; Index < GuidCount; Index++) { + CopyGuid (&Guids[NtGuidCount + Index], mGuidStringList[Index].GuidId); + } + + for (Index = 0; Index < mGuidListCount; Index++) { + CopyGuid (&Guids[NtGuidCount + GuidCount + Index], mGuidList[Index].GuidId); + } + + return EFI_SUCCESS; +} diff --git a/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h new file mode 100644 index 000000000..d91857b8b --- /dev/null +++ b/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h @@ -0,0 +1,294 @@ +/** @file + Provides interface to advanced shell functionality for parsing both handle and protocol database. + + Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+ (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_ +#define _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1 1 +#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2 2 + +/// +/// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec < 2.4a +/// +typedef struct { + /// + /// A unique number identifying the firmware image within the device. The number is + /// between 1 and DescriptorCount. + /// + UINT8 ImageIndex; + /// + /// A unique number identifying the firmware image type. + /// + EFI_GUID ImageTypeId; + /// + /// A unique number identifying the firmware image. + /// + UINT64 ImageId; + /// + /// A pointer to a null-terminated string representing the firmware image name. + /// + CHAR16 *ImageIdName; + /// + /// Identifies the version of the device firmware. The format is vendor specific and new + /// version must have a greater value than an old version. + /// + UINT32 Version; + /// + /// A pointer to a null-terminated string representing the firmware image version name. + /// + CHAR16 *VersionName; + /// + /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid. + /// + UINTN Size; + /// + /// Image attributes that are supported by this device. See 'Image Attribute Definitions' + /// for possible returned values of this parameter. A value of 1 indicates the attribute is + /// supported and the current setting value is indicated in AttributesSetting. A + /// value of 0 indicates the attribute is not supported and the current setting value in + /// AttributesSetting is meaningless. + /// + UINT64 AttributesSupported; + /// + /// Image attributes. See 'Image Attribute Definitions' for possible returned values of + /// this parameter. + /// + UINT64 AttributesSetting; + /// + /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned + /// values of this parameter. + /// + UINT64 Compatibilities; +} EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1; + + +/// +/// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec > 2.4a and < 2.5 +/// +typedef struct { + /// + /// A unique number identifying the firmware image within the device. The number is + /// between 1 and DescriptorCount. + /// + UINT8 ImageIndex; + /// + /// A unique number identifying the firmware image type. + /// + EFI_GUID ImageTypeId; + /// + /// A unique number identifying the firmware image. + /// + UINT64 ImageId; + /// + /// A pointer to a null-terminated string representing the firmware image name. + /// + CHAR16 *ImageIdName; + /// + /// Identifies the version of the device firmware. The format is vendor specific and new + /// version must have a greater value than an old version. + /// + UINT32 Version; + /// + /// A pointer to a null-terminated string representing the firmware image version name. + /// + CHAR16 *VersionName; + /// + /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid. + /// + UINTN Size; + /// + /// Image attributes that are supported by this device. See 'Image Attribute Definitions' + /// for possible returned values of this parameter. A value of 1 indicates the attribute is + /// supported and the current setting value is indicated in AttributesSetting. A + /// value of 0 indicates the attribute is not supported and the current setting value in + /// AttributesSetting is meaningless. + /// + UINT64 AttributesSupported; + /// + /// Image attributes. See 'Image Attribute Definitions' for possible returned values of + /// this parameter. + /// + UINT64 AttributesSetting; + /// + /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned + /// values of this parameter. + /// + UINT64 Compatibilities; + /// + /// Describes the lowest ImageDescriptor version that the device will accept. Only + /// present in version 2 or higher. + UINT32 LowestSupportedImageVersion; +} EFI_FIRMWARE_IMAGE_DESCRIPTOR_V2; + +typedef struct { + LIST_ENTRY Link; + EFI_HANDLE TheHandle; + UINTN TheIndex; +}HANDLE_LIST; + +typedef struct { + HANDLE_LIST List; + UINTN NextIndex; +} HANDLE_INDEX_LIST; + +typedef +CHAR16 * +(EFIAPI *DUMP_PROTOCOL_INFO)( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ); + +typedef struct _GUID_INFO_BLOCK{ + EFI_STRING_ID StringId; + EFI_GUID *GuidId; + DUMP_PROTOCOL_INFO DumpInfo; +} GUID_INFO_BLOCK; + +#endif + diff --git a/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf b/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf new file mode 100644 index 000000000..93b69cd8e --- /dev/null +++ b/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf @@ -0,0 +1,334 @@ +## @file +# Provides interface to advanced shell functionality for parsing both handle and protocol database. +# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+# (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
+# (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION = 0x00010006 + BASE_NAME = UefiHandleParsingLib + FILE_GUID = 3CDC7177-CC2A-4678-BA8F-1A936A093FA4 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = HandleParsingLib|UEFI_APPLICATION UEFI_DRIVER DXE_RUNTIME_DRIVER + CONSTRUCTOR = HandleParsingLibConstructor + DESTRUCTOR = HandleParsingLibDestructor + +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources.common] + UefiHandleParsingLib.c + UefiHandleParsingLib.h + UefiHandleParsingLib.uni + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + ShellPkg/ShellPkg.dec + +[LibraryClasses] + UefiBootServicesTableLib + MemoryAllocationLib + DevicePathLib + BaseLib + BaseMemoryLib + DebugLib + FileHandleLib + PrintLib + UefiLib + HiiLib + SortLib + PeCoffGetEntryPointLib + +[Protocols] + gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES + + # shell 2.0 + gEfiShellProtocolGuid ## SOMETIMES_CONSUMES + gEfiShellParametersProtocolGuid ## SOMETIMES_CONSUMES + + # 'old' shell + gEfiShellEnvironment2Guid ## SOMETIMES_CONSUMES + gEfiShellInterfaceGuid ## SOMETIMES_CONSUMES + + gEfiUnicodeCollation2ProtocolGuid ## UNDEFINED + gEfiDevicePathToTextProtocolGuid ## UNDEFINED + gEfiBusSpecificDriverOverrideProtocolGuid ## UNDEFINED + gEfiDevicePathUtilitiesProtocolGuid ## UNDEFINED + gEfiDevicePathFromTextProtocolGuid ## UNDEFINED + gEfiPlatformDriverOverrideProtocolGuid ## UNDEFINED + gEfiSimpleTextInProtocolGuid ## UNDEFINED + gEfiPlatformToDriverConfigurationProtocolGuid ## UNDEFINED + gEfiDriverSupportedEfiVersionProtocolGuid ## UNDEFINED + gEfiLoadedImageProtocolGuid ## CONSUMES + gEfiDevicePathProtocolGuid ## CONSUMES + gEfiLoadedImageDevicePathProtocolGuid ## UNDEFINED + gEfiSimpleTextOutProtocolGuid ## UNDEFINED + gEfiSimplePointerProtocolGuid ## UNDEFINED + gEfiAbsolutePointerProtocolGuid ## UNDEFINED + gEfiSerialIoProtocolGuid ## UNDEFINED + gEfiEdidDiscoveredProtocolGuid ## UNDEFINED + gEfiEdidActiveProtocolGuid ## UNDEFINED + gEfiEdidOverrideProtocolGuid ## UNDEFINED + gEfiLoadFileProtocolGuid ## UNDEFINED + gEfiLoadFile2ProtocolGuid ## UNDEFINED + gEfiTapeIoProtocolGuid ## UNDEFINED + gEfiDiskIoProtocolGuid ## UNDEFINED + gEfiBlockIoProtocolGuid ## UNDEFINED + gEfiUnicodeCollationProtocolGuid ## UNDEFINED + gEfiPciRootBridgeIoProtocolGuid ## UNDEFINED + gEfiPciIoProtocolGuid ## UNDEFINED + gEfiScsiPassThruProtocolGuid ## UNDEFINED + gEfiScsiIoProtocolGuid ## UNDEFINED + gEfiExtScsiPassThruProtocolGuid ## UNDEFINED + gEfiIScsiInitiatorNameProtocolGuid ## UNDEFINED + gEfiUsbIoProtocolGuid ## UNDEFINED + gEfiUsbHcProtocolGuid ## UNDEFINED + gEfiUsb2HcProtocolGuid ## UNDEFINED + gEfiDebugSupportProtocolGuid ## UNDEFINED + gEfiDebugPortProtocolGuid ## UNDEFINED + gEfiDecompressProtocolGuid ## UNDEFINED + gEfiAcpiTableProtocolGuid ## UNDEFINED + gEfiEbcProtocolGuid ## UNDEFINED + gEfiSimpleNetworkProtocolGuid ## UNDEFINED + gEfiNetworkInterfaceIdentifierProtocolGuid ## UNDEFINED + gEfiNetworkInterfaceIdentifierProtocolGuid_31 ## UNDEFINED + gEfiPxeBaseCodeProtocolGuid ## UNDEFINED + gEfiPxeBaseCodeCallbackProtocolGuid ## UNDEFINED + gEfiBisProtocolGuid ## UNDEFINED + gEfiManagedNetworkServiceBindingProtocolGuid ## UNDEFINED + gEfiManagedNetworkProtocolGuid ## UNDEFINED + gEfiArpServiceBindingProtocolGuid ## UNDEFINED + gEfiArpProtocolGuid ## UNDEFINED + gEfiDhcp4ServiceBindingProtocolGuid ## UNDEFINED + gEfiDhcp4ProtocolGuid ## UNDEFINED + gEfiTcp4ServiceBindingProtocolGuid ## UNDEFINED + gEfiTcp4ProtocolGuid ## UNDEFINED + gEfiIp4ServiceBindingProtocolGuid ## UNDEFINED + gEfiIp4ProtocolGuid ## UNDEFINED + gEfiIp4ConfigProtocolGuid ## UNDEFINED + gEfiIp4Config2ProtocolGuid ## UNDEFINED + gEfiUdp4ServiceBindingProtocolGuid ## UNDEFINED + gEfiUdp4ProtocolGuid ## UNDEFINED + gEfiMtftp4ServiceBindingProtocolGuid ## UNDEFINED + gEfiMtftp4ProtocolGuid ## UNDEFINED + gEfiAuthenticationInfoProtocolGuid ## UNDEFINED + gEfiHashServiceBindingProtocolGuid ## UNDEFINED + gEfiHashProtocolGuid ## UNDEFINED + gEfiHiiFontProtocolGuid ## UNDEFINED + gEfiHiiStringProtocolGuid ## UNDEFINED + gEfiHiiImageProtocolGuid ## UNDEFINED + gEfiHiiConfigRoutingProtocolGuid ## UNDEFINED + gEfiHiiConfigAccessProtocolGuid ## UNDEFINED + gEfiFormBrowser2ProtocolGuid ## UNDEFINED + gEfiDeviceIoProtocolGuid ## UNDEFINED + gEfiUgaDrawProtocolGuid ## UNDEFINED + gEfiUgaIoProtocolGuid ## UNDEFINED + gEfiDriverConfigurationProtocolGuid ## UNDEFINED + gEfiDriverConfiguration2ProtocolGuid ## UNDEFINED + gEfiSimpleTextInputExProtocolGuid ## UNDEFINED + gEfiIp6ServiceBindingProtocolGuid ## UNDEFINED + gEfiIp6ProtocolGuid ## UNDEFINED + gEfiIp6ConfigProtocolGuid ## UNDEFINED + gEfiMtftp6ServiceBindingProtocolGuid ## UNDEFINED + gEfiMtftp6ProtocolGuid ## UNDEFINED + gEfiDhcp6ServiceBindingProtocolGuid ## UNDEFINED + gEfiDhcp6ProtocolGuid ## UNDEFINED + gEfiUdp6ServiceBindingProtocolGuid ## UNDEFINED + gEfiUdp6ProtocolGuid ## UNDEFINED + gEfiTcp6ServiceBindingProtocolGuid ## UNDEFINED + gEfiTcp6ProtocolGuid ## UNDEFINED + gEfiVlanConfigProtocolGuid ## UNDEFINED + gEfiEapProtocolGuid ## UNDEFINED + gEfiEapManagementProtocolGuid ## UNDEFINED + gEfiFtp4ServiceBindingProtocolGuid ## UNDEFINED + gEfiFtp4ProtocolGuid ## UNDEFINED + gEfiIpSecConfigProtocolGuid ## UNDEFINED + gEfiDriverHealthProtocolGuid ## UNDEFINED + gEfiDeferredImageLoadProtocolGuid ## UNDEFINED + gEfiUserCredentialProtocolGuid ## UNDEFINED + gEfiUserManagerProtocolGuid ## UNDEFINED + gEfiAtaPassThruProtocolGuid ## UNDEFINED + gEfiFirmwareManagementProtocolGuid ## UNDEFINED + gEfiIpSecProtocolGuid ## UNDEFINED + gEfiIpSec2ProtocolGuid ## UNDEFINED + gEfiKmsProtocolGuid ## UNDEFINED + gEfiBlockIo2ProtocolGuid ## UNDEFINED + gEfiStorageSecurityCommandProtocolGuid ## UNDEFINED + gEfiUserCredential2ProtocolGuid ## UNDEFINED + gPcdProtocolGuid ## UNDEFINED + gEfiTcgProtocolGuid ## UNDEFINED + gEfiHiiPackageListProtocolGuid ## UNDEFINED + gEfiDriverFamilyOverrideProtocolGuid ## UNDEFINED + gEfiIdeControllerInitProtocolGuid ## UNDEFINED + gEfiDiskIo2ProtocolGuid ## UNDEFINED + gEfiAdapterInformationProtocolGuid ## UNDEFINED + gEfiShellDynamicCommandProtocolGuid ## UNDEFINED + gEfiDiskInfoProtocolGuid ## UNDEFINED + gGetPcdInfoProtocolGuid ## UNDEFINED + gEfiBdsArchProtocolGuid ## UNDEFINED + gEfiCpuArchProtocolGuid ## UNDEFINED + gEfiMetronomeArchProtocolGuid ## UNDEFINED + gEfiMonotonicCounterArchProtocolGuid ## UNDEFINED + gEfiRealTimeClockArchProtocolGuid ## UNDEFINED + gEfiResetArchProtocolGuid ## UNDEFINED + gEfiRuntimeArchProtocolGuid ## UNDEFINED + gEfiSecurityArchProtocolGuid ## UNDEFINED + gEfiTimerArchProtocolGuid ## UNDEFINED + gEfiVariableWriteArchProtocolGuid ## UNDEFINED + gEfiVariableArchProtocolGuid ## UNDEFINED + gEfiSecurityPolicyProtocolGuid ## UNDEFINED + gEfiWatchdogTimerArchProtocolGuid ## UNDEFINED + gEfiStatusCodeRuntimeProtocolGuid ## UNDEFINED + gEfiSmbusHcProtocolGuid ## UNDEFINED + gEfiFirmwareVolume2ProtocolGuid ## UNDEFINED + gEfiFirmwareVolumeBlockProtocolGuid ## UNDEFINED + gEfiCapsuleArchProtocolGuid ## UNDEFINED + gEfiMpServiceProtocolGuid ## UNDEFINED + gEfiPciHostBridgeResourceAllocationProtocolGuid ## UNDEFINED + gEfiPciPlatformProtocolGuid ## UNDEFINED + gEfiPciOverrideProtocolGuid ## UNDEFINED + gEfiPciEnumerationCompleteProtocolGuid ## UNDEFINED + gEfiIncompatiblePciDeviceSupportProtocolGuid ## UNDEFINED + gEfiPciHotPlugInitProtocolGuid ## UNDEFINED + gEfiPciHotPlugRequestProtocolGuid ## UNDEFINED + gEfiSmbiosProtocolGuid ## UNDEFINED + gEfiS3SaveStateProtocolGuid ## UNDEFINED + gEfiS3SmmSaveStateProtocolGuid ## UNDEFINED + gEfiRscHandlerProtocolGuid ## UNDEFINED + gEfiSmmRscHandlerProtocolGuid ## UNDEFINED + gEfiAcpiSdtProtocolGuid ## UNDEFINED + gEfiSioProtocolGuid ## UNDEFINED + gEfiSmmCpuIo2ProtocolGuid ## UNDEFINED + gEfiSmmBase2ProtocolGuid ## UNDEFINED + gEfiSmmAccess2ProtocolGuid ## UNDEFINED + gEfiSmmControl2ProtocolGuid ## UNDEFINED + gEfiSmmConfigurationProtocolGuid ## UNDEFINED + gEfiSmmReadyToLockProtocolGuid ## UNDEFINED + gEfiDxeSmmReadyToLockProtocolGuid ## UNDEFINED + gEfiSmmCommunicationProtocolGuid ## UNDEFINED + gEfiSmmStatusCodeProtocolGuid ## UNDEFINED + gEfiSmmCpuProtocolGuid ## UNDEFINED + gEfiSmmPciRootBridgeIoProtocolGuid ## UNDEFINED + gEfiSmmSwDispatch2ProtocolGuid ## UNDEFINED + gEfiSmmSxDispatch2ProtocolGuid ## UNDEFINED + gEfiSmmPeriodicTimerDispatch2ProtocolGuid ## UNDEFINED + gEfiSmmUsbDispatch2ProtocolGuid ## UNDEFINED + gEfiSmmGpiDispatch2ProtocolGuid ## UNDEFINED + gEfiSmmStandbyButtonDispatch2ProtocolGuid ## UNDEFINED + gEfiSmmPowerButtonDispatch2ProtocolGuid ## UNDEFINED + gEfiSmmIoTrapDispatch2ProtocolGuid ## UNDEFINED + gEfiPcdProtocolGuid ## UNDEFINED + gEfiFirmwareVolumeBlock2ProtocolGuid ## UNDEFINED + gEfiCpuIo2ProtocolGuid ## UNDEFINED + gEfiLegacyRegion2ProtocolGuid ## UNDEFINED + gEfiSecurity2ArchProtocolGuid ## UNDEFINED + gEfiSmmEndOfDxeProtocolGuid ## UNDEFINED + gEfiIsaHcProtocolGuid ## UNDEFINED + gEfiIsaHcServiceBindingProtocolGuid ## UNDEFINED + gEfiSioControlProtocolGuid ## UNDEFINED + gEfiGetPcdInfoProtocolGuid ## UNDEFINED + gEfiI2cMasterProtocolGuid ## UNDEFINED + gEfiI2cIoProtocolGuid ## UNDEFINED + gEfiI2cEnumerateProtocolGuid ## UNDEFINED + gEfiI2cHostProtocolGuid ## UNDEFINED + gEfiI2cBusConfigurationManagementProtocolGuid ## UNDEFINED + gEfiTcg2ProtocolGuid ## UNDEFINED + gEfiTimestampProtocolGuid ## UNDEFINED + gEfiRngProtocolGuid ## UNDEFINED + gEfiNvmExpressPassThruProtocolGuid ## UNDEFINED + gEfiHash2ServiceBindingProtocolGuid ## UNDEFINED + gEfiHash2ProtocolGuid ## UNDEFINED + gEfiBlockIoCryptoProtocolGuid ## UNDEFINED + gEfiSmartCardReaderProtocolGuid ## UNDEFINED + gEfiSmartCardEdgeProtocolGuid ## UNDEFINED + gEfiUsbFunctionIoProtocolGuid ## UNDEFINED + gEfiBluetoothHcProtocolGuid ## UNDEFINED + gEfiBluetoothIoServiceBindingProtocolGuid ## UNDEFINED + gEfiBluetoothIoProtocolGuid ## UNDEFINED + gEfiBluetoothConfigProtocolGuid ## UNDEFINED + gEfiRegularExpressionProtocolGuid ## UNDEFINED + gEfiBootManagerPolicyProtocolGuid ## UNDEFINED + gEfiConfigKeywordHandlerProtocolGuid ## UNDEFINED + gEfiWiFiProtocolGuid ## UNDEFINED + gEfiEapManagement2ProtocolGuid ## UNDEFINED + gEfiEapConfigurationProtocolGuid ## UNDEFINED + gEfiPkcs7VerifyProtocolGuid ## UNDEFINED + gEfiDns4ServiceBindingProtocolGuid ## UNDEFINED + gEfiDns4ProtocolGuid ## UNDEFINED + gEfiDns6ServiceBindingProtocolGuid ## UNDEFINED + gEfiDns6ProtocolGuid ## UNDEFINED + gEfiHttpServiceBindingProtocolGuid ## UNDEFINED + gEfiHttpProtocolGuid ## UNDEFINED + gEfiHttpUtilitiesProtocolGuid ## UNDEFINED + gEfiRestProtocolGuid ## UNDEFINED + gEfiMmEndOfDxeProtocolGuid ## UNDEFINED + gEfiMmIoTrapDispatchProtocolGuid ## UNDEFINED + gEfiMmPowerButtonDispatchProtocolGuid ## UNDEFINED + gEfiMmStandbyButtonDispatchProtocolGuid ## UNDEFINED + gEfiMmGpiDispatchProtocolGuid ## UNDEFINED + gEfiMmUsbDispatchProtocolGuid ## UNDEFINED + gEfiMmPeriodicTimerDispatchProtocolGuid ## UNDEFINED + gEfiMmSxDispatchProtocolGuid ## UNDEFINED + gEfiMmSwDispatchProtocolGuid ## UNDEFINED + gEfiMmPciRootBridgeIoProtocolGuid ## UNDEFINED + gEfiMmCpuProtocolGuid ## UNDEFINED + gEfiMmStatusCodeProtocolGuid ## UNDEFINED + gEfiDxeMmReadyToLockProtocolGuid ## UNDEFINED + gEfiMmConfigurationProtocolGuid ## UNDEFINED + gEfiMmReadyToLockProtocolGuid ## UNDEFINED + gEfiMmControlProtocolGuid ## UNDEFINED + gEfiMmAccessProtocolGuid ## UNDEFINED + gEfiMmBaseProtocolGuid ## UNDEFINED + gEfiMmCpuIoProtocolGuid ## UNDEFINED + gEfiMmRscHandlerProtocolGuid ## UNDEFINED + gEfiMmCommunicationProtocolGuid ## UNDEFINED + gEfiTlsServiceBindingProtocolGuid ## UNDEFINED + gEfiTlsProtocolGuid ## UNDEFINED + gEfiTlsConfigurationProtocolGuid ## UNDEFINED + gEfiSupplicantServiceBindingProtocolGuid ## UNDEFINED + gEfiSupplicantProtocolGuid ## UNDEFINED + gEfiWiFi2ProtocolGuid ## UNDEFINED + gEfiRamDiskProtocolGuid ## UNDEFINED + gEfiHiiImageDecoderProtocolGuid ## UNDEFINED + gEfiHiiImageExProtocolGuid ## UNDEFINED + gEfiSdMmcPassThruProtocolGuid ## UNDEFINED + gEfiEraseBlockProtocolGuid ## UNDEFINED + gEfiBluetoothAttributeProtocolGuid ## UNDEFINED + gEfiBluetoothAttributeServiceBindingProtocolGuid ## UNDEFINED + gEfiBluetoothLeConfigProtocolGuid ## UNDEFINED + gEfiUfsDeviceConfigProtocolGuid ## UNDEFINED + gEfiHttpBootCallbackProtocolGuid ## UNDEFINED + gEfiResetNotificationProtocolGuid ## UNDEFINED + gEfiPartitionInfoProtocolGuid ## UNDEFINED + gEfiHiiPopupProtocolGuid ## UNDEFINED + +[Guids] + gEfiFileInfoGuid ## UNDEFINED + gEfiShellEnvironment2ExtGuid ## SOMETIMES_CONSUMES ## GUID + gEfiPcAnsiGuid ## UNDEFINED + gEfiVT100Guid ## UNDEFINED + gEfiVT100PlusGuid ## UNDEFINED + gEfiVTUTF8Guid ## UNDEFINED + gEfiStandardErrorDeviceGuid ## UNDEFINED + gEfiConsoleInDeviceGuid ## UNDEFINED + gEfiConsoleOutDeviceGuid ## UNDEFINED + gEfiFileSystemInfoGuid ## UNDEFINED + gEfiGlobalVariableGuid ## UNDEFINED + gEfiPartTypeSystemPartGuid ## UNDEFINED + gEfiPartTypeLegacyMbrGuid ## UNDEFINED + gHandleParsingHiiGuid ## UNDEFINED + gEfiAdapterInfoMediaStateGuid ## SOMETIMES_CONSUMES ## GUID + gEfiAdapterInfoNetworkBootGuid ## SOMETIMES_CONSUMES ## GUID + gEfiAdapterInfoSanMacAddressGuid ## SOMETIMES_CONSUMES ## GUID + gEfiAdapterInfoUndiIpv6SupportGuid ## SOMETIMES_CONSUMES ## GUID + +[Pcd.common] + gEfiShellPkgTokenSpaceGuid.PcdShellIncludeNtGuids ## CONSUMES diff --git a/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni new file mode 100644 index 000000000..9c8028d0d --- /dev/null +++ b/roms/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni @@ -0,0 +1,506 @@ +// /** +// +// Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+// (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
+// (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
+// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// Module Name: +// +// UefiHandleParsingLib.uni +// +// Abstract: +// +// +// +// **/ + +/=# + +#langdef en-US "english" + +// +// Protocol names used making the GUID <-> Name bi-directional list +// + +// basics Images & Device Path +#string STR_LOADED_IMAGE #language en-US "LoadedImage" +#string STR_DEVICE_PATH #language en-US "DevicePath" +#string STR_IMAGE_PATH #language en-US "ImageDevicePath" +#string STR_DEVICE_PATH_UTIL #language en-US "DevicePathUtilities" +#string STR_DEVICE_PATH_TXT #language en-US "DevicePathToText" +#string STR_DEVICE_PATH_FTXT #language en-US "DevicePathFromText" +#string STR_DEVICE_PATH_PC #language en-US "DevicePathPCAnsi" +#string STR_DEVICE_PATH_VT100 #language en-US "DevicePathVT100" +#string STR_DEVICE_PATH_VT100P #language en-US "DevicePathVT100+" +#string STR_DEVICE_PATH_VTUTF8 #language en-US "DevicePathVTUTF8" + +// Drivers +#string STR_DRIVER_BINDING #language en-US "DriverBinding" +#string STR_PLATFORM_OVERRIDE #language en-US "PlatformOverride" +#string STR_BUS_OVERRIDE #language en-US "BusSpecificDriverOverride" +#string STR_DRIVER_DIAG #language en-US "DriverDiagnostics" +#string STR_DRIVER_DIAG2 #language en-US "DriverDiagnostics2" +#string STR_DRIVER_CN #language en-US "ComponentName" +#string STR_DRIVER_CN2 #language en-US "ComponentName2" +#string STR_PLAT_DRV_CFG #language en-US "PlatformtoDriverConfiguration" +#string STR_DRIVER_VERSION #language en-US "SupportedEfiSpecVersion" + +// Console +#string STR_TXT_IN #language en-US "SimpleTextIn" +#string STR_TXT_IN_EX #language en-US "SimpleTextInEx" +#string STR_TXT_OUT #language en-US "SimpleTextOut" +#string STR_SIM_POINTER #language en-US "SimplePointer" +#string STR_ABS_POINTER #language en-US "AbsolutePointer" +#string STR_SERIAL_IO #language en-US "SerialIO" +#string STR_GRAPHICS_OUTPUT #language en-US "GraphicsOutput" +#string STR_EDID_DISCOVERED #language en-US "EDIDDiscovered" +#string STR_EDID_ACTIVE #language en-US "EDIDActive" +#string STR_EDID_OVERRIDE #language en-US "EDIDOverride" +#string STR_CON_IN #language en-US "ConsoleIn" +#string STR_CON_OUT #language en-US "ConsoleOut" +#string STR_STD_ERR #language en-US "StdErr" + +// Media +#string STR_LOAD_FILE #language en-US "LoadFile" +#string STR_LOAD_FILE2 #language en-US "LoadFile2" +#string STR_SIMPLE_FILE_SYS #language en-US "SimpleFileSystem" +#string STR_FILE_INFO #language en-US "FileInfo" +#string STR_FILE_SYS_INFO #language en-US "FileSystemInfo" +#string STR_TAPE_IO #language en-US "TapeIO" +#string STR_DISK_IO #language en-US "DiskIO" +#string STR_DISK_IO2 #language en-US "DiskIO2" +#string STR_BLK_IO #language en-US "BlockIO" +#string STR_UC #language en-US "UnicodeCollation" +#string STR_UC2 #language en-US "UnicodeCollation2" +#string STR_ADAPTER_INFO #language en-US "AdapterInfo" + +// PCI +#string STR_PCIRB_IO #language en-US "PCIRootBridgeIO" +#string STR_PCI_IO #language en-US "PCIIO" + +// SCSI +#string STR_SCSI_PT #language en-US "SCSIPassThru" +#string STR_SCSI_IO #language en-US "SCSIIO" +#string STR_SCSI_PT_EXT #language en-US "ExtendedSCSIPassThru" + +// iSCSI +#string STR_ISCSI #language en-US "iSCSIInitiatorName" + +// USB +#string STR_USB_IO #language en-US "USBIO" +#string STR_USB_HC #language en-US "USBHostControler" +#string STR_USB_HC2 #language en-US "USBHostController2" + +// Debug +#string STR_DEBUG_SUPPORT #language en-US "DebugSupport" +#string STR_DEBUG_PORT #language en-US "DebugPort" + +#string STR_DECOMPRESS #language en-US "Decompress" + +#string STR_ACPI_TABLE #language en-US "AcpiTable" + +#string STR_EBC_INTERPRETER #language en-US "EBCInterpreter" + +// Network +#string STR_SNP #language en-US "SimpleNetwork" +#string STR_NII #language en-US "NetworkInterfaceIdentifier" +#string STR_NII_31 #language en-US "NetworkInterfaceIdentifier31" +#string STR_PXE_BC #language en-US "PXEBaseCode" +#string STR_PXE_CB #language en-US "PXECallback" +#string STR_BIS #language en-US "BIS" +#string STR_MNP_SB #language en-US "ManagedNetworkServiceBinding" +#string STR_MNP #language en-US "ManagedNetwork" + +#string STR_ARP_SB #language en-US "ARPServiceBinding" +#string STR_ARP #language en-US "ARP" +#string STR_DHCPV4_SB #language en-US "DHCPv4ServiceBinding" +#string STR_DHCPV4 #language en-US "DHCPv4" +#string STR_TCPV4_SB #language en-US "TCPv4ServiceBinding" +#string STR_TCPV4 #language en-US "TCPv4" +#string STR_IPV4_SB #language en-US "IPv4ServiceBinding" +#string STR_IPV4 #language en-US "IPv4" +#string STR_IPV4_CFG #language en-US "IPv4Config" +#string STR_IPV4_CFG2 #language en-US "IPv4Config2" +#string STR_UDPV4_SB #language en-US "UDPv4ServiceBinding" +#string STR_UDPV4 #language en-US "UDPv4" +#string STR_MTFTPV4_SB #language en-US "MTFTPv4ServiceBinding" +#string STR_MTFTPV4 #language en-US "MTFTPv4" + +// Security +#string STR_HASH_SB #language en-US "HashServiceBinding" +#string STR_HASH #language en-US "Hash" +#string STR_AUTH_INFO #language en-US "AuthenticationInfo" + +// HII +#string STR_HII_FONT #language en-US "HIIFont" +#string STR_HII_STRING #language en-US "HIIString" +#string STR_HII_IMAGE #language en-US "HIIImage" +#string STR_HII_DATABASE #language en-US "HIIDatabase" +#string STR_HII_CONFIG_ROUT #language en-US "HIIConfigRouting" +#string STR_HII_CONFIG_ACC #language en-US "HIIConfigAccess" +#string STR_HII_FORM_BROWSER2 #language en-US "HIIFormBrowser2" + +// Shell +#string STR_SHELL_PARAMETERS #language en-US "ShellParameters" +#string STR_SHELL #language en-US "Shell" +#string STR_SHELL_DYNAMIC #language en-US "ShellDynamicCommand" + +#string STR_EFI_GLOBAL_VARIABLE #language en-US "EFIGlobalVariable" + +// NT32 emulation +#string STR_WINNT_THUNK #language en-US "WinNTThunk" +#string STR_WINNT_DRIVER_IO #language en-US "WinNTDriverIO" +#string STR_WINNT_SERIAL_PORT #language en-US "WinNTSerialPort" + +// deprecated protocols +#string STR_SHELL_INTERFACE #language en-US "ShellInterface" +#string STR_SHELL_ENV #language en-US "ShellEnvironment" +#string STR_SHELL_ENV2 #language en-US "ShellEnvironment2" +#string STR_SHELL_DP_MAP #language en-US "ShellDevicePathMap" +#string STR_SHELL_ALIAS #language en-US "ShellAlias" +#string STR_DEVICE_IO #language en-US "DeviceIO" +#string STR_TCP #language en-US "TCP" +#string STR_UGA_DRAW #language en-US "UGADraw" +#string STR_UGA_IO #language en-US "UGAIO" +#string STR_ESP #language en-US "EFISystemPartition" +#string STR_GPT_NBR #language en-US "LegacyMBR" +#string STR_DRIVER_CONFIG #language en-US "DriverConfiguration" +#string STR_DRIVER_CONFIG2 #language en-US "DriverConfiguration2" +#string STR_ISA_IO #language en-US "ISAIO" +#string STR_ISA_ACPI #language en-US "ISAACPI" +#string STR_HII_FORM_BROWSER #language en-US "HIIFormBrowser" +#string STR_HII #language en-US "HII" +#string STR_HII_FORM_CALLBACK #language en-US "HIICallback" + +#string STR_TXT_OUT_DUMP_HEADER #language en-US " Address: %%H%X%%N Attrib %02x" +#string STR_TXT_OUT_DUMP_LINE #language en-US "\r\n %c mode %d: Col %d Row %d" + +#string STR_DRIVER_FAM_OVERRIDE #language en-US "DriverFamilyOverride" +#string STR_PCD #language en-US "Pcd" +#string STR_TCG #language en-US "Tcg" +#string STR_HII_PACKAGE_LIST #language en-US "HiiPackageList" + +#string STR_IP6_SB #language en-US "Ip6ServiceBinding" +#string STR_IP6 #language en-US "Ip6" +#string STR_IP6_CONFIG #language en-US "Ip6Config" +#string STR_MTFTP6_SB #language en-US "Mtftp6ServiceBinding" +#string STR_MTFTP6 #language en-US "Mtftp6" +#string STR_DHCP6_SB #language en-US "Dhcp6ServiceBinding" +#string STR_DHCP6 #language en-US "Dhcp6" +#string STR_UDP6_SB #language en-US "Udp6ServiceBinding" +#string STR_UDP6 #language en-US "Udp6" +#string STR_TCP6_SB #language en-US "Tcp6ServiceBinding" +#string STR_TCP6 #language en-US "Tcp6" +#string STR_VLAN_CONFIG #language en-US "VlanConfig" +#string STR_EAP #language en-US "Eap" +#string STR_EAP_MGMT #language en-US "EapManagement" +#string STR_FTP4_SB #language en-US "Ftp4ServiceBinding" +#string STR_FTP4 #language en-US "Ftp4" +#string STR_IP_SEC_CONFIG #language en-US "IpSecConfig" +#string STR_DH #language en-US "DriverHealth" +#string STR_DEF_IMG_LOAD #language en-US "DeferredImageLoad" +#string STR_USER_CRED #language en-US "UserCredential" +#string STR_USER_MNGR #language en-US "UserManager" +#string STR_ATA_PASS_THRU #language en-US "AtaPassThru" +#string STR_FW_MGMT #language en-US "FirmwareManagement" +#string STR_IP_SEC #language en-US "IpSec" +#string STR_IP_SEC2 #language en-US "IpSec2" +#string STR_KMS #language en-US "Kms" +#string STR_BLK_IO2 #language en-US "BlockIo2" +#string STR_SSC #language en-US "StorageSecurityCommand" +#string STR_UCRED2 #language en-US "UserCredential2" + +#string STR_PCDINFOPROT #language en-US "GetPcdInfoProtocol" +#string STR_BDS_ARCH #language en-US "BdsArch" +#string STR_CPU_ARCH #language en-US "CpuArch" +#string STR_MET_ARCH #language en-US "MetronomeArch" +#string STR_MON_ARCH #language en-US "MonotonicCounterArch" +#string STR_RTC_ARCH #language en-US "RealTimeClockArch" +#string STR_RESET_ARCH #language en-US "ResetArch" +#string STR_RT_ARCH #language en-US "RuntimeArch" +#string STR_SEC_ARCH #language en-US "SecurityArch" +#string STR_TIMER_ARCH #language en-US "TimerArch" +#string STR_VAR_ARCH #language en-US "VariableWriteArch" +#string STR_V_ARCH #language en-US "VariableArch" +#string STR_SECP #language en-US "SecurityPolicy" +#string STR_WDT_ARCH #language en-US "WatchdogTimerArch" +#string STR_SCR #language en-US "StatusCodeRuntime" +#string STR_SMB_HC #language en-US "SmbusHc" +#string STR_FV_2 #language en-US "FirmwareVolume2" +#string STR_FV_BLOCK #language en-US "FirmwareVolumeBlock" +#string STR_CAP_ARCH #language en-US "CapsuleArch" +#string STR_MP_SERVICE #language en-US "MpService" +#string STR_HBRAP #language en-US "PciHostBridgeResourceAllocation" +#string STR_PCIP #language en-US "PciPlatform" +#string STR_PCIO #language en-US "PciOverride" +#string STR_PCIE #language en-US "PciEnumerationComplete" +#string STR_IPCID #language en-US "IncompatiblePciDeviceSupport" +#string STR_PCIHPI #language en-US "PciHotPlugInit" +#string STR_PCIHPR #language en-US "PciHotPlugRequest" +#string STR_SMBIOS #language en-US "Smbios" +#string STR_S3_SAVE #language en-US "S3SaveState" +#string STR_S3_S_SMM #language en-US "S3SmmSaveState" +#string STR_RSC #language en-US "RscHandler" +#string STR_S_RSC #language en-US "SmmRscHandler" +#string STR_ACPI_SDT #language en-US "AcpiSdt" +#string STR_SIO #language en-US "Sio" +#string STR_S_CPU2 #language en-US "SmmCpuIo2" +#string STR_S_BASE2 #language en-US "SmmBase2" +#string STR_S_ACC_2 #language en-US "SmmAccess2" +#string STR_S_CON_2 #language en-US "SmmControl2" +#string STR_S_CONFIG #language en-US "SmmConfig" +#string STR_S_RTL #language en-US "SmmReadyToLock" +#string STR_DS_RTL #language en-US "DxeSmmReadyToLock" +#string STR_S_COMM #language en-US "SmmCommunication" +#string STR_S_STAT #language en-US "SmmStatusCode" +#string STR_S_CPU #language en-US "SmmCpu" +#string STR_S_PCIRBIO #language en-US "SmmPCIRootBridgeIO" +#string STR_S_SWD #language en-US "SmmSwDispatch2" +#string STR_S_SXD #language en-US "SmmSxDispatch2" +#string STR_S_PTD2 #language en-US "SmmPeriodicTimerDispatch2" +#string STR_S_UD2 #language en-US "SmmUsbDispatch2" +#string STR_S_GD2 #language en-US "SmmGpiDispatch2" +#string STR_S_SBD2 #language en-US "SmmStandbyButtonDispatch2" +#string STR_S_PBD2 #language en-US "SmmPowerButtonDispatch2" +#string STR_S_ITD2 #language en-US "SmmIoTrapDispatch2" +#string STR_PCD #language en-US "Pcd" +#string STR_FVB2 #language en-US "FirmwareVolumeBlock2" +#string STR_CPUIO2 #language en-US "CpuIo2" +#string STR_LEGACY_R2 #language en-US "LegacyRegion2" +#string STR_S2ARCH #language en-US "Security2Arch" +#string STR_EODXE #language en-US "SmmEndOfDxe" +#string STR_ISAHC #language en-US "IsaHc" +#string STR_ISAHC_B #language en-US "IsaHcServiceBinding" +#string STR_SIO_C #language en-US "SioControl" +#string STR_GET_PCD #language en-US "GetPcdInfo" +#string STR_I2C_M #language en-US "I2cMaster" +#string STR_I2CIO #language en-US "I2cIo" +#string STR_I2CEN #language en-US "I2cEnumerate" +#string STR_I2C_H #language en-US "I2cHost" +#string STR_I2C_BCM #language en-US "I2cBusConfigurationManagement" +#string STR_TCG2 #language en-US "Tcg2" +#string STR_TIMESTAMP #language en-US "Timestamp" +#string STR_RNG #language en-US "Rng" +#string STR_NVMEPT #language en-US "NvmExpressPassThru" +#string STR_H2_SB #language en-US "Hash2ServiceBinding" +#string STR_HASH2 #language en-US "Hash2" +#string STR_BIO_C #language en-US "BlockIoCrypto" +#string STR_SCR #language en-US "SmartCardReader" +#string STR_SCE #language en-US "SmartCardEdge" +#string STR_USB_FIO #language en-US "UsbFunctionIo" +#string STR_BC_HC #language en-US "BluetoothHc" +#string STR_BC_IO_SB #language en-US "BluetoothIoServiceBinding" +#string STR_BC_IO #language en-US "BluetoothIo" +#string STR_BC_C #language en-US "BluetoothConfig" +#string STR_REG_EXP #language en-US "RegularExpression" +#string STR_B_MGR_P #language en-US "BootManagerPolicy" +#string STR_CKH #language en-US "ConfigKeywordHandler" +#string STR_WIFI #language en-US "WiFi" +#string STR_EAP_M #language en-US "EapManagement2" +#string STR_EAP_C #language en-US "EapConfiguration" +#string STR_PKCS7 #language en-US "Pkcs7Verify" +#string STR_NET_DNS4_SB #language en-US "Dns4ServiceBinding" +#string STR_NET_DNS4 #language en-US "Dns4" +#string STR_NET_DNS6_SB #language en-US "Dns6ServiceBinding" +#string STR_NET_DNS6 #language en-US "Dns6" +#string STR_NET_HTTP_SB #language en-US "HttpServiceBinding" +#string STR_NET_HTTP #language en-US "Http" +#string STR_NET_HTTP_U #language en-US "HttpUtilities" +#string STR_REST #language en-US "Rest" + +#string STR_MM_EOD #language en-US "MmEndOfDxe" +#string STR_MM_ITD #language en-US "MmIoTrapDispatch" +#string STR_MM_PBD #language en-US "MmPowerButtonDispatch" +#string STR_MM_SBD #language en-US "MmStandbyButtonDispatch" +#string STR_MM_GD #language en-US "MmGpiDispatch" +#string STR_MM_UD #language en-US "MmUsbDispatch" +#string STR_MM_PTD #language en-US "MmPeriodicTimerDispatch" +#string STR_MM_SXD #language en-US "MmSxDispatch" +#string STR_MM_SWD #language en-US "MmSwDispatch" +#string STR_MM_PRBI #language en-US "MmPciRootBridgeIo" +#string STR_MM_CPU #language en-US "MmCpu" +#string STR_MM_STACODE #language en-US "MmStatusCode" +#string STR_DXEMM_RTL #language en-US "DxeMmReadyToLock" +#string STR_MM_CONFIG #language en-US "MmConfiguration" +#string STR_MM_RTL #language en-US "MmReadyToLock" +#string STR_MM_CONTROL #language en-US "MmControl" +#string STR_MM_ACCESS #language en-US "MmAccess" +#string STR_MM_BASE #language en-US "MmBase" +#string STR_MM_CPUIO #language en-US "MmCpuIo" +#string STR_MM_RH #language en-US "MmRscHandler" +#string STR_MM_COM #language en-US "MmCommunication" + +#string STR_TLS_SB #language en-US "TlsServiceBinding" +#string STR_TLS #language en-US "Tls" +#string STR_TLS_CONFIG #language en-US "TlsConfiguration" +#string STR_SUPPLICANT_SB #language en-US "SupplicantServiceBinding" +#string STR_SUPPLICANT #language en-US "Supplicant" + +#string STR_WIFI2 #language en-US "WiFi2" +#string STR_RAMDISK #language en-US "RamDisk" +#string STR_HII_ID #language en-US "HiiImageDecoder" +#string STR_HII_IE #language en-US "HiiImageEx" +#string STR_SD_MPT #language en-US "SdMmcPassThru" +#string STR_ERASE_BLOCK #language en-US "EraseBlock" + +#string STR_BLUETOOTH_ATTR #language en-US "BluetoothAttribute" +#string STR_BLUETOOTH_ATTR_SB #language en-US "BluetoothAttributeServiceBinding" +#string STR_BLUETOOTH_LE_CONFIG #language en-US "BluetoothLeConfig" +#string STR_UFS_DEV_CONFIG #language en-US "UfsDeviceConfig" +#string STR_HTTP_BOOT_CALL #language en-US "HttpBootCallback" +#string STR_RESET_NOTI #language en-US "ResetNotification" +#string STR_PARTITION_INFO #language en-US "PartitionInfo" +#string STR_HII_POPUP #language en-US "HiiPopup" + +#string STR_IDE_CONT_INIT #language en-US "IdeControllerInit" +#string STR_DISK_INFO #language en-US "DiskInfo" +#string STR_BLOCKIO_INFO #language en-US " %s%sMId:%%H%x%%N bsize %%H%x%%N, lblock %lx (%,ld), %s %s %s" +#string STR_DEBUGSUPPORT_INFO #language en-US " Isa = %s" +#string STR_DEBUGSUPPORT_UNKNOWN #language en-US " Unknown (%%H%s%%N)" + +#string STR_PCIRB_DUMP_PH #language en-US " ParentHandle..: %%H%x%%N\r\n" +#string STR_PCIRB_DUMP_SEG #language en-US " Segment #.....: %%H%x%%N\r\n" +#string STR_PCIRB_DUMP_ATT #language en-US " Attributes....: %%H%x%%N\r\n" +#string STR_PCIRB_DUMP_SUPPORTS #language en-US " Supports......: %%H%x%%N\r\n" +#string STR_PCIRB_DUMP_BUS #language en-US " BUS : " +#string STR_PCIRB_DUMP_MEM #language en-US " MEM : " +#string STR_PCIRB_DUMP_IO #language en-US " IO : " +#string STR_PCIRB_DUMP_TITLE #language en-US " Type Flag Base Limit Gran\r\n" + " ==== ==== ================ ================ ====" +#string STR_PCIIO_DUMP_MAIN #language en-US " Segment #.....: %02x\r\n" + " Bus #.........: %02x\r\n" + " Device #......: %02x\r\n" + " Function #....: %02x\r\n" + " ROM Size......: %lx\r\n" + " ROM Location..: %08x\r\n" + " Vendor ID.....: %04x\r\n" + " Device ID.....: %04x\r\n" + " Class Code....: %02x %02x %02x\r\n" + " Configuration Header :" +#string STR_USBIO_DUMP_MAIN #language en-US " Interface Number #.....: %02x\r\n" + " Interface Class #......: %02x\r\n" + " Interface Subclass #...: %02x\r\n" + " Interface Protocol #...: %02x" + +#string STR_LI_DUMP_NAME #language en-US " Name..........: %%H%s%%N\r\n" + +#string STR_LI_DUMP_MAIN #language en-US " Revision......: %%H0x%08x%%N\r\n" + " ParentHandle..: %%H%x%%N\r\n" + " SystemTable...: %%H%x%%N\r\n" + " DeviceHandle..: %%H%x%%N\r\n" + " FilePath......: %%H%s%%N\r\n" + " PdbFileName...: %%H%a%%N\r\n" + " OptionsSize...: %%H%x%%N\r\n" + " LoadOptions...: %%H%x%%N\r\n" + " ImageBase.....: %%H%x%%N\r\n" + " ImageSize.....: %%H%Lx%%N\r\n" + " CodeType......: %%H%s%%N\r\n" + " DataType......: %%H%s%%N\r\n" + " Unload........: %%H%x%%N" + +#string STR_GOP_DUMP_MAIN #language en-US " Max Mode..............: %%H0x%08x%%N\r\n" + " Current Mode..........: %%H0x%08x%%N\r\n" + " Frame Buffer Base.....: %%H0x%L016x%%N\r\n" + " Frame Buffer Size.....: %%H0x%L016x%%N\r\n" + " Mode Info Size........: %%H0x%L016x%%N\r\n" + " Information\r\n" + " Version.............: %%H0x%08x%%N\r\n" + " HorizontalResolution: %%H%d%%N\r\n" + " VerticalResolution..: %%H%d%%N\r\n" + " Pixel Format........: %%H%s%%N\r\n" + " Pixels / Scan Line..: %%H%d%%N\r\n" + " Pixel Info\r\n" + " RedMask...........: %%H0x%08x%%N\r\n" + " GreenMask.........: %%H0x%08x%%N\r\n" + " BlueMask..........: %%H0x%08x%%N\r\n" + +#string STR_GOP_RES_LIST_MAIN #language en-US " Supported Resolution List" +#string STR_GOP_RES_LIST_ENTRY #language en-US "\r\n" + " Resolution[%%H%d%%N]:\r\n" + " Horizontal........: %%H%d%%N\r\n" + " Vertical..........: %%H%d%%N" +#string STR_BSDO_DUMP_MAIN #language en-US " Drv[%02x] File:%%H%s%%N" +#string STR_EDID_DISCOVERED_MAIN #language en-US " EDID Discovered Size : %%H0x%08x%%N\r\n" +#string STR_EDID_DISCOVERED_DATA #language en-US " EDID Discovered Data :\r\n" +#string STR_EDID_ACTIVE_MAIN #language en-US " EDID Active Size : %%H0x%08x%%N\r\n" +#string STR_EDID_ACTIVE_DATA #language en-US " EDID Active Data :\r\n" + +#string STR_GET_SUPP_TYPES_FAILED #language en-US "Unable to get supported types - %%H%r%%N\r\n" +#string STR_SUPP_TYPE_HEADER #language en-US " Supported Information Types: \r\n" +#string STR_GUID_NUMBER #language en-US " Guid[%%H%d%%N] : %g" +#string STR_GUID_STRING #language en-US " - %%B%s%%N\r\n" +#string STR_GETINFO_FAILED #language en-US " Unable to get information - %%H%r%%N\r\n" +#string STR_MEDIA_STATE #language en-US " MediaState: %%H0x%08x - %r%%N\r\n" +#string STR_NETWORK_BOOT_INFO #language en-US "" + " iSsciIpv4BootCapablity : %%H%d%%N\r\n" + " iScsiIpv6BootCapablity : %%H%d%%N\r\n" + " FCoeBootCapablity : %%H%d%%N\r\n" + " OffloadCapability : %%H%d%%N\r\n" + " iScsiMpioCapability : %%H%d%%N\r\n" + " iScsiIpv4Boot : %%H%d%%N\r\n" + " iScsiIpv6Boot : %%H%d%%N\r\n" + " FCoeBoot : %%H%d%%N\r\n" +#string STR_SAN_MAC_ADDRESS_INFO #language en-US " SanMacAddress: %%H%02x-%02x-%02x-%02x-%02x-%02x%%N \r\n" +#string STR_UNDI_IPV6_INFO #language en-US " UNDI IPv6 Supported: %%H%d%%N \r\n" +#string STR_UNKNOWN_INFO_TYPE #language en-US " The 'InformationType' - %%H%g%%N can't be recongnized\r\n" + +#string STR_FMP_IMAGEID_NON_UNIQUE #language en-US " The ImageId value for each Firmware Image is not unique.\r\n" +#string STR_FMP_IMAGE_INFO_SIZE #language en-US " ImageInfoSize: %%H0x%L016x%%N\r\n" +#string STR_FMP_DESCRIPTOR_VERSION #language en-US " DescriptorVersion: %%H%d%%N\r\n" +#string STR_FMP_DESCRIPTOR_COUNT #language en-US " DescriptorCount : %%H%d%%N\r\n" +#string STR_FMP_DESCRIPTOR_SIZE #language en-US " DescriptorSize : %%H0x%Lx%%N\r\n" +#string STR_FMP_PACKAGE_VERSION #language en-US " PackageVersion : %%H0x%08x%%N\r\n" +#string STR_FMP_PACKAGE_VERSION_NAME #language en-US " PackageVersionName : %%H%s%%N\r\n" +#string STR_FMP_IMAGE_DESCRIPTOR_INFO #language en-US "" + " ImageInfo[%%H%d%%N]:\r\n" + " =============\r\n" + " ImageIndex : %%H%d%%N\r\n" + " ImageTypeId : %%H%g%%N\r\n" + " ImageId : %%H%L016x%%N\r\n" + " ImageIdName : %%H%s%%N\r\n" + " Version : %%H0x%08x%%N\r\n" + " VersionName : %%H%s%%N\r\n" + " Size : %%H0x%L016x%%N\r\n" + " AttributesSupported : %%H0x%L016x%%N\r\n" + " AttributesSetting : %%H%s%%N\r\n" + " Compatibilities : %%H0x%L016x%%N\r\n" + " LowestSupportedImageVersion : %%H0x%08x%%N\r\n" + " LastAttemptVersion : %%H0x%08x%%N\r\n" + " LastAttemptStatus : %%H0x%08x%%N\r\n" + " HardwareInstance : %%H0x%08x%%N\r\n" + +#string STR_FMP_IMAGE_DESCRIPTOR_INFO_V1 #language en-US "" + " ImageInfo[%%H%d%%N]:\r\n" + " =============\r\n" + " ImageIndex : %%H%d%%N\r\n" + " ImageTypeId : %%H%g%%N\r\n" + " ImageId : %%H%L016x%%N\r\n" + " ImageIdName : %%H%s%%N\r\n" + " Version : %%H0x%08x%%N\r\n" + " VersionName : %%H%s%%N\r\n" + " Size : %%H0x%L016x%%N\r\n" + " AttributesSupported : %%H0x%L016x%%N\r\n" + " AttributesSetting : %%H%s%%N\r\n" + " Compatibilities : %%H0x%L016x%%N\r\n" + +#string STR_FMP_IMAGE_DESCRIPTOR_INFO_V2 #language en-US "" + " ImageInfo[%%H%d%%N]:\r\n" + " =============\r\n" + " ImageIndex : %%H%d%%N\r\n" + " ImageTypeId : %%H%g%%N\r\n" + " ImageId : %%H%L016x%%N\r\n" + " ImageIdName : %%H%s%%N\r\n" + " Version : %%H0x%08x%%N\r\n" + " VersionName : %%H%s%%N\r\n" + " Size : %%H0x%L016x%%N\r\n" + " AttributesSupported : %%H0x%L016x%%N\r\n" + " AttributesSetting : %%H%s%%N\r\n" + " Compatibilities : %%H0x%L016x%%N\r\n" + " LowestSupportedImageVersion : %%H0x%08x%%N\r\n" + +#string STR_PARTINFO_DUMP_TYPE_OTHER #language en-US " Partition Type : Other" +#string STR_PARTINFO_DUMP_TYPE_MBR #language en-US " Partition Type : MBR" +#string STR_PARTINFO_DUMP_TYPE_GPT #language en-US " Partition Type : GPT" +#string STR_PARTINFO_DUMP_EFI_SYS_PART #language en-US " EFI System Partition : Yes" +#string STR_PARTINFO_DUMP_NOT_EFI_SYS_PART #language en-US " EFI System Partition : No" -- cgit 1.2.3-korg