mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 00:54:06 +02:00
ArmPlatformPkg/EblCmdLib: Add the 'devicepaths' EBL command
This command start alls the available drivers and prints out all the device paths of the platform. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11801 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ea46ebbe6a
commit
6a15908fd6
@ -29,11 +29,13 @@
|
||||
#include <Library/PeCoffGetEntryPointLib.h>
|
||||
#include <Library/PerformanceLib.h>
|
||||
#include <Library/TimerLib.h>
|
||||
#include <Library/BdsLib.h>
|
||||
|
||||
#include <Guid/DebugImageInfoTable.h>
|
||||
|
||||
#include <Protocol/DebugSupport.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/DevicePathToText.h>
|
||||
|
||||
EFI_STATUS
|
||||
EblDumpMmu (
|
||||
@ -183,7 +185,7 @@ ImageHandleToPdbFileName (
|
||||
}
|
||||
|
||||
|
||||
CHAR8 *mTokenList[] = {
|
||||
STATIC CHAR8 *mTokenList[] = {
|
||||
/*"SEC",*/
|
||||
"PEI",
|
||||
"DXE",
|
||||
@ -282,8 +284,7 @@ EblDumpGcd (
|
||||
AsciiPrint (" Address Range Image Device Attributes\n");
|
||||
AsciiPrint ("__________________________________________________________\n");
|
||||
for (i=0; i < NumberOfDescriptors; i++) {
|
||||
//AsciiPrint ("%016lx - %016lx",MemorySpaceMap[i].BaseAddress,MemorySpaceMap[i].BaseAddress+MemorySpaceMap[i].Length);
|
||||
AsciiPrint ("MEM %08lx - %08lx",(UINT64)MemorySpaceMap[i].BaseAddress,MemorySpaceMap[i].BaseAddress+MemorySpaceMap[i].Length-1);
|
||||
AsciiPrint ("MEM %016lx - %016lx",(UINT64)MemorySpaceMap[i].BaseAddress,MemorySpaceMap[i].BaseAddress+MemorySpaceMap[i].Length-1);
|
||||
AsciiPrint (" %08x %08x",MemorySpaceMap[i].ImageHandle,MemorySpaceMap[i].DeviceHandle);
|
||||
|
||||
if (MemorySpaceMap[i].Attributes & EFI_MEMORY_RUNTIME)
|
||||
@ -341,6 +342,43 @@ EblDumpGcd (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EblDevicePaths (
|
||||
IN UINTN Argc,
|
||||
IN CHAR8 **Argv
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN HandleCount;
|
||||
EFI_HANDLE *HandleBuffer;
|
||||
UINTN Index;
|
||||
CHAR16* String;
|
||||
EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol;
|
||||
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol;
|
||||
|
||||
BdsConnectAllDrivers();
|
||||
|
||||
Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
|
||||
if (EFI_ERROR (Status)) {
|
||||
AsciiPrint ("Did not find the DevicePathToTextProtocol.\n");
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiDevicePathProtocolGuid, NULL, &HandleCount, &HandleBuffer);
|
||||
if (EFI_ERROR (Status)) {
|
||||
AsciiPrint ("No device path found\n");
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
for (Index = 0; Index < HandleCount; Index++) {
|
||||
Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID **)&DevicePathProtocol);
|
||||
String = DevicePathToTextProtocol->ConvertDevicePathToText(DevicePathProtocol,TRUE,TRUE);
|
||||
Print (L"[0x%X] %s\n",(UINT32)HandleBuffer[Index], String);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mLibCmdTemplate[] =
|
||||
{
|
||||
{
|
||||
@ -372,6 +410,12 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mLibCmdTemplate[] =
|
||||
" dump MMU Table",
|
||||
NULL,
|
||||
EblDumpMmu
|
||||
},
|
||||
{
|
||||
"devicepaths",
|
||||
" list all the Device Paths",
|
||||
NULL,
|
||||
EblDevicePaths
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/** @file
|
||||
#
|
||||
# Copyright (c) 2010, ARM Ltd. All rights reserved.<BR>
|
||||
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -44,10 +44,12 @@
|
||||
ArmDisassemblerLib
|
||||
PerformanceLib
|
||||
TimerLib
|
||||
BdsLib
|
||||
|
||||
[Protocols]
|
||||
gEfiDebugSupportProtocolGuid
|
||||
gEfiLoadedImageProtocolGuid
|
||||
gEfiDevicePathToTextProtocolGuid
|
||||
|
||||
[Guids]
|
||||
gEfiDebugImageInfoTableGuid
|
||||
|
Loading…
x
Reference in New Issue
Block a user