2 Pci Express Library Services for PCI Segment #0
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Module Name: PciExpressLib.h
17 #ifndef __PCI_EXPRESS_LIB_H__
18 #define __PCI_EXPRESS_LIB_H__
20 #include <Library/PciLib.h>
23 Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
24 address that can be passed to the PCI Library functions.
26 Computes an address that is compatible with the PCI Library functions. The
27 unused upper bits of Bus, Device, Function and Register are stripped prior to
28 the generation of the address.
30 @param Bus PCI Bus number. Range 0..255.
31 @param Device PCI Device number. Range 0..31.
32 @param Function PCI Function number. Range 0..7.
33 @param Register PCI Register number. Range 0..4095.
35 @return The encode PCI address.
38 #define PCI_EXPRESS_LIB_ADDRESS(Bus,Device,Function,Offset) \
39 PCI_LIB_ADDRESS (Bus, Device, Function, Offset)
42 Reads an 8-bit PCI configuration register.
44 Reads and returns the 8-bit PCI configuration register specified by Address.
45 This function must guarantee that all PCI read and write operations are
48 If Address > 0x0FFFFFFF, then ASSERT().
50 @param Address Address that encodes the PCI Bus, Device, Function and
53 @return The read value from the PCI configuration register.
63 Writes an 8-bit PCI configuration register.
65 Writes the 8-bit PCI configuration register specified by Address with the
66 value specified by Value. Value is returned. This function must guarantee
67 that all PCI read and write operations are serialized.
69 If Address > 0x0FFFFFFF, then ASSERT().
71 @param Address Address that encodes the PCI Bus, Device, Function and
73 @param Value The value to write.
75 @return The value written to the PCI configuration register.
86 Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
89 Reads the 8-bit PCI configuration register specified by Address, performs a
90 bitwise inclusive OR between the read result and the value specified by
91 OrData, and writes the result to the 8-bit PCI configuration register
92 specified by Address. The value written to the PCI configuration register is
93 returned. This function must guarantee that all PCI read and write operations
96 If Address > 0x0FFFFFFF, then ASSERT().
98 @param Address Address that encodes the PCI Bus, Device, Function and
100 @param OrData The value to OR with the PCI configuration register.
102 @return The value written back to the PCI configuration register.
113 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
116 Reads the 8-bit PCI configuration register specified by Address, performs a
117 bitwise AND between the read result and the value specified by AndData, and
118 writes the result to the 8-bit PCI configuration register specified by
119 Address. The value written to the PCI configuration register is returned.
120 This function must guarantee that all PCI read and write operations are
123 If Address > 0x0FFFFFFF, then ASSERT().
125 @param Address Address that encodes the PCI Bus, Device, Function and
127 @param AndData The value to AND with the PCI configuration register.
129 @return The value written back to the PCI configuration register.
140 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
141 value, followed a bitwise inclusive OR with another 8-bit value.
143 Reads the 8-bit PCI configuration register specified by Address, performs a
144 bitwise AND between the read result and the value specified by AndData,
145 performs a bitwise inclusive OR between the result of the AND operation and
146 the value specified by OrData, and writes the result to the 8-bit PCI
147 configuration register specified by Address. The value written to the PCI
148 configuration register is returned. This function must guarantee that all PCI
149 read and write operations are serialized.
151 If Address > 0x0FFFFFFF, then ASSERT().
153 @param Address Address that encodes the PCI Bus, Device, Function and
155 @param AndData The value to AND with the PCI configuration register.
156 @param OrData The value to OR with the result of the AND operation.
158 @return The value written back to the PCI configuration register.
163 PciExpressAndThenOr8 (
170 Reads a bit field of a PCI configuration register.
172 Reads the bit field in an 8-bit PCI configuration register. The bit field is
173 specified by the StartBit and the EndBit. The value of the bit field is
176 If Address > 0x0FFFFFFF, then ASSERT().
177 If StartBit is greater than 7, then ASSERT().
178 If EndBit is greater than 7, then ASSERT().
179 If EndBit is less than or equal to StartBit, then ASSERT().
181 @param Address PCI configuration register to read.
182 @param StartBit The ordinal of the least significant bit in the bit field.
184 @param EndBit The ordinal of the most significant bit in the bit field.
187 @return The value of the bit field read from the PCI configuration register.
192 PciExpressBitFieldRead8 (
199 Writes a bit field to a PCI configuration register.
201 Writes Value to the bit field of the PCI configuration register. The bit
202 field is specified by the StartBit and the EndBit. All other bits in the
203 destination PCI configuration register are preserved. The new value of the
204 8-bit register is returned.
206 If Address > 0x0FFFFFFF, then ASSERT().
207 If StartBit is greater than 7, then ASSERT().
208 If EndBit is greater than 7, then ASSERT().
209 If EndBit is less than or equal to StartBit, then ASSERT().
211 @param Address PCI configuration register to write.
212 @param StartBit The ordinal of the least significant bit in the bit field.
214 @param EndBit The ordinal of the most significant bit in the bit field.
216 @param Value New value of the bit field.
218 @return The value written back to the PCI configuration register.
223 PciExpressBitFieldWrite8 (
231 Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
232 writes the result back to the bit field in the 8-bit port.
234 Reads the 8-bit PCI configuration register specified by Address, performs a
235 bitwise inclusive OR between the read result and the value specified by
236 OrData, and writes the result to the 8-bit PCI configuration register
237 specified by Address. The value written to the PCI configuration register is
238 returned. This function must guarantee that all PCI read and write operations
239 are serialized. Extra left bits in OrData are stripped.
241 If Address > 0x0FFFFFFF, then ASSERT().
242 If StartBit is greater than 7, then ASSERT().
243 If EndBit is greater than 7, then ASSERT().
244 If EndBit is less than or equal to StartBit, then ASSERT().
246 @param Address PCI configuration register to write.
247 @param StartBit The ordinal of the least significant bit in the bit field.
249 @param EndBit The ordinal of the most significant bit in the bit field.
251 @param OrData The value to OR with the PCI configuration register.
253 @return The value written back to the PCI configuration register.
258 PciExpressBitFieldOr8 (
266 Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
267 AND, and writes the result back to the bit field in the 8-bit register.
269 Reads the 8-bit PCI configuration register specified by Address, performs a
270 bitwise AND between the read result and the value specified by AndData, and
271 writes the result to the 8-bit PCI configuration register specified by
272 Address. The value written to the PCI configuration register is returned.
273 This function must guarantee that all PCI read and write operations are
274 serialized. Extra left bits in AndData are stripped.
276 If Address > 0x0FFFFFFF, then ASSERT().
277 If StartBit is greater than 7, then ASSERT().
278 If EndBit is greater than 7, then ASSERT().
279 If EndBit is less than or equal to StartBit, then ASSERT().
281 @param Address PCI configuration register to write.
282 @param StartBit The ordinal of the least significant bit in the bit field.
284 @param EndBit The ordinal of the most significant bit in the bit field.
286 @param AndData The value to AND with the PCI configuration register.
288 @return The value written back to the PCI configuration register.
293 PciExpressBitFieldAnd8 (
301 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
302 bitwise inclusive OR, and writes the result back to the bit field in the
305 Reads the 8-bit PCI configuration register specified by Address, performs a
306 bitwise AND followed by a bitwise inclusive OR between the read result and
307 the value specified by AndData, and writes the result to the 8-bit PCI
308 configuration register specified by Address. The value written to the PCI
309 configuration register is returned. This function must guarantee that all PCI
310 read and write operations are serialized. Extra left bits in both AndData and
313 If Address > 0x0FFFFFFF, then ASSERT().
314 If StartBit is greater than 7, then ASSERT().
315 If EndBit is greater than 7, then ASSERT().
316 If EndBit is less than or equal to StartBit, then ASSERT().
318 @param Address PCI configuration register to write.
319 @param StartBit The ordinal of the least significant bit in the bit field.
321 @param EndBit The ordinal of the most significant bit in the bit field.
323 @param AndData The value to AND with the PCI configuration register.
324 @param OrData The value to OR with the result of the AND operation.
326 @return The value written back to the PCI configuration register.
331 PciExpressBitFieldAndThenOr8 (
340 Reads a 16-bit PCI configuration register.
342 Reads and returns the 16-bit PCI configuration register specified by Address.
343 This function must guarantee that all PCI read and write operations are
346 If Address > 0x0FFFFFFF, then ASSERT().
347 If Address is not aligned on a 16-bit boundary, then ASSERT().
349 @param Address Address that encodes the PCI Bus, Device, Function and
352 @return The read value from the PCI configuration register.
362 Writes a 16-bit PCI configuration register.
364 Writes the 16-bit PCI configuration register specified by Address with the
365 value specified by Value. Value is returned. This function must guarantee
366 that all PCI read and write operations are serialized.
368 If Address > 0x0FFFFFFF, then ASSERT().
369 If Address is not aligned on a 16-bit boundary, then ASSERT().
371 @param Address Address that encodes the PCI Bus, Device, Function and
373 @param Value The value to write.
375 @return The value written to the PCI configuration register.
386 Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
389 Reads the 16-bit PCI configuration register specified by Address, performs a
390 bitwise inclusive OR between the read result and the value specified by
391 OrData, and writes the result to the 16-bit PCI configuration register
392 specified by Address. The value written to the PCI configuration register is
393 returned. This function must guarantee that all PCI read and write operations
396 If Address > 0x0FFFFFFF, then ASSERT().
397 If Address is not aligned on a 16-bit boundary, then ASSERT().
399 @param Address Address that encodes the PCI Bus, Device, Function and
401 @param OrData The value to OR with the PCI configuration register.
403 @return The value written back to the PCI configuration register.
414 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
417 Reads the 16-bit PCI configuration register specified by Address, performs a
418 bitwise AND between the read result and the value specified by AndData, and
419 writes the result to the 16-bit PCI configuration register specified by
420 Address. The value written to the PCI configuration register is returned.
421 This function must guarantee that all PCI read and write operations are
424 If Address > 0x0FFFFFFF, then ASSERT().
425 If Address is not aligned on a 16-bit boundary, then ASSERT().
427 @param Address Address that encodes the PCI Bus, Device, Function and
429 @param AndData The value to AND with the PCI configuration register.
431 @return The value written back to the PCI configuration register.
442 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
443 value, followed a bitwise inclusive OR with another 16-bit value.
445 Reads the 16-bit PCI configuration register specified by Address, performs a
446 bitwise AND between the read result and the value specified by AndData,
447 performs a bitwise inclusive OR between the result of the AND operation and
448 the value specified by OrData, and writes the result to the 16-bit PCI
449 configuration register specified by Address. The value written to the PCI
450 configuration register is returned. This function must guarantee that all PCI
451 read and write operations are serialized.
453 If Address > 0x0FFFFFFF, then ASSERT().
454 If Address is not aligned on a 16-bit boundary, then ASSERT().
456 @param Address Address that encodes the PCI Bus, Device, Function and
458 @param AndData The value to AND with the PCI configuration register.
459 @param OrData The value to OR with the result of the AND operation.
461 @return The value written back to the PCI configuration register.
466 PciExpressAndThenOr16 (
473 Reads a bit field of a PCI configuration register.
475 Reads the bit field in a 16-bit PCI configuration register. The bit field is
476 specified by the StartBit and the EndBit. The value of the bit field is
479 If Address > 0x0FFFFFFF, then ASSERT().
480 If Address is not aligned on a 16-bit boundary, then ASSERT().
481 If StartBit is greater than 15, then ASSERT().
482 If EndBit is greater than 15, then ASSERT().
483 If EndBit is less than or equal to StartBit, then ASSERT().
485 @param Address PCI configuration register to read.
486 @param StartBit The ordinal of the least significant bit in the bit field.
488 @param EndBit The ordinal of the most significant bit in the bit field.
491 @return The value of the bit field read from the PCI configuration register.
496 PciExpressBitFieldRead16 (
503 Writes a bit field to a PCI configuration register.
505 Writes Value to the bit field of the PCI configuration register. The bit
506 field is specified by the StartBit and the EndBit. All other bits in the
507 destination PCI configuration register are preserved. The new value of the
508 16-bit register is returned.
510 If Address > 0x0FFFFFFF, then ASSERT().
511 If Address is not aligned on a 16-bit boundary, then ASSERT().
512 If StartBit is greater than 15, then ASSERT().
513 If EndBit is greater than 15, then ASSERT().
514 If EndBit is less than or equal to StartBit, then ASSERT().
516 @param Address PCI configuration register to write.
517 @param StartBit The ordinal of the least significant bit in the bit field.
519 @param EndBit The ordinal of the most significant bit in the bit field.
521 @param Value New value of the bit field.
523 @return The value written back to the PCI configuration register.
528 PciExpressBitFieldWrite16 (
536 Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
537 writes the result back to the bit field in the 16-bit port.
539 Reads the 16-bit PCI configuration register specified by Address, performs a
540 bitwise inclusive OR between the read result and the value specified by
541 OrData, and writes the result to the 16-bit PCI configuration register
542 specified by Address. The value written to the PCI configuration register is
543 returned. This function must guarantee that all PCI read and write operations
544 are serialized. Extra left bits in OrData are stripped.
546 If Address > 0x0FFFFFFF, then ASSERT().
547 If Address is not aligned on a 16-bit boundary, then ASSERT().
548 If StartBit is greater than 15, then ASSERT().
549 If EndBit is greater than 15, then ASSERT().
550 If EndBit is less than or equal to StartBit, then ASSERT().
552 @param Address PCI configuration register to write.
553 @param StartBit The ordinal of the least significant bit in the bit field.
555 @param EndBit The ordinal of the most significant bit in the bit field.
557 @param OrData The value to OR with the PCI configuration register.
559 @return The value written back to the PCI configuration register.
564 PciExpressBitFieldOr16 (
572 Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
573 AND, and writes the result back to the bit field in the 16-bit register.
575 Reads the 16-bit PCI configuration register specified by Address, performs a
576 bitwise AND between the read result and the value specified by AndData, and
577 writes the result to the 16-bit PCI configuration register specified by
578 Address. The value written to the PCI configuration register is returned.
579 This function must guarantee that all PCI read and write operations are
580 serialized. Extra left bits in AndData are stripped.
582 If Address > 0x0FFFFFFF, then ASSERT().
583 If Address is not aligned on a 16-bit boundary, then ASSERT().
584 If StartBit is greater than 15, then ASSERT().
585 If EndBit is greater than 15, then ASSERT().
586 If EndBit is less than or equal to StartBit, then ASSERT().
588 @param Address PCI configuration register to write.
589 @param StartBit The ordinal of the least significant bit in the bit field.
591 @param EndBit The ordinal of the most significant bit in the bit field.
593 @param AndData The value to AND with the PCI configuration register.
595 @return The value written back to the PCI configuration register.
600 PciExpressBitFieldAnd16 (
608 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
609 bitwise inclusive OR, and writes the result back to the bit field in the
612 Reads the 16-bit PCI configuration register specified by Address, performs a
613 bitwise AND followed by a bitwise inclusive OR between the read result and
614 the value specified by AndData, and writes the result to the 16-bit PCI
615 configuration register specified by Address. The value written to the PCI
616 configuration register is returned. This function must guarantee that all PCI
617 read and write operations are serialized. Extra left bits in both AndData and
620 If Address > 0x0FFFFFFF, then ASSERT().
621 If Address is not aligned on a 16-bit boundary, then ASSERT().
622 If StartBit is greater than 15, then ASSERT().
623 If EndBit is greater than 15, then ASSERT().
624 If EndBit is less than or equal to StartBit, then ASSERT().
626 @param Address PCI configuration register to write.
627 @param StartBit The ordinal of the least significant bit in the bit field.
629 @param EndBit The ordinal of the most significant bit in the bit field.
631 @param AndData The value to AND with the PCI configuration register.
632 @param OrData The value to OR with the result of the AND operation.
634 @return The value written back to the PCI configuration register.
639 PciExpressBitFieldAndThenOr16 (
648 Reads a 32-bit PCI configuration register.
650 Reads and returns the 32-bit PCI configuration register specified by Address.
651 This function must guarantee that all PCI read and write operations are
654 If Address > 0x0FFFFFFF, then ASSERT().
655 If Address is not aligned on a 32-bit boundary, then ASSERT().
657 @param Address Address that encodes the PCI Bus, Device, Function and
660 @return The read value from the PCI configuration register.
670 Writes a 32-bit PCI configuration register.
672 Writes the 32-bit PCI configuration register specified by Address with the
673 value specified by Value. Value is returned. This function must guarantee
674 that all PCI read and write operations are serialized.
676 If Address > 0x0FFFFFFF, then ASSERT().
677 If Address is not aligned on a 32-bit boundary, then ASSERT().
679 @param Address Address that encodes the PCI Bus, Device, Function and
681 @param Value The value to write.
683 @return The value written to the PCI configuration register.
694 Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
697 Reads the 32-bit PCI configuration register specified by Address, performs a
698 bitwise inclusive OR between the read result and the value specified by
699 OrData, and writes the result to the 32-bit PCI configuration register
700 specified by Address. The value written to the PCI configuration register is
701 returned. This function must guarantee that all PCI read and write operations
704 If Address > 0x0FFFFFFF, then ASSERT().
705 If Address is not aligned on a 32-bit boundary, then ASSERT().
707 @param Address Address that encodes the PCI Bus, Device, Function and
709 @param OrData The value to OR with the PCI configuration register.
711 @return The value written back to the PCI configuration register.
722 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
725 Reads the 32-bit PCI configuration register specified by Address, performs a
726 bitwise AND between the read result and the value specified by AndData, and
727 writes the result to the 32-bit PCI configuration register specified by
728 Address. The value written to the PCI configuration register is returned.
729 This function must guarantee that all PCI read and write operations are
732 If Address > 0x0FFFFFFF, then ASSERT().
733 If Address is not aligned on a 32-bit boundary, then ASSERT().
735 @param Address Address that encodes the PCI Bus, Device, Function and
737 @param AndData The value to AND with the PCI configuration register.
739 @return The value written back to the PCI configuration register.
750 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
751 value, followed a bitwise inclusive OR with another 32-bit value.
753 Reads the 32-bit PCI configuration register specified by Address, performs a
754 bitwise AND between the read result and the value specified by AndData,
755 performs a bitwise inclusive OR between the result of the AND operation and
756 the value specified by OrData, and writes the result to the 32-bit PCI
757 configuration register specified by Address. The value written to the PCI
758 configuration register is returned. This function must guarantee that all PCI
759 read and write operations are serialized.
761 If Address > 0x0FFFFFFF, then ASSERT().
762 If Address is not aligned on a 32-bit boundary, then ASSERT().
764 @param Address Address that encodes the PCI Bus, Device, Function and
766 @param AndData The value to AND with the PCI configuration register.
767 @param OrData The value to OR with the result of the AND operation.
769 @return The value written back to the PCI configuration register.
774 PciExpressAndThenOr32 (
781 Reads a bit field of a PCI configuration register.
783 Reads the bit field in a 32-bit PCI configuration register. The bit field is
784 specified by the StartBit and the EndBit. The value of the bit field is
787 If Address > 0x0FFFFFFF, then ASSERT().
788 If Address is not aligned on a 32-bit boundary, then ASSERT().
789 If StartBit is greater than 31, then ASSERT().
790 If EndBit is greater than 31, then ASSERT().
791 If EndBit is less than or equal to StartBit, then ASSERT().
793 @param Address PCI configuration register to read.
794 @param StartBit The ordinal of the least significant bit in the bit field.
796 @param EndBit The ordinal of the most significant bit in the bit field.
799 @return The value of the bit field read from the PCI configuration register.
804 PciExpressBitFieldRead32 (
811 Writes a bit field to a PCI configuration register.
813 Writes Value to the bit field of the PCI configuration register. The bit
814 field is specified by the StartBit and the EndBit. All other bits in the
815 destination PCI configuration register are preserved. The new value of the
816 32-bit register is returned.
818 If Address > 0x0FFFFFFF, then ASSERT().
819 If Address is not aligned on a 32-bit boundary, then ASSERT().
820 If StartBit is greater than 31, then ASSERT().
821 If EndBit is greater than 31, then ASSERT().
822 If EndBit is less than or equal to StartBit, then ASSERT().
824 @param Address PCI configuration register to write.
825 @param StartBit The ordinal of the least significant bit in the bit field.
827 @param EndBit The ordinal of the most significant bit in the bit field.
829 @param Value New value of the bit field.
831 @return The value written back to the PCI configuration register.
836 PciExpressBitFieldWrite32 (
844 Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
845 writes the result back to the bit field in the 32-bit port.
847 Reads the 32-bit PCI configuration register specified by Address, performs a
848 bitwise inclusive OR between the read result and the value specified by
849 OrData, and writes the result to the 32-bit PCI configuration register
850 specified by Address. The value written to the PCI configuration register is
851 returned. This function must guarantee that all PCI read and write operations
852 are serialized. Extra left bits in OrData are stripped.
854 If Address > 0x0FFFFFFF, then ASSERT().
855 If Address is not aligned on a 32-bit boundary, then ASSERT().
856 If StartBit is greater than 31, then ASSERT().
857 If EndBit is greater than 31, then ASSERT().
858 If EndBit is less than or equal to StartBit, then ASSERT().
860 @param Address PCI configuration register to write.
861 @param StartBit The ordinal of the least significant bit in the bit field.
863 @param EndBit The ordinal of the most significant bit in the bit field.
865 @param OrData The value to OR with the PCI configuration register.
867 @return The value written back to the PCI configuration register.
872 PciExpressBitFieldOr32 (
880 Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
881 AND, and writes the result back to the bit field in the 32-bit register.
883 Reads the 32-bit PCI configuration register specified by Address, performs a
884 bitwise AND between the read result and the value specified by AndData, and
885 writes the result to the 32-bit PCI configuration register specified by
886 Address. The value written to the PCI configuration register is returned.
887 This function must guarantee that all PCI read and write operations are
888 serialized. Extra left bits in AndData are stripped.
890 If Address > 0x0FFFFFFF, then ASSERT().
891 If Address is not aligned on a 32-bit boundary, then ASSERT().
892 If StartBit is greater than 31, then ASSERT().
893 If EndBit is greater than 31, then ASSERT().
894 If EndBit is less than or equal to StartBit, then ASSERT().
896 @param Address PCI configuration register to write.
897 @param StartBit The ordinal of the least significant bit in the bit field.
899 @param EndBit The ordinal of the most significant bit in the bit field.
901 @param AndData The value to AND with the PCI configuration register.
903 @return The value written back to the PCI configuration register.
908 PciExpressBitFieldAnd32 (
916 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
917 bitwise inclusive OR, and writes the result back to the bit field in the
920 Reads the 32-bit PCI configuration register specified by Address, performs a
921 bitwise AND followed by a bitwise inclusive OR between the read result and
922 the value specified by AndData, and writes the result to the 32-bit PCI
923 configuration register specified by Address. The value written to the PCI
924 configuration register is returned. This function must guarantee that all PCI
925 read and write operations are serialized. Extra left bits in both AndData and
928 If Address > 0x0FFFFFFF, then ASSERT().
929 If Address is not aligned on a 32-bit boundary, then ASSERT().
930 If StartBit is greater than 31, then ASSERT().
931 If EndBit is greater than 31, then ASSERT().
932 If EndBit is less than or equal to StartBit, then ASSERT().
934 @param Address PCI configuration register to write.
935 @param StartBit The ordinal of the least significant bit in the bit field.
937 @param EndBit The ordinal of the most significant bit in the bit field.
939 @param AndData The value to AND with the PCI configuration register.
940 @param OrData The value to OR with the result of the AND operation.
942 @return The value written back to the PCI configuration register.
947 PciExpressBitFieldAndThenOr32 (
956 Reads a range of PCI configuration registers into a caller supplied buffer.
958 Reads the range of PCI configuration registers specified by StartAddress and
959 Size into the buffer specified by Buffer. This function only allows the PCI
960 configuration registers from a single PCI function to be read. Size is
961 returned. When possible 32-bit PCI configuration read cycles are used to read
962 from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
963 and 16-bit PCI configuration read cycles may be used at the beginning and the
966 If StartAddress > 0x0FFFFFFF, then ASSERT().
967 If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
968 If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
969 If Buffer is NULL, then ASSERT().
971 @param StartAddress Starting address that encodes the PCI Bus, Device,
972 Function and Register.
973 @param Size Size in bytes of the transfer.
974 @param Buffer Pointer to a buffer receiving the data read.
981 PciExpressReadBuffer (
982 IN UINTN StartAddress
,
988 Copies the data in a caller supplied buffer to a specified range of PCI
991 Writes the range of PCI configuration registers specified by StartAddress and
992 Size from the buffer specified by Buffer. This function only allows the PCI
993 configuration registers from a single PCI function to be written. Size is
994 returned. When possible 32-bit PCI configuration write cycles are used to
995 write from StartAdress to StartAddress + Size. Due to alignment restrictions,
996 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
997 and the end of the range.
999 If StartAddress > 0x0FFFFFFF, then ASSERT().
1000 If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
1001 If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
1002 If Buffer is NULL, then ASSERT().
1004 @param StartAddress Starting address that encodes the PCI Bus, Device,
1005 Function and Register.
1006 @param Size Size in bytes of the transfer.
1007 @param Buffer Pointer to a buffer containing the data to write.
1014 PciExpressWriteBuffer (
1015 IN UINTN StartAddress
,