]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/PciCf8Lib.h
2 Provides services to access PCI Configuration Space using the I/O ports 0xCF8 and 0xCFC.
4 This library is identical to the PCI Library, except the access method for performing PCI
5 configuration cycles must be though I/O ports 0xCF8 and 0xCFC. This library only allows
6 access to PCI Segment #0.
8 Copyright (c) 2006 - 2008, Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #ifndef __PCI_CF8_LIB_H__
20 #define __PCI_CF8_LIB_H__
24 Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
25 address that can be passed to the PCI Library functions.
27 Computes an address that is compatible with the PCI Library functions. The
28 unused upper bits of Bus, Device, Function and Register are stripped prior to
29 the generation of the address.
31 @param Bus PCI Bus number. Range 0..255.
32 @param Device PCI Device number. Range 0..31.
33 @param Function PCI Function number. Range 0..7.
34 @param Register PCI Register number. Range 0..255.
36 @return The encode PCI address.
39 #define PCI_CF8_LIB_ADDRESS(Bus,Device,Function,Offset) \
40 (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
43 Reads an 8-bit PCI configuration register.
45 Reads and returns the 8-bit PCI configuration register specified by Address.
46 This function must guarantee that all PCI read and write operations are
49 If Address > 0x0FFFFFFF, then ASSERT().
50 If the register specified by Address >= 0x100, then ASSERT().
52 @param Address Address that encodes the PCI Bus, Device, Function and
55 @return The read value from the PCI configuration register.
65 Writes an 8-bit PCI configuration register.
67 Writes the 8-bit PCI configuration register specified by Address with the
68 value specified by Value. Value is returned. This function must guarantee
69 that all PCI read and write operations are serialized.
71 If Address > 0x0FFFFFFF, then ASSERT().
72 If the register specified by Address >= 0x100, then ASSERT().
74 @param Address Address that encodes the PCI Bus, Device, Function and
76 @param Value The value to write.
78 @return The value written to the PCI configuration register.
89 Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
92 Reads the 8-bit PCI configuration register specified by Address, performs a
93 bitwise inclusive OR between the read result and the value specified by
94 OrData, and writes the result to the 8-bit PCI configuration register
95 specified by Address. The value written to the PCI configuration register is
96 returned. This function must guarantee that all PCI read and write operations
99 If Address > 0x0FFFFFFF, then ASSERT().
100 If the register specified by Address >= 0x100, then ASSERT().
102 @param Address Address that encodes the PCI Bus, Device, Function and
104 @param OrData The value to OR with the PCI configuration register.
106 @return The value written back to the PCI configuration register.
117 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
120 Reads the 8-bit PCI configuration register specified by Address, performs a
121 bitwise AND between the read result and the value specified by AndData, and
122 writes the result to the 8-bit PCI configuration register specified by
123 Address. The value written to the PCI configuration register is returned.
124 This function must guarantee that all PCI read and write operations are
127 If Address > 0x0FFFFFFF, then ASSERT().
128 If the register specified by Address >= 0x100, then ASSERT().
130 @param Address Address that encodes the PCI Bus, Device, Function and
132 @param AndData The value to AND with the PCI configuration register.
134 @return The value written back to the PCI configuration register.
145 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
146 value, followed a bitwise inclusive OR with another 8-bit value.
148 Reads the 8-bit PCI configuration register specified by Address, performs a
149 bitwise AND between the read result and the value specified by AndData,
150 performs a bitwise inclusive OR between the result of the AND operation and
151 the value specified by OrData, and writes the result to the 8-bit PCI
152 configuration register specified by Address. The value written to the PCI
153 configuration register is returned. This function must guarantee that all PCI
154 read and write operations are serialized.
156 If Address > 0x0FFFFFFF, then ASSERT().
157 If the register specified by Address >= 0x100, then ASSERT().
159 @param Address Address that encodes the PCI Bus, Device, Function and
161 @param AndData The value to AND with the PCI configuration register.
162 @param OrData The value to OR with the result of the AND operation.
164 @return The value written back to the PCI configuration register.
176 Reads a bit field of a PCI configuration register.
178 Reads the bit field in an 8-bit PCI configuration register. The bit field is
179 specified by the StartBit and the EndBit. The value of the bit field is
182 If Address > 0x0FFFFFFF, then ASSERT().
183 If the register specified by Address >= 0x100, then ASSERT().
184 If StartBit is greater than 7, then ASSERT().
185 If EndBit is greater than 7, then ASSERT().
186 If EndBit is less than StartBit, then ASSERT().
188 @param Address PCI configuration register to read.
189 @param StartBit The ordinal of the least significant bit in the bit field.
191 @param EndBit The ordinal of the most significant bit in the bit field.
194 @return The value of the bit field read from the PCI configuration register.
199 PciCf8BitFieldRead8 (
206 Writes a bit field to a PCI configuration register.
208 Writes Value to the bit field of the PCI configuration register. The bit
209 field is specified by the StartBit and the EndBit. All other bits in the
210 destination PCI configuration register are preserved. The new value of the
211 8-bit register is returned.
213 If Address > 0x0FFFFFFF, then ASSERT().
214 If the register specified by Address >= 0x100, then ASSERT().
215 If StartBit is greater than 7, then ASSERT().
216 If EndBit is greater than 7, then ASSERT().
217 If EndBit is less than StartBit, then ASSERT().
219 @param Address PCI configuration register to write.
220 @param StartBit The ordinal of the least significant bit in the bit field.
222 @param EndBit The ordinal of the most significant bit in the bit field.
224 @param Value New value of the bit field.
226 @return The value written back to the PCI configuration register.
231 PciCf8BitFieldWrite8 (
239 Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
240 writes the result back to the bit field in the 8-bit port.
242 Reads the 8-bit PCI configuration register specified by Address, performs a
243 bitwise inclusive OR between the read result and the value specified by
244 OrData, and writes the result to the 8-bit PCI configuration register
245 specified by Address. The value written to the PCI configuration register is
246 returned. This function must guarantee that all PCI read and write operations
247 are serialized. Extra left bits in OrData are stripped.
249 If Address > 0x0FFFFFFF, then ASSERT().
250 If the register specified by Address >= 0x100, then ASSERT().
251 If StartBit is greater than 7, then ASSERT().
252 If EndBit is greater than 7, then ASSERT().
253 If EndBit is less than StartBit, then ASSERT().
255 @param Address PCI configuration register to write.
256 @param StartBit The ordinal of the least significant bit in the bit field.
258 @param EndBit The ordinal of the most significant bit in the bit field.
260 @param OrData The value to OR with the PCI configuration register.
262 @return The value written back to the PCI configuration register.
275 Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
276 AND, and writes the result back to the bit field in the 8-bit register.
278 Reads the 8-bit PCI configuration register specified by Address, performs a
279 bitwise AND between the read result and the value specified by AndData, and
280 writes the result to the 8-bit PCI configuration register specified by
281 Address. The value written to the PCI configuration register is returned.
282 This function must guarantee that all PCI read and write operations are
283 serialized. Extra left bits in AndData are stripped.
285 If Address > 0x0FFFFFFF, then ASSERT().
286 If the register specified by Address >= 0x100, then ASSERT().
287 If StartBit is greater than 7, then ASSERT().
288 If EndBit is greater than 7, then ASSERT().
289 If EndBit is less than StartBit, then ASSERT().
291 @param Address PCI configuration register to write.
292 @param StartBit The ordinal of the least significant bit in the bit field.
294 @param EndBit The ordinal of the most significant bit in the bit field.
296 @param AndData The value to AND with the PCI configuration register.
298 @return The value written back to the PCI configuration register.
311 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
312 bitwise inclusive OR, and writes the result back to the bit field in the
315 Reads the 8-bit PCI configuration register specified by Address, performs a
316 bitwise AND followed by a bitwise inclusive OR between the read result and
317 the value specified by AndData, and writes the result to the 8-bit PCI
318 configuration register specified by Address. The value written to the PCI
319 configuration register is returned. This function must guarantee that all PCI
320 read and write operations are serialized. Extra left bits in both AndData and
323 If Address > 0x0FFFFFFF, then ASSERT().
324 If the register specified by Address >= 0x100, then ASSERT().
325 If StartBit is greater than 7, then ASSERT().
326 If EndBit is greater than 7, then ASSERT().
327 If EndBit is less than StartBit, then ASSERT().
329 @param Address PCI configuration register to write.
330 @param StartBit The ordinal of the least significant bit in the bit field.
332 @param EndBit The ordinal of the most significant bit in the bit field.
334 @param AndData The value to AND with the PCI configuration register.
335 @param OrData The value to OR with the result of the AND operation.
337 @return The value written back to the PCI configuration register.
342 PciCf8BitFieldAndThenOr8 (
351 Reads a 16-bit PCI configuration register.
353 Reads and returns the 16-bit PCI configuration register specified by Address.
354 This function must guarantee that all PCI read and write operations are
357 If Address > 0x0FFFFFFF, then ASSERT().
358 If Address is not aligned on a 16-bit boundary, then ASSERT().
359 If the register specified by Address >= 0x100, then ASSERT().
361 @param Address Address that encodes the PCI Bus, Device, Function and
364 @return The read value from the PCI configuration register.
374 Writes a 16-bit PCI configuration register.
376 Writes the 16-bit PCI configuration register specified by Address with the
377 value specified by Value. Value is returned. This function must guarantee
378 that all PCI read and write operations are serialized.
380 If Address > 0x0FFFFFFF, then ASSERT().
381 If Address is not aligned on a 16-bit boundary, then ASSERT().
382 If the register specified by Address >= 0x100, then ASSERT().
384 @param Address Address that encodes the PCI Bus, Device, Function and
386 @param Value The value to write.
388 @return The value written to the PCI configuration register.
399 Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
402 Reads the 16-bit PCI configuration register specified by Address, performs a
403 bitwise inclusive OR between the read result and the value specified by
404 OrData, and writes the result to the 16-bit PCI configuration register
405 specified by Address. The value written to the PCI configuration register is
406 returned. This function must guarantee that all PCI read and write operations
409 If Address > 0x0FFFFFFF, then ASSERT().
410 If Address is not aligned on a 16-bit boundary, then ASSERT().
411 If the register specified by Address >= 0x100, then ASSERT().
413 @param Address Address that encodes the PCI Bus, Device, Function and
415 @param OrData The value to OR with the PCI configuration register.
417 @return The value written back to the PCI configuration register.
428 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
431 Reads the 16-bit PCI configuration register specified by Address, performs a
432 bitwise AND between the read result and the value specified by AndData, and
433 writes the result to the 16-bit PCI configuration register specified by
434 Address. The value written to the PCI configuration register is returned.
435 This function must guarantee that all PCI read and write operations are
438 If Address > 0x0FFFFFFF, then ASSERT().
439 If Address is not aligned on a 16-bit boundary, then ASSERT().
440 If the register specified by Address >= 0x100, then ASSERT().
442 @param Address Address that encodes the PCI Bus, Device, Function and
444 @param AndData The value to AND with the PCI configuration register.
446 @return The value written back to the PCI configuration register.
457 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
458 value, followed a bitwise inclusive OR with another 16-bit value.
460 Reads the 16-bit PCI configuration register specified by Address, performs a
461 bitwise AND between the read result and the value specified by AndData,
462 performs a bitwise inclusive OR between the result of the AND operation and
463 the value specified by OrData, and writes the result to the 16-bit PCI
464 configuration register specified by Address. The value written to the PCI
465 configuration register is returned. This function must guarantee that all PCI
466 read and write operations are serialized.
468 If Address > 0x0FFFFFFF, then ASSERT().
469 If Address is not aligned on a 16-bit boundary, then ASSERT().
470 If the register specified by Address >= 0x100, then ASSERT().
472 @param Address Address that encodes the PCI Bus, Device, Function and
474 @param AndData The value to AND with the PCI configuration register.
475 @param OrData The value to OR with the result of the AND operation.
477 @return The value written back to the PCI configuration register.
489 Reads a bit field of a PCI configuration register.
491 Reads the bit field in a 16-bit PCI configuration register. The bit field is
492 specified by the StartBit and the EndBit. The value of the bit field is
495 If Address > 0x0FFFFFFF, then ASSERT().
496 If Address is not aligned on a 16-bit boundary, then ASSERT().
497 If the register specified by Address >= 0x100, then ASSERT().
498 If StartBit is greater than 15, then ASSERT().
499 If EndBit is greater than 15, then ASSERT().
500 If EndBit is less than StartBit, then ASSERT().
502 @param Address PCI configuration register to read.
503 @param StartBit The ordinal of the least significant bit in the bit field.
505 @param EndBit The ordinal of the most significant bit in the bit field.
508 @return The value of the bit field read from the PCI configuration register.
513 PciCf8BitFieldRead16 (
520 Writes a bit field to a PCI configuration register.
522 Writes Value to the bit field of the PCI configuration register. The bit
523 field is specified by the StartBit and the EndBit. All other bits in the
524 destination PCI configuration register are preserved. The new value of the
525 16-bit register is returned.
527 If Address > 0x0FFFFFFF, then ASSERT().
528 If Address is not aligned on a 16-bit boundary, then ASSERT().
529 If the register specified by Address >= 0x100, then ASSERT().
530 If StartBit is greater than 15, then ASSERT().
531 If EndBit is greater than 15, then ASSERT().
532 If EndBit is less than StartBit, then ASSERT().
534 @param Address PCI configuration register to write.
535 @param StartBit The ordinal of the least significant bit in the bit field.
537 @param EndBit The ordinal of the most significant bit in the bit field.
539 @param Value New value of the bit field.
541 @return The value written back to the PCI configuration register.
546 PciCf8BitFieldWrite16 (
554 Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
555 writes the result back to the bit field in the 16-bit port.
557 Reads the 16-bit PCI configuration register specified by Address, performs a
558 bitwise inclusive OR between the read result and the value specified by
559 OrData, and writes the result to the 16-bit PCI configuration register
560 specified by Address. The value written to the PCI configuration register is
561 returned. This function must guarantee that all PCI read and write operations
562 are serialized. Extra left bits in OrData are stripped.
564 If Address > 0x0FFFFFFF, then ASSERT().
565 If Address is not aligned on a 16-bit boundary, then ASSERT().
566 If the register specified by Address >= 0x100, then ASSERT().
567 If StartBit is greater than 15, then ASSERT().
568 If EndBit is greater than 15, then ASSERT().
569 If EndBit is less than StartBit, then ASSERT().
571 @param Address PCI configuration register to write.
572 @param StartBit The ordinal of the least significant bit in the bit field.
574 @param EndBit The ordinal of the most significant bit in the bit field.
576 @param OrData The value to OR with the PCI configuration register.
578 @return The value written back to the PCI configuration register.
591 Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
592 AND, and writes the result back to the bit field in the 16-bit register.
594 Reads the 16-bit PCI configuration register specified by Address, performs a
595 bitwise AND between the read result and the value specified by AndData, and
596 writes the result to the 16-bit PCI configuration register specified by
597 Address. The value written to the PCI configuration register is returned.
598 This function must guarantee that all PCI read and write operations are
599 serialized. Extra left bits in AndData are stripped.
601 If Address > 0x0FFFFFFF, then ASSERT().
602 If Address is not aligned on a 16-bit boundary, then ASSERT().
603 If the register specified by Address >= 0x100, then ASSERT().
604 If StartBit is greater than 15, then ASSERT().
605 If EndBit is greater than 15, then ASSERT().
606 If EndBit is less than StartBit, then ASSERT().
608 @param Address PCI configuration register to write.
609 @param StartBit The ordinal of the least significant bit in the bit field.
611 @param EndBit The ordinal of the most significant bit in the bit field.
613 @param AndData The value to AND with the PCI configuration register.
615 @return The value written back to the PCI configuration register.
620 PciCf8BitFieldAnd16 (
628 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
629 bitwise inclusive OR, and writes the result back to the bit field in the
632 Reads the 16-bit PCI configuration register specified by Address, performs a
633 bitwise AND followed by a bitwise inclusive OR between the read result and
634 the value specified by AndData, and writes the result to the 16-bit PCI
635 configuration register specified by Address. The value written to the PCI
636 configuration register is returned. This function must guarantee that all PCI
637 read and write operations are serialized. Extra left bits in both AndData and
640 If Address > 0x0FFFFFFF, then ASSERT().
641 If Address is not aligned on a 16-bit boundary, then ASSERT().
642 If the register specified by Address >= 0x100, then ASSERT().
643 If StartBit is greater than 15, then ASSERT().
644 If EndBit is greater than 15, then ASSERT().
645 If EndBit is less than StartBit, then ASSERT().
647 @param Address PCI configuration register to write.
648 @param StartBit The ordinal of the least significant bit in the bit field.
650 @param EndBit The ordinal of the most significant bit in the bit field.
652 @param AndData The value to AND with the PCI configuration register.
653 @param OrData The value to OR with the result of the AND operation.
655 @return The value written back to the PCI configuration register.
660 PciCf8BitFieldAndThenOr16 (
669 Reads a 32-bit PCI configuration register.
671 Reads and returns the 32-bit PCI configuration register specified by Address.
672 This function must guarantee that all PCI read and write operations are
675 If Address > 0x0FFFFFFF, then ASSERT().
676 If Address is not aligned on a 32-bit boundary, then ASSERT().
677 If the register specified by Address >= 0x100, then ASSERT().
679 @param Address Address that encodes the PCI Bus, Device, Function and
682 @return The read value from the PCI configuration register.
692 Writes a 32-bit PCI configuration register.
694 Writes the 32-bit PCI configuration register specified by Address with the
695 value specified by Value. Value is returned. This function must guarantee
696 that all PCI read and write operations are serialized.
698 If Address > 0x0FFFFFFF, then ASSERT().
699 If Address is not aligned on a 32-bit boundary, then ASSERT().
700 If the register specified by Address >= 0x100, then ASSERT().
702 @param Address Address that encodes the PCI Bus, Device, Function and
704 @param Value The value to write.
706 @return The value written to the PCI configuration register.
717 Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
720 Reads the 32-bit PCI configuration register specified by Address, performs a
721 bitwise inclusive OR between the read result and the value specified by
722 OrData, and writes the result to the 32-bit PCI configuration register
723 specified by Address. The value written to the PCI configuration register is
724 returned. This function must guarantee that all PCI read and write operations
727 If Address > 0x0FFFFFFF, then ASSERT().
728 If Address is not aligned on a 32-bit boundary, then ASSERT().
729 If the register specified by Address >= 0x100, then ASSERT().
731 @param Address Address that encodes the PCI Bus, Device, Function and
733 @param OrData The value to OR with the PCI configuration register.
735 @return The value written back to the PCI configuration register.
746 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
749 Reads the 32-bit PCI configuration register specified by Address, performs a
750 bitwise AND between the read result and the value specified by AndData, and
751 writes the result to the 32-bit PCI configuration register specified by
752 Address. The value written to the PCI configuration register is returned.
753 This function must guarantee that all PCI read and write operations are
756 If Address > 0x0FFFFFFF, then ASSERT().
757 If Address is not aligned on a 32-bit boundary, then ASSERT().
758 If the register specified by Address >= 0x100, then ASSERT().
760 @param Address Address that encodes the PCI Bus, Device, Function and
762 @param AndData The value to AND with the PCI configuration register.
764 @return The value written back to the PCI configuration register.
775 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
776 value, followed a bitwise inclusive OR with another 32-bit value.
778 Reads the 32-bit PCI configuration register specified by Address, performs a
779 bitwise AND between the read result and the value specified by AndData,
780 performs a bitwise inclusive OR between the result of the AND operation and
781 the value specified by OrData, and writes the result to the 32-bit PCI
782 configuration register specified by Address. The value written to the PCI
783 configuration register is returned. This function must guarantee that all PCI
784 read and write operations are serialized.
786 If Address > 0x0FFFFFFF, then ASSERT().
787 If Address is not aligned on a 32-bit boundary, then ASSERT().
788 If the register specified by Address >= 0x100, then ASSERT().
790 @param Address Address that encodes the PCI Bus, Device, Function and
792 @param AndData The value to AND with the PCI configuration register.
793 @param OrData The value to OR with the result of the AND operation.
795 @return The value written back to the PCI configuration register.
807 Reads a bit field of a PCI configuration register.
809 Reads the bit field in a 32-bit PCI configuration register. The bit field is
810 specified by the StartBit and the EndBit. The value of the bit field is
813 If Address > 0x0FFFFFFF, then ASSERT().
814 If Address is not aligned on a 32-bit boundary, then ASSERT().
815 If the register specified by Address >= 0x100, then ASSERT().
816 If StartBit is greater than 31, then ASSERT().
817 If EndBit is greater than 31, then ASSERT().
818 If EndBit is less than StartBit, then ASSERT().
820 @param Address PCI configuration register to read.
821 @param StartBit The ordinal of the least significant bit in the bit field.
823 @param EndBit The ordinal of the most significant bit in the bit field.
826 @return The value of the bit field read from the PCI configuration register.
831 PciCf8BitFieldRead32 (
838 Writes a bit field to a PCI configuration register.
840 Writes Value to the bit field of the PCI configuration register. The bit
841 field is specified by the StartBit and the EndBit. All other bits in the
842 destination PCI configuration register are preserved. The new value of the
843 32-bit register is returned.
845 If Address > 0x0FFFFFFF, then ASSERT().
846 If Address is not aligned on a 32-bit boundary, then ASSERT().
847 If the register specified by Address >= 0x100, then ASSERT().
848 If StartBit is greater than 31, then ASSERT().
849 If EndBit is greater than 31, then ASSERT().
850 If EndBit is less than StartBit, then ASSERT().
852 @param Address PCI configuration register to write.
853 @param StartBit The ordinal of the least significant bit in the bit field.
855 @param EndBit The ordinal of the most significant bit in the bit field.
857 @param Value New value of the bit field.
859 @return The value written back to the PCI configuration register.
864 PciCf8BitFieldWrite32 (
872 Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
873 writes the result back to the bit field in the 32-bit port.
875 Reads the 32-bit PCI configuration register specified by Address, performs a
876 bitwise inclusive OR between the read result and the value specified by
877 OrData, and writes the result to the 32-bit PCI configuration register
878 specified by Address. The value written to the PCI configuration register is
879 returned. This function must guarantee that all PCI read and write operations
880 are serialized. Extra left bits in OrData are stripped.
882 If Address > 0x0FFFFFFF, then ASSERT().
883 If Address is not aligned on a 32-bit boundary, then ASSERT().
884 If the register specified by Address >= 0x100, then ASSERT().
885 If StartBit is greater than 31, then ASSERT().
886 If EndBit is greater than 31, then ASSERT().
887 If EndBit is less than StartBit, then ASSERT().
889 @param Address PCI configuration register to write.
890 @param StartBit The ordinal of the least significant bit in the bit field.
892 @param EndBit The ordinal of the most significant bit in the bit field.
894 @param OrData The value to OR with the PCI configuration register.
896 @return The value written back to the PCI configuration register.
909 Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
910 AND, and writes the result back to the bit field in the 32-bit register.
912 Reads the 32-bit PCI configuration register specified by Address, performs a
913 bitwise AND between the read result and the value specified by AndData, and
914 writes the result to the 32-bit PCI configuration register specified by
915 Address. The value written to the PCI configuration register is returned.
916 This function must guarantee that all PCI read and write operations are
917 serialized. Extra left bits in AndData are stripped.
919 If Address > 0x0FFFFFFF, then ASSERT().
920 If Address is not aligned on a 32-bit boundary, then ASSERT().
921 If the register specified by Address >= 0x100, then ASSERT().
922 If StartBit is greater than 31, then ASSERT().
923 If EndBit is greater than 31, then ASSERT().
924 If EndBit is less than StartBit, then ASSERT().
926 @param Address PCI configuration register to write.
927 @param StartBit The ordinal of the least significant bit in the bit field.
929 @param EndBit The ordinal of the most significant bit in the bit field.
931 @param AndData The value to AND with the PCI configuration register.
933 @return The value written back to the PCI configuration register.
938 PciCf8BitFieldAnd32 (
946 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
947 bitwise inclusive OR, and writes the result back to the bit field in the
950 Reads the 32-bit PCI configuration register specified by Address, performs a
951 bitwise AND followed by a bitwise inclusive OR between the read result and
952 the value specified by AndData, and writes the result to the 32-bit PCI
953 configuration register specified by Address. The value written to the PCI
954 configuration register is returned. This function must guarantee that all PCI
955 read and write operations are serialized. Extra left bits in both AndData and
958 If Address > 0x0FFFFFFF, then ASSERT().
959 If Address is not aligned on a 32-bit boundary, then ASSERT().
960 If the register specified by Address >= 0x100, then ASSERT().
961 If StartBit is greater than 31, then ASSERT().
962 If EndBit is greater than 31, then ASSERT().
963 If EndBit is less than StartBit, then ASSERT().
965 @param Address PCI configuration register to write.
966 @param StartBit The ordinal of the least significant bit in the bit field.
968 @param EndBit The ordinal of the most significant bit in the bit field.
970 @param AndData The value to AND with the PCI configuration register.
971 @param OrData The value to OR with the result of the AND operation.
973 @return The value written back to the PCI configuration register.
978 PciCf8BitFieldAndThenOr32 (
987 Reads a range of PCI configuration registers into a caller supplied buffer.
989 Reads the range of PCI configuration registers specified by StartAddress and
990 Size into the buffer specified by Buffer. This function only allows the PCI
991 configuration registers from a single PCI function to be read. Size is
992 returned. When possible 32-bit PCI configuration read cycles are used to read
993 from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
994 and 16-bit PCI configuration read cycles may be used at the beginning and the
997 If StartAddress > 0x0FFFFFFF, then ASSERT().
998 If the register specified by StartAddress >= 0x100, then ASSERT().
999 If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
1000 If Size > 0 and Buffer is NULL, then ASSERT().
1002 @param StartAddress Starting address that encodes the PCI Bus, Device,
1003 Function and Register.
1004 @param Size Size in bytes of the transfer.
1005 @param Buffer Pointer to a buffer receiving the data read.
1007 @return Size read from StartAddress.
1013 IN UINTN StartAddress
,
1019 Copies the data in a caller supplied buffer to a specified range of PCI
1020 configuration space.
1022 Writes the range of PCI configuration registers specified by StartAddress and
1023 Size from the buffer specified by Buffer. This function only allows the PCI
1024 configuration registers from a single PCI function to be written. Size is
1025 returned. When possible 32-bit PCI configuration write cycles are used to
1026 write from StartAdress to StartAddress + Size. Due to alignment restrictions,
1027 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
1028 and the end of the range.
1030 If StartAddress > 0x0FFFFFFF, then ASSERT().
1031 If the register specified by StartAddress >= 0x100, then ASSERT().
1032 If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
1033 If Size > 0 and Buffer is NULL, then ASSERT().
1035 @param StartAddress Starting address that encodes the PCI Bus, Device,
1036 Function and Register.
1037 @param Size Size in bytes of the transfer.
1038 @param Buffer Pointer to a buffer containing the data to write.
1040 @return Size written to StartAddress.
1046 IN UINTN StartAddress
,