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