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