mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 22:54:51 +02:00
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> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14968 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
64106abf4b
commit
ece77e4047
@ -21,70 +21,6 @@
|
|||||||
|
|
||||||
#include <IndustryStandard/Virtio.h>
|
#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
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
|
@ -24,75 +24,6 @@
|
|||||||
#include <Library/VirtioLib.h>
|
#include <Library/VirtioLib.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
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.
|
Configure a virtio ring.
|
||||||
|
@ -56,18 +56,18 @@
|
|||||||
one of UINT8, UINT16, UINT32, UINT64.
|
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 ( \
|
#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
|
||||||
(Dev)->VirtIo, \
|
(Dev)->VirtIo, \
|
||||||
OFFSET_OF_VBLK (Field), \
|
OFFSET_OF_VBLK (Field), \
|
||||||
SIZE_OF_VBLK (Field), \
|
SIZE_OF_VBLK (Field), \
|
||||||
(Value) \
|
(Value) \
|
||||||
))
|
))
|
||||||
|
|
||||||
#define VIRTIO_CFG_READ(Dev, Field, Pointer) (VirtioReadDevice ( \
|
#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
|
||||||
(Dev)->VirtIo, \
|
(Dev)->VirtIo, \
|
||||||
OFFSET_OF_VBLK (Field), \
|
OFFSET_OF_VBLK (Field), \
|
||||||
SIZE_OF_VBLK (Field), \
|
SIZE_OF_VBLK (Field), \
|
||||||
|
@ -107,14 +107,14 @@ typedef struct {
|
|||||||
#define VIRTIO_NET_FROM_SNP(SnpPointer) \
|
#define VIRTIO_NET_FROM_SNP(SnpPointer) \
|
||||||
CR (SnpPointer, VNET_DEV, Snp, VNET_SIG)
|
CR (SnpPointer, VNET_DEV, Snp, VNET_SIG)
|
||||||
|
|
||||||
#define VIRTIO_CFG_WRITE(Dev, Field, Value) (VirtioWriteDevice ( \
|
#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
|
||||||
(Dev)->VirtIo, \
|
(Dev)->VirtIo, \
|
||||||
OFFSET_OF_VNET (Field), \
|
OFFSET_OF_VNET (Field), \
|
||||||
SIZE_OF_VNET (Field), \
|
SIZE_OF_VNET (Field), \
|
||||||
(Value) \
|
(Value) \
|
||||||
))
|
))
|
||||||
|
|
||||||
#define VIRTIO_CFG_READ(Dev, Field, Pointer) (VirtioReadDevice ( \
|
#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
|
||||||
(Dev)->VirtIo, \
|
(Dev)->VirtIo, \
|
||||||
OFFSET_OF_VNET (Field), \
|
OFFSET_OF_VNET (Field), \
|
||||||
SIZE_OF_VNET (Field), \
|
SIZE_OF_VNET (Field), \
|
||||||
|
@ -70,18 +70,18 @@
|
|||||||
one of UINT8, UINT16, UINT32, UINT64.
|
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 ( \
|
#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
|
||||||
(Dev)->VirtIo, \
|
(Dev)->VirtIo, \
|
||||||
OFFSET_OF_VSCSI (Field), \
|
OFFSET_OF_VSCSI (Field), \
|
||||||
SIZE_OF_VSCSI (Field), \
|
SIZE_OF_VSCSI (Field), \
|
||||||
(Value) \
|
(Value) \
|
||||||
))
|
))
|
||||||
|
|
||||||
#define VIRTIO_CFG_READ(Dev, Field, Pointer) (VirtioReadDevice ( \
|
#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
|
||||||
(Dev)->VirtIo, \
|
(Dev)->VirtIo, \
|
||||||
OFFSET_OF_VSCSI (Field), \
|
OFFSET_OF_VSCSI (Field), \
|
||||||
SIZE_OF_VSCSI (Field), \
|
SIZE_OF_VSCSI (Field), \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user