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:
@@ -3,7 +3,7 @@
|
||||
the PCI operations to be replayed during an S3 resume. This library class
|
||||
maps directly on top of the PciLib class.
|
||||
|
||||
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
|
||||
@@ -208,6 +208,7 @@ S3PciBitFieldRead8 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -244,6 +245,7 @@ S3PciBitFieldWrite8 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -280,6 +282,7 @@ S3PciBitFieldOr8 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -317,6 +320,8 @@ S3PciBitFieldAnd8 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -520,6 +525,7 @@ S3PciBitFieldRead16 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -557,6 +563,7 @@ S3PciBitFieldWrite16 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -594,6 +601,7 @@ S3PciBitFieldOr16 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -632,6 +640,8 @@ S3PciBitFieldAnd16 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -803,7 +813,7 @@ S3PciAndThenOr32 (
|
||||
If StartBit is greater than 31, then ASSERT().
|
||||
If EndBit is greater than 31, then ASSERT().
|
||||
If EndBit is less than StartBit, then ASSERT().
|
||||
|
||||
|
||||
@param[in] Address The PCI configuration register to read.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
Range 0..31.
|
||||
@@ -835,6 +845,7 @@ S3PciBitFieldRead32 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -872,6 +883,7 @@ S3PciBitFieldWrite32 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -909,6 +921,7 @@ S3PciBitFieldOr32 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -947,6 +960,8 @@ S3PciBitFieldAnd32 (
|
||||
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[in] Address The PCI configuration register to write.
|
||||
@param[in] StartBit The ordinal of the least significant bit in the bit field.
|
||||
|
Reference in New Issue
Block a user