2 PCI CF8 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: PciCf8Lib.h
17 #ifndef __PCI_CF8_LIB_H__
18 #define __PCI_CF8_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..255.
35 @return The encode PCI address.
38 #define PCI_CF8_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().
49 If the register specified by Address >= 0x100, then ASSERT().
51 @param Address Address that encodes the PCI Bus, Device, Function and
54 @return The read value from the PCI configuration register.
64 Writes an 8-bit PCI configuration register.
66 Writes the 8-bit PCI configuration register specified by Address with the
67 value specified by Value. Value is returned. This function must guarantee
68 that all PCI read and write operations are serialized.
70 If Address > 0x0FFFFFFF, then ASSERT().
71 If the register specified by Address >= 0x100, then ASSERT().
73 @param Address Address that encodes the PCI Bus, Device, Function and
75 @param Value The value to write.
77 @return The value written to the PCI configuration register.
88 Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
91 Reads the 8-bit PCI configuration register specified by Address, performs a
92 bitwise inclusive OR between the read result and the value specified by
93 OrData, and writes the result to the 8-bit PCI configuration register
94 specified by Address. The value written to the PCI configuration register is
95 returned. This function must guarantee that all PCI read and write operations
98 If Address > 0x0FFFFFFF, then ASSERT().
99 If the register specified by Address >= 0x100, then ASSERT().
101 @param Address Address that encodes the PCI Bus, Device, Function and
103 @param OrData The value to OR with the PCI configuration register.
105 @return The value written back to the PCI configuration register.
116 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
119 Reads the 8-bit PCI configuration register specified by Address, performs a
120 bitwise AND between the read result and the value specified by AndData, and
121 writes the result to the 8-bit PCI configuration register specified by
122 Address. The value written to the PCI configuration register is returned.
123 This function must guarantee that all PCI read and write operations are
126 If Address > 0x0FFFFFFF, then ASSERT().
127 If the register specified by Address >= 0x100, then ASSERT().
129 @param Address Address that encodes the PCI Bus, Device, Function and
131 @param AndData The value to AND with the PCI configuration register.
133 @return The value written back to the PCI configuration register.
144 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
145 value, followed a bitwise inclusive OR with another 8-bit value.
147 Reads the 8-bit PCI configuration register specified by Address, performs a
148 bitwise AND between the read result and the value specified by AndData,
149 performs a bitwise inclusive OR between the result of the AND operation and
150 the value specified by OrData, and writes the result to the 8-bit PCI
151 configuration register specified by Address. The value written to the PCI
152 configuration register is returned. This function must guarantee that all PCI
153 read and write operations are serialized.
155 If Address > 0x0FFFFFFF, then ASSERT().
156 If the register specified by Address >= 0x100, then ASSERT().
158 @param Address Address that encodes the PCI Bus, Device, Function and
160 @param AndData The value to AND with the PCI configuration register.
161 @param OrData The value to OR with the result of the AND operation.
163 @return The value written back to the PCI configuration register.
175 Reads a bit field of a PCI configuration register.
177 Reads the bit field in an 8-bit PCI configuration register. The bit field is
178 specified by the StartBit and the EndBit. The value of the bit field is
181 If Address > 0x0FFFFFFF, then ASSERT().
182 If the register specified by Address >= 0x100, then ASSERT().
183 If StartBit is greater than 7, then ASSERT().
184 If EndBit is greater than 7, then ASSERT().
185 If EndBit is less than or equal to StartBit, then ASSERT().
187 @param Address PCI configuration register to read.
188 @param StartBit The ordinal of the least significant bit in the bit field.
190 @param EndBit The ordinal of the most significant bit in the bit field.
193 @return The value of the bit field read from the PCI configuration register.
198 PciCf8BitFieldRead8 (
205 Writes a bit field to a PCI configuration register.
207 Writes Value to the bit field of the PCI configuration register. The bit
208 field is specified by the StartBit and the EndBit. All other bits in the
209 destination PCI configuration register are preserved. The new value of the
210 8-bit register is returned.
212 If Address > 0x0FFFFFFF, then ASSERT().
213 If the register specified by Address >= 0x100, then ASSERT().
214 If StartBit is greater than 7, then ASSERT().
215 If EndBit is greater than 7, then ASSERT().
216 If EndBit is less than or equal to StartBit, then ASSERT().
218 @param Address PCI configuration register to write.
219 @param StartBit The ordinal of the least significant bit in the bit field.
221 @param EndBit The ordinal of the most significant bit in the bit field.
223 @param Value New value of the bit field.
225 @return The value written back to the PCI configuration register.
230 PciCf8BitFieldWrite8 (
238 Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
239 writes the result back to the bit field in the 8-bit port.
241 Reads the 8-bit PCI configuration register specified by Address, performs a
242 bitwise inclusive OR between the read result and the value specified by
243 OrData, and writes the result to the 8-bit PCI configuration register
244 specified by Address. The value written to the PCI configuration register is
245 returned. This function must guarantee that all PCI read and write operations
246 are serialized. Extra left bits in OrData are stripped.
248 If Address > 0x0FFFFFFF, then ASSERT().
249 If the register specified by Address >= 0x100, then ASSERT().
250 If StartBit is greater than 7, then ASSERT().
251 If EndBit is greater than 7, then ASSERT().
252 If EndBit is less than or equal to StartBit, then ASSERT().
254 @param Address PCI configuration register to write.
255 @param StartBit The ordinal of the least significant bit in the bit field.
257 @param EndBit The ordinal of the most significant bit in the bit field.
259 @param OrData The value to OR with the PCI configuration register.
261 @return The value written back to the PCI configuration register.
274 Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
275 AND, and writes the result back to the bit field in the 8-bit register.
277 Reads the 8-bit PCI configuration register specified by Address, performs a
278 bitwise AND between the read result and the value specified by AndData, and
279 writes the result to the 8-bit PCI configuration register specified by
280 Address. The value written to the PCI configuration register is returned.
281 This function must guarantee that all PCI read and write operations are
282 serialized. Extra left bits in AndData are stripped.
284 If Address > 0x0FFFFFFF, then ASSERT().
285 If the register specified by Address >= 0x100, then ASSERT().
286 If StartBit is greater than 7, then ASSERT().
287 If EndBit is greater than 7, then ASSERT().
288 If EndBit is less than or equal to StartBit, then ASSERT().
290 @param Address PCI configuration register to write.
291 @param StartBit The ordinal of the least significant bit in the bit field.
293 @param EndBit The ordinal of the most significant bit in the bit field.
295 @param AndData The value to AND with the PCI configuration register.
297 @return The value written back to the PCI configuration register.
310 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
311 bitwise inclusive OR, and writes the result back to the bit field in the
314 Reads the 8-bit PCI configuration register specified by Address, performs a
315 bitwise AND followed by a bitwise inclusive OR between the read result and
316 the value specified by AndData, and writes the result to the 8-bit PCI
317 configuration register specified by Address. The value written to the PCI
318 configuration register is returned. This function must guarantee that all PCI
319 read and write operations are serialized. Extra left bits in both AndData and
322 If Address > 0x0FFFFFFF, then ASSERT().
323 If the register specified by Address >= 0x100, then ASSERT().
324 If StartBit is greater than 7, then ASSERT().
325 If EndBit is greater than 7, then ASSERT().
326 If EndBit is less than or equal to StartBit, then ASSERT().
328 @param Address PCI configuration register to write.
329 @param StartBit The ordinal of the least significant bit in the bit field.
331 @param EndBit The ordinal of the most significant bit in the bit field.
333 @param AndData The value to AND with the PCI configuration register.
334 @param OrData The value to OR with the result of the AND operation.
336 @return The value written back to the PCI configuration register.
341 PciCf8BitFieldAndThenOr8 (
350 Reads a 16-bit PCI configuration register.
352 Reads and returns the 16-bit PCI configuration register specified by Address.
353 This function must guarantee that all PCI read and write operations are
356 If Address > 0x0FFFFFFF, then ASSERT().
357 If Address is not aligned on a 16-bit boundary, then ASSERT().
358 If the register specified by Address >= 0x100, then ASSERT().
360 @param Address Address that encodes the PCI Bus, Device, Function and
363 @return The read value from the PCI configuration register.
373 Writes a 16-bit PCI configuration register.
375 Writes the 16-bit PCI configuration register specified by Address with the
376 value specified by Value. Value is returned. This function must guarantee
377 that all PCI read and write operations are serialized.
379 If Address > 0x0FFFFFFF, then ASSERT().
380 If Address is not aligned on a 16-bit boundary, then ASSERT().
381 If the register specified by Address >= 0x100, then ASSERT().
383 @param Address Address that encodes the PCI Bus, Device, Function and
385 @param Value The value to write.
387 @return The value written to the PCI configuration register.
398 Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
401 Reads the 16-bit PCI configuration register specified by Address, performs a
402 bitwise inclusive OR between the read result and the value specified by
403 OrData, and writes the result to the 16-bit PCI configuration register
404 specified by Address. The value written to the PCI configuration register is
405 returned. This function must guarantee that all PCI read and write operations
408 If Address > 0x0FFFFFFF, then ASSERT().
409 If Address is not aligned on a 16-bit boundary, then ASSERT().
410 If the register specified by Address >= 0x100, then ASSERT().
412 @param Address Address that encodes the PCI Bus, Device, Function and
414 @param OrData The value to OR with the PCI configuration register.
416 @return The value written back to the PCI configuration register.
427 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
430 Reads the 16-bit PCI configuration register specified by Address, performs a
431 bitwise AND between the read result and the value specified by AndData, and
432 writes the result to the 16-bit PCI configuration register specified by
433 Address. The value written to the PCI configuration register is returned.
434 This function must guarantee that all PCI read and write operations are
437 If Address > 0x0FFFFFFF, then ASSERT().
438 If Address is not aligned on a 16-bit boundary, then ASSERT().
439 If the register specified by Address >= 0x100, then ASSERT().
441 @param Address Address that encodes the PCI Bus, Device, Function and
443 @param AndData The value to AND with the PCI configuration register.
445 @return The value written back to the PCI configuration register.
456 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
457 value, followed a bitwise inclusive OR with another 16-bit value.
459 Reads the 16-bit PCI configuration register specified by Address, performs a
460 bitwise AND between the read result and the value specified by AndData,
461 performs a bitwise inclusive OR between the result of the AND operation and
462 the value specified by OrData, and writes the result to the 16-bit PCI
463 configuration register specified by Address. The value written to the PCI
464 configuration register is returned. This function must guarantee that all PCI
465 read and write operations are serialized.
467 If Address > 0x0FFFFFFF, then ASSERT().
468 If Address is not aligned on a 16-bit boundary, then ASSERT().
469 If the register specified by Address >= 0x100, then ASSERT().
471 @param Address Address that encodes the PCI Bus, Device, Function and
473 @param AndData The value to AND with the PCI configuration register.
474 @param OrData The value to OR with the result of the AND operation.
476 @return The value written back to the PCI configuration register.
488 Reads a bit field of a PCI configuration register.
490 Reads the bit field in a 16-bit PCI configuration register. The bit field is
491 specified by the StartBit and the EndBit. The value of the bit field is
494 If Address > 0x0FFFFFFF, then ASSERT().
495 If Address is not aligned on a 16-bit boundary, then ASSERT().
496 If the register specified by Address >= 0x100, then ASSERT().
497 If StartBit is greater than 15, then ASSERT().
498 If EndBit is greater than 15, then ASSERT().
499 If EndBit is less than or equal to StartBit, then ASSERT().
501 @param Address PCI configuration register to read.
502 @param StartBit The ordinal of the least significant bit in the bit field.
504 @param EndBit The ordinal of the most significant bit in the bit field.
507 @return The value of the bit field read from the PCI configuration register.
512 PciCf8BitFieldRead16 (
519 Writes a bit field to a PCI configuration register.
521 Writes Value to the bit field of the PCI configuration register. The bit
522 field is specified by the StartBit and the EndBit. All other bits in the
523 destination PCI configuration register are preserved. The new value of the
524 16-bit register is returned.
526 If Address > 0x0FFFFFFF, then ASSERT().
527 If Address is not aligned on a 16-bit boundary, then ASSERT().
528 If the register specified by Address >= 0x100, then ASSERT().
529 If StartBit is greater than 15, then ASSERT().
530 If EndBit is greater than 15, then ASSERT().
531 If EndBit is less than or equal to StartBit, then ASSERT().
533 @param Address PCI configuration register to write.
534 @param StartBit The ordinal of the least significant bit in the bit field.
536 @param EndBit The ordinal of the most significant bit in the bit field.
538 @param Value New value of the bit field.
540 @return The value written back to the PCI configuration register.
545 PciCf8BitFieldWrite16 (
553 Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
554 writes the result back to the bit field in the 16-bit port.
556 Reads the 16-bit PCI configuration register specified by Address, performs a
557 bitwise inclusive OR between the read result and the value specified by
558 OrData, and writes the result to the 16-bit PCI configuration register
559 specified by Address. The value written to the PCI configuration register is
560 returned. This function must guarantee that all PCI read and write operations
561 are serialized. Extra left bits in OrData are stripped.
563 If Address > 0x0FFFFFFF, then ASSERT().
564 If Address is not aligned on a 16-bit boundary, then ASSERT().
565 If the register specified by Address >= 0x100, then ASSERT().
566 If StartBit is greater than 15, then ASSERT().
567 If EndBit is greater than 15, then ASSERT().
568 If EndBit is less than or equal to StartBit, then ASSERT().
570 @param Address PCI configuration register to write.
571 @param StartBit The ordinal of the least significant bit in the bit field.
573 @param EndBit The ordinal of the most significant bit in the bit field.
575 @param OrData The value to OR with the PCI configuration register.
577 @return The value written back to the PCI configuration register.
590 Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
591 AND, and writes the result back to the bit field in the 16-bit register.
593 Reads the 16-bit PCI configuration register specified by Address, performs a
594 bitwise AND between the read result and the value specified by AndData, and
595 writes the result to the 16-bit PCI configuration register specified by
596 Address. The value written to the PCI configuration register is returned.
597 This function must guarantee that all PCI read and write operations are
598 serialized. Extra left bits in AndData are stripped.
600 If Address > 0x0FFFFFFF, then ASSERT().
601 If Address is not aligned on a 16-bit boundary, then ASSERT().
602 If the register specified by Address >= 0x100, then ASSERT().
603 If StartBit is greater than 15, then ASSERT().
604 If EndBit is greater than 15, then ASSERT().
605 If EndBit is less than or equal to StartBit, then ASSERT().
607 @param Address PCI configuration register to write.
608 @param StartBit The ordinal of the least significant bit in the bit field.
610 @param EndBit The ordinal of the most significant bit in the bit field.
612 @param AndData The value to AND with the PCI configuration register.
614 @return The value written back to the PCI configuration register.
619 PciCf8BitFieldAnd16 (
627 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
628 bitwise inclusive OR, and writes the result back to the bit field in the
631 Reads the 16-bit PCI configuration register specified by Address, performs a
632 bitwise AND followed by a bitwise inclusive OR between the read result and
633 the value specified by AndData, and writes the result to the 16-bit PCI
634 configuration register specified by Address. The value written to the PCI
635 configuration register is returned. This function must guarantee that all PCI
636 read and write operations are serialized. Extra left bits in both AndData and
639 If Address > 0x0FFFFFFF, then ASSERT().
640 If Address is not aligned on a 16-bit boundary, then ASSERT().
641 If the register specified by Address >= 0x100, then ASSERT().
642 If StartBit is greater than 15, then ASSERT().
643 If EndBit is greater than 15, then ASSERT().
644 If EndBit is less than or equal to StartBit, then ASSERT().
646 @param Address PCI configuration register to write.
647 @param StartBit The ordinal of the least significant bit in the bit field.
649 @param EndBit The ordinal of the most significant bit in the bit field.
651 @param AndData The value to AND with the PCI configuration register.
652 @param OrData The value to OR with the result of the AND operation.
654 @return The value written back to the PCI configuration register.
659 PciCf8BitFieldAndThenOr16 (
668 Reads a 32-bit PCI configuration register.
670 Reads and returns the 32-bit PCI configuration register specified by Address.
671 This function must guarantee that all PCI read and write operations are
674 If Address > 0x0FFFFFFF, then ASSERT().
675 If Address is not aligned on a 32-bit boundary, then ASSERT().
676 If the register specified by Address >= 0x100, then ASSERT().
678 @param Address Address that encodes the PCI Bus, Device, Function and
681 @return The read value from the PCI configuration register.
691 Writes a 32-bit PCI configuration register.
693 Writes the 32-bit PCI configuration register specified by Address with the
694 value specified by Value. Value is returned. This function must guarantee
695 that all PCI read and write operations are serialized.
697 If Address > 0x0FFFFFFF, then ASSERT().
698 If Address is not aligned on a 32-bit boundary, then ASSERT().
699 If the register specified by Address >= 0x100, then ASSERT().
701 @param Address Address that encodes the PCI Bus, Device, Function and
703 @param Value The value to write.
705 @return The value written to the PCI configuration register.
716 Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
719 Reads the 32-bit PCI configuration register specified by Address, performs a
720 bitwise inclusive OR between the read result and the value specified by
721 OrData, and writes the result to the 32-bit PCI configuration register
722 specified by Address. The value written to the PCI configuration register is
723 returned. This function must guarantee that all PCI read and write operations
726 If Address > 0x0FFFFFFF, then ASSERT().
727 If Address is not aligned on a 32-bit boundary, then ASSERT().
728 If the register specified by Address >= 0x100, then ASSERT().
730 @param Address Address that encodes the PCI Bus, Device, Function and
732 @param OrData The value to OR 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
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, and
750 writes the result to the 32-bit PCI configuration register specified by
751 Address. The value written to the PCI configuration register is returned.
752 This function must guarantee that all PCI read and write operations are
755 If Address > 0x0FFFFFFF, then ASSERT().
756 If Address is not aligned on a 32-bit boundary, then ASSERT().
757 If the register specified by Address >= 0x100, 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.
763 @return The value written back to the PCI configuration register.
774 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
775 value, followed a bitwise inclusive OR with another 32-bit value.
777 Reads the 32-bit PCI configuration register specified by Address, performs a
778 bitwise AND between the read result and the value specified by AndData,
779 performs a bitwise inclusive OR between the result of the AND operation and
780 the value specified by OrData, and writes the result to the 32-bit PCI
781 configuration register specified by Address. The value written to the PCI
782 configuration register is returned. This function must guarantee that all PCI
783 read and write operations are serialized.
785 If Address > 0x0FFFFFFF, then ASSERT().
786 If Address is not aligned on a 32-bit boundary, then ASSERT().
787 If the register specified by Address >= 0x100, then ASSERT().
789 @param Address Address that encodes the PCI Bus, Device, Function and
791 @param AndData The value to AND with the PCI configuration register.
792 @param OrData The value to OR with the result of the AND operation.
794 @return The value written back to the PCI configuration register.
806 Reads a bit field of a PCI configuration register.
808 Reads the bit field in a 32-bit PCI configuration register. The bit field is
809 specified by the StartBit and the EndBit. The value of the bit field is
812 If Address > 0x0FFFFFFF, then ASSERT().
813 If Address is not aligned on a 32-bit boundary, then ASSERT().
814 If the register specified by Address >= 0x100, 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 read.
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.
825 @return The value of the bit field read from the PCI configuration register.
830 PciCf8BitFieldRead32 (
837 Writes a bit field to a PCI configuration register.
839 Writes Value to the bit field of the PCI configuration register. The bit
840 field is specified by the StartBit and the EndBit. All other bits in the
841 destination PCI configuration register are preserved. The new value of the
842 32-bit register is returned.
844 If Address > 0x0FFFFFFF, then ASSERT().
845 If Address is not aligned on a 32-bit boundary, then ASSERT().
846 If the register specified by Address >= 0x100, then ASSERT().
847 If StartBit is greater than 31, then ASSERT().
848 If EndBit is greater than 31, then ASSERT().
849 If EndBit is less than or equal to StartBit, then ASSERT().
851 @param Address PCI configuration register to write.
852 @param StartBit The ordinal of the least significant bit in the bit field.
854 @param EndBit The ordinal of the most significant bit in the bit field.
856 @param Value New value of the bit field.
858 @return The value written back to the PCI configuration register.
863 PciCf8BitFieldWrite32 (
871 Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
872 writes the result back to the bit field in the 32-bit port.
874 Reads the 32-bit PCI configuration register specified by Address, performs a
875 bitwise inclusive OR between the read result and the value specified by
876 OrData, and writes the result to the 32-bit PCI configuration register
877 specified by Address. The value written to the PCI configuration register is
878 returned. This function must guarantee that all PCI read and write operations
879 are serialized. Extra left bits in OrData are stripped.
881 If Address > 0x0FFFFFFF, then ASSERT().
882 If Address is not aligned on a 32-bit boundary, then ASSERT().
883 If the register specified by Address >= 0x100, then ASSERT().
884 If StartBit is greater than 31, then ASSERT().
885 If EndBit is greater than 31, then ASSERT().
886 If EndBit is less than or equal to StartBit, then ASSERT().
888 @param Address PCI configuration register to write.
889 @param StartBit The ordinal of the least significant bit in the bit field.
891 @param EndBit The ordinal of the most significant bit in the bit field.
893 @param OrData The value to OR with the PCI configuration register.
895 @return The value written back to the PCI configuration register.
908 Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
909 AND, and writes the result back to the bit field in the 32-bit register.
911 Reads the 32-bit PCI configuration register specified by Address, performs a
912 bitwise AND between the read result and the value specified by AndData, and
913 writes the result to the 32-bit PCI configuration register specified by
914 Address. The value written to the PCI configuration register is returned.
915 This function must guarantee that all PCI read and write operations are
916 serialized. Extra left bits in AndData are stripped.
918 If Address > 0x0FFFFFFF, then ASSERT().
919 If Address is not aligned on a 32-bit boundary, then ASSERT().
920 If the register specified by Address >= 0x100, then ASSERT().
921 If StartBit is greater than 31, then ASSERT().
922 If EndBit is greater than 31, then ASSERT().
923 If EndBit is less than or equal to StartBit, then ASSERT().
925 @param Address PCI configuration register to write.
926 @param StartBit The ordinal of the least significant bit in the bit field.
928 @param EndBit The ordinal of the most significant bit in the bit field.
930 @param AndData The value to AND with the PCI configuration register.
932 @return The value written back to the PCI configuration register.
937 PciCf8BitFieldAnd32 (
945 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
946 bitwise inclusive OR, and writes the result back to the bit field in the
949 Reads the 32-bit PCI configuration register specified by Address, performs a
950 bitwise AND followed by a bitwise inclusive OR between the read result and
951 the value specified by AndData, and writes the result to the 32-bit PCI
952 configuration register specified by Address. The value written to the PCI
953 configuration register is returned. This function must guarantee that all PCI
954 read and write operations are serialized. Extra left bits in both AndData and
957 If Address > 0x0FFFFFFF, then ASSERT().
958 If Address is not aligned on a 32-bit boundary, then ASSERT().
959 If the register specified by Address >= 0x100, then ASSERT().
960 If StartBit is greater than 31, then ASSERT().
961 If EndBit is greater than 31, then ASSERT().
962 If EndBit is less than or equal to StartBit, then ASSERT().
964 @param Address PCI configuration register to write.
965 @param StartBit The ordinal of the least significant bit in the bit field.
967 @param EndBit The ordinal of the most significant bit in the bit field.
969 @param AndData The value to AND with the PCI configuration register.
970 @param OrData The value to OR with the result of the AND operation.
972 @return The value written back to the PCI configuration register.
977 PciCf8BitFieldAndThenOr32 (
986 Reads a range of PCI configuration registers into a caller supplied buffer.
988 Reads the range of PCI configuration registers specified by StartAddress and
989 Size into the buffer specified by Buffer. This function only allows the PCI
990 configuration registers from a single PCI function to be read. Size is
991 returned. When possible 32-bit PCI configuration read cycles are used to read
992 from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
993 and 16-bit PCI configuration read cycles may be used at the beginning and the
996 If StartAddress > 0x0FFFFFFF, then ASSERT().
997 If the register specified by StartAddress >= 0x100, then ASSERT().
998 If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
999 If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
1000 If 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.
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 (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
1034 If Buffer is NULL, then ASSERT().
1036 @param StartAddress Starting address that encodes the PCI Bus, Device,
1037 Function and Register.
1038 @param Size Size in bytes of the transfer.
1039 @param Buffer Pointer to a buffer containing the data to write.
1047 IN UINTN StartAddress
,