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