summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2013-10-16 18:29:13 +0100
committerSteven Kinney <steven.kinney@linaro.org>2013-11-13 10:09:15 -0600
commit6a90696e53f829e790a8ab67a8040dfd6707f313 (patch)
treedb1b88b57a583100f8df8ff7f888d09526443e69
parentb3387d8d78f8854256f1c704b75128d88e9cdc75 (diff)
OvmfPkg/Virtio: Removed VirtioReadDevice() / VirtIoWriteDevice() functions
These functions did not provide much more than the new protocol functions VIRTIO_DEVICE_PROTOCOL.ReadDevice() / VIRTIO_DEVICE_PROTOCOL.WriteDevice(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Signed-off-by: Steven Kinney <steven.kinney@linaro.org>
-rw-r--r--OvmfPkg/Include/Library/VirtioLib.h64
-rw-r--r--OvmfPkg/Library/VirtioLib/VirtioLib.c69
-rw-r--r--OvmfPkg/VirtioBlkDxe/VirtioBlk.c24
-rw-r--r--OvmfPkg/VirtioNetDxe/VirtioNet.h22
-rw-r--r--OvmfPkg/VirtioScsiDxe/VirtioScsi.c24
5 files changed, 35 insertions, 168 deletions
diff --git a/OvmfPkg/Include/Library/VirtioLib.h b/OvmfPkg/Include/Library/VirtioLib.h
index 3521fbfc8..e61a5090e 100644
--- a/OvmfPkg/Include/Library/VirtioLib.h
+++ b/OvmfPkg/Include/Library/VirtioLib.h
@@ -21,70 +21,6 @@
#include <IndustryStandard/Virtio.h>
-/**
-
- Write a word into VirtIo Device Specific Region
-
- The VirtIo Device Specific Region must be an iomem region.
- This is an internal function for the driver-specific VIRTIO_CFG_WRITE()
- macros.
-
- @param[in] VirtIo Target Virtio device.
-
- @param[in] FieldOffset Destination offset.
-
- @param[in] FieldSize Destination field size, must be in { 1, 2, 4, 8 }.
-
- @param[in] Value Little endian value to write, converted to UINT64.
- The least significant FieldSize bytes will be used.
-
-
- @return Status code returned by VirtIo->WriteDevice().
-
-**/
-EFI_STATUS
-EFIAPI
-VirtioWriteDevice (
- IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- );
-
-
-/**
-
- Read a word from VirtIo Device Specific Region
-
- The VirtIo Device Specific Region must be an iomem region.
- This is an internal function for the driver-specific VIRTIO_CFG_READ()
- macros.
-
- @param[in] VirtIo Source Virtio device.
-
- @param[in] FieldOffset Source offset.
-
- @param[in] FieldSize Source field size, must be in { 1, 2, 4, 8 }.
-
- @param[in] BufferSize Number of bytes available in the target buffer. Must
- equal FieldSize.
-
- @param[out] Buffer Target buffer.
-
-
- @return Status code returned by VirtIo->ReadDevice().
-
-**/
-EFI_STATUS
-EFIAPI
-VirtioReadDevice (
- IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- );
-
/**
diff --git a/OvmfPkg/Library/VirtioLib/VirtioLib.c b/OvmfPkg/Library/VirtioLib/VirtioLib.c
index 96e527a3d..1550318d8 100644
--- a/OvmfPkg/Library/VirtioLib/VirtioLib.c
+++ b/OvmfPkg/Library/VirtioLib/VirtioLib.c
@@ -26,75 +26,6 @@
/**
- Write a word into Region 0 of the device specified by VirtIo.
-
- Region 0 must be an iomem region. This is an internal function for the
- driver-specific VIRTIO_CFG_WRITE() macros.
-
- @param[in] VirtIo Target VirtIo device.
-
- @param[in] FieldOffset Destination offset.
-
- @param[in] FieldSize Destination field size, must be in { 1, 2, 4, 8 }.
-
- @param[in] Value Little endian value to write, converted to UINT64.
- The least significant FieldSize bytes will be used.
-
-
- @return Status code returned by VirtIo->Io.Write().
-
-**/
-EFI_STATUS
-EFIAPI
-VirtioWriteDevice (
- IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- )
-{
- return VirtIo->WriteDevice (VirtIo, FieldOffset, FieldSize, Value);
-}
-
-
-/**
-
- Read a word from Region 0 of the device specified by VirtIo.
-
- Region 0 must be an iomem region. This is an internal function for the
- driver-specific VIRTIO_CFG_READ() macros.
-
- @param[in] VirtIo Source VirtIo device.
-
- @param[in] FieldOffset Source offset.
-
- @param[in] FieldSize Source field size, must be in { 1, 2, 4, 8 }.
-
- @param[in] BufferSize Number of bytes available in the target buffer. Must
- equal FieldSize.
-
- @param[out] Buffer Target buffer.
-
-
- @return Status code returned by VirtIo->Io.Read().
-
-**/
-EFI_STATUS
-EFIAPI
-VirtioReadDevice (
- IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- )
-{
- return VirtIo->ReadDevice (VirtIo, FieldOffset, FieldSize, BufferSize, Buffer);
-}
-
-
-/**
-
Configure a virtio ring.
This function sets up internal storage (the guest-host communication area)
diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
index 4c96d9376..08edf23fc 100644
--- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
+++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
@@ -56,23 +56,23 @@
one of UINT8, UINT16, UINT32, UINT64.
- @return Status code returned by VirtioWriteDevice() / VirtioReadDevice().
+ @return Status code returned by Virtio->WriteDevice() / Virtio->ReadDevice().
**/
-#define VIRTIO_CFG_WRITE(Dev, Field, Value) (VirtioWriteDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VBLK (Field), \
- SIZE_OF_VBLK (Field), \
- (Value) \
+#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VBLK (Field), \
+ SIZE_OF_VBLK (Field), \
+ (Value) \
))
-#define VIRTIO_CFG_READ(Dev, Field, Pointer) (VirtioReadDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VBLK (Field), \
- SIZE_OF_VBLK (Field), \
- sizeof *(Pointer), \
- (Pointer) \
+#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VBLK (Field), \
+ SIZE_OF_VBLK (Field), \
+ sizeof *(Pointer), \
+ (Pointer) \
))
diff --git a/OvmfPkg/VirtioNetDxe/VirtioNet.h b/OvmfPkg/VirtioNetDxe/VirtioNet.h
index 580260760..a0e0b4337 100644
--- a/OvmfPkg/VirtioNetDxe/VirtioNet.h
+++ b/OvmfPkg/VirtioNetDxe/VirtioNet.h
@@ -107,19 +107,19 @@ typedef struct {
#define VIRTIO_NET_FROM_SNP(SnpPointer) \
CR (SnpPointer, VNET_DEV, Snp, VNET_SIG)
-#define VIRTIO_CFG_WRITE(Dev, Field, Value) (VirtioWriteDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VNET (Field), \
- SIZE_OF_VNET (Field), \
- (Value) \
+#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VNET (Field), \
+ SIZE_OF_VNET (Field), \
+ (Value) \
))
-#define VIRTIO_CFG_READ(Dev, Field, Pointer) (VirtioReadDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VNET (Field), \
- SIZE_OF_VNET (Field), \
- sizeof *(Pointer), \
- (Pointer) \
+#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VNET (Field), \
+ SIZE_OF_VNET (Field), \
+ sizeof *(Pointer), \
+ (Pointer) \
))
//
diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
index 5a4aaf197..3b6c3ade8 100644
--- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
+++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
@@ -70,23 +70,23 @@
one of UINT8, UINT16, UINT32, UINT64.
- @return Status codes returned by VirtioWriteDevice() / VirtioReadDevice().
+ @return Status codes returned by Virtio->WriteDevice() / Virtio->ReadDevice().
**/
-#define VIRTIO_CFG_WRITE(Dev, Field, Value) (VirtioWriteDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VSCSI (Field), \
- SIZE_OF_VSCSI (Field), \
- (Value) \
+#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VSCSI (Field), \
+ SIZE_OF_VSCSI (Field), \
+ (Value) \
))
-#define VIRTIO_CFG_READ(Dev, Field, Pointer) (VirtioReadDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VSCSI (Field), \
- SIZE_OF_VSCSI (Field), \
- sizeof *(Pointer), \
- (Pointer) \
+#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VSCSI (Field), \
+ SIZE_OF_VSCSI (Field), \
+ sizeof *(Pointer), \
+ (Pointer) \
))