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
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
PCI CF8 Library functions that use I/O ports 0xCF8 and 0xCFC to perform PCI Configuration cycles.
|
||||
Layers on top of an I/O Library instance.
|
||||
|
||||
Copyright (c) 2006 - 2010, 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
|
||||
@@ -369,6 +369,7 @@ PciCf8BitFieldRead8 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -424,6 +425,7 @@ PciCf8BitFieldWrite8 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -479,6 +481,7 @@ PciCf8BitFieldOr8 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -536,6 +539,8 @@ PciCf8BitFieldAnd8 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -862,6 +867,7 @@ PciCf8BitFieldRead16 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -918,6 +924,7 @@ PciCf8BitFieldWrite16 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -974,6 +981,7 @@ PciCf8BitFieldOr16 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -1032,6 +1040,8 @@ PciCf8BitFieldAnd16 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -1358,6 +1368,7 @@ PciCf8BitFieldRead32 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -1414,6 +1425,7 @@ PciCf8BitFieldWrite32 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -1470,6 +1482,7 @@ PciCf8BitFieldOr32 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -1528,6 +1541,8 @@ PciCf8BitFieldAnd32 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
|
Reference in New Issue
Block a user