]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/IoLib.h
MdePkg UefiLib: Make the event empty function public
[mirror_edk2.git] / MdePkg / Include / Library / IoLib.h
1 /** @file
2 Provide services to access I/O Ports and MMIO registers.
3
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
6
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef __IO_LIB_H__
18 #define __IO_LIB_H__
19
20 /**
21 Macro that converts PCI Segment and I/O Port to an address that can be
22 passed to the I/O Library functions.
23
24 Computes an address that is compatible with the I/O Library functions.
25 The unused upper bits of Segment, and Port are stripped prior to the
26 generation of the address.
27
28 @param Segment PCI Segment number. Range 0..65535.
29 @param Port I/O Port number. Range 0..65535.
30
31 @return An address that the I/o Library functions need.
32
33 **/
34
35 #define IO_LIB_ADDRESS(Segment,Port) \
36 ( ((Port) & 0xffff) | (((Segment) & 0xffff) << 16) )
37
38 /**
39 Reads an 8-bit I/O port.
40
41 Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
42 This function must guarantee that all I/O read and write operations are
43 serialized.
44
45 If 8-bit I/O port operations are not supported, then ASSERT().
46
47 @param Port The I/O port to read.
48
49 @return The value read.
50
51 **/
52 UINT8
53 EFIAPI
54 IoRead8 (
55 IN UINTN Port
56 );
57
58 /**
59 Writes an 8-bit I/O port.
60
61 Writes the 8-bit I/O port specified by Port with the value specified by Value
62 and returns Value. This function must guarantee that all I/O read and write
63 operations are serialized.
64
65 If 8-bit I/O port operations are not supported, then ASSERT().
66
67 @param Port The I/O port to write.
68 @param Value The value to write to the I/O port.
69
70 @return The value written the I/O port.
71
72 **/
73 UINT8
74 EFIAPI
75 IoWrite8 (
76 IN UINTN Port,
77 IN UINT8 Value
78 );
79
80 /**
81 Reads an 8-bit I/O port fifo into a block of memory.
82
83 Reads the 8-bit I/O fifo port specified by Port.
84 The port is read Count times, and the read data is
85 stored in the provided Buffer.
86
87 This function must guarantee that all I/O read and write operations are
88 serialized.
89
90 If 8-bit I/O port operations are not supported, then ASSERT().
91
92 @param Port The I/O port to read.
93 @param Count The number of times to read I/O port.
94 @param Buffer The buffer to store the read data into.
95
96 **/
97 VOID
98 EFIAPI
99 IoReadFifo8 (
100 IN UINTN Port,
101 IN UINTN Count,
102 OUT VOID *Buffer
103 );
104
105 /**
106 Writes a block of memory into an 8-bit I/O port fifo.
107
108 Writes the 8-bit I/O fifo port specified by Port.
109 The port is written Count times, and the write data is
110 retrieved from the provided Buffer.
111
112 This function must guarantee that all I/O write and write operations are
113 serialized.
114
115 If 8-bit I/O port operations are not supported, then ASSERT().
116
117 @param Port The I/O port to write.
118 @param Count The number of times to write I/O port.
119 @param Buffer The buffer to retrieve the write data from.
120
121 **/
122 VOID
123 EFIAPI
124 IoWriteFifo8 (
125 IN UINTN Port,
126 IN UINTN Count,
127 IN VOID *Buffer
128 );
129
130 /**
131 Reads an 8-bit I/O port, performs a bitwise OR, and writes the
132 result back to the 8-bit I/O port.
133
134 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
135 between the read result and the value specified by OrData, and writes the
136 result to the 8-bit I/O port specified by Port. The value written to the I/O
137 port is returned. This function must guarantee that all I/O read and write
138 operations are serialized.
139
140 If 8-bit I/O port operations are not supported, then ASSERT().
141
142 @param Port The I/O port to write.
143 @param OrData The value to OR with the read value from the I/O port.
144
145 @return The value written back to the I/O port.
146
147 **/
148 UINT8
149 EFIAPI
150 IoOr8 (
151 IN UINTN Port,
152 IN UINT8 OrData
153 );
154
155 /**
156 Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
157 to the 8-bit I/O port.
158
159 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
160 the read result and the value specified by AndData, and writes the result to
161 the 8-bit I/O port specified by Port. The value written to the I/O port is
162 returned. This function must guarantee that all I/O read and write operations
163 are serialized.
164
165 If 8-bit I/O port operations are not supported, then ASSERT().
166
167 @param Port The I/O port to write.
168 @param AndData The value to AND with the read value from the I/O port.
169
170 @return The value written back to the I/O port.
171
172 **/
173 UINT8
174 EFIAPI
175 IoAnd8 (
176 IN UINTN Port,
177 IN UINT8 AndData
178 );
179
180 /**
181 Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
182 OR, and writes the result back to the 8-bit I/O port.
183
184 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
185 the read result and the value specified by AndData, performs a bitwise OR
186 between the result of the AND operation and the value specified by OrData,
187 and writes the result to the 8-bit I/O port specified by Port. The value
188 written to the I/O port is returned. This function must guarantee that all
189 I/O read and write operations are serialized.
190
191 If 8-bit I/O port operations are not supported, then ASSERT().
192
193 @param Port The I/O port to write.
194 @param AndData The value to AND with the read value from the I/O port.
195 @param OrData The value to OR with the result of the AND operation.
196
197 @return The value written back to the I/O port.
198
199 **/
200 UINT8
201 EFIAPI
202 IoAndThenOr8 (
203 IN UINTN Port,
204 IN UINT8 AndData,
205 IN UINT8 OrData
206 );
207
208 /**
209 Reads a bit field of an I/O register.
210
211 Reads the bit field in an 8-bit I/O register. The bit field is specified by
212 the StartBit and the EndBit. The value of the bit field is returned.
213
214 If 8-bit I/O port operations are not supported, then ASSERT().
215 If StartBit is greater than 7, then ASSERT().
216 If EndBit is greater than 7, then ASSERT().
217 If EndBit is less than StartBit, then ASSERT().
218
219 @param Port The I/O port to read.
220 @param StartBit The ordinal of the least significant bit in the bit field.
221 Range 0..7.
222 @param EndBit The ordinal of the most significant bit in the bit field.
223 Range 0..7.
224
225 @return The value read.
226
227 **/
228 UINT8
229 EFIAPI
230 IoBitFieldRead8 (
231 IN UINTN Port,
232 IN UINTN StartBit,
233 IN UINTN EndBit
234 );
235
236 /**
237 Writes a bit field to an I/O register.
238
239 Writes Value to the bit field of the I/O register. The bit field is specified
240 by the StartBit and the EndBit. All other bits in the destination I/O
241 register are preserved. The value written to the I/O port is returned.
242
243 If 8-bit I/O port operations are not supported, then ASSERT().
244 If StartBit is greater than 7, then ASSERT().
245 If EndBit is greater than 7, then ASSERT().
246 If EndBit is less than StartBit, then ASSERT().
247 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
248
249 @param Port The I/O port to write.
250 @param StartBit The ordinal of the least significant bit in the bit field.
251 Range 0..7.
252 @param EndBit The ordinal of the most significant bit in the bit field.
253 Range 0..7.
254 @param Value New value of the bit field.
255
256 @return The value written back to the I/O port.
257
258 **/
259 UINT8
260 EFIAPI
261 IoBitFieldWrite8 (
262 IN UINTN Port,
263 IN UINTN StartBit,
264 IN UINTN EndBit,
265 IN UINT8 Value
266 );
267
268 /**
269 Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
270 result back to the bit field in the 8-bit port.
271
272 Reads the 8-bit I/O port specified by Port, performs a bitwise OR
273 between the read result and the value specified by OrData, and writes the
274 result to the 8-bit I/O port specified by Port. The value written to the I/O
275 port is returned. This function must guarantee that all I/O read and write
276 operations are serialized. Extra left bits in OrData are stripped.
277
278 If 8-bit I/O port operations are not supported, then ASSERT().
279 If StartBit is greater than 7, then ASSERT().
280 If EndBit is greater than 7, then ASSERT().
281 If EndBit is less than StartBit, then ASSERT().
282 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
283
284 @param Port The I/O port to write.
285 @param StartBit The ordinal of the least significant bit in the bit field.
286 Range 0..7.
287 @param EndBit The ordinal of the most significant bit in the bit field.
288 Range 0..7.
289 @param OrData The value to OR with the read value from the I/O port.
290
291 @return The value written back to the I/O port.
292
293 **/
294 UINT8
295 EFIAPI
296 IoBitFieldOr8 (
297 IN UINTN Port,
298 IN UINTN StartBit,
299 IN UINTN EndBit,
300 IN UINT8 OrData
301 );
302
303 /**
304 Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
305 result back to the bit field in the 8-bit port.
306
307 Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
308 the read result and the value specified by AndData, and writes the result to
309 the 8-bit I/O port specified by Port. The value written to the I/O port is
310 returned. This function must guarantee that all I/O read and write operations
311 are serialized. Extra left bits in AndData are stripped.
312
313 If 8-bit I/O port operations are not supported, then ASSERT().
314 If StartBit is greater than 7, then ASSERT().
315 If EndBit is greater than 7, then ASSERT().
316 If EndBit is less than StartBit, then ASSERT().
317 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
318
319 @param Port The I/O port to write.
320 @param StartBit The ordinal of the least significant bit in the bit field.
321 Range 0..7.
322 @param EndBit The ordinal of the most significant bit in the bit field.
323 Range 0..7.
324 @param AndData The value to AND with the read value from the I/O port.
325
326 @return The value written back to the I/O port.
327
328 **/
329 UINT8
330 EFIAPI
331 IoBitFieldAnd8 (
332 IN UINTN Port,
333 IN UINTN StartBit,
334 IN UINTN EndBit,
335 IN UINT8 AndData
336 );
337
338 /**
339 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
340 bitwise OR, and writes the result back to the bit field in the
341 8-bit port.
342
343 Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
344 by a bitwise OR between the read result and the value specified by
345 AndData, and writes the result to the 8-bit I/O port specified by Port. The
346 value written to the I/O port is returned. This function must guarantee that
347 all I/O read and write operations are serialized. Extra left bits in both
348 AndData and OrData are stripped.
349
350 If 8-bit I/O port operations are not supported, then ASSERT().
351 If StartBit is greater than 7, then ASSERT().
352 If EndBit is greater than 7, then ASSERT().
353 If EndBit is less than StartBit, then ASSERT().
354 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
355 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
356
357 @param Port The I/O port to write.
358 @param StartBit The ordinal of the least significant bit in the bit field.
359 Range 0..7.
360 @param EndBit The ordinal of the most significant bit in the bit field.
361 Range 0..7.
362 @param AndData The value to AND with the read value from the I/O port.
363 @param OrData The value to OR with the result of the AND operation.
364
365 @return The value written back to the I/O port.
366
367 **/
368 UINT8
369 EFIAPI
370 IoBitFieldAndThenOr8 (
371 IN UINTN Port,
372 IN UINTN StartBit,
373 IN UINTN EndBit,
374 IN UINT8 AndData,
375 IN UINT8 OrData
376 );
377
378 /**
379 Reads a 16-bit I/O port.
380
381 Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
382 This function must guarantee that all I/O read and write operations are
383 serialized.
384
385 If 16-bit I/O port operations are not supported, then ASSERT().
386 If Port is not aligned on a 16-bit boundary, then ASSERT().
387
388 @param Port The I/O port to read.
389
390 @return The value read.
391
392 **/
393 UINT16
394 EFIAPI
395 IoRead16 (
396 IN UINTN Port
397 );
398
399 /**
400 Writes a 16-bit I/O port.
401
402 Writes the 16-bit I/O port specified by Port with the value specified by Value
403 and returns Value. This function must guarantee that all I/O read and write
404 operations are serialized.
405
406 If 16-bit I/O port operations are not supported, then ASSERT().
407 If Port is not aligned on a 16-bit boundary, then ASSERT().
408
409 @param Port The I/O port to write.
410 @param Value The value to write to the I/O port.
411
412 @return The value written the I/O port.
413
414 **/
415 UINT16
416 EFIAPI
417 IoWrite16 (
418 IN UINTN Port,
419 IN UINT16 Value
420 );
421
422 /**
423 Reads a 16-bit I/O port fifo into a block of memory.
424
425 Reads the 16-bit I/O fifo port specified by Port.
426 The port is read Count times, and the read data is
427 stored in the provided Buffer.
428
429 This function must guarantee that all I/O read and write operations are
430 serialized.
431
432 If 16-bit I/O port operations are not supported, then ASSERT().
433
434 @param Port The I/O port to read.
435 @param Count The number of times to read I/O port.
436 @param Buffer The buffer to store the read data into.
437
438 **/
439 VOID
440 EFIAPI
441 IoReadFifo16 (
442 IN UINTN Port,
443 IN UINTN Count,
444 OUT VOID *Buffer
445 );
446
447 /**
448 Writes a block of memory into a 16-bit I/O port fifo.
449
450 Writes the 16-bit I/O fifo port specified by Port.
451 The port is written Count times, and the write data is
452 retrieved from the provided Buffer.
453
454 This function must guarantee that all I/O write and write operations are
455 serialized.
456
457 If 16-bit I/O port operations are not supported, then ASSERT().
458
459 @param Port The I/O port to write.
460 @param Count The number of times to write I/O port.
461 @param Buffer The buffer to retrieve the write data from.
462
463 **/
464 VOID
465 EFIAPI
466 IoWriteFifo16 (
467 IN UINTN Port,
468 IN UINTN Count,
469 IN VOID *Buffer
470 );
471
472 /**
473 Reads a 16-bit I/O port, performs a bitwise OR, and writes the
474 result back to the 16-bit I/O port.
475
476 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
477 between the read result and the value specified by OrData, and writes the
478 result to the 16-bit I/O port specified by Port. The value written to the I/O
479 port is returned. This function must guarantee that all I/O read and write
480 operations are serialized.
481
482 If 16-bit I/O port operations are not supported, then ASSERT().
483 If Port is not aligned on a 16-bit boundary, then ASSERT().
484
485 @param Port The I/O port to write.
486 @param OrData The value to OR with the read value from the I/O port.
487
488 @return The value written back to the I/O port.
489
490 **/
491 UINT16
492 EFIAPI
493 IoOr16 (
494 IN UINTN Port,
495 IN UINT16 OrData
496 );
497
498 /**
499 Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
500 to the 16-bit I/O port.
501
502 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
503 the read result and the value specified by AndData, and writes the result to
504 the 16-bit I/O port specified by Port. The value written to the I/O port is
505 returned. This function must guarantee that all I/O read and write operations
506 are serialized.
507
508 If 16-bit I/O port operations are not supported, then ASSERT().
509 If Port is not aligned on a 16-bit boundary, then ASSERT().
510
511 @param Port The I/O port to write.
512 @param AndData The value to AND with the read value from the I/O port.
513
514 @return The value written back to the I/O port.
515
516 **/
517 UINT16
518 EFIAPI
519 IoAnd16 (
520 IN UINTN Port,
521 IN UINT16 AndData
522 );
523
524 /**
525 Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
526 OR, and writes the result back to the 16-bit I/O port.
527
528 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
529 the read result and the value specified by AndData, performs a bitwise OR
530 between the result of the AND operation and the value specified by OrData,
531 and writes the result to the 16-bit I/O port specified by Port. The value
532 written to the I/O port is returned. This function must guarantee that all
533 I/O read and write operations are serialized.
534
535 If 16-bit I/O port operations are not supported, then ASSERT().
536 If Port is not aligned on a 16-bit boundary, then ASSERT().
537
538 @param Port The I/O port to write.
539 @param AndData The value to AND with the read value from the I/O port.
540 @param OrData The value to OR with the result of the AND operation.
541
542 @return The value written back to the I/O port.
543
544 **/
545 UINT16
546 EFIAPI
547 IoAndThenOr16 (
548 IN UINTN Port,
549 IN UINT16 AndData,
550 IN UINT16 OrData
551 );
552
553 /**
554 Reads a bit field of an I/O register.
555
556 Reads the bit field in a 16-bit I/O register. The bit field is specified by
557 the StartBit and the EndBit. The value of the bit field is returned.
558
559 If 16-bit I/O port operations are not supported, then ASSERT().
560 If Port is not aligned on a 16-bit boundary, then ASSERT().
561 If StartBit is greater than 15, then ASSERT().
562 If EndBit is greater than 15, then ASSERT().
563 If EndBit is less than StartBit, then ASSERT().
564
565 @param Port The I/O port to read.
566 @param StartBit The ordinal of the least significant bit in the bit field.
567 Range 0..15.
568 @param EndBit The ordinal of the most significant bit in the bit field.
569 Range 0..15.
570
571 @return The value read.
572
573 **/
574 UINT16
575 EFIAPI
576 IoBitFieldRead16 (
577 IN UINTN Port,
578 IN UINTN StartBit,
579 IN UINTN EndBit
580 );
581
582 /**
583 Writes a bit field to an I/O register.
584
585 Writes Value to the bit field of the I/O register. The bit field is specified
586 by the StartBit and the EndBit. All other bits in the destination I/O
587 register are preserved. The value written to the I/O port is returned. Extra
588 left bits in Value are stripped.
589
590 If 16-bit I/O port operations are not supported, then ASSERT().
591 If Port is not aligned on a 16-bit boundary, then ASSERT().
592 If StartBit is greater than 15, then ASSERT().
593 If EndBit is greater than 15, then ASSERT().
594 If EndBit is less than StartBit, then ASSERT().
595 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
596
597 @param Port The I/O port to write.
598 @param StartBit The ordinal of the least significant bit in the bit field.
599 Range 0..15.
600 @param EndBit The ordinal of the most significant bit in the bit field.
601 Range 0..15.
602 @param Value New value of the bit field.
603
604 @return The value written back to the I/O port.
605
606 **/
607 UINT16
608 EFIAPI
609 IoBitFieldWrite16 (
610 IN UINTN Port,
611 IN UINTN StartBit,
612 IN UINTN EndBit,
613 IN UINT16 Value
614 );
615
616 /**
617 Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
618 result back to the bit field in the 16-bit port.
619
620 Reads the 16-bit I/O port specified by Port, performs a bitwise OR
621 between the read result and the value specified by OrData, and writes the
622 result to the 16-bit I/O port specified by Port. The value written to the I/O
623 port is returned. This function must guarantee that all I/O read and write
624 operations are serialized. Extra left bits in OrData are stripped.
625
626 If 16-bit I/O port operations are not supported, then ASSERT().
627 If Port is not aligned on a 16-bit boundary, then ASSERT().
628 If StartBit is greater than 15, then ASSERT().
629 If EndBit is greater than 15, then ASSERT().
630 If EndBit is less than StartBit, then ASSERT().
631 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
632
633 @param Port The I/O port to write.
634 @param StartBit The ordinal of the least significant bit in the bit field.
635 Range 0..15.
636 @param EndBit The ordinal of the most significant bit in the bit field.
637 Range 0..15.
638 @param OrData The value to OR with the read value from the I/O port.
639
640 @return The value written back to the I/O port.
641
642 **/
643 UINT16
644 EFIAPI
645 IoBitFieldOr16 (
646 IN UINTN Port,
647 IN UINTN StartBit,
648 IN UINTN EndBit,
649 IN UINT16 OrData
650 );
651
652 /**
653 Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
654 result back to the bit field in the 16-bit port.
655
656 Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
657 the read result and the value specified by AndData, and writes the result to
658 the 16-bit I/O port specified by Port. The value written to the I/O port is
659 returned. This function must guarantee that all I/O read and write operations
660 are serialized. Extra left bits in AndData are stripped.
661
662 If 16-bit I/O port operations are not supported, then ASSERT().
663 If Port is not aligned on a 16-bit boundary, then ASSERT().
664 If StartBit is greater than 15, then ASSERT().
665 If EndBit is greater than 15, then ASSERT().
666 If EndBit is less than StartBit, then ASSERT().
667 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
668
669 @param Port The I/O port to write.
670 @param StartBit The ordinal of the least significant bit in the bit field.
671 Range 0..15.
672 @param EndBit The ordinal of the most significant bit in the bit field.
673 Range 0..15.
674 @param AndData The value to AND with the read value from the I/O port.
675
676 @return The value written back to the I/O port.
677
678 **/
679 UINT16
680 EFIAPI
681 IoBitFieldAnd16 (
682 IN UINTN Port,
683 IN UINTN StartBit,
684 IN UINTN EndBit,
685 IN UINT16 AndData
686 );
687
688 /**
689 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
690 bitwise OR, and writes the result back to the bit field in the
691 16-bit port.
692
693 Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
694 by a bitwise OR between the read result and the value specified by
695 AndData, and writes the result to the 16-bit I/O port specified by Port. The
696 value written to the I/O port is returned. This function must guarantee that
697 all I/O read and write operations are serialized. Extra left bits in both
698 AndData and OrData are stripped.
699
700 If 16-bit I/O port operations are not supported, then ASSERT().
701 If Port is not aligned on a 16-bit boundary, then ASSERT().
702 If StartBit is greater than 15, then ASSERT().
703 If EndBit is greater than 15, then ASSERT().
704 If EndBit is less than StartBit, then ASSERT().
705 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
706 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
707
708 @param Port The I/O port to write.
709 @param StartBit The ordinal of the least significant bit in the bit field.
710 Range 0..15.
711 @param EndBit The ordinal of the most significant bit in the bit field.
712 Range 0..15.
713 @param AndData The value to AND with the read value from the I/O port.
714 @param OrData The value to OR with the result of the AND operation.
715
716 @return The value written back to the I/O port.
717
718 **/
719 UINT16
720 EFIAPI
721 IoBitFieldAndThenOr16 (
722 IN UINTN Port,
723 IN UINTN StartBit,
724 IN UINTN EndBit,
725 IN UINT16 AndData,
726 IN UINT16 OrData
727 );
728
729 /**
730 Reads a 32-bit I/O port.
731
732 Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
733 This function must guarantee that all I/O read and write operations are
734 serialized.
735
736 If 32-bit I/O port operations are not supported, then ASSERT().
737 If Port is not aligned on a 32-bit boundary, then ASSERT().
738
739 @param Port The I/O port to read.
740
741 @return The value read.
742
743 **/
744 UINT32
745 EFIAPI
746 IoRead32 (
747 IN UINTN Port
748 );
749
750 /**
751 Writes a 32-bit I/O port.
752
753 Writes the 32-bit I/O port specified by Port with the value specified by Value
754 and returns Value. This function must guarantee that all I/O read and write
755 operations are serialized.
756
757 If 32-bit I/O port operations are not supported, then ASSERT().
758 If Port is not aligned on a 32-bit boundary, then ASSERT().
759
760 @param Port The I/O port to write.
761 @param Value The value to write to the I/O port.
762
763 @return The value written the I/O port.
764
765 **/
766 UINT32
767 EFIAPI
768 IoWrite32 (
769 IN UINTN Port,
770 IN UINT32 Value
771 );
772
773 /**
774 Reads a 32-bit I/O port fifo into a block of memory.
775
776 Reads the 32-bit I/O fifo port specified by Port.
777 The port is read Count times, and the read data is
778 stored in the provided Buffer.
779
780 This function must guarantee that all I/O read and write operations are
781 serialized.
782
783 If 32-bit I/O port operations are not supported, then ASSERT().
784
785 @param Port The I/O port to read.
786 @param Count The number of times to read I/O port.
787 @param Buffer The buffer to store the read data into.
788
789 **/
790 VOID
791 EFIAPI
792 IoReadFifo32 (
793 IN UINTN Port,
794 IN UINTN Count,
795 OUT VOID *Buffer
796 );
797
798 /**
799 Writes a block of memory into a 32-bit I/O port fifo.
800
801 Writes the 32-bit I/O fifo port specified by Port.
802 The port is written Count times, and the write data is
803 retrieved from the provided Buffer.
804
805 This function must guarantee that all I/O write and write operations are
806 serialized.
807
808 If 32-bit I/O port operations are not supported, then ASSERT().
809
810 @param Port The I/O port to write.
811 @param Count The number of times to write I/O port.
812 @param Buffer The buffer to retrieve the write data from.
813
814 **/
815 VOID
816 EFIAPI
817 IoWriteFifo32 (
818 IN UINTN Port,
819 IN UINTN Count,
820 IN VOID *Buffer
821 );
822
823 /**
824 Reads a 32-bit I/O port, performs a bitwise OR, and writes the
825 result back to the 32-bit I/O port.
826
827 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
828 between the read result and the value specified by OrData, and writes the
829 result to the 32-bit I/O port specified by Port. The value written to the I/O
830 port is returned. This function must guarantee that all I/O read and write
831 operations are serialized.
832
833 If 32-bit I/O port operations are not supported, then ASSERT().
834 If Port is not aligned on a 32-bit boundary, then ASSERT().
835
836 @param Port The I/O port to write.
837 @param OrData The value to OR with the read value from the I/O port.
838
839 @return The value written back to the I/O port.
840
841 **/
842 UINT32
843 EFIAPI
844 IoOr32 (
845 IN UINTN Port,
846 IN UINT32 OrData
847 );
848
849 /**
850 Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
851 to the 32-bit I/O port.
852
853 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
854 the read result and the value specified by AndData, and writes the result to
855 the 32-bit I/O port specified by Port. The value written to the I/O port is
856 returned. This function must guarantee that all I/O read and write operations
857 are serialized.
858
859 If 32-bit I/O port operations are not supported, then ASSERT().
860 If Port is not aligned on a 32-bit boundary, then ASSERT().
861
862 @param Port The I/O port to write.
863 @param AndData The value to AND with the read value from the I/O port.
864
865 @return The value written back to the I/O port.
866
867 **/
868 UINT32
869 EFIAPI
870 IoAnd32 (
871 IN UINTN Port,
872 IN UINT32 AndData
873 );
874
875 /**
876 Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
877 OR, and writes the result back to the 32-bit I/O port.
878
879 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
880 the read result and the value specified by AndData, performs a bitwise OR
881 between the result of the AND operation and the value specified by OrData,
882 and writes the result to the 32-bit I/O port specified by Port. The value
883 written to the I/O port is returned. This function must guarantee that all
884 I/O read and write operations are serialized.
885
886 If 32-bit I/O port operations are not supported, then ASSERT().
887 If Port is not aligned on a 32-bit boundary, then ASSERT().
888
889 @param Port The I/O port to write.
890 @param AndData The value to AND with the read value from the I/O port.
891 @param OrData The value to OR with the result of the AND operation.
892
893 @return The value written back to the I/O port.
894
895 **/
896 UINT32
897 EFIAPI
898 IoAndThenOr32 (
899 IN UINTN Port,
900 IN UINT32 AndData,
901 IN UINT32 OrData
902 );
903
904 /**
905 Reads a bit field of an I/O register.
906
907 Reads the bit field in a 32-bit I/O register. The bit field is specified by
908 the StartBit and the EndBit. The value of the bit field is returned.
909
910 If 32-bit I/O port operations are not supported, then ASSERT().
911 If Port is not aligned on a 32-bit boundary, then ASSERT().
912 If StartBit is greater than 31, then ASSERT().
913 If EndBit is greater than 31, then ASSERT().
914 If EndBit is less than StartBit, then ASSERT().
915
916 @param Port The I/O port to read.
917 @param StartBit The ordinal of the least significant bit in the bit field.
918 Range 0..31.
919 @param EndBit The ordinal of the most significant bit in the bit field.
920 Range 0..31.
921
922 @return The value read.
923
924 **/
925 UINT32
926 EFIAPI
927 IoBitFieldRead32 (
928 IN UINTN Port,
929 IN UINTN StartBit,
930 IN UINTN EndBit
931 );
932
933 /**
934 Writes a bit field to an I/O register.
935
936 Writes Value to the bit field of the I/O register. The bit field is specified
937 by the StartBit and the EndBit. All other bits in the destination I/O
938 register are preserved. The value written to the I/O port is returned. Extra
939 left bits in Value are stripped.
940
941 If 32-bit I/O port operations are not supported, then ASSERT().
942 If Port is not aligned on a 32-bit boundary, then ASSERT().
943 If StartBit is greater than 31, then ASSERT().
944 If EndBit is greater than 31, then ASSERT().
945 If EndBit is less than StartBit, then ASSERT().
946 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
947
948 @param Port The I/O port to write.
949 @param StartBit The ordinal of the least significant bit in the bit field.
950 Range 0..31.
951 @param EndBit The ordinal of the most significant bit in the bit field.
952 Range 0..31.
953 @param Value New value of the bit field.
954
955 @return The value written back to the I/O port.
956
957 **/
958 UINT32
959 EFIAPI
960 IoBitFieldWrite32 (
961 IN UINTN Port,
962 IN UINTN StartBit,
963 IN UINTN EndBit,
964 IN UINT32 Value
965 );
966
967 /**
968 Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
969 result back to the bit field in the 32-bit port.
970
971 Reads the 32-bit I/O port specified by Port, performs a bitwise OR
972 between the read result and the value specified by OrData, and writes the
973 result to the 32-bit I/O port specified by Port. The value written to the I/O
974 port is returned. This function must guarantee that all I/O read and write
975 operations are serialized. Extra left bits in OrData are stripped.
976
977 If 32-bit I/O port operations are not supported, then ASSERT().
978 If Port is not aligned on a 32-bit boundary, then ASSERT().
979 If StartBit is greater than 31, then ASSERT().
980 If EndBit is greater than 31, then ASSERT().
981 If EndBit is less than StartBit, then ASSERT().
982 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
983
984 @param Port The I/O port to write.
985 @param StartBit The ordinal of the least significant bit in the bit field.
986 Range 0..31.
987 @param EndBit The ordinal of the most significant bit in the bit field.
988 Range 0..31.
989 @param OrData The value to OR with the read value from the I/O port.
990
991 @return The value written back to the I/O port.
992
993 **/
994 UINT32
995 EFIAPI
996 IoBitFieldOr32 (
997 IN UINTN Port,
998 IN UINTN StartBit,
999 IN UINTN EndBit,
1000 IN UINT32 OrData
1001 );
1002
1003 /**
1004 Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
1005 result back to the bit field in the 32-bit port.
1006
1007 Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
1008 the read result and the value specified by AndData, and writes the result to
1009 the 32-bit I/O port specified by Port. The value written to the I/O port is
1010 returned. This function must guarantee that all I/O read and write operations
1011 are serialized. Extra left bits in AndData are stripped.
1012
1013 If 32-bit I/O port operations are not supported, then ASSERT().
1014 If Port is not aligned on a 32-bit boundary, then ASSERT().
1015 If StartBit is greater than 31, then ASSERT().
1016 If EndBit is greater than 31, then ASSERT().
1017 If EndBit is less than StartBit, then ASSERT().
1018 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1019
1020 @param Port The I/O port to write.
1021 @param StartBit The ordinal of the least significant bit in the bit field.
1022 Range 0..31.
1023 @param EndBit The ordinal of the most significant bit in the bit field.
1024 Range 0..31.
1025 @param AndData The value to AND with the read value from the I/O port.
1026
1027 @return The value written back to the I/O port.
1028
1029 **/
1030 UINT32
1031 EFIAPI
1032 IoBitFieldAnd32 (
1033 IN UINTN Port,
1034 IN UINTN StartBit,
1035 IN UINTN EndBit,
1036 IN UINT32 AndData
1037 );
1038
1039 /**
1040 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
1041 bitwise OR, and writes the result back to the bit field in the
1042 32-bit port.
1043
1044 Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
1045 by a bitwise OR between the read result and the value specified by
1046 AndData, and writes the result to the 32-bit I/O port specified by Port. The
1047 value written to the I/O port is returned. This function must guarantee that
1048 all I/O read and write operations are serialized. Extra left bits in both
1049 AndData and OrData are stripped.
1050
1051 If 32-bit I/O port operations are not supported, then ASSERT().
1052 If Port is not aligned on a 32-bit boundary, then ASSERT().
1053 If StartBit is greater than 31, then ASSERT().
1054 If EndBit is greater than 31, then ASSERT().
1055 If EndBit is less than StartBit, then ASSERT().
1056 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1057 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1058
1059 @param Port The I/O port to write.
1060 @param StartBit The ordinal of the least significant bit in the bit field.
1061 Range 0..31.
1062 @param EndBit The ordinal of the most significant bit in the bit field.
1063 Range 0..31.
1064 @param AndData The value to AND with the read value from the I/O port.
1065 @param OrData The value to OR with the result of the AND operation.
1066
1067 @return The value written back to the I/O port.
1068
1069 **/
1070 UINT32
1071 EFIAPI
1072 IoBitFieldAndThenOr32 (
1073 IN UINTN Port,
1074 IN UINTN StartBit,
1075 IN UINTN EndBit,
1076 IN UINT32 AndData,
1077 IN UINT32 OrData
1078 );
1079
1080 /**
1081 Reads a 64-bit I/O port.
1082
1083 Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
1084 This function must guarantee that all I/O read and write operations are
1085 serialized.
1086
1087 If 64-bit I/O port operations are not supported, then ASSERT().
1088 If Port is not aligned on a 64-bit boundary, then ASSERT().
1089
1090 @param Port The I/O port to read.
1091
1092 @return The value read.
1093
1094 **/
1095 UINT64
1096 EFIAPI
1097 IoRead64 (
1098 IN UINTN Port
1099 );
1100
1101 /**
1102 Writes a 64-bit I/O port.
1103
1104 Writes the 64-bit I/O port specified by Port with the value specified by Value
1105 and returns Value. This function must guarantee that all I/O read and write
1106 operations are serialized.
1107
1108 If 64-bit I/O port operations are not supported, then ASSERT().
1109 If Port is not aligned on a 64-bit boundary, then ASSERT().
1110
1111 @param Port The I/O port to write.
1112 @param Value The value to write to the I/O port.
1113
1114 @return The value written the I/O port.
1115
1116 **/
1117 UINT64
1118 EFIAPI
1119 IoWrite64 (
1120 IN UINTN Port,
1121 IN UINT64 Value
1122 );
1123
1124 /**
1125 Reads a 64-bit I/O port, performs a bitwise OR, and writes the
1126 result back to the 64-bit I/O port.
1127
1128 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1129 between the read result and the value specified by OrData, and writes the
1130 result to the 64-bit I/O port specified by Port. The value written to the I/O
1131 port is returned. This function must guarantee that all I/O read and write
1132 operations are serialized.
1133
1134 If 64-bit I/O port operations are not supported, then ASSERT().
1135 If Port is not aligned on a 64-bit boundary, then ASSERT().
1136
1137 @param Port The I/O port to write.
1138 @param OrData The value to OR with the read value from the I/O port.
1139
1140 @return The value written back to the I/O port.
1141
1142 **/
1143 UINT64
1144 EFIAPI
1145 IoOr64 (
1146 IN UINTN Port,
1147 IN UINT64 OrData
1148 );
1149
1150 /**
1151 Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
1152 to the 64-bit I/O port.
1153
1154 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1155 the read result and the value specified by AndData, and writes the result to
1156 the 64-bit I/O port specified by Port. The value written to the I/O port is
1157 returned. This function must guarantee that all I/O read and write operations
1158 are serialized.
1159
1160 If 64-bit I/O port operations are not supported, then ASSERT().
1161 If Port is not aligned on a 64-bit boundary, then ASSERT().
1162
1163 @param Port The I/O port to write.
1164 @param AndData The value to AND with the read value from the I/O port.
1165
1166 @return The value written back to the I/O port.
1167
1168 **/
1169 UINT64
1170 EFIAPI
1171 IoAnd64 (
1172 IN UINTN Port,
1173 IN UINT64 AndData
1174 );
1175
1176 /**
1177 Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
1178 OR, and writes the result back to the 64-bit I/O port.
1179
1180 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1181 the read result and the value specified by AndData, performs a bitwise OR
1182 between the result of the AND operation and the value specified by OrData,
1183 and writes the result to the 64-bit I/O port specified by Port. The value
1184 written to the I/O port is returned. This function must guarantee that all
1185 I/O read and write operations are serialized.
1186
1187 If 64-bit I/O port operations are not supported, then ASSERT().
1188 If Port is not aligned on a 64-bit boundary, then ASSERT().
1189
1190 @param Port The I/O port to write.
1191 @param AndData The value to AND with the read value from the I/O port.
1192 @param OrData The value to OR with the result of the AND operation.
1193
1194 @return The value written back to the I/O port.
1195
1196 **/
1197 UINT64
1198 EFIAPI
1199 IoAndThenOr64 (
1200 IN UINTN Port,
1201 IN UINT64 AndData,
1202 IN UINT64 OrData
1203 );
1204
1205 /**
1206 Reads a bit field of an I/O register.
1207
1208 Reads the bit field in a 64-bit I/O register. The bit field is specified by
1209 the StartBit and the EndBit. The value of the bit field is returned.
1210
1211 If 64-bit I/O port operations are not supported, then ASSERT().
1212 If Port is not aligned on a 64-bit boundary, then ASSERT().
1213 If StartBit is greater than 63, then ASSERT().
1214 If EndBit is greater than 63, then ASSERT().
1215 If EndBit is less than StartBit, then ASSERT().
1216
1217 @param Port The I/O port to read.
1218 @param StartBit The ordinal of the least significant bit in the bit field.
1219 Range 0..63.
1220 @param EndBit The ordinal of the most significant bit in the bit field.
1221 Range 0..63.
1222
1223 @return The value read.
1224
1225 **/
1226 UINT64
1227 EFIAPI
1228 IoBitFieldRead64 (
1229 IN UINTN Port,
1230 IN UINTN StartBit,
1231 IN UINTN EndBit
1232 );
1233
1234 /**
1235 Writes a bit field to an I/O register.
1236
1237 Writes Value to the bit field of the I/O register. The bit field is specified
1238 by the StartBit and the EndBit. All other bits in the destination I/O
1239 register are preserved. The value written to the I/O port is returned. Extra
1240 left bits in Value are stripped.
1241
1242 If 64-bit I/O port operations are not supported, then ASSERT().
1243 If Port is not aligned on a 64-bit boundary, then ASSERT().
1244 If StartBit is greater than 63, then ASSERT().
1245 If EndBit is greater than 63, then ASSERT().
1246 If EndBit is less than StartBit, then ASSERT().
1247 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1248
1249 @param Port The I/O port to write.
1250 @param StartBit The ordinal of the least significant bit in the bit field.
1251 Range 0..63.
1252 @param EndBit The ordinal of the most significant bit in the bit field.
1253 Range 0..63.
1254 @param Value New value of the bit field.
1255
1256 @return The value written back to the I/O port.
1257
1258 **/
1259 UINT64
1260 EFIAPI
1261 IoBitFieldWrite64 (
1262 IN UINTN Port,
1263 IN UINTN StartBit,
1264 IN UINTN EndBit,
1265 IN UINT64 Value
1266 );
1267
1268 /**
1269 Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
1270 result back to the bit field in the 64-bit port.
1271
1272 Reads the 64-bit I/O port specified by Port, performs a bitwise OR
1273 between the read result and the value specified by OrData, and writes the
1274 result to the 64-bit I/O port specified by Port. The value written to the I/O
1275 port is returned. This function must guarantee that all I/O read and write
1276 operations are serialized. Extra left bits in OrData are stripped.
1277
1278 If 64-bit I/O port operations are not supported, then ASSERT().
1279 If Port is not aligned on a 64-bit boundary, then ASSERT().
1280 If StartBit is greater than 63, then ASSERT().
1281 If EndBit is greater than 63, then ASSERT().
1282 If EndBit is less than StartBit, then ASSERT().
1283 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1284
1285 @param Port The I/O port to write.
1286 @param StartBit The ordinal of the least significant bit in the bit field.
1287 Range 0..63.
1288 @param EndBit The ordinal of the most significant bit in the bit field.
1289 Range 0..63.
1290 @param OrData The value to OR with the read value from the I/O port.
1291
1292 @return The value written back to the I/O port.
1293
1294 **/
1295 UINT64
1296 EFIAPI
1297 IoBitFieldOr64 (
1298 IN UINTN Port,
1299 IN UINTN StartBit,
1300 IN UINTN EndBit,
1301 IN UINT64 OrData
1302 );
1303
1304 /**
1305 Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
1306 result back to the bit field in the 64-bit port.
1307
1308 Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
1309 the read result and the value specified by AndData, and writes the result to
1310 the 64-bit I/O port specified by Port. The value written to the I/O port is
1311 returned. This function must guarantee that all I/O read and write operations
1312 are serialized. Extra left bits in AndData are stripped.
1313
1314 If 64-bit I/O port operations are not supported, then ASSERT().
1315 If Port is not aligned on a 64-bit boundary, then ASSERT().
1316 If StartBit is greater than 63, then ASSERT().
1317 If EndBit is greater than 63, then ASSERT().
1318 If EndBit is less than StartBit, then ASSERT().
1319 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1320
1321 @param Port The I/O port to write.
1322 @param StartBit The ordinal of the least significant bit in the bit field.
1323 Range 0..63.
1324 @param EndBit The ordinal of the most significant bit in the bit field.
1325 Range 0..63.
1326 @param AndData The value to AND with the read value from the I/O port.
1327
1328 @return The value written back to the I/O port.
1329
1330 **/
1331 UINT64
1332 EFIAPI
1333 IoBitFieldAnd64 (
1334 IN UINTN Port,
1335 IN UINTN StartBit,
1336 IN UINTN EndBit,
1337 IN UINT64 AndData
1338 );
1339
1340 /**
1341 Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
1342 bitwise OR, and writes the result back to the bit field in the
1343 64-bit port.
1344
1345 Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
1346 by a bitwise OR between the read result and the value specified by
1347 AndData, and writes the result to the 64-bit I/O port specified by Port. The
1348 value written to the I/O port is returned. This function must guarantee that
1349 all I/O read and write operations are serialized. Extra left bits in both
1350 AndData and OrData are stripped.
1351
1352 If 64-bit I/O port operations are not supported, then ASSERT().
1353 If Port is not aligned on a 64-bit boundary, then ASSERT().
1354 If StartBit is greater than 63, then ASSERT().
1355 If EndBit is greater than 63, then ASSERT().
1356 If EndBit is less than StartBit, then ASSERT().
1357 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1358 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1359
1360 @param Port The I/O port to write.
1361 @param StartBit The ordinal of the least significant bit in the bit field.
1362 Range 0..63.
1363 @param EndBit The ordinal of the most significant bit in the bit field.
1364 Range 0..63.
1365 @param AndData The value to AND with the read value from the I/O port.
1366 @param OrData The value to OR with the result of the AND operation.
1367
1368 @return The value written back to the I/O port.
1369
1370 **/
1371 UINT64
1372 EFIAPI
1373 IoBitFieldAndThenOr64 (
1374 IN UINTN Port,
1375 IN UINTN StartBit,
1376 IN UINTN EndBit,
1377 IN UINT64 AndData,
1378 IN UINT64 OrData
1379 );
1380
1381 /**
1382 Reads an 8-bit MMIO register.
1383
1384 Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
1385 returned. This function must guarantee that all MMIO read and write
1386 operations are serialized.
1387
1388 If 8-bit MMIO register operations are not supported, then ASSERT().
1389
1390 @param Address The MMIO register to read.
1391
1392 @return The value read.
1393
1394 **/
1395 UINT8
1396 EFIAPI
1397 MmioRead8 (
1398 IN UINTN Address
1399 );
1400
1401 /**
1402 Writes an 8-bit MMIO register.
1403
1404 Writes the 8-bit MMIO register specified by Address with the value specified
1405 by Value and returns Value. This function must guarantee that all MMIO read
1406 and write operations are serialized.
1407
1408 If 8-bit MMIO register operations are not supported, then ASSERT().
1409
1410 @param Address The MMIO register to write.
1411 @param Value The value to write to the MMIO register.
1412
1413 @return Value.
1414
1415 **/
1416 UINT8
1417 EFIAPI
1418 MmioWrite8 (
1419 IN UINTN Address,
1420 IN UINT8 Value
1421 );
1422
1423 /**
1424 Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
1425 result back to the 8-bit MMIO register.
1426
1427 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1428 OR between the read result and the value specified by OrData, and
1429 writes the result to the 8-bit MMIO register specified by Address. The value
1430 written to the MMIO register is returned. This function must guarantee that
1431 all MMIO read and write operations are serialized.
1432
1433 If 8-bit MMIO register operations are not supported, then ASSERT().
1434
1435 @param Address The MMIO register to write.
1436 @param OrData The value to OR with the read value from the MMIO register.
1437
1438 @return The value written back to the MMIO register.
1439
1440 **/
1441 UINT8
1442 EFIAPI
1443 MmioOr8 (
1444 IN UINTN Address,
1445 IN UINT8 OrData
1446 );
1447
1448 /**
1449 Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
1450 back to the 8-bit MMIO register.
1451
1452 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1453 between the read result and the value specified by AndData, and writes the
1454 result to the 8-bit MMIO register specified by Address. The value written to
1455 the MMIO register is returned. This function must guarantee that all MMIO
1456 read and write operations are serialized.
1457
1458 If 8-bit MMIO register operations are not supported, then ASSERT().
1459
1460 @param Address The MMIO register to write.
1461 @param AndData The value to AND with the read value from the MMIO register.
1462
1463 @return The value written back to the MMIO register.
1464
1465 **/
1466 UINT8
1467 EFIAPI
1468 MmioAnd8 (
1469 IN UINTN Address,
1470 IN UINT8 AndData
1471 );
1472
1473 /**
1474 Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
1475 OR, and writes the result back to the 8-bit MMIO register.
1476
1477 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1478 between the read result and the value specified by AndData, performs a
1479 bitwise OR between the result of the AND operation and the value specified by
1480 OrData, and writes the result to the 8-bit MMIO register specified by
1481 Address. The value written to the MMIO register is returned. This function
1482 must guarantee that all MMIO read and write operations are serialized.
1483
1484 If 8-bit MMIO register operations are not supported, then ASSERT().
1485
1486
1487 @param Address The MMIO register to write.
1488 @param AndData The value to AND with the read value from the MMIO register.
1489 @param OrData The value to OR with the result of the AND operation.
1490
1491 @return The value written back to the MMIO register.
1492
1493 **/
1494 UINT8
1495 EFIAPI
1496 MmioAndThenOr8 (
1497 IN UINTN Address,
1498 IN UINT8 AndData,
1499 IN UINT8 OrData
1500 );
1501
1502 /**
1503 Reads a bit field of a MMIO register.
1504
1505 Reads the bit field in an 8-bit MMIO register. The bit field is specified by
1506 the StartBit and the EndBit. The value of the bit field is returned.
1507
1508 If 8-bit MMIO register operations are not supported, then ASSERT().
1509 If StartBit is greater than 7, then ASSERT().
1510 If EndBit is greater than 7, then ASSERT().
1511 If EndBit is less than StartBit, then ASSERT().
1512
1513 @param Address MMIO register to read.
1514 @param StartBit The ordinal of the least significant bit in the bit field.
1515 Range 0..7.
1516 @param EndBit The ordinal of the most significant bit in the bit field.
1517 Range 0..7.
1518
1519 @return The value read.
1520
1521 **/
1522 UINT8
1523 EFIAPI
1524 MmioBitFieldRead8 (
1525 IN UINTN Address,
1526 IN UINTN StartBit,
1527 IN UINTN EndBit
1528 );
1529
1530 /**
1531 Writes a bit field to a MMIO register.
1532
1533 Writes Value to the bit field of the MMIO register. The bit field is
1534 specified by the StartBit and the EndBit. All other bits in the destination
1535 MMIO register are preserved. The new value of the 8-bit register is returned.
1536
1537 If 8-bit MMIO register operations are not supported, then ASSERT().
1538 If StartBit is greater than 7, then ASSERT().
1539 If EndBit is greater than 7, then ASSERT().
1540 If EndBit is less than StartBit, then ASSERT().
1541 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1542
1543 @param Address MMIO register to write.
1544 @param StartBit The ordinal of the least significant bit in the bit field.
1545 Range 0..7.
1546 @param EndBit The ordinal of the most significant bit in the bit field.
1547 Range 0..7.
1548 @param Value New value of the bit field.
1549
1550 @return The value written back to the MMIO register.
1551
1552 **/
1553 UINT8
1554 EFIAPI
1555 MmioBitFieldWrite8 (
1556 IN UINTN Address,
1557 IN UINTN StartBit,
1558 IN UINTN EndBit,
1559 IN UINT8 Value
1560 );
1561
1562 /**
1563 Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
1564 writes the result back to the bit field in the 8-bit MMIO register.
1565
1566 Reads the 8-bit MMIO register specified by Address, performs a bitwise
1567 OR between the read result and the value specified by OrData, and
1568 writes the result to the 8-bit MMIO register specified by Address. The value
1569 written to the MMIO register is returned. This function must guarantee that
1570 all MMIO read and write operations are serialized. Extra left bits in OrData
1571 are stripped.
1572
1573 If 8-bit MMIO register operations are not supported, then ASSERT().
1574 If StartBit is greater than 7, then ASSERT().
1575 If EndBit is greater than 7, then ASSERT().
1576 If EndBit is less than StartBit, then ASSERT().
1577 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1578
1579 @param Address MMIO register to write.
1580 @param StartBit The ordinal of the least significant bit in the bit field.
1581 Range 0..7.
1582 @param EndBit The ordinal of the most significant bit in the bit field.
1583 Range 0..7.
1584 @param OrData The value to OR with read value from the MMIO register.
1585
1586 @return The value written back to the MMIO register.
1587
1588 **/
1589 UINT8
1590 EFIAPI
1591 MmioBitFieldOr8 (
1592 IN UINTN Address,
1593 IN UINTN StartBit,
1594 IN UINTN EndBit,
1595 IN UINT8 OrData
1596 );
1597
1598 /**
1599 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
1600 writes the result back to the bit field in the 8-bit MMIO register.
1601
1602 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1603 between the read result and the value specified by AndData, and writes the
1604 result to the 8-bit MMIO register specified by Address. The value written to
1605 the MMIO register is returned. This function must guarantee that all MMIO
1606 read and write operations are serialized. Extra left bits in AndData are
1607 stripped.
1608
1609 If 8-bit MMIO register operations are not supported, then ASSERT().
1610 If StartBit is greater than 7, then ASSERT().
1611 If EndBit is greater than 7, then ASSERT().
1612 If EndBit is less than StartBit, then ASSERT().
1613 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1614
1615 @param Address MMIO register to write.
1616 @param StartBit The ordinal of the least significant bit in the bit field.
1617 Range 0..7.
1618 @param EndBit The ordinal of the most significant bit in the bit field.
1619 Range 0..7.
1620 @param AndData The value to AND with read value from the MMIO register.
1621
1622 @return The value written back to the MMIO register.
1623
1624 **/
1625 UINT8
1626 EFIAPI
1627 MmioBitFieldAnd8 (
1628 IN UINTN Address,
1629 IN UINTN StartBit,
1630 IN UINTN EndBit,
1631 IN UINT8 AndData
1632 );
1633
1634 /**
1635 Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
1636 by a bitwise OR, and writes the result back to the bit field in the
1637 8-bit MMIO register.
1638
1639 Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
1640 followed by a bitwise OR between the read result and the value
1641 specified by AndData, and writes the result to the 8-bit MMIO register
1642 specified by Address. The value written to the MMIO register is returned.
1643 This function must guarantee that all MMIO read and write operations are
1644 serialized. Extra left bits in both AndData and OrData are stripped.
1645
1646 If 8-bit MMIO register operations are not supported, then ASSERT().
1647 If StartBit is greater than 7, then ASSERT().
1648 If EndBit is greater than 7, then ASSERT().
1649 If EndBit is less than StartBit, then ASSERT().
1650 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1651 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1652
1653 @param Address MMIO register to write.
1654 @param StartBit The ordinal of the least significant bit in the bit field.
1655 Range 0..7.
1656 @param EndBit The ordinal of the most significant bit in the bit field.
1657 Range 0..7.
1658 @param AndData The value to AND with read value from the MMIO register.
1659 @param OrData The value to OR with the result of the AND operation.
1660
1661 @return The value written back to the MMIO register.
1662
1663 **/
1664 UINT8
1665 EFIAPI
1666 MmioBitFieldAndThenOr8 (
1667 IN UINTN Address,
1668 IN UINTN StartBit,
1669 IN UINTN EndBit,
1670 IN UINT8 AndData,
1671 IN UINT8 OrData
1672 );
1673
1674 /**
1675 Reads a 16-bit MMIO register.
1676
1677 Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
1678 returned. This function must guarantee that all MMIO read and write
1679 operations are serialized.
1680
1681 If 16-bit MMIO register operations are not supported, then ASSERT().
1682 If Address is not aligned on a 16-bit boundary, then ASSERT().
1683
1684 @param Address The MMIO register to read.
1685
1686 @return The value read.
1687
1688 **/
1689 UINT16
1690 EFIAPI
1691 MmioRead16 (
1692 IN UINTN Address
1693 );
1694
1695 /**
1696 Writes a 16-bit MMIO register.
1697
1698 Writes the 16-bit MMIO register specified by Address with the value specified
1699 by Value and returns Value. This function must guarantee that all MMIO read
1700 and write operations are serialized.
1701
1702 If 16-bit MMIO register operations are not supported, then ASSERT().
1703 If Address is not aligned on a 16-bit boundary, then ASSERT().
1704
1705 @param Address The MMIO register to write.
1706 @param Value The value to write to the MMIO register.
1707
1708 @return Value.
1709
1710 **/
1711 UINT16
1712 EFIAPI
1713 MmioWrite16 (
1714 IN UINTN Address,
1715 IN UINT16 Value
1716 );
1717
1718 /**
1719 Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
1720 result back to the 16-bit MMIO register.
1721
1722 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1723 OR between the read result and the value specified by OrData, and
1724 writes the result to the 16-bit MMIO register specified by Address. The value
1725 written to the MMIO register is returned. This function must guarantee that
1726 all MMIO read and write operations are serialized.
1727
1728 If 16-bit MMIO register operations are not supported, then ASSERT().
1729 If Address is not aligned on a 16-bit boundary, then ASSERT().
1730
1731 @param Address The MMIO register to write.
1732 @param OrData The value to OR with the read value from the MMIO register.
1733
1734 @return The value written back to the MMIO register.
1735
1736 **/
1737 UINT16
1738 EFIAPI
1739 MmioOr16 (
1740 IN UINTN Address,
1741 IN UINT16 OrData
1742 );
1743
1744 /**
1745 Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
1746 back to the 16-bit MMIO register.
1747
1748 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1749 between the read result and the value specified by AndData, and writes the
1750 result to the 16-bit MMIO register specified by Address. The value written to
1751 the MMIO register is returned. This function must guarantee that all MMIO
1752 read and write operations are serialized.
1753
1754 If 16-bit MMIO register operations are not supported, then ASSERT().
1755 If Address is not aligned on a 16-bit boundary, then ASSERT().
1756
1757 @param Address The MMIO register to write.
1758 @param AndData The value to AND with the read value from the MMIO register.
1759
1760 @return The value written back to the MMIO register.
1761
1762 **/
1763 UINT16
1764 EFIAPI
1765 MmioAnd16 (
1766 IN UINTN Address,
1767 IN UINT16 AndData
1768 );
1769
1770 /**
1771 Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
1772 OR, and writes the result back to the 16-bit MMIO register.
1773
1774 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1775 between the read result and the value specified by AndData, performs a
1776 bitwise OR between the result of the AND operation and the value specified by
1777 OrData, and writes the result to the 16-bit MMIO register specified by
1778 Address. The value written to the MMIO register is returned. This function
1779 must guarantee that all MMIO read and write operations are serialized.
1780
1781 If 16-bit MMIO register operations are not supported, then ASSERT().
1782 If Address is not aligned on a 16-bit boundary, then ASSERT().
1783
1784 @param Address The MMIO register to write.
1785 @param AndData The value to AND with the read value from the MMIO register.
1786 @param OrData The value to OR with the result of the AND operation.
1787
1788 @return The value written back to the MMIO register.
1789
1790 **/
1791 UINT16
1792 EFIAPI
1793 MmioAndThenOr16 (
1794 IN UINTN Address,
1795 IN UINT16 AndData,
1796 IN UINT16 OrData
1797 );
1798
1799 /**
1800 Reads a bit field of a MMIO register.
1801
1802 Reads the bit field in a 16-bit MMIO register. The bit field is specified by
1803 the StartBit and the EndBit. The value of the bit field is returned.
1804
1805 If 16-bit MMIO register operations are not supported, then ASSERT().
1806 If Address is not aligned on a 16-bit boundary, then ASSERT().
1807 If StartBit is greater than 15, then ASSERT().
1808 If EndBit is greater than 15, then ASSERT().
1809 If EndBit is less than StartBit, then ASSERT().
1810
1811 @param Address MMIO register to read.
1812 @param StartBit The ordinal of the least significant bit in the bit field.
1813 Range 0..15.
1814 @param EndBit The ordinal of the most significant bit in the bit field.
1815 Range 0..15.
1816
1817 @return The value read.
1818
1819 **/
1820 UINT16
1821 EFIAPI
1822 MmioBitFieldRead16 (
1823 IN UINTN Address,
1824 IN UINTN StartBit,
1825 IN UINTN EndBit
1826 );
1827
1828 /**
1829 Writes a bit field to a MMIO register.
1830
1831 Writes Value to the bit field of the MMIO register. The bit field is
1832 specified by the StartBit and the EndBit. All other bits in the destination
1833 MMIO register are preserved. The new value of the 16-bit register is returned.
1834
1835 If 16-bit MMIO register operations are not supported, then ASSERT().
1836 If Address is not aligned on a 16-bit boundary, then ASSERT().
1837 If StartBit is greater than 15, then ASSERT().
1838 If EndBit is greater than 15, then ASSERT().
1839 If EndBit is less than StartBit, then ASSERT().
1840 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1841
1842 @param Address MMIO register to write.
1843 @param StartBit The ordinal of the least significant bit in the bit field.
1844 Range 0..15.
1845 @param EndBit The ordinal of the most significant bit in the bit field.
1846 Range 0..15.
1847 @param Value New value of the bit field.
1848
1849 @return The value written back to the MMIO register.
1850
1851 **/
1852 UINT16
1853 EFIAPI
1854 MmioBitFieldWrite16 (
1855 IN UINTN Address,
1856 IN UINTN StartBit,
1857 IN UINTN EndBit,
1858 IN UINT16 Value
1859 );
1860
1861 /**
1862 Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
1863 writes the result back to the bit field in the 16-bit MMIO register.
1864
1865 Reads the 16-bit MMIO register specified by Address, performs a bitwise
1866 OR between the read result and the value specified by OrData, and
1867 writes the result to the 16-bit MMIO register specified by Address. The value
1868 written to the MMIO register is returned. This function must guarantee that
1869 all MMIO read and write operations are serialized. Extra left bits in OrData
1870 are stripped.
1871
1872 If 16-bit MMIO register operations are not supported, then ASSERT().
1873 If Address is not aligned on a 16-bit boundary, then ASSERT().
1874 If StartBit is greater than 15, then ASSERT().
1875 If EndBit is greater than 15, then ASSERT().
1876 If EndBit is less than StartBit, then ASSERT().
1877 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1878
1879 @param Address MMIO register to write.
1880 @param StartBit The ordinal of the least significant bit in the bit field.
1881 Range 0..15.
1882 @param EndBit The ordinal of the most significant bit in the bit field.
1883 Range 0..15.
1884 @param OrData The value to OR with read value from the MMIO register.
1885
1886 @return The value written back to the MMIO register.
1887
1888 **/
1889 UINT16
1890 EFIAPI
1891 MmioBitFieldOr16 (
1892 IN UINTN Address,
1893 IN UINTN StartBit,
1894 IN UINTN EndBit,
1895 IN UINT16 OrData
1896 );
1897
1898 /**
1899 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
1900 writes the result back to the bit field in the 16-bit MMIO register.
1901
1902 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1903 between the read result and the value specified by AndData, and writes the
1904 result to the 16-bit MMIO register specified by Address. The value written to
1905 the MMIO register is returned. This function must guarantee that all MMIO
1906 read and write operations are serialized. Extra left bits in AndData are
1907 stripped.
1908
1909 If 16-bit MMIO register operations are not supported, then ASSERT().
1910 If Address is not aligned on a 16-bit boundary, then ASSERT().
1911 If StartBit is greater than 15, then ASSERT().
1912 If EndBit is greater than 15, then ASSERT().
1913 If EndBit is less than StartBit, then ASSERT().
1914 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1915
1916 @param Address MMIO register to write.
1917 @param StartBit The ordinal of the least significant bit in the bit field.
1918 Range 0..15.
1919 @param EndBit The ordinal of the most significant bit in the bit field.
1920 Range 0..15.
1921 @param AndData The value to AND with read value from the MMIO register.
1922
1923 @return The value written back to the MMIO register.
1924
1925 **/
1926 UINT16
1927 EFIAPI
1928 MmioBitFieldAnd16 (
1929 IN UINTN Address,
1930 IN UINTN StartBit,
1931 IN UINTN EndBit,
1932 IN UINT16 AndData
1933 );
1934
1935 /**
1936 Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
1937 by a bitwise OR, and writes the result back to the bit field in the
1938 16-bit MMIO register.
1939
1940 Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
1941 followed by a bitwise OR between the read result and the value
1942 specified by AndData, and writes the result to the 16-bit MMIO register
1943 specified by Address. The value written to the MMIO register is returned.
1944 This function must guarantee that all MMIO read and write operations are
1945 serialized. Extra left bits in both AndData and OrData are stripped.
1946
1947 If 16-bit MMIO register operations are not supported, then ASSERT().
1948 If Address is not aligned on a 16-bit boundary, then ASSERT().
1949 If StartBit is greater than 15, then ASSERT().
1950 If EndBit is greater than 15, then ASSERT().
1951 If EndBit is less than StartBit, then ASSERT().
1952 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1953 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
1954
1955 @param Address MMIO register to write.
1956 @param StartBit The ordinal of the least significant bit in the bit field.
1957 Range 0..15.
1958 @param EndBit The ordinal of the most significant bit in the bit field.
1959 Range 0..15.
1960 @param AndData The value to AND with read value from the MMIO register.
1961 @param OrData The value to OR with the result of the AND operation.
1962
1963 @return The value written back to the MMIO register.
1964
1965 **/
1966 UINT16
1967 EFIAPI
1968 MmioBitFieldAndThenOr16 (
1969 IN UINTN Address,
1970 IN UINTN StartBit,
1971 IN UINTN EndBit,
1972 IN UINT16 AndData,
1973 IN UINT16 OrData
1974 );
1975
1976 /**
1977 Reads a 32-bit MMIO register.
1978
1979 Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
1980 returned. This function must guarantee that all MMIO read and write
1981 operations are serialized.
1982
1983 If 32-bit MMIO register operations are not supported, then ASSERT().
1984 If Address is not aligned on a 32-bit boundary, then ASSERT().
1985
1986 @param Address The MMIO register to read.
1987
1988 @return The value read.
1989
1990 **/
1991 UINT32
1992 EFIAPI
1993 MmioRead32 (
1994 IN UINTN Address
1995 );
1996
1997 /**
1998 Writes a 32-bit MMIO register.
1999
2000 Writes the 32-bit MMIO register specified by Address with the value specified
2001 by Value and returns Value. This function must guarantee that all MMIO read
2002 and write operations are serialized.
2003
2004 If 32-bit MMIO register operations are not supported, then ASSERT().
2005 If Address is not aligned on a 32-bit boundary, then ASSERT().
2006
2007 @param Address The MMIO register to write.
2008 @param Value The value to write to the MMIO register.
2009
2010 @return Value.
2011
2012 **/
2013 UINT32
2014 EFIAPI
2015 MmioWrite32 (
2016 IN UINTN Address,
2017 IN UINT32 Value
2018 );
2019
2020 /**
2021 Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
2022 result back to the 32-bit MMIO register.
2023
2024 Reads the 32-bit MMIO register specified by Address, performs a bitwise
2025 OR between the read result and the value specified by OrData, and
2026 writes the result to the 32-bit MMIO register specified by Address. The value
2027 written to the MMIO register is returned. This function must guarantee that
2028 all MMIO read and write operations are serialized.
2029
2030 If 32-bit MMIO register operations are not supported, then ASSERT().
2031 If Address is not aligned on a 32-bit boundary, then ASSERT().
2032
2033 @param Address The MMIO register to write.
2034 @param OrData The value to OR with the read value from the MMIO register.
2035
2036 @return The value written back to the MMIO register.
2037
2038 **/
2039 UINT32
2040 EFIAPI
2041 MmioOr32 (
2042 IN UINTN Address,
2043 IN UINT32 OrData
2044 );
2045
2046 /**
2047 Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
2048 back to the 32-bit MMIO register.
2049
2050 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2051 between the read result and the value specified by AndData, and writes the
2052 result to the 32-bit MMIO register specified by Address. The value written to
2053 the MMIO register is returned. This function must guarantee that all MMIO
2054 read and write operations are serialized.
2055
2056 If 32-bit MMIO register operations are not supported, then ASSERT().
2057 If Address is not aligned on a 32-bit boundary, then ASSERT().
2058
2059 @param Address The MMIO register to write.
2060 @param AndData The value to AND with the read value from the MMIO register.
2061
2062 @return The value written back to the MMIO register.
2063
2064 **/
2065 UINT32
2066 EFIAPI
2067 MmioAnd32 (
2068 IN UINTN Address,
2069 IN UINT32 AndData
2070 );
2071
2072 /**
2073 Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
2074 OR, and writes the result back to the 32-bit MMIO register.
2075
2076 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2077 between the read result and the value specified by AndData, performs a
2078 bitwise OR between the result of the AND operation and the value specified by
2079 OrData, and writes the result to the 32-bit MMIO register specified by
2080 Address. The value written to the MMIO register is returned. This function
2081 must guarantee that all MMIO read and write operations are serialized.
2082
2083 If 32-bit MMIO register operations are not supported, then ASSERT().
2084 If Address is not aligned on a 32-bit boundary, then ASSERT().
2085
2086 @param Address The MMIO register to write.
2087 @param AndData The value to AND with the read value from the MMIO register.
2088 @param OrData The value to OR with the result of the AND operation.
2089
2090 @return The value written back to the MMIO register.
2091
2092 **/
2093 UINT32
2094 EFIAPI
2095 MmioAndThenOr32 (
2096 IN UINTN Address,
2097 IN UINT32 AndData,
2098 IN UINT32 OrData
2099 );
2100
2101 /**
2102 Reads a bit field of a MMIO register.
2103
2104 Reads the bit field in a 32-bit MMIO register. The bit field is specified by
2105 the StartBit and the EndBit. The value of the bit field is returned.
2106
2107 If 32-bit MMIO register operations are not supported, then ASSERT().
2108 If Address is not aligned on a 32-bit boundary, then ASSERT().
2109 If StartBit is greater than 31, then ASSERT().
2110 If EndBit is greater than 31, then ASSERT().
2111 If EndBit is less than StartBit, then ASSERT().
2112
2113 @param Address MMIO register to read.
2114 @param StartBit The ordinal of the least significant bit in the bit field.
2115 Range 0..31.
2116 @param EndBit The ordinal of the most significant bit in the bit field.
2117 Range 0..31.
2118
2119 @return The value read.
2120
2121 **/
2122 UINT32
2123 EFIAPI
2124 MmioBitFieldRead32 (
2125 IN UINTN Address,
2126 IN UINTN StartBit,
2127 IN UINTN EndBit
2128 );
2129
2130 /**
2131 Writes a bit field to a MMIO register.
2132
2133 Writes Value to the bit field of the MMIO register. The bit field is
2134 specified by the StartBit and the EndBit. All other bits in the destination
2135 MMIO register are preserved. The new value of the 32-bit register is returned.
2136
2137 If 32-bit MMIO register operations are not supported, then ASSERT().
2138 If Address is not aligned on a 32-bit boundary, then ASSERT().
2139 If StartBit is greater than 31, then ASSERT().
2140 If EndBit is greater than 31, then ASSERT().
2141 If EndBit is less than StartBit, then ASSERT().
2142 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2143
2144 @param Address MMIO register to write.
2145 @param StartBit The ordinal of the least significant bit in the bit field.
2146 Range 0..31.
2147 @param EndBit The ordinal of the most significant bit in the bit field.
2148 Range 0..31.
2149 @param Value New value of the bit field.
2150
2151 @return The value written back to the MMIO register.
2152
2153 **/
2154 UINT32
2155 EFIAPI
2156 MmioBitFieldWrite32 (
2157 IN UINTN Address,
2158 IN UINTN StartBit,
2159 IN UINTN EndBit,
2160 IN UINT32 Value
2161 );
2162
2163 /**
2164 Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
2165 writes the result back to the bit field in the 32-bit MMIO register.
2166
2167 Reads the 32-bit MMIO register specified by Address, performs a bitwise
2168 OR between the read result and the value specified by OrData, and
2169 writes the result to the 32-bit MMIO register specified by Address. The value
2170 written to the MMIO register is returned. This function must guarantee that
2171 all MMIO read and write operations are serialized. Extra left bits in OrData
2172 are stripped.
2173
2174 If 32-bit MMIO register operations are not supported, then ASSERT().
2175 If Address is not aligned on a 32-bit boundary, then ASSERT().
2176 If StartBit is greater than 31, then ASSERT().
2177 If EndBit is greater than 31, then ASSERT().
2178 If EndBit is less than StartBit, then ASSERT().
2179 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2180
2181 @param Address MMIO register to write.
2182 @param StartBit The ordinal of the least significant bit in the bit field.
2183 Range 0..31.
2184 @param EndBit The ordinal of the most significant bit in the bit field.
2185 Range 0..31.
2186 @param OrData The value to OR with read value from the MMIO register.
2187
2188 @return The value written back to the MMIO register.
2189
2190 **/
2191 UINT32
2192 EFIAPI
2193 MmioBitFieldOr32 (
2194 IN UINTN Address,
2195 IN UINTN StartBit,
2196 IN UINTN EndBit,
2197 IN UINT32 OrData
2198 );
2199
2200 /**
2201 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
2202 writes the result back to the bit field in the 32-bit MMIO register.
2203
2204 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2205 between the read result and the value specified by AndData, and writes the
2206 result to the 32-bit MMIO register specified by Address. The value written to
2207 the MMIO register is returned. This function must guarantee that all MMIO
2208 read and write operations are serialized. Extra left bits in AndData are
2209 stripped.
2210
2211 If 32-bit MMIO register operations are not supported, then ASSERT().
2212 If Address is not aligned on a 32-bit boundary, then ASSERT().
2213 If StartBit is greater than 31, then ASSERT().
2214 If EndBit is greater than 31, then ASSERT().
2215 If EndBit is less than StartBit, then ASSERT().
2216 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2217
2218 @param Address MMIO register to write.
2219 @param StartBit The ordinal of the least significant bit in the bit field.
2220 Range 0..31.
2221 @param EndBit The ordinal of the most significant bit in the bit field.
2222 Range 0..31.
2223 @param AndData The value to AND with read value from the MMIO register.
2224
2225 @return The value written back to the MMIO register.
2226
2227 **/
2228 UINT32
2229 EFIAPI
2230 MmioBitFieldAnd32 (
2231 IN UINTN Address,
2232 IN UINTN StartBit,
2233 IN UINTN EndBit,
2234 IN UINT32 AndData
2235 );
2236
2237 /**
2238 Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
2239 by a bitwise OR, and writes the result back to the bit field in the
2240 32-bit MMIO register.
2241
2242 Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
2243 followed by a bitwise OR between the read result and the value
2244 specified by AndData, and writes the result to the 32-bit MMIO register
2245 specified by Address. The value written to the MMIO register is returned.
2246 This function must guarantee that all MMIO read and write operations are
2247 serialized. Extra left bits in both AndData and OrData are stripped.
2248
2249 If 32-bit MMIO register operations are not supported, then ASSERT().
2250 If Address is not aligned on a 32-bit boundary, then ASSERT().
2251 If StartBit is greater than 31, then ASSERT().
2252 If EndBit is greater than 31, then ASSERT().
2253 If EndBit is less than StartBit, then ASSERT().
2254 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2255 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2256
2257 @param Address MMIO register to write.
2258 @param StartBit The ordinal of the least significant bit in the bit field.
2259 Range 0..31.
2260 @param EndBit The ordinal of the most significant bit in the bit field.
2261 Range 0..31.
2262 @param AndData The value to AND with read value from the MMIO register.
2263 @param OrData The value to OR with the result of the AND operation.
2264
2265 @return The value written back to the MMIO register.
2266
2267 **/
2268 UINT32
2269 EFIAPI
2270 MmioBitFieldAndThenOr32 (
2271 IN UINTN Address,
2272 IN UINTN StartBit,
2273 IN UINTN EndBit,
2274 IN UINT32 AndData,
2275 IN UINT32 OrData
2276 );
2277
2278 /**
2279 Reads a 64-bit MMIO register.
2280
2281 Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
2282 returned. This function must guarantee that all MMIO read and write
2283 operations are serialized.
2284
2285 If 64-bit MMIO register operations are not supported, then ASSERT().
2286 If Address is not aligned on a 64-bit boundary, then ASSERT().
2287
2288 @param Address The MMIO register to read.
2289
2290 @return The value read.
2291
2292 **/
2293 UINT64
2294 EFIAPI
2295 MmioRead64 (
2296 IN UINTN Address
2297 );
2298
2299 /**
2300 Writes a 64-bit MMIO register.
2301
2302 Writes the 64-bit MMIO register specified by Address with the value specified
2303 by Value and returns Value. This function must guarantee that all MMIO read
2304 and write operations are serialized.
2305
2306 If 64-bit MMIO register operations are not supported, then ASSERT().
2307 If Address is not aligned on a 64-bit boundary, then ASSERT().
2308
2309 @param Address The MMIO register to write.
2310 @param Value The value to write to the MMIO register.
2311
2312 **/
2313 UINT64
2314 EFIAPI
2315 MmioWrite64 (
2316 IN UINTN Address,
2317 IN UINT64 Value
2318 );
2319
2320 /**
2321 Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
2322 result back to the 64-bit MMIO register.
2323
2324 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2325 OR between the read result and the value specified by OrData, and
2326 writes the result to the 64-bit MMIO register specified by Address. The value
2327 written to the MMIO register is returned. This function must guarantee that
2328 all MMIO read and write operations are serialized.
2329
2330 If 64-bit MMIO register operations are not supported, then ASSERT().
2331 If Address is not aligned on a 64-bit boundary, then ASSERT().
2332
2333 @param Address The MMIO register to write.
2334 @param OrData The value to OR with the read value from the MMIO register.
2335
2336 @return The value written back to the MMIO register.
2337
2338 **/
2339 UINT64
2340 EFIAPI
2341 MmioOr64 (
2342 IN UINTN Address,
2343 IN UINT64 OrData
2344 );
2345
2346 /**
2347 Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
2348 back to the 64-bit MMIO register.
2349
2350 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2351 between the read result and the value specified by AndData, and writes the
2352 result to the 64-bit MMIO register specified by Address. The value written to
2353 the MMIO register is returned. This function must guarantee that all MMIO
2354 read and write operations are serialized.
2355
2356 If 64-bit MMIO register operations are not supported, then ASSERT().
2357 If Address is not aligned on a 64-bit boundary, then ASSERT().
2358
2359 @param Address The MMIO register to write.
2360 @param AndData The value to AND with the read value from the MMIO register.
2361
2362 @return The value written back to the MMIO register.
2363
2364 **/
2365 UINT64
2366 EFIAPI
2367 MmioAnd64 (
2368 IN UINTN Address,
2369 IN UINT64 AndData
2370 );
2371
2372 /**
2373 Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
2374 OR, and writes the result back to the 64-bit MMIO register.
2375
2376 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2377 between the read result and the value specified by AndData, performs a
2378 bitwise OR between the result of the AND operation and the value specified by
2379 OrData, and writes the result to the 64-bit MMIO register specified by
2380 Address. The value written to the MMIO register is returned. This function
2381 must guarantee that all MMIO read and write operations are serialized.
2382
2383 If 64-bit MMIO register operations are not supported, then ASSERT().
2384 If Address is not aligned on a 64-bit boundary, then ASSERT().
2385
2386 @param Address The MMIO register to write.
2387 @param AndData The value to AND with the read value from the MMIO register.
2388 @param OrData The value to OR with the result of the AND operation.
2389
2390 @return The value written back to the MMIO register.
2391
2392 **/
2393 UINT64
2394 EFIAPI
2395 MmioAndThenOr64 (
2396 IN UINTN Address,
2397 IN UINT64 AndData,
2398 IN UINT64 OrData
2399 );
2400
2401 /**
2402 Reads a bit field of a MMIO register.
2403
2404 Reads the bit field in a 64-bit MMIO register. The bit field is specified by
2405 the StartBit and the EndBit. The value of the bit field is returned.
2406
2407 If 64-bit MMIO register operations are not supported, then ASSERT().
2408 If Address is not aligned on a 64-bit boundary, then ASSERT().
2409 If StartBit is greater than 63, then ASSERT().
2410 If EndBit is greater than 63, then ASSERT().
2411 If EndBit is less than StartBit, then ASSERT().
2412
2413 @param Address MMIO register to read.
2414 @param StartBit The ordinal of the least significant bit in the bit field.
2415 Range 0..63.
2416 @param EndBit The ordinal of the most significant bit in the bit field.
2417 Range 0..63.
2418
2419 @return The value read.
2420
2421 **/
2422 UINT64
2423 EFIAPI
2424 MmioBitFieldRead64 (
2425 IN UINTN Address,
2426 IN UINTN StartBit,
2427 IN UINTN EndBit
2428 );
2429
2430 /**
2431 Writes a bit field to a MMIO register.
2432
2433 Writes Value to the bit field of the MMIO register. The bit field is
2434 specified by the StartBit and the EndBit. All other bits in the destination
2435 MMIO register are preserved. The new value of the 64-bit register is returned.
2436
2437 If 64-bit MMIO register operations are not supported, then ASSERT().
2438 If Address is not aligned on a 64-bit boundary, then ASSERT().
2439 If StartBit is greater than 63, then ASSERT().
2440 If EndBit is greater than 63, then ASSERT().
2441 If EndBit is less than StartBit, then ASSERT().
2442 If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2443
2444 @param Address MMIO register to write.
2445 @param StartBit The ordinal of the least significant bit in the bit field.
2446 Range 0..63.
2447 @param EndBit The ordinal of the most significant bit in the bit field.
2448 Range 0..63.
2449 @param Value New value of the bit field.
2450
2451 @return The value written back to the MMIO register.
2452
2453 **/
2454 UINT64
2455 EFIAPI
2456 MmioBitFieldWrite64 (
2457 IN UINTN Address,
2458 IN UINTN StartBit,
2459 IN UINTN EndBit,
2460 IN UINT64 Value
2461 );
2462
2463 /**
2464 Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
2465 writes the result back to the bit field in the 64-bit MMIO register.
2466
2467 Reads the 64-bit MMIO register specified by Address, performs a bitwise
2468 OR between the read result and the value specified by OrData, and
2469 writes the result to the 64-bit MMIO register specified by Address. The value
2470 written to the MMIO register is returned. This function must guarantee that
2471 all MMIO read and write operations are serialized. Extra left bits in OrData
2472 are stripped.
2473
2474 If 64-bit MMIO register operations are not supported, then ASSERT().
2475 If Address is not aligned on a 64-bit boundary, then ASSERT().
2476 If StartBit is greater than 63, then ASSERT().
2477 If EndBit is greater than 63, then ASSERT().
2478 If EndBit is less than StartBit, then ASSERT().
2479 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2480
2481 @param Address MMIO register to write.
2482 @param StartBit The ordinal of the least significant bit in the bit field.
2483 Range 0..63.
2484 @param EndBit The ordinal of the most significant bit in the bit field.
2485 Range 0..63.
2486 @param OrData The value to OR with read value from the MMIO register.
2487
2488 @return The value written back to the MMIO register.
2489
2490 **/
2491 UINT64
2492 EFIAPI
2493 MmioBitFieldOr64 (
2494 IN UINTN Address,
2495 IN UINTN StartBit,
2496 IN UINTN EndBit,
2497 IN UINT64 OrData
2498 );
2499
2500 /**
2501 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
2502 writes the result back to the bit field in the 64-bit MMIO register.
2503
2504 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2505 between the read result and the value specified by AndData, and writes the
2506 result to the 64-bit MMIO register specified by Address. The value written to
2507 the MMIO register is returned. This function must guarantee that all MMIO
2508 read and write operations are serialized. Extra left bits in AndData are
2509 stripped.
2510
2511 If 64-bit MMIO register operations are not supported, then ASSERT().
2512 If Address is not aligned on a 64-bit boundary, then ASSERT().
2513 If StartBit is greater than 63, then ASSERT().
2514 If EndBit is greater than 63, then ASSERT().
2515 If EndBit is less than StartBit, then ASSERT().
2516 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2517
2518 @param Address MMIO register to write.
2519 @param StartBit The ordinal of the least significant bit in the bit field.
2520 Range 0..63.
2521 @param EndBit The ordinal of the most significant bit in the bit field.
2522 Range 0..63.
2523 @param AndData The value to AND with read value from the MMIO register.
2524
2525 @return The value written back to the MMIO register.
2526
2527 **/
2528 UINT64
2529 EFIAPI
2530 MmioBitFieldAnd64 (
2531 IN UINTN Address,
2532 IN UINTN StartBit,
2533 IN UINTN EndBit,
2534 IN UINT64 AndData
2535 );
2536
2537 /**
2538 Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
2539 by a bitwise OR, and writes the result back to the bit field in the
2540 64-bit MMIO register.
2541
2542 Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
2543 followed by a bitwise OR between the read result and the value
2544 specified by AndData, and writes the result to the 64-bit MMIO register
2545 specified by Address. The value written to the MMIO register is returned.
2546 This function must guarantee that all MMIO read and write operations are
2547 serialized. Extra left bits in both AndData and OrData are stripped.
2548
2549 If 64-bit MMIO register operations are not supported, then ASSERT().
2550 If Address is not aligned on a 64-bit boundary, then ASSERT().
2551 If StartBit is greater than 63, then ASSERT().
2552 If EndBit is greater than 63, then ASSERT().
2553 If EndBit is less than StartBit, then ASSERT().
2554 If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2555 If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
2556
2557 @param Address MMIO register to write.
2558 @param StartBit The ordinal of the least significant bit in the bit field.
2559 Range 0..63.
2560 @param EndBit The ordinal of the most significant bit in the bit field.
2561 Range 0..63.
2562 @param AndData The value to AND with read value from the MMIO register.
2563 @param OrData The value to OR with the result of the AND operation.
2564
2565 @return The value written back to the MMIO register.
2566
2567 **/
2568 UINT64
2569 EFIAPI
2570 MmioBitFieldAndThenOr64 (
2571 IN UINTN Address,
2572 IN UINTN StartBit,
2573 IN UINTN EndBit,
2574 IN UINT64 AndData,
2575 IN UINT64 OrData
2576 );
2577
2578 /**
2579 Copy data from MMIO region to system memory by using 8-bit access.
2580
2581 Copy data from MMIO region specified by starting address StartAddress
2582 to system memory specified by Buffer by using 8-bit access. The total
2583 number of byte to be copied is specified by Length. Buffer is returned.
2584
2585 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2586 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2587
2588
2589 @param StartAddress Starting address for the MMIO region to be copied from.
2590 @param Length The size, in bytes, of Buffer.
2591 @param Buffer Pointer to a system memory buffer receiving the data read.
2592
2593 @return Buffer
2594
2595 **/
2596 UINT8 *
2597 EFIAPI
2598 MmioReadBuffer8 (
2599 IN UINTN StartAddress,
2600 IN UINTN Length,
2601 OUT UINT8 *Buffer
2602 );
2603
2604 /**
2605 Copy data from MMIO region to system memory by using 16-bit access.
2606
2607 Copy data from MMIO region specified by starting address StartAddress
2608 to system memory specified by Buffer by using 16-bit access. The total
2609 number of byte to be copied is specified by Length. Buffer is returned.
2610
2611 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2612
2613 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2614 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2615
2616 If Length is not aligned on a 16-bit boundary, then ASSERT().
2617 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2618
2619 @param StartAddress Starting address for the MMIO region to be copied from.
2620 @param Length The size, in bytes, of Buffer.
2621 @param Buffer Pointer to a system memory buffer receiving the data read.
2622
2623 @return Buffer
2624
2625 **/
2626 UINT16 *
2627 EFIAPI
2628 MmioReadBuffer16 (
2629 IN UINTN StartAddress,
2630 IN UINTN Length,
2631 OUT UINT16 *Buffer
2632 );
2633
2634 /**
2635 Copy data from MMIO region to system memory by using 32-bit access.
2636
2637 Copy data from MMIO region specified by starting address StartAddress
2638 to system memory specified by Buffer by using 32-bit access. The total
2639 number of byte to be copied is specified by Length. Buffer is returned.
2640
2641 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2642
2643 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2644 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2645
2646 If Length is not aligned on a 32-bit boundary, then ASSERT().
2647 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2648
2649 @param StartAddress Starting address for the MMIO region to be copied from.
2650 @param Length The size, in bytes, of Buffer.
2651 @param Buffer Pointer to a system memory buffer receiving the data read.
2652
2653 @return Buffer
2654
2655 **/
2656 UINT32 *
2657 EFIAPI
2658 MmioReadBuffer32 (
2659 IN UINTN StartAddress,
2660 IN UINTN Length,
2661 OUT UINT32 *Buffer
2662 );
2663
2664 /**
2665 Copy data from MMIO region to system memory by using 64-bit access.
2666
2667 Copy data from MMIO region specified by starting address StartAddress
2668 to system memory specified by Buffer by using 64-bit access. The total
2669 number of byte to be copied is specified by Length. Buffer is returned.
2670
2671 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2672
2673 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2674 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
2675
2676 If Length is not aligned on a 64-bit boundary, then ASSERT().
2677 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2678
2679 @param StartAddress Starting address for the MMIO region to be copied from.
2680 @param Length The size, in bytes, of Buffer.
2681 @param Buffer Pointer to a system memory buffer receiving the data read.
2682
2683 @return Buffer
2684
2685 **/
2686 UINT64 *
2687 EFIAPI
2688 MmioReadBuffer64 (
2689 IN UINTN StartAddress,
2690 IN UINTN Length,
2691 OUT UINT64 *Buffer
2692 );
2693
2694 /**
2695 Copy data from system memory to MMIO region by using 8-bit access.
2696
2697 Copy data from system memory specified by Buffer to MMIO region specified
2698 by starting address StartAddress by using 8-bit access. The total number
2699 of byte to be copied is specified by Length. Buffer is returned.
2700
2701 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2702 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2703
2704
2705 @param StartAddress Starting address for the MMIO region to be copied to.
2706 @param Length The size, in bytes, of Buffer.
2707 @param Buffer Pointer to a system memory buffer containing the data to write.
2708
2709 @return Buffer
2710
2711 **/
2712 UINT8 *
2713 EFIAPI
2714 MmioWriteBuffer8 (
2715 IN UINTN StartAddress,
2716 IN UINTN Length,
2717 IN CONST UINT8 *Buffer
2718 );
2719
2720 /**
2721 Copy data from system memory to MMIO region by using 16-bit access.
2722
2723 Copy data from system memory specified by Buffer to MMIO region specified
2724 by starting address StartAddress by using 16-bit access. The total number
2725 of byte to be copied is specified by Length. Buffer is returned.
2726
2727 If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
2728
2729 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2730 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2731
2732 If Length is not aligned on a 16-bit boundary, then ASSERT().
2733
2734 If Buffer is not aligned on a 16-bit boundary, then ASSERT().
2735
2736 @param StartAddress Starting address for the MMIO region to be copied to.
2737 @param Length The size, in bytes, of Buffer.
2738 @param Buffer Pointer to a system memory buffer containing the data to write.
2739
2740 @return Buffer
2741
2742 **/
2743 UINT16 *
2744 EFIAPI
2745 MmioWriteBuffer16 (
2746 IN UINTN StartAddress,
2747 IN UINTN Length,
2748 IN CONST UINT16 *Buffer
2749 );
2750
2751 /**
2752 Copy data from system memory to MMIO region by using 32-bit access.
2753
2754 Copy data from system memory specified by Buffer to MMIO region specified
2755 by starting address StartAddress by using 32-bit access. The total number
2756 of byte to be copied is specified by Length. Buffer is returned.
2757
2758 If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
2759
2760 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2761 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2762
2763 If Length is not aligned on a 32-bit boundary, then ASSERT().
2764
2765 If Buffer is not aligned on a 32-bit boundary, then ASSERT().
2766
2767 @param StartAddress Starting address for the MMIO region to be copied to.
2768 @param Length The size, in bytes, of Buffer.
2769 @param Buffer Pointer to a system memory buffer containing the data to write.
2770
2771 @return Buffer
2772
2773 **/
2774 UINT32 *
2775 EFIAPI
2776 MmioWriteBuffer32 (
2777 IN UINTN StartAddress,
2778 IN UINTN Length,
2779 IN CONST UINT32 *Buffer
2780 );
2781
2782 /**
2783 Copy data from system memory to MMIO region by using 64-bit access.
2784
2785 Copy data from system memory specified by Buffer to MMIO region specified
2786 by starting address StartAddress by using 64-bit access. The total number
2787 of byte to be copied is specified by Length. Buffer is returned.
2788
2789 If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
2790
2791 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
2792 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
2793
2794 If Length is not aligned on a 64-bit boundary, then ASSERT().
2795
2796 If Buffer is not aligned on a 64-bit boundary, then ASSERT().
2797
2798 @param StartAddress Starting address for the MMIO region to be copied to.
2799 @param Length The size, in bytes, of Buffer.
2800 @param Buffer Pointer to a system memory buffer containing the data to write.
2801
2802 @return Buffer
2803
2804 **/
2805 UINT64 *
2806 EFIAPI
2807 MmioWriteBuffer64 (
2808 IN UINTN StartAddress,
2809 IN UINTN Length,
2810 IN CONST UINT64 *Buffer
2811 );
2812
2813
2814 #endif
2815