]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciCf8Lib.h
3 Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 Public header file for Pci Cf8 Lib
23 #ifndef __EDKII_GLUE_PCI_CF8_LIB_H__
24 #define __EDKII_GLUE_PCI_CF8_LIB_H__
28 Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
29 address that can be passed to the PCI Library functions.
31 Computes an address that is compatible with the PCI Library functions. The
32 unused upper bits of Bus, Device, Function and Register are stripped prior to
33 the generation of the address.
35 @param Bus PCI Bus number. Range 0..255.
36 @param Device PCI Device number. Range 0..31.
37 @param Function PCI Function number. Range 0..7.
38 @param Register PCI Register number. Range 0..255.
40 @return The encode PCI address.
43 #define PCI_CF8_LIB_ADDRESS(Bus,Device,Function,Offset) \
44 (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
47 Reads an 8-bit PCI configuration register.
49 Reads and returns the 8-bit PCI configuration register specified by Address.
50 This function must guarantee that all PCI read and write operations are
53 If Address > 0x0FFFFFFF, then ASSERT().
54 If the register specified by Address >= 0x100, then ASSERT().
56 @param Address Address that encodes the PCI Bus, Device, Function and
59 @return The read value from the PCI configuration register.
69 Writes an 8-bit PCI configuration register.
71 Writes the 8-bit PCI configuration register specified by Address with the
72 value specified by Value. Value is returned. This function must guarantee
73 that all PCI read and write operations are serialized.
75 If Address > 0x0FFFFFFF, then ASSERT().
76 If the register specified by Address >= 0x100, then ASSERT().
78 @param Address Address that encodes the PCI Bus, Device, Function and
80 @param Value The value to write.
82 @return The value written to the PCI configuration register.
93 Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
96 Reads the 8-bit PCI configuration register specified by Address, performs a
97 bitwise inclusive OR between the read result and the value specified by
98 OrData, and writes the result to the 8-bit PCI configuration register
99 specified by Address. The value written to the PCI configuration register is
100 returned. This function must guarantee that all PCI read and write operations
103 If Address > 0x0FFFFFFF, then ASSERT().
104 If the register specified by Address >= 0x100, then ASSERT().
106 @param Address Address that encodes the PCI Bus, Device, Function and
108 @param OrData The value to OR with the PCI configuration register.
110 @return The value written back to the PCI configuration register.
121 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
124 Reads the 8-bit PCI configuration register specified by Address, performs a
125 bitwise AND between the read result and the value specified by AndData, and
126 writes the result to the 8-bit PCI configuration register specified by
127 Address. The value written to the PCI configuration register is returned.
128 This function must guarantee that all PCI read and write operations are
131 If Address > 0x0FFFFFFF, then ASSERT().
132 If the register specified by Address >= 0x100, then ASSERT().
134 @param Address Address that encodes the PCI Bus, Device, Function and
136 @param AndData The value to AND with the PCI configuration register.
138 @return The value written back to the PCI configuration register.
149 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
150 value, followed a bitwise inclusive OR with another 8-bit value.
152 Reads the 8-bit PCI configuration register specified by Address, performs a
153 bitwise AND between the read result and the value specified by AndData,
154 performs a bitwise inclusive OR between the result of the AND operation and
155 the value specified by OrData, and writes the result to the 8-bit PCI
156 configuration register specified by Address. The value written to the PCI
157 configuration register is returned. This function must guarantee that all PCI
158 read and write operations are serialized.
160 If Address > 0x0FFFFFFF, then ASSERT().
161 If the register specified by Address >= 0x100, then ASSERT().
163 @param Address Address that encodes the PCI Bus, Device, Function and
165 @param AndData The value to AND with the PCI configuration register.
166 @param OrData The value to OR with the result of the AND operation.
168 @return The value written back to the PCI configuration register.
180 Reads a bit field of a PCI configuration register.
182 Reads the bit field in an 8-bit PCI configuration register. The bit field is
183 specified by the StartBit and the EndBit. The value of the bit field is
186 If Address > 0x0FFFFFFF, then ASSERT().
187 If the register specified by Address >= 0x100, then ASSERT().
188 If StartBit is greater than 7, then ASSERT().
189 If EndBit is greater than 7, then ASSERT().
190 If EndBit is less than StartBit, then ASSERT().
192 @param Address PCI configuration register to read.
193 @param StartBit The ordinal of the least significant bit in the bit field.
195 @param EndBit The ordinal of the most significant bit in the bit field.
198 @return The value of the bit field read from the PCI configuration register.
203 PciCf8BitFieldRead8 (
210 Writes a bit field to a PCI configuration register.
212 Writes Value to the bit field of the PCI configuration register. The bit
213 field is specified by the StartBit and the EndBit. All other bits in the
214 destination PCI configuration register are preserved. The new value of the
215 8-bit register is returned.
217 If Address > 0x0FFFFFFF, then ASSERT().
218 If the register specified by Address >= 0x100, then ASSERT().
219 If StartBit is greater than 7, then ASSERT().
220 If EndBit is greater than 7, then ASSERT().
221 If EndBit is less than StartBit, then ASSERT().
223 @param Address PCI configuration register to write.
224 @param StartBit The ordinal of the least significant bit in the bit field.
226 @param EndBit The ordinal of the most significant bit in the bit field.
228 @param Value New value of the bit field.
230 @return The value written back to the PCI configuration register.
235 PciCf8BitFieldWrite8 (
243 Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
244 writes the result back to the bit field in the 8-bit port.
246 Reads the 8-bit PCI configuration register specified by Address, performs a
247 bitwise inclusive OR between the read result and the value specified by
248 OrData, and writes the result to the 8-bit PCI configuration register
249 specified by Address. The value written to the PCI configuration register is
250 returned. This function must guarantee that all PCI read and write operations
251 are serialized. Extra left bits in OrData are stripped.
253 If Address > 0x0FFFFFFF, then ASSERT().
254 If the register specified by Address >= 0x100, then ASSERT().
255 If StartBit is greater than 7, then ASSERT().
256 If EndBit is greater than 7, then ASSERT().
257 If EndBit is less than StartBit, then ASSERT().
259 @param Address PCI configuration register to write.
260 @param StartBit The ordinal of the least significant bit in the bit field.
262 @param EndBit The ordinal of the most significant bit in the bit field.
264 @param OrData The value to OR with the PCI configuration register.
266 @return The value written back to the PCI configuration register.
279 Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
280 AND, and writes the result back to the bit field in the 8-bit register.
282 Reads the 8-bit PCI configuration register specified by Address, performs a
283 bitwise AND between the read result and the value specified by AndData, and
284 writes the result to the 8-bit PCI configuration register specified by
285 Address. The value written to the PCI configuration register is returned.
286 This function must guarantee that all PCI read and write operations are
287 serialized. Extra left bits in AndData are stripped.
289 If Address > 0x0FFFFFFF, then ASSERT().
290 If the register specified by Address >= 0x100, then ASSERT().
291 If StartBit is greater than 7, then ASSERT().
292 If EndBit is greater than 7, then ASSERT().
293 If EndBit is less than StartBit, then ASSERT().
295 @param Address PCI configuration register to write.
296 @param StartBit The ordinal of the least significant bit in the bit field.
298 @param EndBit The ordinal of the most significant bit in the bit field.
300 @param AndData The value to AND with the PCI configuration register.
302 @return The value written back to the PCI configuration register.
315 Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
316 bitwise inclusive OR, and writes the result back to the bit field in the
319 Reads the 8-bit PCI configuration register specified by Address, performs a
320 bitwise AND followed by a bitwise inclusive OR between the read result and
321 the value specified by AndData, and writes the result to the 8-bit PCI
322 configuration register specified by Address. The value written to the PCI
323 configuration register is returned. This function must guarantee that all PCI
324 read and write operations are serialized. Extra left bits in both AndData and
327 If Address > 0x0FFFFFFF, then ASSERT().
328 If the register specified by Address >= 0x100, then ASSERT().
329 If StartBit is greater than 7, then ASSERT().
330 If EndBit is greater than 7, then ASSERT().
331 If EndBit is less than StartBit, then ASSERT().
333 @param Address PCI configuration register to write.
334 @param StartBit The ordinal of the least significant bit in the bit field.
336 @param EndBit The ordinal of the most significant bit in the bit field.
338 @param AndData The value to AND with the PCI configuration register.
339 @param OrData The value to OR with the result of the AND operation.
341 @return The value written back to the PCI configuration register.
346 PciCf8BitFieldAndThenOr8 (
355 Reads a 16-bit PCI configuration register.
357 Reads and returns the 16-bit PCI configuration register specified by Address.
358 This function must guarantee that all PCI read and write operations are
361 If Address > 0x0FFFFFFF, then ASSERT().
362 If Address is not aligned on a 16-bit boundary, then ASSERT().
363 If the register specified by Address >= 0x100, then ASSERT().
365 @param Address Address that encodes the PCI Bus, Device, Function and
368 @return The read value from the PCI configuration register.
378 Writes a 16-bit PCI configuration register.
380 Writes the 16-bit PCI configuration register specified by Address with the
381 value specified by Value. Value is returned. This function must guarantee
382 that all PCI read and write operations are serialized.
384 If Address > 0x0FFFFFFF, then ASSERT().
385 If Address is not aligned on a 16-bit boundary, then ASSERT().
386 If the register specified by Address >= 0x100, then ASSERT().
388 @param Address Address that encodes the PCI Bus, Device, Function and
390 @param Value The value to write.
392 @return The value written to the PCI configuration register.
403 Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
406 Reads the 16-bit PCI configuration register specified by Address, performs a
407 bitwise inclusive OR between the read result and the value specified by
408 OrData, and writes the result to the 16-bit PCI configuration register
409 specified by Address. The value written to the PCI configuration register is
410 returned. This function must guarantee that all PCI read and write operations
413 If Address > 0x0FFFFFFF, then ASSERT().
414 If Address is not aligned on a 16-bit boundary, then ASSERT().
415 If the register specified by Address >= 0x100, then ASSERT().
417 @param Address Address that encodes the PCI Bus, Device, Function and
419 @param OrData The value to OR with the PCI configuration register.
421 @return The value written back to the PCI configuration register.
432 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
435 Reads the 16-bit PCI configuration register specified by Address, performs a
436 bitwise AND between the read result and the value specified by AndData, and
437 writes the result to the 16-bit PCI configuration register specified by
438 Address. The value written to the PCI configuration register is returned.
439 This function must guarantee that all PCI read and write operations are
442 If Address > 0x0FFFFFFF, then ASSERT().
443 If Address is not aligned on a 16-bit boundary, then ASSERT().
444 If the register specified by Address >= 0x100, then ASSERT().
446 @param Address Address that encodes the PCI Bus, Device, Function and
448 @param AndData The value to AND with the PCI configuration register.
450 @return The value written back to the PCI configuration register.
461 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
462 value, followed a bitwise inclusive OR with another 16-bit value.
464 Reads the 16-bit PCI configuration register specified by Address, performs a
465 bitwise AND between the read result and the value specified by AndData,
466 performs a bitwise inclusive OR between the result of the AND operation and
467 the value specified by OrData, and writes the result to the 16-bit PCI
468 configuration register specified by Address. The value written to the PCI
469 configuration register is returned. This function must guarantee that all PCI
470 read and write operations are serialized.
472 If Address > 0x0FFFFFFF, then ASSERT().
473 If Address is not aligned on a 16-bit boundary, then ASSERT().
474 If the register specified by Address >= 0x100, then ASSERT().
476 @param Address Address that encodes the PCI Bus, Device, Function and
478 @param AndData The value to AND with the PCI configuration register.
479 @param OrData The value to OR with the result of the AND operation.
481 @return The value written back to the PCI configuration register.
493 Reads a bit field of a PCI configuration register.
495 Reads the bit field in a 16-bit PCI configuration register. The bit field is
496 specified by the StartBit and the EndBit. The value of the bit field is
499 If Address > 0x0FFFFFFF, then ASSERT().
500 If Address is not aligned on a 16-bit boundary, then ASSERT().
501 If the register specified by Address >= 0x100, then ASSERT().
502 If StartBit is greater than 15, then ASSERT().
503 If EndBit is greater than 15, then ASSERT().
504 If EndBit is less than StartBit, then ASSERT().
506 @param Address PCI configuration register to read.
507 @param StartBit The ordinal of the least significant bit in the bit field.
509 @param EndBit The ordinal of the most significant bit in the bit field.
512 @return The value of the bit field read from the PCI configuration register.
517 PciCf8BitFieldRead16 (
524 Writes a bit field to a PCI configuration register.
526 Writes Value to the bit field of the PCI configuration register. The bit
527 field is specified by the StartBit and the EndBit. All other bits in the
528 destination PCI configuration register are preserved. The new value of the
529 16-bit register is returned.
531 If Address > 0x0FFFFFFF, then ASSERT().
532 If Address is not aligned on a 16-bit boundary, then ASSERT().
533 If the register specified by Address >= 0x100, then ASSERT().
534 If StartBit is greater than 15, then ASSERT().
535 If EndBit is greater than 15, then ASSERT().
536 If EndBit is less than StartBit, then ASSERT().
538 @param Address PCI configuration register to write.
539 @param StartBit The ordinal of the least significant bit in the bit field.
541 @param EndBit The ordinal of the most significant bit in the bit field.
543 @param Value New value of the bit field.
545 @return The value written back to the PCI configuration register.
550 PciCf8BitFieldWrite16 (
558 Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
559 writes the result back to the bit field in the 16-bit port.
561 Reads the 16-bit PCI configuration register specified by Address, performs a
562 bitwise inclusive OR between the read result and the value specified by
563 OrData, and writes the result to the 16-bit PCI configuration register
564 specified by Address. The value written to the PCI configuration register is
565 returned. This function must guarantee that all PCI read and write operations
566 are serialized. Extra left bits in OrData are stripped.
568 If Address > 0x0FFFFFFF, then ASSERT().
569 If Address is not aligned on a 16-bit boundary, then ASSERT().
570 If the register specified by Address >= 0x100, then ASSERT().
571 If StartBit is greater than 15, then ASSERT().
572 If EndBit is greater than 15, then ASSERT().
573 If EndBit is less than StartBit, then ASSERT().
575 @param Address PCI configuration register to write.
576 @param StartBit The ordinal of the least significant bit in the bit field.
578 @param EndBit The ordinal of the most significant bit in the bit field.
580 @param OrData The value to OR with the PCI configuration register.
582 @return The value written back to the PCI configuration register.
595 Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
596 AND, and writes the result back to the bit field in the 16-bit register.
598 Reads the 16-bit PCI configuration register specified by Address, performs a
599 bitwise AND between the read result and the value specified by AndData, and
600 writes the result to the 16-bit PCI configuration register specified by
601 Address. The value written to the PCI configuration register is returned.
602 This function must guarantee that all PCI read and write operations are
603 serialized. Extra left bits in AndData are stripped.
605 If Address > 0x0FFFFFFF, then ASSERT().
606 If Address is not aligned on a 16-bit boundary, then ASSERT().
607 If the register specified by Address >= 0x100, then ASSERT().
608 If StartBit is greater than 15, then ASSERT().
609 If EndBit is greater than 15, then ASSERT().
610 If EndBit is less than StartBit, then ASSERT().
612 @param Address PCI configuration register to write.
613 @param StartBit The ordinal of the least significant bit in the bit field.
615 @param EndBit The ordinal of the most significant bit in the bit field.
617 @param AndData The value to AND with the PCI configuration register.
619 @return The value written back to the PCI configuration register.
624 PciCf8BitFieldAnd16 (
632 Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
633 bitwise inclusive OR, and writes the result back to the bit field in the
636 Reads the 16-bit PCI configuration register specified by Address, performs a
637 bitwise AND followed by a bitwise inclusive OR between the read result and
638 the value specified by AndData, and writes the result to the 16-bit PCI
639 configuration register specified by Address. The value written to the PCI
640 configuration register is returned. This function must guarantee that all PCI
641 read and write operations are serialized. Extra left bits in both AndData and
644 If Address > 0x0FFFFFFF, then ASSERT().
645 If Address is not aligned on a 16-bit boundary, then ASSERT().
646 If the register specified by Address >= 0x100, then ASSERT().
647 If StartBit is greater than 15, then ASSERT().
648 If EndBit is greater than 15, then ASSERT().
649 If EndBit is less than StartBit, then ASSERT().
651 @param Address PCI configuration register to write.
652 @param StartBit The ordinal of the least significant bit in the bit field.
654 @param EndBit The ordinal of the most significant bit in the bit field.
656 @param AndData The value to AND with the PCI configuration register.
657 @param OrData The value to OR with the result of the AND operation.
659 @return The value written back to the PCI configuration register.
664 PciCf8BitFieldAndThenOr16 (
673 Reads a 32-bit PCI configuration register.
675 Reads and returns the 32-bit PCI configuration register specified by Address.
676 This function must guarantee that all PCI read and write operations are
679 If Address > 0x0FFFFFFF, then ASSERT().
680 If Address is not aligned on a 32-bit boundary, then ASSERT().
681 If the register specified by Address >= 0x100, then ASSERT().
683 @param Address Address that encodes the PCI Bus, Device, Function and
686 @return The read value from the PCI configuration register.
696 Writes a 32-bit PCI configuration register.
698 Writes the 32-bit PCI configuration register specified by Address with the
699 value specified by Value. Value is returned. This function must guarantee
700 that all PCI read and write operations are serialized.
702 If Address > 0x0FFFFFFF, then ASSERT().
703 If Address is not aligned on a 32-bit boundary, then ASSERT().
704 If the register specified by Address >= 0x100, then ASSERT().
706 @param Address Address that encodes the PCI Bus, Device, Function and
708 @param Value The value to write.
710 @return The value written to the PCI configuration register.
721 Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
724 Reads the 32-bit PCI configuration register specified by Address, performs a
725 bitwise inclusive OR between the read result and the value specified by
726 OrData, and writes the result to the 32-bit PCI configuration register
727 specified by Address. The value written to the PCI configuration register is
728 returned. This function must guarantee that all PCI read and write operations
731 If Address > 0x0FFFFFFF, then ASSERT().
732 If Address is not aligned on a 32-bit boundary, then ASSERT().
733 If the register specified by Address >= 0x100, then ASSERT().
735 @param Address Address that encodes the PCI Bus, Device, Function and
737 @param OrData The value to OR 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
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, and
755 writes the result to the 32-bit PCI configuration register specified by
756 Address. The value written to the PCI configuration register is returned.
757 This function must guarantee that all PCI read and write operations are
760 If Address > 0x0FFFFFFF, then ASSERT().
761 If Address is not aligned on a 32-bit boundary, then ASSERT().
762 If the register specified by Address >= 0x100, 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.
768 @return The value written back to the PCI configuration register.
779 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
780 value, followed a bitwise inclusive OR with another 32-bit value.
782 Reads the 32-bit PCI configuration register specified by Address, performs a
783 bitwise AND between the read result and the value specified by AndData,
784 performs a bitwise inclusive OR between the result of the AND operation and
785 the value specified by OrData, and writes the result to the 32-bit PCI
786 configuration register specified by Address. The value written to the PCI
787 configuration register is returned. This function must guarantee that all PCI
788 read and write operations are serialized.
790 If Address > 0x0FFFFFFF, then ASSERT().
791 If Address is not aligned on a 32-bit boundary, then ASSERT().
792 If the register specified by Address >= 0x100, then ASSERT().
794 @param Address Address that encodes the PCI Bus, Device, Function and
796 @param AndData The value to AND with the PCI configuration register.
797 @param OrData The value to OR with the result of the AND operation.
799 @return The value written back to the PCI configuration register.
811 Reads a bit field of a PCI configuration register.
813 Reads the bit field in a 32-bit PCI configuration register. The bit field is
814 specified by the StartBit and the EndBit. The value of the bit field is
817 If Address > 0x0FFFFFFF, then ASSERT().
818 If Address is not aligned on a 32-bit boundary, then ASSERT().
819 If the register specified by Address >= 0x100, 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 StartBit, then ASSERT().
824 @param Address PCI configuration register to read.
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.
830 @return The value of the bit field read from the PCI configuration register.
835 PciCf8BitFieldRead32 (
842 Writes a bit field to a PCI configuration register.
844 Writes Value to the bit field of the PCI configuration register. The bit
845 field is specified by the StartBit and the EndBit. All other bits in the
846 destination PCI configuration register are preserved. The new value of the
847 32-bit register is returned.
849 If Address > 0x0FFFFFFF, then ASSERT().
850 If Address is not aligned on a 32-bit boundary, then ASSERT().
851 If the register specified by Address >= 0x100, then ASSERT().
852 If StartBit is greater than 31, then ASSERT().
853 If EndBit is greater than 31, then ASSERT().
854 If EndBit is less than StartBit, then ASSERT().
856 @param Address PCI configuration register to write.
857 @param StartBit The ordinal of the least significant bit in the bit field.
859 @param EndBit The ordinal of the most significant bit in the bit field.
861 @param Value New value of the bit field.
863 @return The value written back to the PCI configuration register.
868 PciCf8BitFieldWrite32 (
876 Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
877 writes the result back to the bit field in the 32-bit port.
879 Reads the 32-bit PCI configuration register specified by Address, performs a
880 bitwise inclusive OR between the read result and the value specified by
881 OrData, and writes the result to the 32-bit PCI configuration register
882 specified by Address. The value written to the PCI configuration register is
883 returned. This function must guarantee that all PCI read and write operations
884 are serialized. Extra left bits in OrData are stripped.
886 If Address > 0x0FFFFFFF, then ASSERT().
887 If Address is not aligned on a 32-bit boundary, then ASSERT().
888 If the register specified by Address >= 0x100, then ASSERT().
889 If StartBit is greater than 31, then ASSERT().
890 If EndBit is greater than 31, then ASSERT().
891 If EndBit is less than StartBit, then ASSERT().
893 @param Address PCI configuration register to write.
894 @param StartBit The ordinal of the least significant bit in the bit field.
896 @param EndBit The ordinal of the most significant bit in the bit field.
898 @param OrData The value to OR with the PCI configuration register.
900 @return The value written back to the PCI configuration register.
913 Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
914 AND, and writes the result back to the bit field in the 32-bit register.
916 Reads the 32-bit PCI configuration register specified by Address, performs a
917 bitwise AND between the read result and the value specified by AndData, and
918 writes the result to the 32-bit PCI configuration register specified by
919 Address. The value written to the PCI configuration register is returned.
920 This function must guarantee that all PCI read and write operations are
921 serialized. Extra left bits in AndData are stripped.
923 If Address > 0x0FFFFFFF, then ASSERT().
924 If Address is not aligned on a 32-bit boundary, then ASSERT().
925 If the register specified by Address >= 0x100, then ASSERT().
926 If StartBit is greater than 31, then ASSERT().
927 If EndBit is greater than 31, then ASSERT().
928 If EndBit is less than StartBit, then ASSERT().
930 @param Address PCI configuration register to write.
931 @param StartBit The ordinal of the least significant bit in the bit field.
933 @param EndBit The ordinal of the most significant bit in the bit field.
935 @param AndData The value to AND with the PCI configuration register.
937 @return The value written back to the PCI configuration register.
942 PciCf8BitFieldAnd32 (
950 Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
951 bitwise inclusive OR, and writes the result back to the bit field in the
954 Reads the 32-bit PCI configuration register specified by Address, performs a
955 bitwise AND followed by a bitwise inclusive OR between the read result and
956 the value specified by AndData, and writes the result to the 32-bit PCI
957 configuration register specified by Address. The value written to the PCI
958 configuration register is returned. This function must guarantee that all PCI
959 read and write operations are serialized. Extra left bits in both AndData and
962 If Address > 0x0FFFFFFF, then ASSERT().
963 If Address is not aligned on a 32-bit boundary, then ASSERT().
964 If the register specified by Address >= 0x100, then ASSERT().
965 If StartBit is greater than 31, then ASSERT().
966 If EndBit is greater than 31, then ASSERT().
967 If EndBit is less than StartBit, then ASSERT().
969 @param Address PCI configuration register to write.
970 @param StartBit The ordinal of the least significant bit in the bit field.
972 @param EndBit The ordinal of the most significant bit in the bit field.
974 @param AndData The value to AND with the PCI configuration register.
975 @param OrData The value to OR with the result of the AND operation.
977 @return The value written back to the PCI configuration register.
982 PciCf8BitFieldAndThenOr32 (
991 Reads a range of PCI configuration registers into a caller supplied buffer.
993 Reads the range of PCI configuration registers specified by StartAddress and
994 Size into the buffer specified by Buffer. This function only allows the PCI
995 configuration registers from a single PCI function to be read. Size is
996 returned. When possible 32-bit PCI configuration read cycles are used to read
997 from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
998 and 16-bit PCI configuration read cycles may be used at the beginning and the
1001 If StartAddress > 0x0FFFFFFF, then ASSERT().
1002 If the register specified by StartAddress >= 0x100, then ASSERT().
1003 If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
1004 If Size > 0 and Buffer is NULL, then ASSERT().
1006 @param StartAddress Starting address that encodes the PCI Bus, Device,
1007 Function and Register.
1008 @param Size Size in bytes of the transfer.
1009 @param Buffer Pointer to a buffer receiving the data read.
1017 IN UINTN StartAddress
,
1023 Copies the data in a caller supplied buffer to a specified range of PCI
1024 configuration space.
1026 Writes the range of PCI configuration registers specified by StartAddress and
1027 Size from the buffer specified by Buffer. This function only allows the PCI
1028 configuration registers from a single PCI function to be written. Size is
1029 returned. When possible 32-bit PCI configuration write cycles are used to
1030 write from StartAdress to StartAddress + Size. Due to alignment restrictions,
1031 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
1032 and the end of the range.
1034 If StartAddress > 0x0FFFFFFF, then ASSERT().
1035 If the register specified by StartAddress >= 0x100, then ASSERT().
1036 If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
1037 If Size > 0 and Buffer is NULL, then ASSERT().
1039 @param StartAddress Starting address that encodes the PCI Bus, Device,
1040 Function and Register.
1041 @param Size Size in bytes of the transfer.
1042 @param Buffer Pointer to a buffer containing the data to write.
1050 IN UINTN StartAddress
,