20#define PCI_CONFIGURATION_ADDRESS_PORT 0xCF8
21#define PCI_CONFIGURATION_DATA_PORT 0xCFC
42#define PCI_TO_CF8_ADDRESS(A) \
43 ((UINT32) ((((A) >> 4) & 0x00ffff00) | ((A) & 0xfc) | 0x80000000))
53#define ASSERT_INVALID_PCI_ADDRESS(A, M) \
54 ASSERT (((A) & (~0xffff0ff | (M))) == 0)
110 BOOLEAN InterruptState;
116 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
118 Result =
IoRead8 (PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3));
119 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
148 BOOLEAN InterruptState;
154 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
157 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
160 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
193 BOOLEAN InterruptState;
199 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
202 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
205 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
238 BOOLEAN InterruptState;
244 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
247 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
250 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
286 BOOLEAN InterruptState;
292 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
295 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
299 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
334 BOOLEAN InterruptState;
340 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
343 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
347 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
386 BOOLEAN InterruptState;
392 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
395 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
400 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
442 BOOLEAN InterruptState;
448 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
451 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
456 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
498 BOOLEAN InterruptState;
504 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
507 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
512 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
559 BOOLEAN InterruptState;
565 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
568 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
574 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
602 BOOLEAN InterruptState;
608 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
610 Result =
IoRead16 (PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2));
611 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
641 BOOLEAN InterruptState;
647 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
650 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
653 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
687 BOOLEAN InterruptState;
693 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
696 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
699 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
733 BOOLEAN InterruptState;
739 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
742 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
745 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
782 BOOLEAN InterruptState;
788 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
791 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
795 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
831 BOOLEAN InterruptState;
837 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
840 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
844 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
884 BOOLEAN InterruptState;
890 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
893 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
898 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
941 BOOLEAN InterruptState;
947 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
950 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
955 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
998 BOOLEAN InterruptState;
1004 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1007 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
1012 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1060 BOOLEAN InterruptState;
1066 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1069 PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
1075 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1103 BOOLEAN InterruptState;
1109 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1111 Result =
IoRead32 (PCI_CONFIGURATION_DATA_PORT);
1112 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1142 BOOLEAN InterruptState;
1148 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1151 PCI_CONFIGURATION_DATA_PORT,
1154 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1188 BOOLEAN InterruptState;
1194 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1197 PCI_CONFIGURATION_DATA_PORT,
1200 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1234 BOOLEAN InterruptState;
1240 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1243 PCI_CONFIGURATION_DATA_PORT,
1246 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1283 BOOLEAN InterruptState;
1289 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1292 PCI_CONFIGURATION_DATA_PORT,
1296 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1332 BOOLEAN InterruptState;
1338 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1341 PCI_CONFIGURATION_DATA_PORT,
1345 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1385 BOOLEAN InterruptState;
1391 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1394 PCI_CONFIGURATION_DATA_PORT,
1399 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1442 BOOLEAN InterruptState;
1448 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1451 PCI_CONFIGURATION_DATA_PORT,
1456 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1499 BOOLEAN InterruptState;
1505 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1508 PCI_CONFIGURATION_DATA_PORT,
1513 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1561 BOOLEAN InterruptState;
1567 AddressPort =
IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT);
1570 PCI_CONFIGURATION_DATA_PORT,
1576 IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort);
1616 ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);
1622 ASSERT (Buffer !=
NULL);
1629 if ((StartAddress & 1) != 0) {
1633 *(
volatile UINT8 *)Buffer =
PciCf8Read8 (StartAddress);
1634 StartAddress +=
sizeof (UINT8);
1635 Size -=
sizeof (UINT8);
1636 Buffer = (UINT8 *)Buffer + 1;
1639 if ((Size >=
sizeof (UINT16)) && ((StartAddress & 2) != 0)) {
1645 StartAddress +=
sizeof (UINT16);
1646 Size -=
sizeof (UINT16);
1647 Buffer = (UINT16 *)Buffer + 1;
1650 while (Size >=
sizeof (UINT32)) {
1655 StartAddress +=
sizeof (UINT32);
1656 Size -=
sizeof (UINT32);
1657 Buffer = (UINT32 *)Buffer + 1;
1660 if (Size >=
sizeof (UINT16)) {
1665 StartAddress +=
sizeof (UINT16);
1666 Size -=
sizeof (UINT16);
1667 Buffer = (UINT16 *)Buffer + 1;
1670 if (Size >=
sizeof (UINT8)) {
1674 *(
volatile UINT8 *)Buffer =
PciCf8Read8 (StartAddress);
1716 ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);
1722 ASSERT (Buffer !=
NULL);
1729 if ((StartAddress & 1) != 0) {
1734 StartAddress +=
sizeof (UINT8);
1735 Size -=
sizeof (UINT8);
1736 Buffer = (UINT8 *)Buffer + 1;
1739 if ((Size >=
sizeof (UINT16)) && ((StartAddress & 2) != 0)) {
1744 StartAddress +=
sizeof (UINT16);
1745 Size -=
sizeof (UINT16);
1746 Buffer = (UINT16 *)Buffer + 1;
1749 while (Size >=
sizeof (UINT32)) {
1754 StartAddress +=
sizeof (UINT32);
1755 Size -=
sizeof (UINT32);
1756 Buffer = (UINT32 *)Buffer + 1;
1759 if (Size >=
sizeof (UINT16)) {
1764 StartAddress +=
sizeof (UINT16);
1765 Size -=
sizeof (UINT16);
1766 Buffer = (UINT16 *)Buffer + 1;
1769 if (Size >=
sizeof (UINT8)) {
BOOLEAN EFIAPI SetInterruptState(IN BOOLEAN InterruptState)
BOOLEAN EFIAPI SaveAndDisableInterrupts(VOID)
UINT16 EFIAPI ReadUnaligned16(IN CONST UINT16 *Buffer)
UINT32 EFIAPI WriteUnaligned32(OUT UINT32 *Buffer, IN UINT32 Value)
UINT16 EFIAPI WriteUnaligned16(OUT UINT16 *Buffer, IN UINT16 Value)
UINT32 EFIAPI ReadUnaligned32(IN CONST UINT32 *Buffer)
UINT8 EFIAPI IoWrite8(IN UINTN Port, IN UINT8 Value)
UINT8 EFIAPI IoBitFieldWrite8(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 Value)
UINT8 EFIAPI IoBitFieldAndThenOr8(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData, IN UINT8 OrData)
UINT16 EFIAPI IoAndThenOr16(IN UINTN Port, IN UINT16 AndData, IN UINT16 OrData)
UINT32 EFIAPI IoBitFieldAnd32(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData)
UINT32 EFIAPI IoBitFieldWrite32(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 Value)
UINT16 EFIAPI IoOr16(IN UINTN Port, IN UINT16 OrData)
UINT16 EFIAPI IoBitFieldAnd16(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData)
UINT16 EFIAPI IoBitFieldOr16(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 OrData)
UINT8 EFIAPI IoBitFieldOr8(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 OrData)
UINT8 EFIAPI IoAnd8(IN UINTN Port, IN UINT8 AndData)
UINT8 EFIAPI IoBitFieldAnd8(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData)
UINT32 EFIAPI IoOr32(IN UINTN Port, IN UINT32 OrData)
UINT16 EFIAPI IoBitFieldWrite16(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 Value)
UINT16 EFIAPI IoBitFieldRead16(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit)
UINT32 EFIAPI IoAndThenOr32(IN UINTN Port, IN UINT32 AndData, IN UINT32 OrData)
UINT32 EFIAPI IoBitFieldRead32(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit)
UINT32 EFIAPI IoBitFieldAndThenOr32(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData, IN UINT32 OrData)
UINT32 EFIAPI IoBitFieldOr32(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
UINT16 EFIAPI IoAnd16(IN UINTN Port, IN UINT16 AndData)
UINT8 EFIAPI IoBitFieldRead8(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit)
UINT32 EFIAPI IoAnd32(IN UINTN Port, IN UINT32 AndData)
UINT8 EFIAPI IoRead8(IN UINTN Port)
UINT8 EFIAPI IoAndThenOr8(IN UINTN Port, IN UINT8 AndData, IN UINT8 OrData)
UINT16 EFIAPI IoBitFieldAndThenOr16(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData, IN UINT16 OrData)
UINT8 EFIAPI IoOr8(IN UINTN Port, IN UINT8 OrData)
UINT16 EFIAPI IoRead16(IN UINTN Port)
UINT32 EFIAPI IoRead32(IN UINTN Port)
UINT32 EFIAPI IoWrite32(IN UINTN Port, IN UINT32 Value)
UINT16 EFIAPI IoWrite16(IN UINTN Port, IN UINT16 Value)
UINT8 EFIAPI PciCf8Read8(IN UINTN Address)
UINT32 EFIAPI PciCf8BitFieldOr32(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
UINT32 EFIAPI PciCf8BitFieldRead32(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit)
UINT32 EFIAPI PciCf8BitFieldWrite32(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 Value)
UINT8 EFIAPI PciCf8And8(IN UINTN Address, IN UINT8 AndData)
UINT32 EFIAPI PciCf8Write32(IN UINTN Address, IN UINT32 Value)
UINT32 EFIAPI PciCf8And32(IN UINTN Address, IN UINT32 AndData)
UINTN EFIAPI PciCf8WriteBuffer(IN UINTN StartAddress, IN UINTN Size, IN VOID *Buffer)
UINT8 EFIAPI PciCf8BitFieldWrite8(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 Value)
UINT32 EFIAPI PciCf8Or32(IN UINTN Address, IN UINT32 OrData)
UINT32 EFIAPI PciCf8Read32(IN UINTN Address)
UINT8 EFIAPI PciCf8AndThenOr8(IN UINTN Address, IN UINT8 AndData, IN UINT8 OrData)
#define PCI_TO_CF8_ADDRESS(A)
UINT8 EFIAPI PciCf8BitFieldRead8(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit)
UINT8 EFIAPI PciCf8Or8(IN UINTN Address, IN UINT8 OrData)
UINT16 EFIAPI PciCf8BitFieldOr16(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 OrData)
#define ASSERT_INVALID_PCI_ADDRESS(A, M)
UINT16 EFIAPI PciCf8Write16(IN UINTN Address, IN UINT16 Value)
UINT16 EFIAPI PciCf8And16(IN UINTN Address, IN UINT16 AndData)
UINT8 EFIAPI PciCf8BitFieldAndThenOr8(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData, IN UINT8 OrData)
UINT8 EFIAPI PciCf8Write8(IN UINTN Address, IN UINT8 Value)
UINT32 EFIAPI PciCf8AndThenOr32(IN UINTN Address, IN UINT32 AndData, IN UINT32 OrData)
RETURN_STATUS EFIAPI PciCf8RegisterForRuntimeAccess(IN UINTN Address)
UINT32 EFIAPI PciCf8BitFieldAndThenOr32(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData, IN UINT32 OrData)
UINT16 EFIAPI PciCf8Read16(IN UINTN Address)
UINT16 EFIAPI PciCf8Or16(IN UINTN Address, IN UINT16 OrData)
UINT16 EFIAPI PciCf8BitFieldAndThenOr16(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData, IN UINT16 OrData)
UINT16 EFIAPI PciCf8BitFieldAnd16(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData)
UINT8 EFIAPI PciCf8BitFieldAnd8(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData)
UINT16 EFIAPI PciCf8AndThenOr16(IN UINTN Address, IN UINT16 AndData, IN UINT16 OrData)
UINT16 EFIAPI PciCf8BitFieldWrite16(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 Value)
UINT8 EFIAPI PciCf8BitFieldOr8(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 OrData)
UINTN EFIAPI PciCf8ReadBuffer(IN UINTN StartAddress, IN UINTN Size, OUT VOID *Buffer)
UINT32 EFIAPI PciCf8BitFieldAnd32(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData)
UINT16 EFIAPI PciCf8BitFieldRead16(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit)