/** @file\r
Provides interface to advanced shell functionality for parsing both handle and protocol database.\r
\r
- Copyright (c) 2013 Hewlett-Packard Development Company, L.P.\r
+ Copyright (c) 2013 - 2014, Hewlett-Packard Development Company, L.P.\r
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
return (RetVal);\r
}\r
\r
+/**\r
+ Function to translate the EFI_GRAPHICS_PIXEL_FORMAT into a string.\r
+\r
+ @param[in] Fmt The format type.\r
+\r
+ @retval A string representation of the type allocated from BS Pool.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+ConvertPixelFormat (\r
+ IN CONST EFI_GRAPHICS_PIXEL_FORMAT Fmt\r
+ )\r
+{\r
+ CHAR16 *RetVal;\r
+ RetVal = NULL;\r
+\r
+ switch (Fmt) {\r
+ case PixelRedGreenBlueReserved8BitPerColor: StrnCatGrow(&RetVal, NULL, L"PixelRedGreenBlueReserved8BitPerColor", 0); break;\r
+ case PixelBlueGreenRedReserved8BitPerColor: StrnCatGrow(&RetVal, NULL, L"PixelBlueGreenRedReserved8BitPerColor", 0); break;\r
+ case PixelBitMask: StrnCatGrow(&RetVal, NULL, L"PixelBitMask", 0); break;\r
+ case PixelBltOnly: StrnCatGrow(&RetVal, NULL, L"PixelBltOnly", 0); break;\r
+ case PixelFormatMax: StrnCatGrow(&RetVal, NULL, L"PixelFormatMax", 0); break;\r
+ default: ASSERT(FALSE);\r
+ }\r
+ return (RetVal);\r
+}\r
+\r
/**\r
Constructor for the library.\r
\r
return RetVal;\r
}\r
\r
+/**\r
+ Function to dump information about GOP.\r
+\r
+ This will allocate the return buffer from boot services pool.\r
+\r
+ @param[in] TheHandle The handle that has LoadedImage installed.\r
+ @param[in] Verbose TRUE for additional information, FALSE otherwise.\r
+\r
+ @retval A poitner to a string containing the information.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+GraphicsOutputProtocolDumpInformation(\r
+ IN CONST EFI_HANDLE TheHandle,\r
+ IN CONST BOOLEAN Verbose\r
+ )\r
+{\r
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r
+ EFI_STATUS Status;\r
+ CHAR16 *RetVal;\r
+ CHAR16 *Temp;\r
+ CHAR16 *Fmt;\r
+\r
+ if (!Verbose) {\r
+ return (CatSPrint(NULL, L"GraphicsOutput"));\r
+ }\r
+\r
+ Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_GOP_DUMP_MAIN), NULL);\r
+ RetVal = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));\r
+ if (Temp == NULL || RetVal == NULL) {\r
+ SHELL_FREE_NON_NULL(Temp);\r
+ SHELL_FREE_NON_NULL(RetVal);\r
+ return NULL;\r
+ }\r
+\r
+ Status = gBS->OpenProtocol (\r
+ TheHandle,\r
+ &gEfiGraphicsOutputProtocolGuid,\r
+ (VOID**)&GraphicsOutput,\r
+ gImageHandle,\r
+ NULL,\r
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+ );\r
+\r
+ if (EFI_ERROR (Status)) {\r
+ SHELL_FREE_NON_NULL (Temp);\r
+ SHELL_FREE_NON_NULL (RetVal);\r
+ return NULL;\r
+ }\r
+\r
+ Fmt = ConvertPixelFormat(GraphicsOutput->Mode->Info->PixelFormat);\r
+\r
+ RetVal = CatSPrint(RetVal,\r
+ Temp,\r
+ GraphicsOutput->Mode->MaxMode,\r
+ GraphicsOutput->Mode->Mode,\r
+ GraphicsOutput->Mode->FrameBufferBase,\r
+ (UINT64)GraphicsOutput->Mode->FrameBufferSize,\r
+ (UINT64)GraphicsOutput->Mode->SizeOfInfo,\r
+ GraphicsOutput->Mode->Info->Version,\r
+ GraphicsOutput->Mode->Info->HorizontalResolution,\r
+ GraphicsOutput->Mode->Info->VerticalResolution,\r
+ Fmt,\r
+ GraphicsOutput->Mode->Info->PixelsPerScanLine,\r
+ GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.RedMask,\r
+ GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.GreenMask,\r
+ GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.BlueMask\r
+ );\r
+ \r
+ SHELL_FREE_NON_NULL(Temp);\r
+ SHELL_FREE_NON_NULL(Fmt);\r
+\r
+ return RetVal;\r
+}\r
+\r
/**\r
Function to dump information about PciRootBridgeIo.\r
\r
{STRING_TOKEN(STR_SIM_POINTER), &gEfiSimplePointerProtocolGuid, NULL},\r
{STRING_TOKEN(STR_ABS_POINTER), &gEfiAbsolutePointerProtocolGuid, NULL},\r
{STRING_TOKEN(STR_SERIAL_IO), &gEfiSerialIoProtocolGuid, NULL},\r
- {STRING_TOKEN(STR_GRAPHICS_OUTPUT), &gEfiGraphicsOutputProtocolGuid, NULL},\r
+ {STRING_TOKEN(STR_GRAPHICS_OUTPUT), &gEfiGraphicsOutputProtocolGuid, GraphicsOutputProtocolDumpInformation},\r
{STRING_TOKEN(STR_EDID_DISCOVERED), &gEfiEdidDiscoveredProtocolGuid, NULL},\r
{STRING_TOKEN(STR_EDID_ACTIVE), &gEfiEdidActiveProtocolGuid, NULL},\r
{STRING_TOKEN(STR_EDID_OVERRIDE), &gEfiEdidOverrideProtocolGuid, NULL},\r
{STRING_TOKEN(STR_IPV4_SB), &gEfiIp4ServiceBindingProtocolGuid, NULL},\r
{STRING_TOKEN(STR_IPV4), &gEfiIp4ProtocolGuid, NULL},\r
{STRING_TOKEN(STR_IPV4_CFG), &gEfiIp4ConfigProtocolGuid, NULL},\r
- {STRING_TOKEN(STR_SHELL_PARAMETERS), &gEfiShellParametersProtocolGuid, NULL},\r
- {STRING_TOKEN(STR_SHELL), &gEfiShellProtocolGuid, NULL},\r
{STRING_TOKEN(STR_UDPV4_SB), &gEfiUdp4ServiceBindingProtocolGuid, NULL},\r
{STRING_TOKEN(STR_UDPV4), &gEfiUdp4ProtocolGuid, NULL},\r
{STRING_TOKEN(STR_MTFTPV4_SB), &gEfiMtftp4ServiceBindingProtocolGuid, NULL},\r
// UEFI 2.4\r
//\r
{STRING_TOKEN(STR_DISK_IO2), &gEfiDiskIo2ProtocolGuid, NULL},\r
+ {STRING_TOKEN(STR_ADAPTER_INFO), &gEfiAdapterInformationProtocolGuid, NULL},\r
\r
//\r
// PI Spec ones\r
//\r
{STRING_TOKEN(STR_IDE_CONT_INIT), &gEfiIdeControllerInitProtocolGuid, NULL},\r
\r
+//\r
+// UEFI Shell Spec 2.0\r
+//\r
+ {STRING_TOKEN(STR_SHELL_PARAMETERS), &gEfiShellParametersProtocolGuid, NULL},\r
+ {STRING_TOKEN(STR_SHELL), &gEfiShellProtocolGuid, NULL},\r
+\r
+//\r
+// UEFI Shell Spec 2.1\r
+//\r
+ {STRING_TOKEN(STR_SHELL_DYNAMIC), &gEfiShellDynamicCommandProtocolGuid, NULL},\r
+\r
//\r
// terminator\r
//\r
/**\r
Function to get the Guid for a protocol or struct based on it's string name.\r
\r
+ do not modify the returned Guid.\r
+\r
@param[in] Name The pointer to the string name.\r
@param[in] Lang The pointer to the language code.\r
- @param[in] Guid The pointer to the Guid.\r
+ @param[out] Guid The pointer to the Guid.\r
\r
@retval EFI_SUCCESS The operation was sucessful.\r
**/\r
GetGuidFromStringName(\r
IN CONST CHAR16 *Name,\r
IN CONST CHAR8 *Lang OPTIONAL,\r
- IN EFI_GUID **Guid\r
+ OUT EFI_GUID **Guid\r
)\r
{\r
CONST GUID_INFO_BLOCK *ListWalker;\r