\r
**/\r
#define PCI_TO_CF8_ADDRESS(A) \\r
- ((UINT32) ((((A) >> 4) & 0xffffff00) | ((A) & 0xfc) | 0x80000000))\r
+ ((UINT32) ((((A) >> 4) & 0x00ffff00) | ((A) & 0xfc) | 0x80000000))\r
\r
/**\r
Reads an 8-bit PCI configuration register.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 7, then ASSERT().\r
If EndBit is greater than 7, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 7, then ASSERT().\r
If EndBit is greater than 7, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 7, then ASSERT().\r
If EndBit is greater than 7, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 7, then ASSERT().\r
If EndBit is greater than 7, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 7, then ASSERT().\r
If EndBit is greater than 7, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 15, then ASSERT().\r
If EndBit is greater than 15, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If the register specified by Address >= 0x100, then ASSERT().\r
If StartBit is greater than 31, then ASSERT().\r
If EndBit is greater than 31, then ASSERT().\r
- If EndBit is less than or equal to StartBit, then ASSERT().\r
+ If EndBit is less than StartBit, then ASSERT().\r
\r
@param Address PCI configuration register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
{\r
UINTN EndAddress;\r
\r
+ ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
+ ASSERT (Buffer != NULL);\r
+\r
EndAddress = StartAddress + Size;\r
\r
if (StartAddress < EndAddress && (StartAddress & 1)) {\r
{\r
UINTN EndAddress;\r
\r
+ ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
+ ASSERT (Buffer != NULL);\r
+\r
EndAddress = StartAddress + Size;\r
\r
if ((StartAddress < EndAddress) && ((StartAddress & 1)!= 0)) {\r