2 Definitions from the VirtIo 1.0 specification (csprd05).
4 Copyright (C) 2016, Red Hat, Inc.
5 Copyright (C) 2017, AMD, Inc.
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _VIRTIO_1_0_H_
17 #define _VIRTIO_1_0_H_
19 #include <IndustryStandard/Virtio095.h>
22 // Subsystem Device IDs (to be) introduced in VirtIo 1.0
24 #define VIRTIO_SUBSYSTEM_GPU_DEVICE 16
27 // Structures for parsing the VirtIo 1.0 specific PCI capabilities from the
32 UINT8 CapId
; // Capability identifier (generic)
33 UINT8 CapNext
; // Link to next capability (generic)
34 } VIRTIO_PCI_CAP_LINK
;
37 UINT8 ConfigType
; // Identifies the specific VirtIo 1.0 config structure
38 UINT8 Bar
; // The BAR that contains the structure
40 UINT32 Offset
; // Offset within Bar until the start of the structure
41 UINT32 Length
; // Length of the structure
46 // Values for the VIRTIO_PCI_CAP.ConfigType field
48 #define VIRTIO_PCI_CAP_COMMON_CFG 1 // Common configuration
49 #define VIRTIO_PCI_CAP_NOTIFY_CFG 2 // Notifications
50 #define VIRTIO_PCI_CAP_DEVICE_CFG 4 // Device specific configuration
53 // Structure pointed-to by Bar and Offset in VIRTIO_PCI_CAP when ConfigType is
54 // VIRTIO_PCI_CAP_COMMON_CFG
58 UINT32 DeviceFeatureSelect
;
60 UINT32 DriverFeatureSelect
;
65 UINT8 ConfigGeneration
;
68 UINT16 QueueMsixVector
;
70 UINT16 QueueNotifyOff
;
74 } VIRTIO_PCI_COMMON_CFG
;
78 // VirtIo 1.0 device status bits
80 #define VSTAT_FEATURES_OK BIT3
83 // VirtIo 1.0 reserved (device-independent) feature bits
85 #define VIRTIO_F_VERSION_1 BIT32
86 #define VIRTIO_F_IOMMU_PLATFORM BIT33
88 #endif // _VIRTIO_1_0_H_