VirtualBox

Changeset 42740 in vbox for trunk/src


Ignore:
Timestamp:
Aug 10, 2012 6:59:20 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79955
Message:

EFI: Debug lib missed functions.

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  
    2424
    2525#include "VBoxDebugLib.h"
     26#include <Protocol/DevicePath.h>
     27#include <Protocol/DevicePathToText.h>
     28#include <Uefi/UefiSpec.h>
     29#include <Library/UefiBootServicesTableLib.h>
    2630#include "DevEFI.h"
    2731
     32static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *g_DevPath2Txt;
    2833
    2934
     
    8186}
    8287
     88CHAR16* 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
     103CHAR16* 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}
     126CHAR16* 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
    83141
    84142VOID * EFIAPI
  • trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.inf

    r28800 r42740  
    4545        PrintLib
    4646
     47[Protocols]
     48    gEfiDevicePathToTextProtocolGuid
     49
    4750[Guids]
    4851        # none
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette