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:
@@ -10,7 +10,7 @@
|
||||
these three libraries is identical. The PCI CF8 Library and PCI Express Library simply use
|
||||
explicit access methods.
|
||||
|
||||
Copyright (c) 2006 - 2009, 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
|
||||
@@ -236,6 +236,7 @@ PciBitFieldRead8 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -271,6 +272,7 @@ PciBitFieldWrite8 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -306,6 +308,7 @@ PciBitFieldOr8 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -343,6 +346,8 @@ PciBitFieldAnd8 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -541,6 +546,7 @@ PciBitFieldRead16 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -577,6 +583,7 @@ PciBitFieldWrite16 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -613,6 +620,7 @@ PciBitFieldOr16 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -651,6 +659,8 @@ PciBitFieldAnd16 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -849,6 +859,7 @@ PciBitFieldRead32 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -885,6 +896,7 @@ PciBitFieldWrite32 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -921,6 +933,7 @@ PciBitFieldOr32 (
|
||||
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 PCI configuration register to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -959,6 +972,8 @@ PciBitFieldAnd32 (
|
||||
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 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