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:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
IA-32/x64 MSR functions.
|
||||
|
||||
Copyright (c) 2006 - 2008, 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
|
||||
@@ -203,6 +203,7 @@ AsmMsrBitFieldRead32 (
|
||||
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 Index The 32-bit MSR index to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -243,6 +244,7 @@ AsmMsrBitFieldWrite32 (
|
||||
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 Index The 32-bit MSR index to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -283,6 +285,7 @@ AsmMsrBitFieldOr32 (
|
||||
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 Index The 32-bit MSR index to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -325,6 +328,8 @@ AsmMsrBitFieldAnd32 (
|
||||
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 Index The 32-bit MSR index to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -491,6 +496,7 @@ AsmMsrBitFieldRead64 (
|
||||
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 Index The 32-bit MSR index to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -532,6 +538,7 @@ AsmMsrBitFieldWrite64 (
|
||||
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 Index The 32-bit MSR index to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -573,6 +580,7 @@ AsmMsrBitFieldOr64 (
|
||||
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 Index The 32-bit MSR index to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@@ -615,6 +623,8 @@ AsmMsrBitFieldAnd64 (
|
||||
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 Index The 32-bit MSR index to write.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
|
Reference in New Issue
Block a user