]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/S3PciLib.h
Add ASSERT() for BitField operations to make sure the input value is valid.
[mirror_edk2.git] / MdePkg / Include / Library / S3PciLib.h
index 72b6e26e384da83e132a682354ff0c969e15f51c..bae12aba1eb802b0f8ff792f05bf22fb5bdd43df 100644 (file)
@@ -3,7 +3,7 @@
   the PCI operations to be replayed during an S3 resume. This library class\r
   maps directly on top of the PciLib class. \r
 \r
   the PCI operations to be replayed during an S3 resume. This library class\r
   maps directly on top of the PciLib class. \r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -208,6 +208,7 @@ S3PciBitFieldRead8 (
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -244,6 +245,7 @@ S3PciBitFieldWrite8 (
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -280,6 +282,7 @@ S3PciBitFieldOr8 (
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -317,6 +320,8 @@ S3PciBitFieldAnd8 (
   If StartBit is greater than 7, then ASSERT().\r
   If EndBit is greater than 7, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -520,6 +525,7 @@ S3PciBitFieldRead16 (
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -557,6 +563,7 @@ S3PciBitFieldWrite16 (
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -594,6 +601,7 @@ S3PciBitFieldOr16 (
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -632,6 +640,8 @@ S3PciBitFieldAnd16 (
   If StartBit is greater than 15, then ASSERT().\r
   If EndBit is greater than 15, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -803,7 +813,7 @@ S3PciAndThenOr32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
-\r
\r
   @param[in] Address    The PCI configuration register to read.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
                         Range 0..31.\r
   @param[in] Address    The PCI configuration register to read.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
                         Range 0..31.\r
@@ -835,6 +845,7 @@ S3PciBitFieldRead32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -872,6 +883,7 @@ S3PciBitFieldWrite32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -909,6 +921,7 @@ S3PciBitFieldOr32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
@@ -947,6 +960,8 @@ S3PciBitFieldAnd32 (
   If StartBit is greater than 31, then ASSERT().\r
   If EndBit is greater than 31, then ASSERT().\r
   If EndBit is less than StartBit, 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 StartBit, then ASSERT().\r
+  If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
+  If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r
 \r
   @param[in] Address    The PCI configuration register to write.\r
   @param[in] StartBit   The ordinal of the least significant bit in the bit field.\r