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