OvmfPkg/VirtioMmioDeviceLib: add missing IN and OUT decoration
[mirror_edk2.git] / OvmfPkg / Library / VirtioMmioDeviceLib / VirtioMmioDevice.h
CommitLineData
6fb4e772
OM
1/** @file\r
2\r
3 Internal definitions for the VirtIo MMIO Device driver\r
4\r
5 Copyright (C) 2013, ARM Ltd\r
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\r
17#ifndef _VIRTIO_MMIO_DEVICE_INTERNAL_H_\r
18#define _VIRTIO_MMIO_DEVICE_INTERNAL_H_\r
19\r
20#include <Protocol/VirtioDevice.h>\r
21\r
22#include <IndustryStandard/Virtio.h>\r
23\r
24#include <Library/DebugLib.h>\r
25#include <Library/IoLib.h>\r
26#include <Library/UefiLib.h>\r
27#include <Library/VirtioMmioDeviceLib.h>\r
28\r
29#define VIRTIO_MMIO_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'M', 'I', 'O')\r
30\r
31typedef struct {\r
32 UINT32 Signature;\r
33 VIRTIO_DEVICE_PROTOCOL VirtioDevice;\r
34 PHYSICAL_ADDRESS BaseAddress;\r
35} VIRTIO_MMIO_DEVICE;\r
36\r
37#define VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE(Device) \\r
38 CR (Device, VIRTIO_MMIO_DEVICE, VirtioDevice, VIRTIO_MMIO_DEVICE_SIGNATURE)\r
39\r
40#define VIRTIO_CFG_WRITE(Device, Offset, Val) \\r
41 (MmioWrite32 (Device->BaseAddress + (Offset), Val))\r
42#define VIRTIO_CFG_READ(Device, Offset) \\r
43 (MmioRead32 (Device->BaseAddress + (Offset)))\r
44\r
45EFI_STATUS\r
46EFIAPI\r
47VirtioMmioDeviceRead (\r
48 IN VIRTIO_DEVICE_PROTOCOL *This,\r
49 IN UINTN FieldOFfset,\r
50 IN UINTN FieldSize,\r
51 IN UINTN BufferSize,\r
52 OUT VOID* Buffer\r
53 );\r
54\r
55EFI_STATUS\r
56EFIAPI\r
57VirtioMmioDeviceWrite (\r
58 IN VIRTIO_DEVICE_PROTOCOL *This,\r
59 IN UINTN FieldOffset,\r
60 IN UINTN FieldSize,\r
61 IN UINT64 Value\r
62 );\r
63\r
64EFI_STATUS\r
65EFIAPI\r
66VirtioMmioGetDeviceFeatures (\r
67 IN VIRTIO_DEVICE_PROTOCOL *This,\r
bc8fde6f 68 OUT UINT64 *DeviceFeatures\r
6fb4e772
OM
69 );\r
70\r
6fb4e772
OM
71EFI_STATUS\r
72EFIAPI\r
73VirtioMmioGetQueueSize (\r
74 IN VIRTIO_DEVICE_PROTOCOL *This,\r
75 OUT UINT16 *QueueNumMax\r
76 );\r
77\r
78EFI_STATUS\r
79EFIAPI\r
80VirtioMmioGetDeviceStatus (\r
81 IN VIRTIO_DEVICE_PROTOCOL *This,\r
82 OUT UINT8 *DeviceStatus\r
83 );\r
84\r
85EFI_STATUS\r
86EFIAPI\r
87VirtioMmioSetQueueSize (\r
22701a3d
BS
88 IN VIRTIO_DEVICE_PROTOCOL *This,\r
89 IN UINT16 QueueSize\r
6fb4e772
OM
90 );\r
91\r
92EFI_STATUS\r
93EFIAPI\r
94VirtioMmioSetDeviceStatus (\r
22701a3d
BS
95 IN VIRTIO_DEVICE_PROTOCOL *This,\r
96 IN UINT8 DeviceStatus\r
6fb4e772
OM
97 );\r
98\r
99EFI_STATUS\r
100EFIAPI\r
101VirtioMmioSetQueueNotify (\r
22701a3d
BS
102 IN VIRTIO_DEVICE_PROTOCOL *This,\r
103 IN UINT16 QueueNotify\r
6fb4e772
OM
104 );\r
105\r
106EFI_STATUS\r
107EFIAPI\r
108VirtioMmioSetQueueSel (\r
22701a3d
BS
109 IN VIRTIO_DEVICE_PROTOCOL *This,\r
110 IN UINT16 Sel\r
6fb4e772
OM
111 );\r
112\r
113EFI_STATUS\r
114VirtioMmioSetQueueAddress (\r
07af4eee
LE
115 IN VIRTIO_DEVICE_PROTOCOL *This,\r
116 IN VRING *Ring\r
6fb4e772
OM
117 );\r
118\r
119EFI_STATUS\r
120EFIAPI\r
121VirtioMmioSetQueueAlignment (\r
22701a3d
BS
122 IN VIRTIO_DEVICE_PROTOCOL *This,\r
123 IN UINT32 Alignment\r
6fb4e772
OM
124 );\r
125\r
126EFI_STATUS\r
127EFIAPI\r
128VirtioMmioSetPageSize (\r
22701a3d
BS
129 IN VIRTIO_DEVICE_PROTOCOL *This,\r
130 IN UINT32 PageSize\r
6fb4e772
OM
131 );\r
132\r
133EFI_STATUS\r
134EFIAPI\r
135VirtioMmioSetGuestFeatures (\r
22701a3d
BS
136 IN VIRTIO_DEVICE_PROTOCOL *This,\r
137 IN UINT64 Features\r
6fb4e772
OM
138 );\r
139\r
140#endif // _VIRTIO_MMIO_DEVICE_INTERNAL_H_\r