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
This commit is contained in:
vanjeff 2008-09-24 05:30:40 +00:00
parent dfb8993c3c
commit 5385a57969
11 changed files with 104 additions and 129 deletions

View File

@ -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,16 +2213,16 @@ 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,
OUT UINT16 *Buffer,
IN UINT16 Value
);
@ -2237,7 +2237,7 @@ 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
@ -2259,7 +2259,7 @@ 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
@ -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,16 +2299,16 @@ 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,
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,16 +2342,16 @@ 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,
OUT UINT64 *Buffer,
IN UINT64 Value
);

View File

@ -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);
}

View File

@ -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),

View File

@ -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,7 +24,7 @@
@param Buffer Pointer to a 16-bit value that may be unaligned.
@return *Uint16
@return The 16-bit value read from Buffer.
**/
UINT16
@ -51,7 +50,7 @@ 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
@ -79,7 +78,7 @@ 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
@ -108,7 +107,7 @@ 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
@ -135,7 +134,7 @@ WriteUnaligned24 (
@param Buffer Pointer to a 32-bit value that may be unaligned.
@return *Uint32
@return The 32-bit value read from Buffer.
**/
UINT32
@ -167,7 +166,7 @@ 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
@ -194,7 +193,7 @@ WriteUnaligned32 (
@param Buffer Pointer to a 64-bit value that may be unaligned.
@return *Uint64
@return The 64-bit value read from Buffer.
**/
UINT64
@ -226,7 +225,7 @@ 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

View File

@ -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));
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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));
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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,7 +26,7 @@
@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
@ -52,7 +52,7 @@ 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
@ -77,7 +77,7 @@ 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
@ -103,7 +103,7 @@ 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
@ -129,7 +129,7 @@ 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
@ -155,7 +155,7 @@ 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
@ -180,7 +180,7 @@ 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
@ -206,7 +206,7 @@ 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