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/Pci23.h>
20 #include <IndustryStandard/Virtio095.h>
23 // Subsystem Device IDs (to be) introduced in VirtIo 1.0
25 #define VIRTIO_SUBSYSTEM_GPU_DEVICE 16
28 // Structures for parsing the VirtIo 1.0 specific PCI capabilities from the
33 EFI_PCI_CAPABILITY_VENDOR_HDR VendorHdr
;
34 UINT8 ConfigType
; // Identifies the specific VirtIo 1.0 config structure
35 UINT8 Bar
; // The BAR that contains the structure
37 UINT32 Offset
; // Offset within Bar until the start of the structure
38 UINT32 Length
; // Length of the structure
43 // Values for the VIRTIO_PCI_CAP.ConfigType field
45 #define VIRTIO_PCI_CAP_COMMON_CFG 1 // Common configuration
46 #define VIRTIO_PCI_CAP_NOTIFY_CFG 2 // Notifications
47 #define VIRTIO_PCI_CAP_DEVICE_CFG 4 // Device specific configuration
50 // Structure pointed-to by Bar and Offset in VIRTIO_PCI_CAP when ConfigType is
51 // VIRTIO_PCI_CAP_COMMON_CFG
55 UINT32 DeviceFeatureSelect
;
57 UINT32 DriverFeatureSelect
;
62 UINT8 ConfigGeneration
;
65 UINT16 QueueMsixVector
;
67 UINT16 QueueNotifyOff
;
71 } VIRTIO_PCI_COMMON_CFG
;
75 // VirtIo 1.0 device status bits
77 #define VSTAT_FEATURES_OK BIT3
80 // VirtIo 1.0 reserved (device-independent) feature bits
82 #define VIRTIO_F_VERSION_1 BIT32
83 #define VIRTIO_F_IOMMU_PLATFORM BIT33
85 #endif // _VIRTIO_1_0_H_