2 PCI 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.
21 Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
22 address that can be passed to the PCI Library functions.
24 @param Bus PCI Bus number. Range 0..255.
25 @param Device PCI Device number. Range 0..31.
26 @param Function PCI Function number. Range 0..7.
27 @param Register PCI Register number. Range 0..255 for PCI. Range 0..4095
30 @return The encoded PCI address.
33 #define PCI_LIB_ADDRESS(Bus,Device,Function,Offset) \
34 (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
37 Reads an 8-bit PCI configuration register.
39 Reads and returns the 8-bit PCI configuration register specified by Address.
40 This function must guarantee that all PCI read and write operations are
43 If Address > 0x0FFFFFFF, then ASSERT().
45 @param Address Address that encodes the PCI Bus, Device, Function and
48 @return The read value from the PCI configuration register.
58 Writes an 8-bit PCI configuration register.
60 Writes the 8-bit PCI configuration register specified by Address with the
61 value specified by Value. Value is returned. This function must guarantee
62 that all PCI read and write operations are serialized.
64 If Address > 0x0FFFFFFF, then ASSERT().
66 @param Address Address that encodes the PCI Bus, Device, Function and
68 @param Value The value to write.
70 @return The value written to the PCI configuration register.
81 Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
84 Reads the 8-bit PCI configuration register specified by Address, performs a
85 bitwise inclusive OR between the read result and the value specified by
86 OrData, and writes the result to the 8-bit PCI configuration register
87 specified by Address. The value written to the PCI configuration register is
88 returned. This function must guarantee that all PCI read and write operations
91 If Address > 0x0FFFFFFF, then ASSERT().
93 @param Address Address that encodes the PCI Bus, Device, Function and
95 @param OrData The value to OR with the PCI configuration register.
97 @return The value written back to the PCI configuration register.
108 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
111 Reads the 8-bit PCI configuration register specified by Address, performs a
112 bitwise AND between the read result and the value specified by AndData, and
113 writes the result to the 8-bit PCI configuration register specified by
114 Address. The value written to the PCI configuration register is returned.
115 This function must guarantee that all PCI read and write operations are
118 If Address > 0x0FFFFFFF, then ASSERT().
120 @param Address Address that encodes the PCI Bus, Device, Function and
122 @param AndData The value to AND with the PCI configuration register.
124 @return The value written back to the PCI configuration register.
135 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
136 value, followed a bitwise inclusive OR with another 8-bit value.
138 Reads the 8-bit PCI configuration register specified by Address, performs a
139 bitwise AND between the read result and the value specified by AndData,
140 performs a bitwise inclusive OR between the result of the AND operation and
141 the value specified by OrData, and writes the result to the 8-bit PCI
142 configuration register specified by Address. The value written to the PCI
143 configuration register is returned. This function must guarantee that all PCI
144 read and write operations are serialized.
146 If Address > 0x0FFFFFFF, then ASSERT().
148 @param Address Address that encodes the PCI Bus, Device, Function and
150 @param AndData The value to AND with the PCI configuration register.
151 @param OrData The value to OR with the result of the AND operation.
153 @return The value written back to the PCI configuration register.
165 Reads a bit field of a PCI configuration register.
167 Reads the bit field in an 8-bit PCI configuration register. The bit field is
168 specified by the StartBit and the EndBit. The value of the bit field is
171 If Address > 0x0FFFFFFF, then ASSERT().
172 If StartBit is greater than 7, then ASSERT().
173 If EndBit is greater than 7, then ASSERT().
174 If EndBit is less than or equal to StartBit, then ASSERT().
176 @param Address PCI configuration register to read.
177 @param StartBit The ordinal of the least significant bit in the bit field.
179 @param EndBit The ordinal of the most significant bit in the bit field.
182 @return The value of the bit field read from the PCI configuration register.
194 Writes a bit field to a PCI configuration register.
196 Writes Value to the bit field of the PCI configuration register. The bit
197 field is specified by the StartBit and the EndBit. All other bits in the
198 destination PCI configuration register are preserved. The new value of the
199 8-bit register is returned.
201 If Address > 0x0FFFFFFF, then ASSERT().
202 If StartBit is greater than 7, then ASSERT().
203 If EndBit is greater than 7, then ASSERT().
204 If EndBit is less than or equal to StartBit, then ASSERT().
206 @param Address PCI configuration register to write.
207 @param StartBit The ordinal of the least significant bit in the bit field.
209 @param EndBit The ordinal of the most significant bit in the bit field.
211 @param Value New value of the bit field.
213 @return The value written back to the PCI configuration register.
226 Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
227 writes the result back to the bit field in the 8-bit port.
229 Reads the 8-bit PCI configuration register specified by Address, performs a
230 bitwise inclusive OR between the read result and the value specified by
231 OrData, and writes the result to the 8-bit PCI configuration register
232 specified by Address. The value written to the PCI configuration register is
233 returned. This function must guarantee that all PCI read and write operations
234 are serialized. Extra left bits in OrData are stripped.
236 If Address > 0x0FFFFFFF, then ASSERT().
237 If StartBit is greater than 7, then ASSERT().
238 If EndBit is greater than 7, then ASSERT().
239 If EndBit is less than or equal to StartBit, then ASSERT().
241 @param Address PCI configuration register to write.
242 @param StartBit The ordinal of the least significant bit in the bit field.
244 @param EndBit The ordinal of the most significant bit in the bit field.
246 @param OrData The value to OR with the PCI configuration register.
248 @return The value written back to the PCI configuration register.
261 Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
262 AND, and writes the result back to the bit field in the 8-bit register.
264 Reads the 8-bit PCI configuration register specified by Address, performs a
265 bitwise AND between the read result and the value specified by AndData, and
266 writes the result to the 8-bit PCI configuration register specified by
267 Address. The value written to the PCI configuration register is returned.
268 This function must guarantee that all PCI read and write operations are
269 serialized. Extra left bits in AndData are stripped.
271 If Address > 0x0FFFFFFF, then ASSERT().
272 If StartBit is greater than 7, then ASSERT().
273 If EndBit is greater than 7, then ASSERT().
274 If EndBit is less than or equal to StartBit, then ASSERT().
276 @param Address PCI configuration register to write.
277 @param StartBit The ordinal of the least significant bit in the bit field.
279 @param EndBit The ordinal of the most significant bit in the bit field.
281 @param AndData The value to AND with the PCI configuration register.
283 @return The value written back to the PCI configuration register.
296 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
297 bitwise inclusive OR, and writes the result back to the bit field in the
300 Reads the 8-bit PCI configuration register specified by Address, performs a
301 bitwise AND followed by a bitwise inclusive OR between the read result and
302 the value specified by AndData, and writes the result to the 8-bit PCI
303 configuration register specified by Address. The value written to the PCI
304 configuration register is returned. This function must guarantee that all PCI
305 read and write operations are serialized. Extra left bits in both AndData and
308 If Address > 0x0FFFFFFF, then ASSERT().
309 If StartBit is greater than 7, then ASSERT().
310 If EndBit is greater than 7, then ASSERT().
311 If EndBit is less than or equal to StartBit, then ASSERT().
313 @param Address PCI configuration register to write.
314 @param StartBit The ordinal of the least significant bit in the bit field.
316 @param EndBit The ordinal of the most significant bit in the bit field.
318 @param AndData The value to AND with the PCI configuration register.
319 @param OrData The value to OR with the result of the AND operation.
321 @return The value written back to the PCI configuration register.
326 PciBitFieldAndThenOr8 (
335 Reads a 16-bit PCI configuration register.
337 Reads and returns the 16-bit PCI configuration register specified by Address.
338 This function must guarantee that all PCI read and write operations are
341 If Address > 0x0FFFFFFF, then ASSERT().
342 If Address is not aligned on a 16-bit boundary, then ASSERT().
344 @param Address Address that encodes the PCI Bus, Device, Function and
347 @return The read value from the PCI configuration register.
357 Writes a 16-bit PCI configuration register.
359 Writes the 16-bit PCI configuration register specified by Address with the
360 value specified by Value. Value is returned. This function must guarantee
361 that all PCI read and write operations are serialized.
363 If Address > 0x0FFFFFFF, then ASSERT().
364 If Address is not aligned on a 16-bit boundary, then ASSERT().
366 @param Address Address that encodes the PCI Bus, Device, Function and
368 @param Value The value to write.
370 @return The value written to the PCI configuration register.
381 Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
384 Reads the 16-bit PCI configuration register specified by Address, performs a
385 bitwise inclusive OR between the read result and the value specified by
386 OrData, and writes the result to the 16-bit PCI configuration register
387 specified by Address. The value written to the PCI configuration register is
388 returned. This function must guarantee that all PCI read and write operations
391 If Address > 0x0FFFFFFF, then ASSERT().
392 If Address is not aligned on a 16-bit boundary, then ASSERT().
394 @param Address Address that encodes the PCI Bus, Device, Function and
396 @param OrData The value to OR with the PCI configuration register.
398 @return The value written back to the PCI configuration register.
409 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
412 Reads the 16-bit PCI configuration register specified by Address, performs a
413 bitwise AND between the read result and the value specified by AndData, and
414 writes the result to the 16-bit PCI configuration register specified by
415 Address. The value written to the PCI configuration register is returned.
416 This function must guarantee that all PCI read and write operations are
419 If Address > 0x0FFFFFFF, then ASSERT().
420 If Address is not aligned on a 16-bit boundary, then ASSERT().
422 @param Address Address that encodes the PCI Bus, Device, Function and
424 @param AndData The value to AND with the PCI configuration register.
426 @return The value written back to the PCI configuration register.
437 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
438 value, followed a bitwise inclusive OR with another 16-bit value.
440 Reads the 16-bit PCI configuration register specified by Address, performs a
441 bitwise AND between the read result and the value specified by AndData,
442 performs a bitwise inclusive OR between the result of the AND operation and
443 the value specified by OrData, and writes the result to the 16-bit PCI
444 configuration register specified by Address. The value written to the PCI
445 configuration register is returned. This function must guarantee that all PCI
446 read and write operations are serialized.
448 If Address > 0x0FFFFFFF, then ASSERT().
449 If Address is not aligned on a 16-bit boundary, then ASSERT().
451 @param Address Address that encodes the PCI Bus, Device, Function and
453 @param AndData The value to AND with the PCI configuration register.
454 @param OrData The value to OR with the result of the AND operation.
456 @return The value written back to the PCI configuration register.
468 Reads a bit field of a PCI configuration register.
470 Reads the bit field in a 16-bit PCI configuration register. The bit field is
471 specified by the StartBit and the EndBit. The value of the bit field is
474 If Address > 0x0FFFFFFF, then ASSERT().
475 If Address is not aligned on a 16-bit boundary, then ASSERT().
476 If StartBit is greater than 15, then ASSERT().
477 If EndBit is greater than 15, then ASSERT().
478 If EndBit is less than or equal to StartBit, then ASSERT().
480 @param Address PCI configuration register to read.
481 @param StartBit The ordinal of the least significant bit in the bit field.
483 @param EndBit The ordinal of the most significant bit in the bit field.
486 @return The value of the bit field read from the PCI configuration register.
498 Writes a bit field to a PCI configuration register.
500 Writes Value to the bit field of the PCI configuration register. The bit
501 field is specified by the StartBit and the EndBit. All other bits in the
502 destination PCI configuration register are preserved. The new value of the
503 16-bit register is returned.
505 If Address > 0x0FFFFFFF, then ASSERT().
506 If Address is not aligned on a 16-bit boundary, then ASSERT().
507 If StartBit is greater than 15, then ASSERT().
508 If EndBit is greater than 15, then ASSERT().
509 If EndBit is less than or equal to StartBit, then ASSERT().
511 @param Address PCI configuration register to write.
512 @param StartBit The ordinal of the least significant bit in the bit field.
514 @param EndBit The ordinal of the most significant bit in the bit field.
516 @param Value New value of the bit field.
518 @return The value written back to the PCI configuration register.
531 Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
532 writes the result back to the bit field in the 16-bit port.
534 Reads the 16-bit PCI configuration register specified by Address, performs a
535 bitwise inclusive OR between the read result and the value specified by
536 OrData, and writes the result to the 16-bit PCI configuration register
537 specified by Address. The value written to the PCI configuration register is
538 returned. This function must guarantee that all PCI read and write operations
539 are serialized. Extra left bits in OrData are stripped.
541 If Address > 0x0FFFFFFF, then ASSERT().
542 If Address is not aligned on a 16-bit boundary, then ASSERT().
543 If StartBit is greater than 15, then ASSERT().
544 If EndBit is greater than 15, then ASSERT().
545 If EndBit is less than or equal to StartBit, then ASSERT().
547 @param Address PCI configuration register to write.
548 @param StartBit The ordinal of the least significant bit in the bit field.
550 @param EndBit The ordinal of the most significant bit in the bit field.
552 @param OrData The value to OR with the PCI configuration register.
554 @return The value written back to the PCI configuration register.
567 Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
568 AND, and writes the result back to the bit field in the 16-bit register.
570 Reads the 16-bit PCI configuration register specified by Address, performs a
571 bitwise AND between the read result and the value specified by AndData, and
572 writes the result to the 16-bit PCI configuration register specified by
573 Address. The value written to the PCI configuration register is returned.
574 This function must guarantee that all PCI read and write operations are
575 serialized. Extra left bits in AndData are stripped.
577 If Address > 0x0FFFFFFF, then ASSERT().
578 If Address is not aligned on a 16-bit boundary, then ASSERT().
579 If StartBit is greater than 15, then ASSERT().
580 If EndBit is greater than 15, then ASSERT().
581 If EndBit is less than or equal to StartBit, then ASSERT().
583 @param Address PCI configuration register to write.
584 @param StartBit The ordinal of the least significant bit in the bit field.
586 @param EndBit The ordinal of the most significant bit in the bit field.
588 @param AndData The value to AND with the PCI configuration register.
590 @return The value written back to the PCI configuration register.
603 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
604 bitwise inclusive OR, and writes the result back to the bit field in the
607 Reads the 16-bit PCI configuration register specified by Address, performs a
608 bitwise AND followed by a bitwise inclusive OR between the read result and
609 the value specified by AndData, and writes the result to the 16-bit PCI
610 configuration register specified by Address. The value written to the PCI
611 configuration register is returned. This function must guarantee that all PCI
612 read and write operations are serialized. Extra left bits in both AndData and
615 If Address > 0x0FFFFFFF, then ASSERT().
616 If Address is not aligned on a 16-bit boundary, then ASSERT().
617 If StartBit is greater than 15, then ASSERT().
618 If EndBit is greater than 15, then ASSERT().
619 If EndBit is less than or equal to StartBit, then ASSERT().
621 @param Address PCI configuration register to write.
622 @param StartBit The ordinal of the least significant bit in the bit field.
624 @param EndBit The ordinal of the most significant bit in the bit field.
626 @param AndData The value to AND with the PCI configuration register.
627 @param OrData The value to OR with the result of the AND operation.
629 @return The value written back to the PCI configuration register.
634 PciBitFieldAndThenOr16 (
643 Reads a 32-bit PCI configuration register.
645 Reads and returns the 32-bit PCI configuration register specified by Address.
646 This function must guarantee that all PCI read and write operations are
649 If Address > 0x0FFFFFFF, then ASSERT().
650 If Address is not aligned on a 32-bit boundary, then ASSERT().
652 @param Address Address that encodes the PCI Bus, Device, Function and
655 @return The read value from the PCI configuration register.
665 Writes a 32-bit PCI configuration register.
667 Writes the 32-bit PCI configuration register specified by Address with the
668 value specified by Value. Value is returned. This function must guarantee
669 that all PCI read and write operations are serialized.
671 If Address > 0x0FFFFFFF, then ASSERT().
672 If Address is not aligned on a 32-bit boundary, then ASSERT().
674 @param Address Address that encodes the PCI Bus, Device, Function and
676 @param Value The value to write.
678 @return The value written to the PCI configuration register.
689 Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
692 Reads the 32-bit PCI configuration register specified by Address, performs a
693 bitwise inclusive OR between the read result and the value specified by
694 OrData, and writes the result to the 32-bit PCI configuration register
695 specified by Address. The value written to the PCI configuration register is
696 returned. This function must guarantee that all PCI read and write operations
699 If Address > 0x0FFFFFFF, then ASSERT().
700 If Address is not aligned on a 32-bit boundary, then ASSERT().
702 @param Address Address that encodes the PCI Bus, Device, Function and
704 @param OrData The value to OR with the PCI configuration register.
706 @return The value written back to the PCI configuration register.
717 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
720 Reads the 32-bit PCI configuration register specified by Address, performs a
721 bitwise AND between the read result and the value specified by AndData, and
722 writes the result to the 32-bit PCI configuration register specified by
723 Address. The value written to the PCI configuration register is returned.
724 This function must guarantee that all PCI read and write operations are
727 If Address > 0x0FFFFFFF, then ASSERT().
728 If Address is not aligned on a 32-bit boundary, then ASSERT().
730 @param Address Address that encodes the PCI Bus, Device, Function and
732 @param AndData The value to AND with the PCI configuration register.
734 @return The value written back to the PCI configuration register.
745 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
746 value, followed a bitwise inclusive OR with another 32-bit value.
748 Reads the 32-bit PCI configuration register specified by Address, performs a
749 bitwise AND between the read result and the value specified by AndData,
750 performs a bitwise inclusive OR between the result of the AND operation and
751 the value specified by OrData, and writes the result to the 32-bit PCI
752 configuration register specified by Address. The value written to the PCI
753 configuration register is returned. This function must guarantee that all PCI
754 read and write operations are serialized.
756 If Address > 0x0FFFFFFF, then ASSERT().
757 If Address is not aligned on a 32-bit boundary, then ASSERT().
759 @param Address Address that encodes the PCI Bus, Device, Function and
761 @param AndData The value to AND with the PCI configuration register.
762 @param OrData The value to OR with the result of the AND operation.
764 @return The value written back to the PCI configuration register.
776 Reads a bit field of a PCI configuration register.
778 Reads the bit field in a 32-bit PCI configuration register. The bit field is
779 specified by the StartBit and the EndBit. The value of the bit field is
782 If Address > 0x0FFFFFFF, then ASSERT().
783 If Address is not aligned on a 32-bit boundary, then ASSERT().
784 If StartBit is greater than 31, then ASSERT().
785 If EndBit is greater than 31, then ASSERT().
786 If EndBit is less than or equal to StartBit, then ASSERT().
788 @param Address PCI configuration register to read.
789 @param StartBit The ordinal of the least significant bit in the bit field.
791 @param EndBit The ordinal of the most significant bit in the bit field.
794 @return The value of the bit field read from the PCI configuration register.
806 Writes a bit field to a PCI configuration register.
808 Writes Value to the bit field of the PCI configuration register. The bit
809 field is specified by the StartBit and the EndBit. All other bits in the
810 destination PCI configuration register are preserved. The new value of the
811 32-bit register is returned.
813 If Address > 0x0FFFFFFF, then ASSERT().
814 If Address is not aligned on a 32-bit boundary, then ASSERT().
815 If StartBit is greater than 31, then ASSERT().
816 If EndBit is greater than 31, then ASSERT().
817 If EndBit is less than or equal to StartBit, then ASSERT().
819 @param Address PCI configuration register to write.
820 @param StartBit The ordinal of the least significant bit in the bit field.
822 @param EndBit The ordinal of the most significant bit in the bit field.
824 @param Value New value of the bit field.
826 @return The value written back to the PCI configuration register.
839 Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
840 writes the result back to the bit field in the 32-bit port.
842 Reads the 32-bit PCI configuration register specified by Address, performs a
843 bitwise inclusive OR between the read result and the value specified by
844 OrData, and writes the result to the 32-bit PCI configuration register
845 specified by Address. The value written to the PCI configuration register is
846 returned. This function must guarantee that all PCI read and write operations
847 are serialized. Extra left bits in OrData are stripped.
849 If Address > 0x0FFFFFFF, then ASSERT().
850 If Address is not aligned on a 32-bit boundary, then ASSERT().
851 If StartBit is greater than 31, then ASSERT().
852 If EndBit is greater than 31, then ASSERT().
853 If EndBit is less than or equal to StartBit, then ASSERT().
855 @param Address PCI configuration register to write.
856 @param StartBit The ordinal of the least significant bit in the bit field.
858 @param EndBit The ordinal of the most significant bit in the bit field.
860 @param OrData The value to OR with the PCI configuration register.
862 @return The value written back to the PCI configuration register.
875 Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
876 AND, and writes the result back to the bit field in the 32-bit register.
878 Reads the 32-bit PCI configuration register specified by Address, performs a
879 bitwise AND between the read result and the value specified by AndData, and
880 writes the result to the 32-bit PCI configuration register specified by
881 Address. The value written to the PCI configuration register is returned.
882 This function must guarantee that all PCI read and write operations are
883 serialized. Extra left bits in AndData are stripped.
885 If Address > 0x0FFFFFFF, then ASSERT().
886 If Address is not aligned on a 32-bit boundary, then ASSERT().
887 If StartBit is greater than 31, then ASSERT().
888 If EndBit is greater than 31, then ASSERT().
889 If EndBit is less than or equal to StartBit, then ASSERT().
891 @param Address PCI configuration register to write.
892 @param StartBit The ordinal of the least significant bit in the bit field.
894 @param EndBit The ordinal of the most significant bit in the bit field.
896 @param AndData The value to AND with the PCI configuration register.
898 @return The value written back to the PCI configuration register.
911 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
912 bitwise inclusive OR, and writes the result back to the bit field in the
915 Reads the 32-bit PCI configuration register specified by Address, performs a
916 bitwise AND followed by a bitwise inclusive OR between the read result and
917 the value specified by AndData, and writes the result to the 32-bit PCI
918 configuration register specified by Address. The value written to the PCI
919 configuration register is returned. This function must guarantee that all PCI
920 read and write operations are serialized. Extra left bits in both AndData and
923 If Address > 0x0FFFFFFF, then ASSERT().
924 If Address is not aligned on a 32-bit boundary, then ASSERT().
925 If StartBit is greater than 31, then ASSERT().
926 If EndBit is greater than 31, then ASSERT().
927 If EndBit is less than or equal to StartBit, then ASSERT().
929 @param Address PCI configuration register to write.
930 @param StartBit The ordinal of the least significant bit in the bit field.
932 @param EndBit The ordinal of the most significant bit in the bit field.
934 @param AndData The value to AND with the PCI configuration register.
935 @param OrData The value to OR with the result of the AND operation.
937 @return The value written back to the PCI configuration register.
942 PciBitFieldAndThenOr32 (
951 Reads a range of PCI configuration registers into a caller supplied buffer.
953 Reads the range of PCI configuration registers specified by StartAddress and
954 Size into the buffer specified by Buffer. This function only allows the PCI
955 configuration registers from a single PCI function to be read. Size is
956 returned. When possible 32-bit PCI configuration read cycles are used to read
957 from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
958 and 16-bit PCI configuration read cycles may be used at the beginning and the
961 If StartAddress > 0x0FFFFFFF, then ASSERT().
962 If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
963 If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
964 If Buffer is NULL, then ASSERT().
966 @param StartAddress Starting address that encodes the PCI Bus, Device,
967 Function and Register.
968 @param Size Size in bytes of the transfer.
969 @param Buffer Pointer to a buffer receiving the data read.
977 IN UINTN StartAddress
,
983 Copies the data in a caller supplied buffer to a specified range of PCI
986 Writes the range of PCI configuration registers specified by StartAddress and
987 Size from the buffer specified by Buffer. This function only allows the PCI
988 configuration registers from a single PCI function to be written. Size is
989 returned. When possible 32-bit PCI configuration write cycles are used to
990 write from StartAdress to StartAddress + Size. Due to alignment restrictions,
991 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
992 and the end of the range.
994 If StartAddress > 0x0FFFFFFF, then ASSERT().
995 If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
996 If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
997 If Buffer is NULL, then ASSERT().
999 @param StartAddress Starting address that encodes the PCI Bus, Device,
1000 Function and Register.
1001 @param Size Size in bytes of the transfer.
1002 @param Buffer Pointer to a buffer containing the data to write.
1010 IN UINTN StartAddress
,