THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
- Module Name: IoHighLevel.c\r
+**/\r
\r
- The following IoLib instances share the same version of this file:\r
\r
- BaseIoLibIntrinsic\r
- DxeIoLibCpuIo\r
- PeiIoLibCpuIo\r
+#include <PiPei.h>\r
\r
-**/\r
+#include <Library/IoLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/PeiServicesTablePointerLib.h>\r
\r
/**\r
Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the\r
IN UINT8 OrData\r
)\r
{\r
- return IoWrite8 (Port, IoRead8 (Port) | OrData);\r
+ return IoWrite8 (Port, (UINT8) (IoRead8 (Port) | OrData));\r
}\r
\r
/**\r
IN UINT8 AndData\r
)\r
{\r
- return IoWrite8 (Port, IoRead8 (Port) & AndData);\r
+ return IoWrite8 (Port, (UINT8) (IoRead8 (Port) & AndData));\r
}\r
\r
/**\r
IN UINT8 OrData\r
)\r
{\r
- return IoWrite8 (Port, (IoRead8 (Port) & AndData) | OrData);\r
+ return IoWrite8 (Port, (UINT8) ((IoRead8 (Port) & AndData) | OrData));\r
}\r
\r
/**\r
If 8-bit I/O port operations are not supported, 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 Port The I/O port to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..7.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT8\r
If 8-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 8-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 8-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 8-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
IN UINT16 OrData\r
)\r
{\r
- return IoWrite16 (Port, IoRead16 (Port) | OrData);\r
+ return IoWrite16 (Port, (UINT16) (IoRead16 (Port) | OrData));\r
}\r
\r
/**\r
IN UINT16 AndData\r
)\r
{\r
- return IoWrite16 (Port, IoRead16 (Port) & AndData);\r
+ return IoWrite16 (Port, (UINT16) (IoRead16 (Port) & AndData));\r
}\r
\r
/**\r
IN UINT16 OrData\r
)\r
{\r
- return IoWrite16 (Port, (IoRead16 (Port) & AndData) | OrData);\r
+ return IoWrite16 (Port, (UINT16) ((IoRead16 (Port) & AndData) | OrData));\r
}\r
\r
/**\r
If 16-bit I/O port operations are not supported, 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 Port The I/O port to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..15.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT16\r
If 16-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 16-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 16-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 16-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit I/O port operations are not supported, 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 Port The I/O port to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..31.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT32\r
If 32-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit I/O port operations are not supported, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 Port The I/O port to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit I/O port operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 Port The I/O port to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
IN UINT8 OrData\r
)\r
{\r
- return MmioWrite8 (Address, MmioRead8 (Address) | OrData);\r
+ return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) | OrData));\r
}\r
\r
/**\r
IN UINT8 AndData\r
)\r
{\r
- return MmioWrite8 (Address, MmioRead8 (Address) & AndData);\r
+ return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) & AndData));\r
}\r
\r
/**\r
IN UINT8 OrData\r
)\r
{\r
- return MmioWrite8 (Address, (MmioRead8 (Address) & AndData) | OrData);\r
+ return MmioWrite8 (Address, (UINT8) ((MmioRead8 (Address) & AndData) | OrData));\r
}\r
\r
/**\r
If 8-bit MMIO register operations are not supported, 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 MMIO register to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 8-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 8-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 8-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 8-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
IN UINT16 OrData\r
)\r
{\r
- return MmioWrite16 (Address, MmioRead16 (Address) | OrData);\r
+ return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) | OrData));\r
}\r
\r
/**\r
IN UINT16 AndData\r
)\r
{\r
- return MmioWrite16 (Address, MmioRead16 (Address) & AndData);\r
+ return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) & AndData));\r
}\r
\r
/**\r
IN UINT16 OrData\r
)\r
{\r
- return MmioWrite16 (Address, (MmioRead16 (Address) & AndData) | OrData);\r
+ return MmioWrite16 (Address, (UINT16) ((MmioRead16 (Address) & AndData) | OrData));\r
}\r
\r
/**\r
If 16-bit MMIO register operations are not supported, 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 MMIO register to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..15.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT16\r
If 16-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 16-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 16-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 16-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit MMIO register operations are not supported, 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 MMIO register to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 32-bit MMIO register operations are not supported, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 MMIO register to read.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r
If 64-bit MMIO register operations are not supported, then ASSERT().\r
If StartBit is greater than 63, then ASSERT().\r
If EndBit is greater than 63, 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 MMIO register to write.\r
@param StartBit The ordinal of the least significant bit in the bit field.\r