]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseIoLibIntrinsic/IoLibSev.h
MdePkg: Support IoFifo for Tdx guest in BaseIoLibIntrinsic
[mirror_edk2.git] / MdePkg / Library / BaseIoLibIntrinsic / IoLibSev.h
CommitLineData
d74e9326
MX
1/** @file\r
2 Header file for SEV IO library.\r
3\r
4 Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6**/\r
7\r
8#ifndef IOLIB_SEV_H_\r
9#define IOLIB_SEV_H_\r
10\r
11#include <Base.h>\r
12\r
13#include <Library/BaseLib.h>\r
14#include <Library/DebugLib.h>\r
15\r
16/**\r
17 Reads an 8-bit I/O port fifo into a block of memory.\r
18\r
19 Reads the 8-bit I/O fifo port specified by Port.\r
20 The port is read Count times, and the read data is\r
21 stored in the provided Buffer.\r
22\r
23 This function must guarantee that all I/O read and write operations are\r
24 serialized.\r
25\r
26 If 8-bit I/O port operations are not supported, then ASSERT().\r
27\r
28 @param Port The I/O port to read.\r
29 @param Count The number of times to read I/O port.\r
30 @param Buffer The buffer to store the read data into.\r
31\r
32**/\r
33VOID\r
34EFIAPI\r
35SevIoReadFifo8 (\r
36 IN UINTN Port,\r
37 IN UINTN Count,\r
38 OUT VOID *Buffer\r
39 );\r
40\r
41/**\r
42 Writes a block of memory into an 8-bit I/O port fifo.\r
43\r
44 Writes the 8-bit I/O fifo port specified by Port.\r
45 The port is written Count times, and the write data is\r
46 retrieved from the provided Buffer.\r
47\r
48 This function must guarantee that all I/O write and write operations are\r
49 serialized.\r
50\r
51 If 8-bit I/O port operations are not supported, then ASSERT().\r
52\r
53 @param Port The I/O port to write.\r
54 @param Count The number of times to write I/O port.\r
55 @param Buffer The buffer to retrieve the write data from.\r
56\r
57**/\r
58VOID\r
59EFIAPI\r
60SevIoWriteFifo8 (\r
61 IN UINTN Port,\r
62 IN UINTN Count,\r
63 IN VOID *Buffer\r
64 );\r
65\r
66/**\r
67 Reads an 8-bit I/O port fifo into a block of memory.\r
68\r
69 Reads the 8-bit I/O fifo port specified by Port.\r
70 The port is read Count times, and the read data is\r
71 stored in the provided Buffer.\r
72\r
73 This function must guarantee that all I/O read and write operations are\r
74 serialized.\r
75\r
76 If 8-bit I/O port operations are not supported, then ASSERT().\r
77\r
78 @param Port The I/O port to read.\r
79 @param Count The number of times to read I/O port.\r
80 @param Buffer The buffer to store the read data into.\r
81\r
82**/\r
83VOID\r
84EFIAPI\r
85SevIoReadFifo16 (\r
86 IN UINTN Port,\r
87 IN UINTN Count,\r
88 OUT VOID *Buffer\r
89 );\r
90\r
91/**\r
92 Writes a block of memory into an 8-bit I/O port fifo.\r
93\r
94 Writes the 8-bit I/O fifo port specified by Port.\r
95 The port is written Count times, and the write data is\r
96 retrieved from the provided Buffer.\r
97\r
98 This function must guarantee that all I/O write and write operations are\r
99 serialized.\r
100\r
101 If 8-bit I/O port operations are not supported, then ASSERT().\r
102\r
103 @param Port The I/O port to write.\r
104 @param Count The number of times to write I/O port.\r
105 @param Buffer The buffer to retrieve the write data from.\r
106\r
107**/\r
108VOID\r
109EFIAPI\r
110SevIoWriteFifo16 (\r
111 IN UINTN Port,\r
112 IN UINTN Count,\r
113 IN VOID *Buffer\r
114 );\r
115\r
116/**\r
117 Reads an 8-bit I/O port fifo into a block of memory.\r
118\r
119 Reads the 8-bit I/O fifo port specified by Port.\r
120 The port is read Count times, and the read data is\r
121 stored in the provided Buffer.\r
122\r
123 This function must guarantee that all I/O read and write operations are\r
124 serialized.\r
125\r
126 If 8-bit I/O port operations are not supported, then ASSERT().\r
127\r
128 @param Port The I/O port to read.\r
129 @param Count The number of times to read I/O port.\r
130 @param Buffer The buffer to store the read data into.\r
131\r
132**/\r
133VOID\r
134EFIAPI\r
135SevIoReadFifo32 (\r
136 IN UINTN Port,\r
137 IN UINTN Count,\r
138 OUT VOID *Buffer\r
139 );\r
140\r
141/**\r
142 Writes a block of memory into an 8-bit I/O port fifo.\r
143\r
144 Writes the 8-bit I/O fifo port specified by Port.\r
145 The port is written Count times, and the write data is\r
146 retrieved from the provided Buffer.\r
147\r
148 This function must guarantee that all I/O write and write operations are\r
149 serialized.\r
150\r
151 If 8-bit I/O port operations are not supported, then ASSERT().\r
152\r
153 @param Port The I/O port to write.\r
154 @param Count The number of times to write I/O port.\r
155 @param Buffer The buffer to retrieve the write data from.\r
156\r
157**/\r
158VOID\r
159EFIAPI\r
160SevIoWriteFifo32 (\r
161 IN UINTN Port,\r
162 IN UINTN Count,\r
163 IN VOID *Buffer\r
164 );\r
165\r
166#endif\r