summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/X86Msr.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2012-12-25 02:25:50 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2012-12-25 02:25:50 +0000
commit94952554cc604750f3df3d4e8ae068703481d258 (patch)
tree943da134082610ef812da34b008fe1a0feb107f9 /MdePkg/Library/BaseLib/X86Msr.c
parent2a956f7490cbac07c8eccf2cfc55fb0c02c0654c (diff)
downloadedk2-platforms-94952554cc604750f3df3d4e8ae068703481d258.tar.xz
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
Diffstat (limited to 'MdePkg/Library/BaseLib/X86Msr.c')
-rw-r--r--MdePkg/Library/BaseLib/X86Msr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/MdePkg/Library/BaseLib/X86Msr.c b/MdePkg/Library/BaseLib/X86Msr.c
index 6a6bd9e766..9430980401 100644
--- a/MdePkg/Library/BaseLib/X86Msr.c
+++ b/MdePkg/Library/BaseLib/X86Msr.c
@@ -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.