Revision: 14020
          http://edk2.svn.sourceforge.net/edk2/?rev=14020&view=rev
Author:   lgao4
Date:     2012-12-25 02:29:46 +0000 (Tue, 25 Dec 2012)
Log Message:
-----------
Add ASSERT() for BitField operations to make sure the input value is valid. 
Signed-off-by: Liming Gao <[email protected]>
Reviewed-by: Kinney, Michael D <[email protected]>

Modified Paths:
--------------
    trunk/edk2/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoHighLevel.c

Modified: trunk/edk2/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoHighLevel.c
===================================================================
--- trunk/edk2/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoHighLevel.c    
2012-12-25 02:25:50 UTC (rev 14019)
+++ trunk/edk2/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoHighLevel.c    
2012-12-25 02:29:46 UTC (rev 14020)
@@ -4,7 +4,7 @@
   All assertions for bit field operations are handled bit field functions in 
the
   Base Library.
 
-  Copyright (c) 2006, 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
@@ -156,6 +156,7 @@
   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.
@@ -196,6 +197,7 @@
   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.
@@ -236,6 +238,7 @@
   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.
@@ -278,6 +281,8 @@
   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.
@@ -436,6 +441,7 @@
   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.
@@ -476,6 +482,7 @@
   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.
@@ -516,6 +523,7 @@
   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.
@@ -558,6 +566,8 @@
   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.
@@ -716,6 +726,7 @@
   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.
@@ -756,6 +767,7 @@
   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.
@@ -796,6 +808,7 @@
   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.
@@ -838,6 +851,8 @@
   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.
@@ -996,6 +1011,7 @@
   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.
@@ -1036,6 +1052,7 @@
   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.
@@ -1076,6 +1093,7 @@
   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.
@@ -1118,6 +1136,8 @@
   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.
@@ -1276,6 +1296,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1317,6 +1338,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1358,6 +1380,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1400,6 +1423,8 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1558,6 +1583,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1599,6 +1625,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1640,6 +1667,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1682,6 +1710,8 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1840,6 +1870,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1881,6 +1912,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1922,6 +1954,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -1964,6 +1997,8 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -2122,6 +2157,7 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.
@@ -2163,6 +2199,7 @@
   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.
@@ -2204,6 +2241,7 @@
   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.
@@ -2246,6 +2284,8 @@
   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   MMIO register to write.
   @param  StartBit  The ordinal of the least significant bit in the bit field.

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to