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