OvmfPkg/VirtioPciDeviceDxe: Implement VIRTIO_DEVICE_PROTOCOL for VirtIo Devices over PCI

This change implements the VIRTIO_DEVICE_PROTOCOL for the PCI transport
layer.
The VirtIo device drivers will interact with the PCI-based VirtIo devices
through this protocol implementation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>

v5:
- updated comment block on VirtioPciDeviceRead()
- return EFI_UNSUPPORTED instead of failed ASSERT() in
  VirtioPciSetPageSize()
- VirtioPciIoRead(): restore the original requirement that FieldSize equal
  BufferSize exactly (not only divide it). The looping added in v4 did not
  match the comment block, and the only place that used it in v4 (ie.
  VirtioNetGetFeatures()) needs an open-coded loop anyway (will be done in
  a later part of v5).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14964 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Olivier Martin
2013-12-11 16:57:49 +00:00
committed by jljusten
parent fc4d1ce574
commit 3bb56c062e
4 changed files with 1172 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
## @file
# This driver produces the VirtIo Device Protocol instances for VirtIo PCI
# Device
#
# Copyright (C) 2013, ARM Ltd
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
[Defines]
INF_VERSION = 0x00010006
BASE_NAME = VirtioPciDeviceDxe
FILE_GUID = 83dd3b39-7caf-4fac-a542-e050b767e3a7
MODULE_TYPE = UEFI_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = VirtioPciDeviceEntryPoint
[Sources]
VirtioPciDevice.c
VirtioPciFunctions.c
[Packages]
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses]
BaseMemoryLib
DebugLib
MemoryAllocationLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiLib
[Protocols]
gEfiPciIoProtocolGuid ## TO_START
gVirtioDeviceProtocolGuid ## BY_START