]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/IndustryStandard/Virtio10.h
OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Virtio10.h
CommitLineData
acb81416
LE
1/** @file\r
2 Definitions from the VirtIo 1.0 specification (csprd05).\r
3\r
4 Copyright (C) 2016, Red Hat, Inc.\r
4fb26802 5 Copyright (C) 2017, AMD, Inc.\r
acb81416
LE
6\r
7 This program and the accompanying materials are licensed and made available\r
8 under the terms and conditions of the BSD License which accompanies this\r
9 distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14**/\r
15\r
16#ifndef _VIRTIO_1_0_H_\r
17#define _VIRTIO_1_0_H_\r
18\r
19#include <IndustryStandard/Virtio095.h>\r
20\r
92dc5e9d
LE
21//\r
22// Subsystem Device IDs (to be) introduced in VirtIo 1.0\r
23//\r
24#define VIRTIO_SUBSYSTEM_GPU_DEVICE 16\r
25\r
acb81416
LE
26//\r
27// Structures for parsing the VirtIo 1.0 specific PCI capabilities from the\r
28// config space\r
29//\r
30#pragma pack (1)\r
31typedef struct {\r
32 UINT8 CapId; // Capability identifier (generic)\r
33 UINT8 CapNext; // Link to next capability (generic)\r
34} VIRTIO_PCI_CAP_LINK;\r
35\r
36typedef struct {\r
37 UINT8 ConfigType; // Identifies the specific VirtIo 1.0 config structure\r
38 UINT8 Bar; // The BAR that contains the structure\r
39 UINT8 Padding[3];\r
40 UINT32 Offset; // Offset within Bar until the start of the structure\r
41 UINT32 Length; // Length of the structure\r
42} VIRTIO_PCI_CAP;\r
43#pragma pack ()\r
44\r
45//\r
46// Values for the VIRTIO_PCI_CAP.ConfigType field\r
47//\r
48#define VIRTIO_PCI_CAP_COMMON_CFG 1 // Common configuration\r
49#define VIRTIO_PCI_CAP_NOTIFY_CFG 2 // Notifications\r
50#define VIRTIO_PCI_CAP_DEVICE_CFG 4 // Device specific configuration\r
51\r
52//\r
53// Structure pointed-to by Bar and Offset in VIRTIO_PCI_CAP when ConfigType is\r
54// VIRTIO_PCI_CAP_COMMON_CFG\r
55//\r
56#pragma pack (1)\r
57typedef struct {\r
58 UINT32 DeviceFeatureSelect;\r
59 UINT32 DeviceFeature;\r
60 UINT32 DriverFeatureSelect;\r
61 UINT32 DriverFeature;\r
62 UINT16 MsixConfig;\r
63 UINT16 NumQueues;\r
64 UINT8 DeviceStatus;\r
65 UINT8 ConfigGeneration;\r
66 UINT16 QueueSelect;\r
67 UINT16 QueueSize;\r
68 UINT16 QueueMsixVector;\r
69 UINT16 QueueEnable;\r
70 UINT16 QueueNotifyOff;\r
71 UINT64 QueueDesc;\r
72 UINT64 QueueAvail;\r
73 UINT64 QueueUsed;\r
74} VIRTIO_PCI_COMMON_CFG;\r
75#pragma pack ()\r
76\r
77//\r
78// VirtIo 1.0 device status bits\r
79//\r
80#define VSTAT_FEATURES_OK BIT3\r
81\r
82//\r
83// VirtIo 1.0 reserved (device-independent) feature bits\r
84//\r
4fb26802
BS
85#define VIRTIO_F_VERSION_1 BIT32\r
86#define VIRTIO_F_IOMMU_PLATFORM BIT33\r
acb81416
LE
87\r
88#endif // _VIRTIO_1_0_H_\r