]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdxNull.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseIoLibIntrinsic / IoLibInternalTdxNull.c
1 /** @file
2 Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
3 SPDX-License-Identifier: BSD-2-Clause-Patent
4
5 **/
6
7 #include <Library/BaseLib.h>
8 #include "BaseIoLibIntrinsicInternal.h"
9 #include "IoLibTdx.h"
10
11 /**
12 Check if it is Tdx guest.
13
14 @return TRUE It is Tdx guest
15 @return FALSE It is not Tdx guest
16
17 **/
18 BOOLEAN
19 EFIAPI
20 IsTdxGuest (
21 VOID
22 )
23 {
24 return FALSE;
25 }
26
27 /**
28 Reads an 8-bit I/O port.
29
30 TDVMCALL_IO is invoked to read I/O port.
31
32 @param Port The I/O port to read.
33
34 @return The value read.
35
36 **/
37 UINT8
38 EFIAPI
39 TdIoRead8 (
40 IN UINTN Port
41 )
42 {
43 ASSERT (FALSE);
44 return 0;
45 }
46
47 /**
48 Reads a 16-bit I/O port.
49
50 TDVMCALL_IO is invoked to write I/O port.
51
52 @param Port The I/O port to read.
53
54 @return The value read.
55
56 **/
57 UINT16
58 EFIAPI
59 TdIoRead16 (
60 IN UINTN Port
61 )
62 {
63 ASSERT (FALSE);
64 return 0;
65 }
66
67 /**
68 Reads a 32-bit I/O port.
69
70 TDVMCALL_IO is invoked to read I/O port.
71
72 @param Port The I/O port to read.
73
74 @return The value read.
75
76 **/
77 UINT32
78 EFIAPI
79 TdIoRead32 (
80 IN UINTN Port
81 )
82 {
83 ASSERT (FALSE);
84 return 0;
85 }
86
87 /**
88 Writes an 8-bit I/O port.
89
90 TDVMCALL_IO is invoked to write I/O port.
91
92 @param Port The I/O port to write.
93 @param Value The value to write to the I/O port.
94
95 @return The value written the I/O port.
96
97 **/
98 UINT8
99 EFIAPI
100 TdIoWrite8 (
101 IN UINTN Port,
102 IN UINT8 Value
103 )
104 {
105 ASSERT (FALSE);
106 return 0;
107 }
108
109 /**
110 Writes a 16-bit I/O port.
111
112 TDVMCALL_IO is invoked to write I/O port.
113
114 @param Port The I/O port to write.
115 @param Value The value to write to the I/O port.
116
117 @return The value written the I/O port.
118
119 **/
120 UINT16
121 EFIAPI
122 TdIoWrite16 (
123 IN UINTN Port,
124 IN UINT16 Value
125 )
126 {
127 ASSERT (FALSE);
128 return 0;
129 }
130
131 /**
132 Writes a 32-bit I/O port.
133
134 TDVMCALL_IO is invoked to write I/O port.
135
136 @param Port The I/O port to write.
137 @param Value The value to write to the I/O port.
138
139 @return The value written the I/O port.
140
141 **/
142 UINT32
143 EFIAPI
144 TdIoWrite32 (
145 IN UINTN Port,
146 IN UINT32 Value
147 )
148 {
149 ASSERT (FALSE);
150 return 0;
151 }
152
153 /**
154 Reads an 8-bit MMIO register.
155
156 TDVMCALL_MMIO is invoked to read MMIO registers.
157
158 @param Address The MMIO register to read.
159
160 @return The value read.
161
162 **/
163 UINT8
164 EFIAPI
165 TdMmioRead8 (
166 IN UINTN Address
167 )
168 {
169 ASSERT (FALSE);
170 return 0;
171 }
172
173 /**
174 Writes an 8-bit MMIO register.
175
176 TDVMCALL_MMIO is invoked to read write registers.
177
178 @param Address The MMIO register to write.
179 @param Value The value to write to the MMIO register.
180
181 @return Value.
182
183 **/
184 UINT8
185 EFIAPI
186 TdMmioWrite8 (
187 IN UINTN Address,
188 IN UINT8 Val
189 )
190 {
191 ASSERT (FALSE);
192 return 0;
193 }
194
195 /**
196 Reads a 16-bit MMIO register.
197
198 TDVMCALL_MMIO is invoked to read MMIO registers.
199
200 @param Address The MMIO register to read.
201
202 @return The value read.
203
204 **/
205 UINT16
206 EFIAPI
207 TdMmioRead16 (
208 IN UINTN Address
209 )
210 {
211 ASSERT (FALSE);
212 return 0;
213 }
214
215 /**
216 Writes a 16-bit MMIO register.
217
218 TDVMCALL_MMIO is invoked to write MMIO registers.
219
220 @param Address The MMIO register to write.
221 @param Value The value to write to the MMIO register.
222
223 @return Value.
224
225 **/
226 UINT16
227 EFIAPI
228 TdMmioWrite16 (
229 IN UINTN Address,
230 IN UINT16 Val
231 )
232 {
233 ASSERT (FALSE);
234 return 0;
235 }
236
237 /**
238 Reads a 32-bit MMIO register.
239
240 TDVMCALL_MMIO is invoked to read MMIO registers.
241
242 @param Address The MMIO register to read.
243
244 @return The value read.
245
246 **/
247 UINT32
248 EFIAPI
249 TdMmioRead32 (
250 IN UINTN Address
251 )
252 {
253 ASSERT (FALSE);
254 return 0;
255 }
256
257 /**
258 Writes a 32-bit MMIO register.
259
260 TDVMCALL_MMIO is invoked to write MMIO registers.
261
262 @param Address The MMIO register to write.
263 @param Value The value to write to the MMIO register.
264
265 @return Value.
266
267 **/
268 UINT32
269 EFIAPI
270 TdMmioWrite32 (
271 IN UINTN Address,
272 IN UINT32 Val
273 )
274 {
275 ASSERT (FALSE);
276 return 0;
277 }
278
279 /**
280 Reads a 64-bit MMIO register.
281
282 TDVMCALL_MMIO is invoked to read MMIO registers.
283
284 @param Address The MMIO register to read.
285
286 @return The value read.
287
288 **/
289 UINT64
290 EFIAPI
291 TdMmioRead64 (
292 IN UINTN Address
293 )
294 {
295 ASSERT (FALSE);
296 return 0;
297 }
298
299 /**
300 Writes a 64-bit MMIO register.
301
302 TDVMCALL_MMIO is invoked to write MMIO registers.
303
304 @param Address The MMIO register to write.
305 @param Value The value to write to the MMIO register.
306
307 **/
308 UINT64
309 EFIAPI
310 TdMmioWrite64 (
311 IN UINTN Address,
312 IN UINT64 Value
313 )
314 {
315 ASSERT (FALSE);
316 return 0;
317 }
318
319 /**
320 Reads an 8-bit I/O port fifo into a block of memory.
321
322 Reads the 8-bit I/O fifo port specified by Port.
323 The port is read Count times, and the read data is
324 stored in the provided Buffer.
325
326 This function must guarantee that all I/O read and write operations are
327 serialized.
328
329 If 8-bit I/O port operations are not supported, then ASSERT().
330
331 In TDX a serial of TdIoRead8 is invoked to read the I/O port fifo.
332
333 @param Port The I/O port to read.
334 @param Count The number of times to read I/O port.
335 @param Buffer The buffer to store the read data into.
336
337 **/
338 VOID
339 EFIAPI
340 TdIoReadFifo8 (
341 IN UINTN Port,
342 IN UINTN Count,
343 OUT VOID *Buffer
344 )
345 {
346 ASSERT (FALSE);
347 }
348
349 /**
350 Writes a block of memory into an 8-bit I/O port fifo.
351
352 Writes the 8-bit I/O fifo port specified by Port.
353 The port is written Count times, and the write data is
354 retrieved from the provided Buffer.
355
356 This function must guarantee that all I/O write and write operations are
357 serialized.
358
359 If 8-bit I/O port operations are not supported, then ASSERT().
360
361 In TDX a serial of TdIoWrite8 is invoked to write data to the I/O port.
362
363 @param Port The I/O port to write.
364 @param Count The number of times to write I/O port.
365 @param Buffer The buffer to retrieve the write data from.
366
367 **/
368 VOID
369 EFIAPI
370 TdIoWriteFifo8 (
371 IN UINTN Port,
372 IN UINTN Count,
373 IN VOID *Buffer
374 )
375 {
376 ASSERT (FALSE);
377 }
378
379 /**
380 Reads a 16-bit I/O port fifo into a block of memory.
381
382 Reads the 16-bit I/O fifo port specified by Port.
383 The port is read Count times, and the read data is
384 stored in the provided Buffer.
385
386 This function must guarantee that all I/O read and write operations are
387 serialized.
388
389 If 16-bit I/O port operations are not supported, then ASSERT().
390
391 In TDX a serial of TdIoRead16 is invoked to read data from the I/O port.
392
393 @param Port The I/O port to read.
394 @param Count The number of times to read I/O port.
395 @param Buffer The buffer to store the read data into.
396
397 **/
398 VOID
399 EFIAPI
400 TdIoReadFifo16 (
401 IN UINTN Port,
402 IN UINTN Count,
403 OUT VOID *Buffer
404 )
405 {
406 ASSERT (FALSE);
407 }
408
409 /**
410 Writes a block of memory into a 16-bit I/O port fifo.
411
412 Writes the 16-bit I/O fifo port specified by Port.
413 The port is written Count times, and the write data is
414 retrieved from the provided Buffer.
415
416 This function must guarantee that all I/O write and write operations are
417 serialized.
418
419 If 16-bit I/O port operations are not supported, then ASSERT().
420
421 In TDX a serial of TdIoWrite16 is invoked to write data to the I/O port.
422
423 @param Port The I/O port to write.
424 @param Count The number of times to write I/O port.
425 @param Buffer The buffer to retrieve the write data from.
426
427 **/
428 VOID
429 EFIAPI
430 TdIoWriteFifo16 (
431 IN UINTN Port,
432 IN UINTN Count,
433 IN VOID *Buffer
434 )
435 {
436 ASSERT (FALSE);
437 }
438
439 /**
440 Reads a 32-bit I/O port fifo into a block of memory.
441
442 Reads the 32-bit I/O fifo port specified by Port.
443 The port is read Count times, and the read data is
444 stored in the provided Buffer.
445
446 This function must guarantee that all I/O read and write operations are
447 serialized.
448
449 If 32-bit I/O port operations are not supported, then ASSERT().
450
451 In TDX a serial of TdIoRead32 is invoked to read data from the I/O port.
452
453 @param Port The I/O port to read.
454 @param Count The number of times to read I/O port.
455 @param Buffer The buffer to store the read data into.
456
457 **/
458 VOID
459 EFIAPI
460 TdIoReadFifo32 (
461 IN UINTN Port,
462 IN UINTN Count,
463 OUT VOID *Buffer
464 )
465 {
466 ASSERT (FALSE);
467 }
468
469 /**
470 Writes a block of memory into a 32-bit I/O port fifo.
471
472 Writes the 32-bit I/O fifo port specified by Port.
473 The port is written Count times, and the write data is
474 retrieved from the provided Buffer.
475
476 This function must guarantee that all I/O write and write operations are
477 serialized.
478
479 If 32-bit I/O port operations are not supported, then ASSERT().
480
481 In TDX a serial of TdIoWrite32 is invoked to write data to the I/O port.
482
483 @param Port The I/O port to write.
484 @param Count The number of times to write I/O port.
485 @param Buffer The buffer to retrieve the write data from.
486
487 **/
488 VOID
489 EFIAPI
490 TdIoWriteFifo32 (
491 IN UINTN Port,
492 IN UINTN Count,
493 IN VOID *Buffer
494 )
495 {
496 ASSERT (FALSE);
497 }