- Timestamp:
- Aug 10, 2012 6:59:20 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 79955
- Location:
- trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/Library/VBoxDebugLib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.c
r28800 r42740 24 24 25 25 #include "VBoxDebugLib.h" 26 #include <Protocol/DevicePath.h> 27 #include <Protocol/DevicePathToText.h> 28 #include <Uefi/UefiSpec.h> 29 #include <Library/UefiBootServicesTableLib.h> 26 30 #include "DevEFI.h" 27 31 32 static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *g_DevPath2Txt; 28 33 29 34 … … 81 86 } 82 87 88 CHAR16* VBoxDebugDevicePath2Str(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath) 89 { 90 EFI_STATUS rc; 91 if (!g_DevPath2Txt) 92 { 93 rc = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&g_DevPath2Txt); 94 if (EFI_ERROR(rc)) 95 { 96 DEBUG((DEBUG_INFO, "gEfiDevicePathToTextProtocolGuid:%g isn't instantied\n", gEfiDevicePathToTextProtocolGuid)); 97 return NULL; 98 } 99 } 100 return g_DevPath2Txt->ConvertDevicePathToText(pDevicePath, TRUE, FALSE); 101 } 102 103 CHAR16* VBoxDebugHandleDevicePath2Str(IN EFI_HANDLE hHandle) 104 { 105 EFI_STATUS rc; 106 EFI_DEVICE_PATH_PROTOCOL *pDevicePath = NULL; 107 CHAR16 *psz16TxtDevicePath; 108 rc = gBS->OpenProtocol(hHandle, 109 &gEfiDevicePathProtocolGuid, 110 (VOID **)pDevicePath, 111 NULL, 112 hHandle, 113 EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL); 114 if (EFI_ERROR(rc)) 115 { 116 DEBUG((DEBUG_INFO, "%a:%d failed(%r) to open Device Path Protocol for Handle %p\n", 117 __FUNCTION__, 118 __LINE__, 119 rc, 120 hHandle)); 121 return NULL; 122 } 123 psz16TxtDevicePath = VBoxDebugHandleDevicePath2Str(pDevicePath); 124 return psz16TxtDevicePath; 125 } 126 CHAR16* VBoxDebugPrintDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath) 127 { 128 EFI_STATUS rc; 129 if (!g_DevPath2Txt) 130 { 131 rc = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&g_DevPath2Txt); 132 if (EFI_ERROR(rc)) 133 { 134 DEBUG((DEBUG_INFO, "gEfiDevicePathToTextProtocolGuid:%g isn't instantied\n", gEfiDevicePathToTextProtocolGuid)); 135 return NULL; 136 } 137 } 138 return g_DevPath2Txt->ConvertDevicePathToText(pDevicePath, TRUE, FALSE); 139 } 140 83 141 84 142 VOID * EFIAPI -
trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf
r28800 r42740 45 45 PrintLib 46 46 47 [Protocols] 48 gEfiDevicePathToTextProtocolGuid 49 47 50 [Guids] 48 51 # none
Note:
See TracChangeset
for help on using the changeset viewer.