From d092ba8e71fb3516ad4965ebf55aaa90692f3cd0 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Tue, 29 Oct 2013 06:08:39 +0000 Subject: 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 Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14808 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/Include/IndustryStandard/Virtio.h | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/OvmfPkg/Include/IndustryStandard/Virtio.h b/OvmfPkg/Include/IndustryStandard/Virtio.h index e5abe1bd6e..f1eb2ea120 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 @@ -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. -- cgit v1.2.3