2 Functions accessing PCI configuration registers on any supported PCI segment
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: PciSegmentLib.h
17 #ifndef __PCI_SEGMENT_LIB__
18 #define __PCI_SEGMENT_LIB__
22 Macro that converts PCI Segment, PCI Bus, PCI Device, PCI Function,
23 and PCI Register to an address that can be passed to the PCI Segment Library functions.
25 Computes an address that is compatible with the PCI Segment Library functions.
26 The unused upper bits of Segment, Bus, Device, Function,
27 and Register are stripped prior to the generation of the address.
29 @param Segment PCI Segment number. Range 0..65535.
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 for PCI. Range 0..4095 for PCI Express.
35 @return The address that is compatible with the PCI Segment Library functions.
38 #define PCI_SEGMENT_LIB_ADDRESS(Segment,Bus,Device,Function,Register) \
39 ( ((Register) & 0xfff) | \
40 (((Function) & 0x07) << 12) | \
41 (((Device) & 0x1f) << 15) | \
42 (((Bus) & 0xff) << 20) | \
43 (LShiftU64((Segment) & 0xffff, 32)) \
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 serialized.
51 If any reserved bits in Address are set, then ASSERT().
53 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
55 @return The 8-bit PCI configuration register specified by Address.
66 Writes an 8-bit PCI configuration register.
68 Writes the 8-bit PCI configuration register specified by Address with the value specified by Value.
69 Value is returned. This function must guarantee that all PCI read and write operations are serialized.
70 If Address > 0x0FFFFFFF, then ASSERT().
72 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
73 @param Value The value to write.
75 @return The parameter of Value.
87 Performs a bitwise inclusive OR of an 8-bit PCI configuration register with an 8-bit value.
89 Reads the 8-bit PCI configuration register specified by Address,
90 performs a bitwise inclusive OR between the read result and the value specified by OrData,
91 and writes the result to the 8-bit PCI configuration register specified by Address.
92 The value written to the PCI configuration register is returned.
93 This function must guarantee that all PCI read and write operations are serialized.
94 If any reserved bits in Address are set, then ASSERT().
96 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
97 @param OrData The value to OR with the PCI configuration register.
99 @return The value written to the PCI configuration register.
111 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value.
113 Reads the 8-bit PCI configuration register specified by Address,
114 performs a bitwise AND between the read result and the value specified by AndData,
115 and writes the result to the 8-bit PCI configuration register specified by Address.
116 The value written to the PCI configuration register is returned.
117 This function must guarantee that all PCI read and write operations are serialized.
118 If any reserved bits in Address are set, then ASSERT().
120 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
121 @param Andata The value to AND with the PCI configuration register.
123 @return The value written to the PCI configuration register.
135 Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value,
136 followed a bitwise inclusive OR with another 8-bit value.
138 Reads the 8-bit PCI configuration register specified by Address,
139 performs a 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 the value specified by OrData,
141 and writes the result to the 8-bit PCI configuration register specified by Address.
142 The value written to the PCI configuration register is returned.
143 This function must guarantee that all PCI read and write operations are serialized.
144 If any reserved bits in Address are set, then ASSERT().
146 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
147 @param Andata The value to AND with the PCI configuration register.
148 @param OrData The value to OR with the PCI configuration register.
150 @return The value written to the PCI configuration register.
155 PciSegmentAndThenOr8 (
163 Reads a bit field of a PCI configuration register.
165 Reads the bit field in an 8-bit PCI configuration register.
166 The bit field is specified by the StartBit and the EndBit.
167 The value of the bit field is returned.
168 If any reserved bits in Address are set, then ASSERT().
169 If StartBit is greater than 7, then ASSERT().
170 If EndBit is greater than 7, then ASSERT().
171 If EndBit is less than or equal to StartBit, then ASSERT().
173 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
174 @param StartBit The ordinal of the least significant bit in the bit field.
175 The ordinal of the least significant bit in a byte is bit 0.
176 @param EndBit The ordinal of the most significant bit in the bit field.
177 The ordinal of the most significant bit in a byte is bit 7.
179 @return The value of the bit field.
184 PciSegmentBitFieldRead8 (
192 Writes a bit field to a PCI configuration register.
194 Writes Value to the bit field of the PCI configuration register.
195 The bit field is specified by the StartBit and the EndBit.
196 All other bits in the destination PCI configuration register are preserved.
197 The new value of the 8-bit register is returned.
198 If any reserved bits in Address are set, then ASSERT().
199 If StartBit is greater than 7, then ASSERT().
200 If EndBit is greater than 7, then ASSERT().
201 If EndBit is less than or equal to StartBit, then ASSERT().
203 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
204 @param StartBit The ordinal of the least significant bit in the bit field.
205 The ordinal of the least significant bit in a byte is bit 0.
206 @param EndBit The ordinal of the most significant bit in the bit field.
207 The ordinal of the most significant bit in a byte is bit 7.
208 @param Value New value of the bit field.
210 @return The new value of the 8-bit register.
215 PciSegmentBitFieldWrite8 (
224 Reads the 8-bit PCI configuration register specified by Address,
225 performs a bitwise inclusive OR between the read result and the value specified by OrData,
226 and writes the result to the 8-bit PCI configuration register specified by Address.
228 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
229 @param StartBit The ordinal of the least significant bit in the bit field.
230 The ordinal of the least significant bit in a byte is bit 0.
231 @param EndBit The ordinal of the most significant bit in the bit field.
232 The ordinal of the most significant bit in a byte is bit 7.
233 @param OrData The value to OR with the read value from the PCI configuration register.
235 @return The value written to the PCI configuration register.
240 PciSegmentBitFieldOr8 (
249 Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR,
250 and writes the result back to the bit field in the 8-bit port.
252 Reads the 8-bit PCI configuration register specified by Address,
253 performs a bitwise inclusive OR between the read result and the value specified by OrData,
254 and writes the result to the 8-bit PCI configuration register specified by Address.
255 The value written to the PCI configuration register is returned.
256 This function must guarantee that all PCI read and write operations are serialized.
257 Extra left bits in OrData are stripped.
258 If any reserved bits in Address are set, then ASSERT().
259 If StartBit is greater than 7, then ASSERT().
260 If EndBit is greater than 7, then ASSERT().
261 If EndBit is less than or equal to StartBit, then ASSERT().
263 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
264 @param StartBit The ordinal of the least significant bit in the bit field.
265 The ordinal of the least significant bit in a byte is bit 0.
266 @param EndBit The ordinal of the most significant bit in the bit field.
267 The ordinal of the most significant bit in a byte is bit 7.
268 @param AndData The value to AND with the read value from the PCI configuration register.
270 @return The value written to the PCI configuration register.
275 PciSegmentBitFieldAnd8 (
284 Reads a bit field in an 8-bit PCI configuration register, performs a bitwise AND,
285 and writes the result back to the bit field in the 8-bit register.
287 Reads the 8-bit PCI configuration register specified by Address,
288 performs a bitwise AND between the read result and the value specified by AndData,
289 and writes the result to the 8-bit PCI configuration register specified by Address.
290 The value written to the PCI configuration register is returned.
291 This function must guarantee that all PCI read and write operations are serialized.
292 Extra left bits in AndData are stripped.
293 If any reserved bits in Address are set, then ASSERT().
294 If StartBit is greater than 7, then ASSERT().
295 If EndBit is greater than 7, then ASSERT().
296 If EndBit is less than or equal to StartBit, then ASSERT().
298 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
299 @param StartBit The ordinal of the least significant bit in the bit field.
300 The ordinal of the least significant bit in a byte is bit 0.
301 @param EndBit The ordinal of the most significant bit in the bit field.
302 The ordinal of the most significant bit in a byte is bit 7.
303 @param AndData The value to AND with the read value from the PCI configuration register.
304 @param OrData The value to OR with the read value from the PCI configuration register.
306 @return The value written to the PCI configuration register.
311 PciSegmentBitFieldAndThenOr8 (
321 Reads a 16-bit PCI configuration register.
323 Reads and returns the 16-bit PCI configuration register specified by Address.
324 This function must guarantee that all PCI read and write operations are serialized.
325 If any reserved bits in Address are set, then ASSERT().
327 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
329 @return The 16-bit PCI configuration register specified by Address.
340 Writes a 16-bit PCI configuration register.
342 Writes the 16-bit PCI configuration register specified by Address with the value specified by Value.
343 Value is returned. This function must guarantee that all PCI read and write operations are serialized.
344 If Address > 0x0FFFFFFF, then ASSERT().
346 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
347 @param Value The value to write.
349 @return The parameter of Value.
361 Performs a bitwise inclusive OR of a 16-bit PCI configuration register with a 16-bit value.
363 Reads the 16-bit PCI configuration register specified by Address,
364 performs a bitwise inclusive OR between the read result and the value specified by OrData,
365 and writes the result to the 16-bit PCI configuration register specified by Address.
366 The value written to the PCI configuration register is returned.
367 This function must guarantee that all PCI read and write operations are serialized.
368 If any reserved bits in Address are set, then ASSERT().
370 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
371 @param OrData The value to OR with the PCI configuration register.
373 @return The value written to the PCI configuration register.
385 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value.
387 Reads the 16-bit PCI configuration register specified by Address,
388 performs a bitwise AND between the read result and the value specified by AndData,
389 and writes the result to the 16-bit PCI configuration register specified by Address.
390 The value written to the PCI configuration register is returned.
391 This function must guarantee that all PCI read and write operations are serialized.
392 If any reserved bits in Address are set, then ASSERT().
394 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
395 @param Andata The value to AND with the PCI configuration register.
397 @return The value written to the PCI configuration register.
409 Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value,
410 followed a bitwise inclusive OR with another 16-bit value.
412 Reads the 16-bit PCI configuration register specified by Address,
413 performs a bitwise AND between the read result and the value specified by AndData,
414 performs a bitwise inclusive OR between the result of the AND operation and the value specified by OrData,
415 and writes the result to the 16-bit PCI configuration register specified by Address.
416 The value written to the PCI configuration register is returned.
417 This function must guarantee that all PCI read and write operations are serialized.
418 If any reserved bits in Address are set, then ASSERT().
420 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
421 @param Andata The value to AND with the PCI configuration register.
422 @param OrData The value to OR with the PCI configuration register.
424 @return The value written to the PCI configuration register.
429 PciSegmentAndThenOr16 (
437 Reads a bit field of a PCI configuration register.
439 Reads the bit field in a 16-bit PCI configuration register.
440 The bit field is specified by the StartBit and the EndBit.
441 The value of the bit field is returned.
442 If any reserved bits in Address are set, then ASSERT().
443 If StartBit is greater than 7, then ASSERT().
444 If EndBit is greater than 7, then ASSERT().
445 If EndBit is less than or equal to StartBit, then ASSERT().
447 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
448 @param StartBit The ordinal of the least significant bit in the bit field.
449 The ordinal of the least significant bit in a byte is bit 0.
450 @param EndBit The ordinal of the most significant bit in the bit field.
451 The ordinal of the most significant bit in a byte is bit 7.
453 @return The value of the bit field.
458 PciSegmentBitFieldRead16 (
466 Writes a bit field to a PCI configuration register.
468 Writes Value to the bit field of the PCI configuration register.
469 The bit field is specified by the StartBit and the EndBit.
470 All other bits in the destination PCI configuration register are preserved.
471 The new value of the 16-bit register is returned.
472 If any reserved bits in Address are set, then ASSERT().
473 If StartBit is greater than 7, then ASSERT().
474 If EndBit is greater than 7, then ASSERT().
475 If EndBit is less than or equal to StartBit, then ASSERT().
477 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
478 @param StartBit The ordinal of the least significant bit in the bit field.
479 The ordinal of the least significant bit in a byte is bit 0.
480 @param EndBit The ordinal of the most significant bit in the bit field.
481 The ordinal of the most significant bit in a byte is bit 7.
482 @param Value New value of the bit field.
484 @return The new value of the 16-bit register.
489 PciSegmentBitFieldWrite16 (
498 Reads the 16-bit PCI configuration register specified by Address,
499 performs a bitwise inclusive OR between the read result and the value specified by OrData,
500 and writes the result to the 16-bit PCI configuration register specified by Address.
502 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
503 @param StartBit The ordinal of the least significant bit in the bit field.
504 The ordinal of the least significant bit in a byte is bit 0.
505 @param EndBit The ordinal of the most significant bit in the bit field.
506 The ordinal of the most significant bit in a byte is bit 7.
507 @param OrData The value to OR with the read value from the PCI configuration register.
509 @return The value written to the PCI configuration register.
514 PciSegmentBitFieldOr16 (
523 Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR,
524 and writes the result back to the bit field in the 16-bit port.
526 Reads the 16-bit PCI configuration register specified by Address,
527 performs a bitwise inclusive OR between the read result and the value specified by OrData,
528 and writes the result to the 16-bit PCI configuration register specified by Address.
529 The value written to the PCI configuration register is returned.
530 This function must guarantee that all PCI read and write operations are serialized.
531 Extra left bits in OrData are stripped.
532 If any reserved bits in Address are set, then ASSERT().
533 If StartBit is greater than 7, then ASSERT().
534 If EndBit is greater than 7, then ASSERT().
535 If EndBit is less than or equal to StartBit, then ASSERT().
537 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
538 @param StartBit The ordinal of the least significant bit in the bit field.
539 The ordinal of the least significant bit in a byte is bit 0.
540 @param EndBit The ordinal of the most significant bit in the bit field.
541 The ordinal of the most significant bit in a byte is bit 7.
542 @param AndData The value to AND with the read value from the PCI configuration register.
544 @return The value written to the PCI configuration register.
549 PciSegmentBitFieldAnd16 (
558 Reads a bit field in a 16-bit PCI configuration register, performs a bitwise AND,
559 and writes the result back to the bit field in the 16-bit register.
561 Reads the 16-bit PCI configuration register specified by Address,
562 performs a bitwise AND between the read result and the value specified by AndData,
563 and writes the result to the 16-bit PCI configuration register specified by Address.
564 The value written to the PCI configuration register is returned.
565 This function must guarantee that all PCI read and write operations are serialized.
566 Extra left bits in AndData are stripped.
567 If any reserved bits in Address are set, then ASSERT().
568 If StartBit is greater than 7, then ASSERT().
569 If EndBit is greater than 7, then ASSERT().
570 If EndBit is less than or equal to StartBit, then ASSERT().
572 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
573 @param StartBit The ordinal of the least significant bit in the bit field.
574 The ordinal of the least significant bit in a byte is bit 0.
575 @param EndBit The ordinal of the most significant bit in the bit field.
576 The ordinal of the most significant bit in a byte is bit 7.
577 @param AndData The value to AND with the read value from the PCI configuration register.
578 @param OrData The value to OR with the read value from the PCI configuration register.
580 @return The value written to the PCI configuration register.
585 PciSegmentBitFieldAndThenOr16 (
595 Reads a 32-bit PCI configuration register.
597 Reads and returns the 32-bit PCI configuration register specified by Address.
598 This function must guarantee that all PCI read and write operations are serialized.
599 If any reserved bits in Address are set, then ASSERT().
601 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
603 @return The 32-bit PCI configuration register specified by Address.
614 Writes a 32-bit PCI configuration register.
616 Writes the 32-bit PCI configuration register specified by Address with the value specified by Value.
617 Value is returned. This function must guarantee that all PCI read and write operations are serialized.
618 If Address > 0x0FFFFFFF, then ASSERT().
620 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
621 @param Value The value to write.
623 @return The parameter of Value.
635 Performs a bitwise inclusive OR of a 32-bit PCI configuration register with a 32-bit value.
637 Reads the 32-bit PCI configuration register specified by Address,
638 performs a bitwise inclusive OR between the read result and the value specified by OrData,
639 and writes the result to the 32-bit PCI configuration register specified by Address.
640 The value written to the PCI configuration register is returned.
641 This function must guarantee that all PCI read and write operations are serialized.
642 If any reserved bits in Address are set, then ASSERT().
644 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
645 @param OrData The value to OR with the PCI configuration register.
647 @return The value written to the PCI configuration register.
659 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value.
661 Reads the 32-bit PCI configuration register specified by Address,
662 performs a bitwise AND between the read result and the value specified by AndData,
663 and writes the result to the 32-bit PCI configuration register specified by Address.
664 The value written to the PCI configuration register is returned.
665 This function must guarantee that all PCI read and write operations are serialized.
666 If any reserved bits in Address are set, then ASSERT().
668 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
669 @param Andata The value to AND with the PCI configuration register.
671 @return The value written to the PCI configuration register.
683 Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value,
684 followed a bitwise inclusive OR with another 32-bit value.
686 Reads the 32-bit PCI configuration register specified by Address,
687 performs a bitwise AND between the read result and the value specified by AndData,
688 performs a bitwise inclusive OR between the result of the AND operation and the value specified by OrData,
689 and writes the result to the 32-bit PCI configuration register specified by Address.
690 The value written to the PCI configuration register is returned.
691 This function must guarantee that all PCI read and write operations are serialized.
692 If any reserved bits in Address are set, then ASSERT().
694 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
695 @param Andata The value to AND with the PCI configuration register.
696 @param OrData The value to OR with the PCI configuration register.
698 @return The value written to the PCI configuration register.
703 PciSegmentAndThenOr32 (
711 Reads a bit field of a PCI configuration register.
713 Reads the bit field in a 32-bit PCI configuration register.
714 The bit field is specified by the StartBit and the EndBit.
715 The value of the bit field is returned.
716 If any reserved bits in Address are set, then ASSERT().
717 If StartBit is greater than 7, then ASSERT().
718 If EndBit is greater than 7, then ASSERT().
719 If EndBit is less than or equal to StartBit, then ASSERT().
721 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
722 @param StartBit The ordinal of the least significant bit in the bit field.
723 The ordinal of the least significant bit in a byte is bit 0.
724 @param EndBit The ordinal of the most significant bit in the bit field.
725 The ordinal of the most significant bit in a byte is bit 7.
727 @return The value of the bit field.
732 PciSegmentBitFieldRead32 (
740 Writes a bit field to a PCI configuration register.
742 Writes Value to the bit field of the PCI configuration register.
743 The bit field is specified by the StartBit and the EndBit.
744 All other bits in the destination PCI configuration register are preserved.
745 The new value of the 32-bit register is returned.
746 If any reserved bits in Address are set, then ASSERT().
747 If StartBit is greater than 7, then ASSERT().
748 If EndBit is greater than 7, then ASSERT().
749 If EndBit is less than or equal to StartBit, then ASSERT().
751 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
752 @param StartBit The ordinal of the least significant bit in the bit field.
753 The ordinal of the least significant bit in a byte is bit 0.
754 @param EndBit The ordinal of the most significant bit in the bit field.
755 The ordinal of the most significant bit in a byte is bit 7.
756 @param Value New value of the bit field.
758 @return The new value of the 32-bit register.
763 PciSegmentBitFieldWrite32 (
772 Reads the 32-bit PCI configuration register specified by Address,
773 performs a bitwise inclusive OR between the read result and the value specified by OrData,
774 and writes the result to the 32-bit PCI configuration register specified by Address.
776 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
777 @param StartBit The ordinal of the least significant bit in the bit field.
778 The ordinal of the least significant bit in a byte is bit 0.
779 @param EndBit The ordinal of the most significant bit in the bit field.
780 The ordinal of the most significant bit in a byte is bit 7.
781 @param OrData The value to OR with the read value from the PCI configuration register.
783 @return The value written to the PCI configuration register.
788 PciSegmentBitFieldOr32 (
797 Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR,
798 and writes the result back to the bit field in the 32-bit port.
800 Reads the 32-bit PCI configuration register specified by Address,
801 performs a bitwise inclusive OR between the read result and the value specified by OrData,
802 and writes the result to the 32-bit PCI configuration register specified by Address.
803 The value written to the PCI configuration register is returned.
804 This function must guarantee that all PCI read and write operations are serialized.
805 Extra left bits in OrData are stripped.
806 If any reserved bits in Address are set, then ASSERT().
807 If StartBit is greater than 7, then ASSERT().
808 If EndBit is greater than 7, then ASSERT().
809 If EndBit is less than or equal to StartBit, then ASSERT().
811 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
812 @param StartBit The ordinal of the least significant bit in the bit field.
813 The ordinal of the least significant bit in a byte is bit 0.
814 @param EndBit The ordinal of the most significant bit in the bit field.
815 The ordinal of the most significant bit in a byte is bit 7.
816 @param AndData The value to AND with the read value from the PCI configuration register.
818 @return The value written to the PCI configuration register.
823 PciSegmentBitFieldAnd32 (
832 Reads a bit field in a 32-bit PCI configuration register, performs a bitwise AND,
833 and writes the result back to the bit field in the 32-bit register.
835 Reads the 32-bit PCI configuration register specified by Address,
836 performs a bitwise AND between the read result and the value specified by AndData,
837 and writes the result to the 32-bit PCI configuration register specified by Address.
838 The value written to the PCI configuration register is returned.
839 This function must guarantee that all PCI read and write operations are serialized.
840 Extra left bits in AndData are stripped.
841 If any reserved bits in Address are set, then ASSERT().
842 If StartBit is greater than 7, then ASSERT().
843 If EndBit is greater than 7, then ASSERT().
844 If EndBit is less than or equal to StartBit, then ASSERT().
846 @param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
847 @param StartBit The ordinal of the least significant bit in the bit field.
848 The ordinal of the least significant bit in a byte is bit 0.
849 @param EndBit The ordinal of the most significant bit in the bit field.
850 The ordinal of the most significant bit in a byte is bit 7.
851 @param AndData The value to AND with the read value from the PCI configuration register.
852 @param OrData The value to OR with the read value from the PCI configuration register.
854 @return The value written to the PCI configuration register.
859 PciSegmentBitFieldAndThenOr32 (
869 Reads a range of PCI configuration registers into a caller supplied buffer.
871 Reads the range of PCI configuration registers specified by StartAddress
872 and Size into the buffer specified by Buffer.
873 This function only allows the PCI configuration registers from a single PCI function to be read.
875 If any reserved bits in StartAddress are set, then ASSERT().
876 If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
877 If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
878 If Buffer is NULL, then ASSERT().
880 @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, Function, and Register.
881 @param Size Size in bytes of the transfer.
882 @param Buffer Pointer to a buffer receiving the data read.
884 @return The paramter of Size.
889 PciSegmentReadBuffer (
890 IN UINT64 StartAddress
,
897 Copies the data in a caller supplied buffer to a specified range of PCI configuration space.
899 Writes the range of PCI configuration registers specified by StartAddress
900 and Size from the buffer specified by Buffer.
901 This function only allows the PCI configuration registers from a single PCI function to be written.
903 If any reserved bits in StartAddress are set, then ASSERT().
904 If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
905 If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
906 If Buffer is NULL, then ASSERT().
908 @param StartAddress Starting address that encodes the PCI Segment, Bus, Device, Function, and Register.
909 @param Size Size in bytes of the transfer.
910 @param Buffer Pointer to a buffer containing the data to write.
912 @return The paramter of Size.
917 PciSegmentWriteBuffer (
918 IN UINT64 StartAddress
,