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