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