Copyright (C) 2012, Red Hat, Inc.\r
Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r
Copyright (C) 2013, ARM Ltd.\r
+ Copyright (C) 2017, AMD Inc, All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
VirtioPciGetDeviceStatus, // GetDeviceStatus\r
VirtioPciSetDeviceStatus, // SetDeviceStatus\r
VirtioPciDeviceWrite, // WriteDevice\r
- VirtioPciDeviceRead // ReadDevice\r
+ VirtioPciDeviceRead, // ReadDevice\r
+ VirtioPciAllocateSharedPages, // AllocateSharedPages\r
+ VirtioPciFreeSharedPages, // FreeSharedPages\r
+ VirtioPciMapSharedBuffer, // MapSharedBuffer\r
+ VirtioPciUnmapSharedBuffer, // UnmapSharedBuffer\r
};\r
\r
/**\r
Internal definitions for the VirtIo PCI Device driver\r
\r
Copyright (C) 2013, ARM Ltd\r
+ Copyright (c) 2017, AMD Inc, All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
IN UINT8 DeviceStatus\r
);\r
\r
+EFI_STATUS\r
+EFIAPI\r
+VirtioPciAllocateSharedPages (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN UINTN NumPages,\r
+ OUT VOID **HostAddress\r
+ );\r
+\r
+VOID\r
+EFIAPI\r
+VirtioPciFreeSharedPages (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN UINTN NumPages,\r
+ IN VOID *HostAddress\r
+ );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VirtioPciMapSharedBuffer (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN VIRTIO_MAP_OPERATION Operation,\r
+ IN VOID *HostAddress,\r
+ IN OUT UINTN *NumberOfBytes,\r
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r
+ OUT VOID **Mapping\r
+ );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VirtioPciUnmapSharedBuffer (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN VOID *Mapping\r
+ );\r
#endif // _VIRTIO_PCI_DEVICE_DXE_H_\r
Copyright (C) 2012, Red Hat, Inc.\r
Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
Copyright (C) 2013, ARM Ltd.\r
+ Copyright (C) 2017, AMD Inc, All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_DEVICE_STATUS,\r
sizeof (UINT8), DeviceStatus);\r
}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VirtioPciAllocateSharedPages (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN UINTN NumPages,\r
+ OUT VOID **HostAddress\r
+ )\r
+{\r
+ VOID *Buffer;\r
+\r
+ Buffer = AllocatePages (NumPages);\r
+ if (Buffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ *HostAddress = Buffer;\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+VOID\r
+EFIAPI\r
+VirtioPciFreeSharedPages (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN UINTN NumPages,\r
+ IN VOID *HostAddress\r
+ )\r
+{\r
+ FreePages (HostAddress, NumPages);\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VirtioPciMapSharedBuffer (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN VIRTIO_MAP_OPERATION Operation,\r
+ IN VOID *HostAddress,\r
+ IN OUT UINTN *NumberOfBytes,\r
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r
+ OUT VOID **Mapping\r
+ )\r
+{\r
+ *DeviceAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress;\r
+ *Mapping = NULL;\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+VirtioPciUnmapSharedBuffer (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN VOID *Mapping\r
+ )\r
+{\r
+ return EFI_SUCCESS;\r
+}\r