[edk2] [PATCH v4 02/11] OvmfPkg/Virtio.h: Added PCI/MMIO Virtio Headers Offsets

Subject: [edk2] [PATCH v4 02/11] OvmfPkg/Virtio.h: Added PCI/MMIO Virtio Headers Offsets

From: Olivier Martin <olivier.martin@arm.com>

To: edk2-devel@lists.sourceforge.net

Date: 2013-10-17 02:29:04

Offsets are different between the PCI and MMIO transport layer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin 
---
 OvmfPkg/Include/IndustryStandard/Virtio.h |   35 +++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/OvmfPkg/Include/IndustryStandard/Virtio.h b/OvmfPkg/Include/IndustryStandard/Virtio.h
index e5abe1b..f1eb2ea 100644
--- a/OvmfPkg/Include/IndustryStandard/Virtio.h
+++ b/OvmfPkg/Include/IndustryStandard/Virtio.h
@@ -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
@@ -42,6 +43,40 @@
 #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.
 //
-- 
1.7.0.4


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel