summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiIoLibCpuIo
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2012-12-25 02:25:50 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2012-12-25 02:25:50 +0000
commit94952554cc604750f3df3d4e8ae068703481d258 (patch)
tree943da134082610ef812da34b008fe1a0feb107f9 /MdePkg/Library/PeiIoLibCpuIo
parent2a956f7490cbac07c8eccf2cfc55fb0c02c0654c (diff)
downloadedk2-platforms-94952554cc604750f3df3d4e8ae068703481d258.tar.xz
Add ASSERT() for BitField operations to make sure the input value is valid.
Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Kinney, Michael D <Michael.D.Kinney@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14019 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/PeiIoLibCpuIo')
-rw-r--r--MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c b/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c
index f5e554f9e8..ce73658e84 100644
--- a/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c
+++ b/MdePkg/Library/PeiIoLibCpuIo/IoHighLevel.c
@@ -4,7 +4,7 @@
All assertions for bit field operations are handled bit field functions in the
Base Library.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -152,6 +152,7 @@ IoBitFieldRead8 (
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -192,6 +193,7 @@ IoBitFieldWrite8 (
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -232,6 +234,7 @@ IoBitFieldOr8 (
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -274,6 +277,8 @@ IoBitFieldAnd8 (
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -437,6 +442,7 @@ IoBitFieldRead16 (
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -478,6 +484,7 @@ IoBitFieldWrite16 (
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -519,6 +526,7 @@ IoBitFieldOr16 (
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -562,6 +570,8 @@ IoBitFieldAnd16 (
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -725,6 +735,7 @@ IoBitFieldRead32 (
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -766,6 +777,7 @@ IoBitFieldWrite32 (
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -807,6 +819,7 @@ IoBitFieldOr32 (
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -850,6 +863,8 @@ IoBitFieldAnd32 (
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1013,6 +1028,7 @@ IoBitFieldRead64 (
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1054,6 +1070,7 @@ IoBitFieldWrite64 (
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1095,6 +1112,7 @@ IoBitFieldOr64 (
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1138,6 +1156,8 @@ IoBitFieldAnd64 (
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Port The I/O port to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1296,6 +1316,7 @@ MmioBitFieldRead8 (
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1337,6 +1358,7 @@ MmioBitFieldWrite8 (
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1378,6 +1400,7 @@ MmioBitFieldOr8 (
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1420,6 +1443,8 @@ MmioBitFieldAnd8 (
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1582,6 +1607,7 @@ MmioBitFieldRead16 (
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1624,6 +1650,7 @@ MmioBitFieldWrite16 (
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1666,6 +1693,7 @@ MmioBitFieldOr16 (
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1709,6 +1737,8 @@ MmioBitFieldAnd16 (
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1871,6 +1901,7 @@ MmioBitFieldRead32 (
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1913,6 +1944,7 @@ MmioBitFieldWrite32 (
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1955,6 +1987,7 @@ MmioBitFieldOr32 (
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -1998,6 +2031,8 @@ MmioBitFieldAnd32 (
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2160,6 +2195,7 @@ MmioBitFieldRead64 (
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2202,6 +2238,7 @@ MmioBitFieldWrite64 (
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2244,6 +2281,7 @@ MmioBitFieldOr64 (
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2287,6 +2325,8 @@ MmioBitFieldAnd64 (
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Address The MMIO register to write.
@param StartBit The ordinal of the least significant bit in the bit field.