OvmfPkg/Virtio.h: Added PCI/MMIO Virtio Headers Offsets

Offsets are different between the PCI and MMIO transport layer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14808 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Olivier Martin 2013-10-29 06:08:39 +00:00 committed by oliviermartin
parent b342c97dfc
commit d092ba8e71
1 changed files with 35 additions and 0 deletions

View File

@ -4,6 +4,7 @@
specification.
Copyright (C) 2012, Red Hat, Inc.
Portion of 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
@ -41,6 +42,40 @@
#define VIRTIO_DEVICE_SPECIFIC_CONFIGURATION_OFFSET_PCI_WITH_MSI_X 24
#define VIRTIO_DEVICE_SPECIFIC_CONFIGURATION_OFFSET_MMIO 0x100
//
// PCI VirtIo Header Offsets
//
#define VIRTIO_PCI_OFFSET_DEVICE_FEATURES 0x00
#define VIRTIO_PCI_OFFSET_GUEST_FEATURES 0x04
#define VIRTIO_PCI_OFFSET_QUEUE_ADDRESS 0x08
#define VIRTIO_PCI_OFFSET_QUEUE_SIZE 0x0C
#define VIRTIO_PCI_OFFSET_QUEUE_SELECT 0x0E
#define VIRTIO_PCI_OFFSET_QUEUE_NOTIFY 0x10
#define VIRTIO_PCI_OFFSET_QUEUE_DEVICE_STATUS 0x12
#define VIRTIO_PCI_OFFSET_QUEUE_DEVICE_ISR 0x13
//
// MMIO VirtIo Header Offsets
//
#define VIRTIO_MMIO_OFFSET_MAGIC 0x00
#define VIRTIO_MMIO_OFFSET_VERSION 0x04
#define VIRTIO_MMIO_OFFSET_DEVICE_ID 0x08
#define VIRTIO_MMIO_OFFSET_VENDOR_ID 0x0C
#define VIRTIO_MMIO_OFFSET_HOST_FEATURES 0x10
#define VIRTIO_MMIO_OFFSET_HOST_FEATURES_SEL 0x14
#define VIRTIO_MMIO_OFFSET_GUEST_FEATURES 0x20
#define VIRTIO_MMIO_OFFSET_GUEST_FEATURES_SEL 0x24
#define VIRTIO_MMIO_OFFSET_GUEST_PAGE_SIZE 0x28
#define VIRTIO_MMIO_OFFSET_QUEUE_SEL 0x30
#define VIRTIO_MMIO_OFFSET_QUEUE_NUM_MAX 0x34
#define VIRTIO_MMIO_OFFSET_QUEUE_NUM 0x38
#define VIRTIO_MMIO_OFFSET_QUEUE_ALIGN 0x3C
#define VIRTIO_MMIO_OFFSET_QUEUE_PFN 0x40
#define VIRTIO_MMIO_OFFSET_QUEUE_NOTIFY 0x50
#define VIRTIO_MMIO_OFFSET_INTERRUPT_STATUS 0x60
#define VIRTIO_MMIO_OFFSET_INTERRUPT_ACK 0x64
#define VIRTIO_MMIO_OFFSET_STATUS 0x70
//
// Data in the communication area is defined as packed and accessed as
// volatile.