33InitializeVirtioFdtDxe (
47 Status =
gBS->LocateProtocol (
48 &gFdtClientProtocolGuid,
54 for (FindNodeStatus = FdtClient->FindCompatibleNode (
59 !EFI_ERROR (FindNodeStatus);
60 FindNodeStatus = FdtClient->FindNextCompatibleNode (
67 Status = FdtClient->GetNodeProperty (
74 if (EFI_ERROR (Status)) {
77 "%a: GetNodeProperty () failed (Status == %r)\n",
84 ASSERT (RegSize == 16);
95 if (DevicePath ==
NULL) {
96 DEBUG ((DEBUG_ERROR,
"%a: Out of memory\n", __func__));
100 CopyGuid (&DevicePath->Vendor.
Guid, &gVirtioMmioTransportGuid);
101 DevicePath->PhysBase = RegBase;
104 sizeof (*DevicePath) -
sizeof (DevicePath->End)
109 Status =
gBS->InstallProtocolInterface (
111 &gEfiDevicePathProtocolGuid,
115 if (EFI_ERROR (Status)) {
118 "%a: Failed to install the EFI_DEVICE_PATH "
119 "protocol on a new handle (Status == %r)\n",
128 if (EFI_ERROR (Status)) {
131 "%a: Failed to install VirtIO transport @ 0x%Lx "
132 "on handle %p (Status == %r)\n",
139 Status =
gBS->UninstallProtocolInterface (
141 &gEfiDevicePathProtocolGuid,
150 if (EFI_ERROR (FindNodeStatus) && (FindNodeStatus != EFI_NOT_FOUND)) {
153 "%a: Error occurred while iterating DT nodes "
154 "(FindNodeStatus == %r)\n",
UINT64 EFIAPI SwapBytes64(IN UINT64 Value)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
#define HARDWARE_DEVICE_PATH
UINT16 EFIAPI SetDevicePathNodeLength(IN OUT VOID *Node, IN UINTN Length)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI CreateDeviceNode(IN UINT8 NodeType, IN UINT8 NodeSubType, IN UINT16 NodeLength)
VOID EFIAPI SetDevicePathEndNode(OUT VOID *Node)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
EFI_STATUS VirtioMmioInstallDevice(IN PHYSICAL_ADDRESS BaseAddress, IN EFI_HANDLE Handle)