summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-24 05:30:40 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-24 05:30:40 +0000
commit5385a579693ec4b4876b9c6fd8cd472e49ed5fd6 (patch)
tree06a60985420f2dc1c01ab5bbe0df9b7a9ad0285a
parentdfb8993c3c35616d2e986d000cea855b1f6b43ac (diff)
downloadedk2-platforms-5385a579693ec4b4876b9c6fd8cd472e49ed5fd6.tar.xz
clean up baselib according to review comments.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5958 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdePkg/Include/Library/BaseLib.h54
-rw-r--r--MdePkg/Library/BaseLib/ARShiftU64.c7
-rw-r--r--MdePkg/Library/BaseLib/BitField.c45
-rw-r--r--MdePkg/Library/BaseLib/Ipf/Unaligned.c43
-rw-r--r--MdePkg/Library/BaseLib/LRotU32.c7
-rw-r--r--MdePkg/Library/BaseLib/LRotU64.c7
-rw-r--r--MdePkg/Library/BaseLib/LShiftU64.c7
-rw-r--r--MdePkg/Library/BaseLib/RRotU32.c7
-rw-r--r--MdePkg/Library/BaseLib/RRotU64.c7
-rw-r--r--MdePkg/Library/BaseLib/RShiftU64.c7
-rw-r--r--MdePkg/Library/BaseLib/Unaligned.c42
11 files changed, 104 insertions, 129 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index 0632230a65..6683d4c741 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -1,7 +1,7 @@
/** @file
Memory-only library functions with no library constructor/destructor
- Copyright (c) 2006 - 2007, Intel Corporation
+ Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. 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
@@ -2192,15 +2192,15 @@ DivS64x64Remainder (
If the Buffer is NULL, then ASSERT().
- @param Uint16 Pointer to a 16-bit value that may be unaligned.
+ @param Buffer Pointer to a 16-bit value that may be unaligned.
- @return *Uint16
+ @return The 16-bit value read from Buffer.
**/
UINT16
EFIAPI
ReadUnaligned16 (
- IN CONST UINT16 *Uint16
+ IN CONST UINT16 *Buffer
);
@@ -2213,17 +2213,17 @@ ReadUnaligned16 (
If the Buffer is NULL, then ASSERT().
- @param Uint16 Pointer to a 16-bit value that may be unaligned.
+ @param Buffer Pointer to a 16-bit value that may be unaligned.
@param Value 16-bit value to write to Buffer.
- @return Value
+ @return The 16-bit value to write to Buffer.
**/
UINT16
EFIAPI
WriteUnaligned16 (
- OUT UINT16 *Uint16,
- IN UINT16 Value
+ OUT UINT16 *Buffer,
+ IN UINT16 Value
);
@@ -2237,13 +2237,13 @@ WriteUnaligned16 (
@param Buffer Pointer to a 24-bit value that may be unaligned.
- @return The value read from Buffer.
+ @return The 24-bit value read from Buffer.
**/
UINT32
EFIAPI
ReadUnaligned24 (
- IN CONST UINT32 *Buffer
+ IN CONST UINT32 *Buffer
);
@@ -2259,14 +2259,14 @@ ReadUnaligned24 (
@param Buffer Pointer to a 24-bit value that may be unaligned.
@param Value 24-bit value to write to Buffer.
- @return The value written to Buffer.
+ @return The 24-bit value to write to Buffer.
**/
UINT32
EFIAPI
WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
+ OUT UINT32 *Buffer,
+ IN UINT32 Value
);
@@ -2278,15 +2278,15 @@ WriteUnaligned24 (
If the Buffer is NULL, then ASSERT().
- @param Uint32 Pointer to a 32-bit value that may be unaligned.
+ @param Buffer Pointer to a 32-bit value that may be unaligned.
- @return Value read from Uint32
+ @return The 32-bit value read from Buffer.
**/
UINT32
EFIAPI
ReadUnaligned32 (
- IN CONST UINT32 *Uint32
+ IN CONST UINT32 *Buffer
);
@@ -2299,17 +2299,17 @@ ReadUnaligned32 (
If the Buffer is NULL, then ASSERT().
- @param Uint32 Pointer to a 32-bit value that may be unaligned.
+ @param Buffer Pointer to a 32-bit value that may be unaligned.
@param Value 32-bit value to write to Buffer.
- @return Value written to Uint32.
+ @return The 32-bit value to write to Buffer.
**/
UINT32
EFIAPI
WriteUnaligned32 (
- OUT UINT32 *Uint32,
- IN UINT32 Value
+ OUT UINT32 *Buffer,
+ IN UINT32 Value
);
@@ -2321,15 +2321,15 @@ WriteUnaligned32 (
If the Buffer is NULL, then ASSERT().
- @param Uint64 Pointer to a 64-bit value that may be unaligned.
+ @param Buffer Pointer to a 64-bit value that may be unaligned.
- @return Value read from Uint64.
+ @return The 64-bit value read from Buffer.
**/
UINT64
EFIAPI
ReadUnaligned64 (
- IN CONST UINT64 *Uint64
+ IN CONST UINT64 *Buffer
);
@@ -2342,17 +2342,17 @@ ReadUnaligned64 (
If the Buffer is NULL, then ASSERT().
- @param Uint64 Pointer to a 64-bit value that may be unaligned.
+ @param Buffer Pointer to a 64-bit value that may be unaligned.
@param Value 64-bit value to write to Buffer.
- @return Value written to Uint64.
+ @return The 64-bit value to write to Buffer.
**/
UINT64
EFIAPI
WriteUnaligned64 (
- OUT UINT64 *Uint64,
- IN UINT64 Value
+ OUT UINT64 *Buffer,
+ IN UINT64 Value
);
diff --git a/MdePkg/Library/BaseLib/ARShiftU64.c b/MdePkg/Library/BaseLib/ARShiftU64.c
index 00799921e1..bd926f9034 100644
--- a/MdePkg/Library/BaseLib/ARShiftU64.c
+++ b/MdePkg/Library/BaseLib/ARShiftU64.c
@@ -1,7 +1,7 @@
/** @file
Math worker functions.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,9 +12,6 @@
**/
-
-
-
#include "BaseLibInternals.h"
/**
@@ -39,6 +36,6 @@ ARShiftU64 (
IN UINTN Count
)
{
- ASSERT (Count < sizeof (Operand) * 8);
+ ASSERT (Count < 64);
return InternalMathARShiftU64 (Operand, Count);
}
diff --git a/MdePkg/Library/BaseLib/BitField.c b/MdePkg/Library/BaseLib/BitField.c
index 7907adfeaf..8c713b29bd 100644
--- a/MdePkg/Library/BaseLib/BitField.c
+++ b/MdePkg/Library/BaseLib/BitField.c
@@ -1,7 +1,7 @@
/** @file
Bit field functions of BaseLib.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,9 +12,6 @@
**/
-
-
-
#include "BaseLibInternals.h"
/**
@@ -135,7 +132,7 @@ BitFieldRead8 (
IN UINTN EndBit
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 8);
ASSERT (StartBit <= EndBit);
return (UINT8)BitFieldReadUint (Operand, StartBit, EndBit);
}
@@ -171,7 +168,7 @@ BitFieldWrite8 (
IN UINT8 Value
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 8);
ASSERT (StartBit <= EndBit);
return BitFieldAndThenOr8 (Operand, StartBit, EndBit, 0, Value);
}
@@ -208,7 +205,7 @@ BitFieldOr8 (
IN UINT8 OrData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 8);
ASSERT (StartBit <= EndBit);
return (UINT8)BitFieldOrUint (Operand, StartBit, EndBit, OrData);
}
@@ -245,7 +242,7 @@ BitFieldAnd8 (
IN UINT8 AndData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 8);
ASSERT (StartBit <= EndBit);
return (UINT8)BitFieldAndUint (Operand, StartBit, EndBit, AndData);
}
@@ -285,7 +282,7 @@ BitFieldAndThenOr8 (
IN UINT8 OrData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 8);
ASSERT (StartBit <= EndBit);
return BitFieldOr8 (
BitFieldAnd8 (Operand, StartBit, EndBit, AndData),
@@ -322,7 +319,7 @@ BitFieldRead16 (
IN UINTN EndBit
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 16);
ASSERT (StartBit <= EndBit);
return (UINT16)BitFieldReadUint (Operand, StartBit, EndBit);
}
@@ -358,7 +355,7 @@ BitFieldWrite16 (
IN UINT16 Value
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 16);
ASSERT (StartBit <= EndBit);
return BitFieldAndThenOr16 (Operand, StartBit, EndBit, 0, Value);
}
@@ -395,7 +392,7 @@ BitFieldOr16 (
IN UINT16 OrData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 16);
ASSERT (StartBit <= EndBit);
return (UINT16)BitFieldOrUint (Operand, StartBit, EndBit, OrData);
}
@@ -432,7 +429,7 @@ BitFieldAnd16 (
IN UINT16 AndData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 16);
ASSERT (StartBit <= EndBit);
return (UINT16)BitFieldAndUint (Operand, StartBit, EndBit, AndData);
}
@@ -472,7 +469,7 @@ BitFieldAndThenOr16 (
IN UINT16 OrData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 16);
ASSERT (StartBit <= EndBit);
return BitFieldOr16 (
BitFieldAnd16 (Operand, StartBit, EndBit, AndData),
@@ -509,7 +506,7 @@ BitFieldRead32 (
IN UINTN EndBit
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 32);
ASSERT (StartBit <= EndBit);
return (UINT32)BitFieldReadUint (Operand, StartBit, EndBit);
}
@@ -545,7 +542,7 @@ BitFieldWrite32 (
IN UINT32 Value
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 32);
ASSERT (StartBit <= EndBit);
return BitFieldAndThenOr32 (Operand, StartBit, EndBit, 0, Value);
}
@@ -582,7 +579,7 @@ BitFieldOr32 (
IN UINT32 OrData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 32);
ASSERT (StartBit <= EndBit);
return (UINT32)BitFieldOrUint (Operand, StartBit, EndBit, OrData);
}
@@ -619,7 +616,7 @@ BitFieldAnd32 (
IN UINT32 AndData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 32);
ASSERT (StartBit <= EndBit);
return (UINT32)BitFieldAndUint (Operand, StartBit, EndBit, AndData);
}
@@ -659,7 +656,7 @@ BitFieldAndThenOr32 (
IN UINT32 OrData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 32);
ASSERT (StartBit <= EndBit);
return BitFieldOr32 (
BitFieldAnd32 (Operand, StartBit, EndBit, AndData),
@@ -696,7 +693,7 @@ BitFieldRead64 (
IN UINTN EndBit
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 64);
ASSERT (StartBit <= EndBit);
return RShiftU64 (Operand & ~LShiftU64 ((UINT64)-2, EndBit), StartBit);
}
@@ -732,7 +729,7 @@ BitFieldWrite64 (
IN UINT64 Value
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 64);
ASSERT (StartBit <= EndBit);
return BitFieldAndThenOr64 (Operand, StartBit, EndBit, 0, Value);
}
@@ -772,7 +769,7 @@ BitFieldOr64 (
UINT64 Value1;
UINT64 Value2;
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 64);
ASSERT (StartBit <= EndBit);
Value1 = LShiftU64 (OrData, StartBit);
@@ -816,7 +813,7 @@ BitFieldAnd64 (
UINT64 Value1;
UINT64 Value2;
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 64);
ASSERT (StartBit <= EndBit);
Value1 = LShiftU64 (~AndData, StartBit);
@@ -860,7 +857,7 @@ BitFieldAndThenOr64 (
IN UINT64 OrData
)
{
- ASSERT (EndBit < sizeof (Operand) * 8);
+ ASSERT (EndBit < 64);
ASSERT (StartBit <= EndBit);
return BitFieldOr64 (
BitFieldAnd64 (Operand, StartBit, EndBit, AndData),
diff --git a/MdePkg/Library/BaseLib/Ipf/Unaligned.c b/MdePkg/Library/BaseLib/Ipf/Unaligned.c
index ee6c94253e..772d2f43ef 100644
--- a/MdePkg/Library/BaseLib/Ipf/Unaligned.c
+++ b/MdePkg/Library/BaseLib/Ipf/Unaligned.c
@@ -1,7 +1,7 @@
/** @file
Unaligned access functions of BaseLib for IPF.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,7 +12,6 @@
**/
-
#include <BaseLibInternals.h>
/**
@@ -25,13 +24,13 @@
@param Buffer Pointer to a 16-bit value that may be unaligned.
- @return *Uint16
+ @return The 16-bit value read from Buffer.
**/
UINT16
EFIAPI
ReadUnaligned16 (
- IN CONST UINT16 *Buffer
+ IN CONST UINT16 *Buffer
)
{
ASSERT (Buffer != NULL);
@@ -51,14 +50,14 @@ ReadUnaligned16 (
@param Buffer Pointer to a 16-bit value that may be unaligned.
@param Value 16-bit value to write to Buffer.
- @return Value
+ @return The 16-bit value to write to Buffer.
**/
UINT16
EFIAPI
WriteUnaligned16 (
- OUT UINT16 *Buffer,
- IN UINT16 Value
+ OUT UINT16 *Buffer,
+ IN UINT16 Value
)
{
ASSERT (Buffer != NULL);
@@ -79,13 +78,13 @@ WriteUnaligned16 (
@param Buffer Pointer to a 24-bit value that may be unaligned.
- @return The value read.
+ @return The 24-bit value read from Buffer.
**/
UINT32
EFIAPI
ReadUnaligned24 (
- IN CONST UINT32 *Buffer
+ IN CONST UINT32 *Buffer
)
{
ASSERT (Buffer != NULL);
@@ -108,14 +107,14 @@ ReadUnaligned24 (
@param Buffer Pointer to a 24-bit value that may be unaligned.
@param Value 24-bit value to write to Buffer.
- @return The value written.
+ @return The 24-bit value to write to Buffer.
**/
UINT32
EFIAPI
WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
+ OUT UINT32 *Buffer,
+ IN UINT32 Value
)
{
ASSERT (Buffer != NULL);
@@ -135,13 +134,13 @@ WriteUnaligned24 (
@param Buffer Pointer to a 32-bit value that may be unaligned.
- @return *Uint32
+ @return The 32-bit value read from Buffer.
**/
UINT32
EFIAPI
ReadUnaligned32 (
- IN CONST UINT32 *Buffer
+ IN CONST UINT32 *Buffer
)
{
UINT16 LowerBytes;
@@ -167,14 +166,14 @@ ReadUnaligned32 (
@param Buffer Pointer to a 32-bit value that may be unaligned.
@param Value 32-bit value to write to Buffer.
- @return Value
+ @return The 32-bit value to write to Buffer.
**/
UINT32
EFIAPI
WriteUnaligned32 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
+ OUT UINT32 *Buffer,
+ IN UINT32 Value
)
{
ASSERT (Buffer != NULL);
@@ -194,13 +193,13 @@ WriteUnaligned32 (
@param Buffer Pointer to a 64-bit value that may be unaligned.
- @return *Uint64
+ @return The 64-bit value read from Buffer.
**/
UINT64
EFIAPI
ReadUnaligned64 (
- IN CONST UINT64 *Buffer
+ IN CONST UINT64 *Buffer
)
{
UINT32 LowerBytes;
@@ -226,14 +225,14 @@ ReadUnaligned64 (
@param Buffer Pointer to a 64-bit value that may be unaligned.
@param Value 64-bit value to write to Buffer.
- @return Value
+ @return The 64-bit value to write to Buffer.
**/
UINT64
EFIAPI
WriteUnaligned64 (
- OUT UINT64 *Buffer,
- IN UINT64 Value
+ OUT UINT64 *Buffer,
+ IN UINT64 Value
)
{
ASSERT (Buffer != NULL);
diff --git a/MdePkg/Library/BaseLib/LRotU32.c b/MdePkg/Library/BaseLib/LRotU32.c
index 5bee9627a9..4c709770b2 100644
--- a/MdePkg/Library/BaseLib/LRotU32.c
+++ b/MdePkg/Library/BaseLib/LRotU32.c
@@ -1,7 +1,7 @@
/** @file
Math worker functions.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,9 +12,6 @@
**/
-
-
-
#include "BaseLibInternals.h"
/**
@@ -40,6 +37,6 @@ LRotU32 (
IN UINTN Count
)
{
- ASSERT (Count < sizeof (Operand) * 8);
+ ASSERT (Count < 32);
return (Operand << Count) | (Operand >> (32 - Count));
}
diff --git a/MdePkg/Library/BaseLib/LRotU64.c b/MdePkg/Library/BaseLib/LRotU64.c
index 85d732fb25..441b8f76e7 100644
--- a/MdePkg/Library/BaseLib/LRotU64.c
+++ b/MdePkg/Library/BaseLib/LRotU64.c
@@ -1,7 +1,7 @@
/** @file
Math worker functions.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,9 +12,6 @@
**/
-
-
-
#include "BaseLibInternals.h"
/**
@@ -40,6 +37,6 @@ LRotU64 (
IN UINTN Count
)
{
- ASSERT (Count < sizeof (Operand) * 8);
+ ASSERT (Count < 64);
return InternalMathLRotU64 (Operand, Count);
}
diff --git a/MdePkg/Library/BaseLib/LShiftU64.c b/MdePkg/Library/BaseLib/LShiftU64.c
index 110e93c78e..b8eb3c96dd 100644
--- a/MdePkg/Library/BaseLib/LShiftU64.c
+++ b/MdePkg/Library/BaseLib/LShiftU64.c
@@ -1,7 +1,7 @@
/** @file
Math worker functions.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,9 +12,6 @@
**/
-
-
-
#include "BaseLibInternals.h"
/**
@@ -39,6 +36,6 @@ LShiftU64 (
IN UINTN Count
)
{
- ASSERT (Count < sizeof (Operand) * 8);
+ ASSERT (Count < 64);
return InternalMathLShiftU64 (Operand, Count);
}
diff --git a/MdePkg/Library/BaseLib/RRotU32.c b/MdePkg/Library/BaseLib/RRotU32.c
index b90ae7f424..63f9ce6e6a 100644
--- a/MdePkg/Library/BaseLib/RRotU32.c
+++ b/MdePkg/Library/BaseLib/RRotU32.c
@@ -1,7 +1,7 @@
/** @file
Math worker functions.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,9 +12,6 @@
**/
-
-
-
#include "BaseLibInternals.h"
/**
@@ -40,6 +37,6 @@ RRotU32 (
IN UINTN Count
)
{
- ASSERT (Count < sizeof (Operand) * 8);
+ ASSERT (Count < 32);
return (Operand >> Count) | (Operand << (32 - Count));
}
diff --git a/MdePkg/Library/BaseLib/RRotU64.c b/MdePkg/Library/BaseLib/RRotU64.c
index 2b96cb9af0..abce4f72e3 100644
--- a/MdePkg/Library/BaseLib/RRotU64.c
+++ b/MdePkg/Library/BaseLib/RRotU64.c
@@ -1,7 +1,7 @@
/** @file
Math worker functions.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,9 +12,6 @@
**/
-
-
-
#include "BaseLibInternals.h"
/**
@@ -40,6 +37,6 @@ RRotU64 (
IN UINTN Count
)
{
- ASSERT (Count < sizeof (Operand) * 8);
+ ASSERT (Count < 64);
return InternalMathRRotU64 (Operand, Count);
}
diff --git a/MdePkg/Library/BaseLib/RShiftU64.c b/MdePkg/Library/BaseLib/RShiftU64.c
index 3cd25de6d4..bf6251ae26 100644
--- a/MdePkg/Library/BaseLib/RShiftU64.c
+++ b/MdePkg/Library/BaseLib/RShiftU64.c
@@ -1,7 +1,7 @@
/** @file
Math worker functions.
- Copyright (c) 2006, Intel Corporation<BR>
+ Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. 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
@@ -12,9 +12,6 @@
**/
-
-
-
#include "BaseLibInternals.h"
/**
@@ -39,6 +36,6 @@ RShiftU64 (
IN UINTN Count
)
{
- ASSERT (Count < sizeof (Operand) * 8);
+ ASSERT (Count < 64);
return InternalMathRShiftU64 (Operand, Count);
}
diff --git a/MdePkg/Library/BaseLib/Unaligned.c b/MdePkg/Library/BaseLib/Unaligned.c
index 86e00c2546..acb44fc5aa 100644
--- a/MdePkg/Library/BaseLib/Unaligned.c
+++ b/MdePkg/Library/BaseLib/Unaligned.c
@@ -1,7 +1,7 @@
/** @file
Unaligned access functions of BaseLib.
- Copyright (c) 2006, Intel Corporation
+ Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. 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
@@ -26,13 +26,13 @@
@param Buffer Pointer to a 16-bit value that may be unaligned.
- @return Data read from Buffer.
+ @return The 16-bit value read from Buffer.
**/
UINT16
EFIAPI
ReadUnaligned16 (
- IN CONST UINT16 *Buffer
+ IN CONST UINT16 *Buffer
)
{
ASSERT (Buffer != NULL);
@@ -52,14 +52,14 @@ ReadUnaligned16 (
@param Buffer Pointer to a 16-bit value that may be unaligned.
@param Value 16-bit value to write to Buffer.
- @return Value written to Buffer
+ @return The 16-bit value to write to Buffer.
**/
UINT16
EFIAPI
WriteUnaligned16 (
- OUT UINT16 *Buffer,
- IN UINT16 Value
+ OUT UINT16 *Buffer,
+ IN UINT16 Value
)
{
ASSERT (Buffer != NULL);
@@ -77,13 +77,13 @@ WriteUnaligned16 (
@param Buffer Pointer to a 24-bit value that may be unaligned.
- @return The value read from Buffer.
+ @return The 24-bit value read from Buffer.
**/
UINT32
EFIAPI
ReadUnaligned24 (
- IN CONST UINT32 *Buffer
+ IN CONST UINT32 *Buffer
)
{
ASSERT (Buffer != NULL);
@@ -103,14 +103,14 @@ ReadUnaligned24 (
@param Buffer Pointer to a 24-bit value that may be unaligned.
@param Value 24-bit value to write to Buffer.
- @return The value written to Buffer.
+ @return The 24-bit value to write to Buffer.
**/
UINT32
EFIAPI
WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
+ OUT UINT32 *Buffer,
+ IN UINT32 Value
)
{
ASSERT (Buffer != NULL);
@@ -129,13 +129,13 @@ WriteUnaligned24 (
@param Buffer Pointer to a 32-bit value that may be unaligned.
- @return Data read from Buffer.
+ @return The 32-bit value read from Buffer.
**/
UINT32
EFIAPI
ReadUnaligned32 (
- IN CONST UINT32 *Buffer
+ IN CONST UINT32 *Buffer
)
{
ASSERT (Buffer != NULL);
@@ -155,14 +155,14 @@ ReadUnaligned32 (
@param Buffer Pointer to a 32-bit value that may be unaligned.
@param Value 32-bit value to write to Buffer.
- @return Value written to Buffer
+ @return The 32-bit value to write to Buffer.
**/
UINT32
EFIAPI
WriteUnaligned32 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
+ OUT UINT32 *Buffer,
+ IN UINT32 Value
)
{
ASSERT (Buffer != NULL);
@@ -180,13 +180,13 @@ WriteUnaligned32 (
@param Buffer Pointer to a 64-bit value that may be unaligned.
- @return Data read from Buffer.
+ @return The 64-bit value read from Buffer.
**/
UINT64
EFIAPI
ReadUnaligned64 (
- IN CONST UINT64 *Buffer
+ IN CONST UINT64 *Buffer
)
{
ASSERT (Buffer != NULL);
@@ -206,14 +206,14 @@ ReadUnaligned64 (
@param Buffer Pointer to a 64-bit value that may be unaligned.
@param Value 64-bit value to write to Buffer.
- @return Value written to Buffer.
+ @return The 64-bit value to write to Buffer.
**/
UINT64
EFIAPI
WriteUnaligned64 (
- OUT UINT64 *Buffer,
- IN UINT64 Value
+ OUT UINT64 *Buffer,
+ IN UINT64 Value
)
{
ASSERT (Buffer != NULL);