#include "BaseLibInternals.h"\r
\r
/**\r
- Worker function that returns a bit field from Operand\r
+ Worker function that returns a bit field from Operand.\r
\r
Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
\r
@return The bit field read.\r
\r
**/\r
-unsigned int\r
+UINTN\r
EFIAPI\r
-BitFieldReadUint (\r
- IN unsigned int Operand,\r
+InternalBaseLibBitFieldReadUint (\r
+ IN UINTN Operand,\r
IN UINTN StartBit,\r
IN UINTN EndBit\r
)\r
{\r
//\r
- // ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
+ // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
// are 1's while bit[EndBit + 1] thru the most significant bit are 0's.\r
//\r
- return (Operand & ~((unsigned int)-2 << EndBit)) >> StartBit;\r
+ return (Operand & ~((UINTN)-2 << EndBit)) >> StartBit;\r
}\r
\r
/**\r
- Worker function that reads a bit field from Operand, performs a bitwise OR, \r
+ Worker function that reads a bit field from Operand, performs a bitwise OR,\r
and returns the result.\r
\r
Performs a bitwise OR between the bit field specified by StartBit and EndBit\r
@return The new value.\r
\r
**/\r
-unsigned int\r
+UINTN\r
EFIAPI\r
-BitFieldOrUint (\r
- IN unsigned int Operand,\r
+InternalBaseLibBitFieldOrUint (\r
+ IN UINTN Operand,\r
IN UINTN StartBit,\r
IN UINTN EndBit,\r
- IN unsigned int OrData\r
+ IN UINTN OrData\r
)\r
{\r
//\r
- // ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
+ // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
// are 1's while bit[EndBit + 1] thru the most significant bit are 0's.\r
//\r
- return Operand | ((OrData << StartBit) & ~((unsigned int) -2 << EndBit));\r
+ return Operand | ((OrData << StartBit) & ~((UINTN) -2 << EndBit));\r
}\r
\r
/**\r
- Worker function that reads a bit field from Operand, performs a bitwise AND, \r
+ Worker function that reads a bit field from Operand, performs a bitwise AND,\r
and returns the result.\r
\r
Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
@return The new value.\r
\r
**/\r
-unsigned int\r
+UINTN\r
EFIAPI\r
-BitFieldAndUint (\r
- IN unsigned int Operand,\r
+InternalBaseLibBitFieldAndUint (\r
+ IN UINTN Operand,\r
IN UINTN StartBit,\r
IN UINTN EndBit,\r
- IN unsigned int AndData\r
+ IN UINTN AndData\r
)\r
{\r
//\r
- // ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
+ // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
// are 1's while bit[EndBit + 1] thru the most significant bit are 0's.\r
//\r
- return Operand & ~((~AndData << StartBit) & ~((unsigned int) -2 << EndBit));\r
+ return Operand & ~((~AndData << StartBit) & ~((UINTN)-2 << EndBit));\r
}\r
\r
/**\r
{\r
ASSERT (EndBit < 8);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT8)BitFieldReadUint (Operand, StartBit, EndBit);\r
+ return (UINT8)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);\r
}\r
\r
/**\r
Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the\r
result.\r
\r
- Performs a bitwise inclusive OR between the bit field specified by StartBit\r
+ Performs a bitwise OR between the bit field specified by StartBit\r
and EndBit in Operand and the value specified by OrData. All other bits in\r
Operand are preserved. The new 8-bit value is returned.\r
\r
{\r
ASSERT (EndBit < 8);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT8)BitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
+ return (UINT8)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
}\r
\r
/**\r
{\r
ASSERT (EndBit < 8);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT8)BitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
+ return (UINT8)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
}\r
\r
/**\r
bitwise OR, and returns the result.\r
\r
Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
- in Operand and the value specified by AndData, followed by a bitwise\r
- inclusive OR with value specified by OrData. All other bits in Operand are\r
+ in Operand and the value specified by AndData, followed by a bitwise \r
+ OR with value specified by OrData. All other bits in Operand are\r
preserved. The new 8-bit value is returned.\r
\r
If 8-bit operations are not supported, then ASSERT().\r
{\r
ASSERT (EndBit < 16);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT16)BitFieldReadUint (Operand, StartBit, EndBit);\r
+ return (UINT16)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);\r
}\r
\r
/**\r
Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the\r
result.\r
\r
- Performs a bitwise inclusive OR between the bit field specified by StartBit\r
+ Performs a bitwise OR between the bit field specified by StartBit\r
and EndBit in Operand and the value specified by OrData. All other bits in\r
Operand are preserved. The new 16-bit value is returned.\r
\r
{\r
ASSERT (EndBit < 16);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT16)BitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
+ return (UINT16)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
}\r
\r
/**\r
{\r
ASSERT (EndBit < 16);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT16)BitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
+ return (UINT16)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
}\r
\r
/**\r
bitwise OR, and returns the result.\r
\r
Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
- in Operand and the value specified by AndData, followed by a bitwise\r
- inclusive OR with value specified by OrData. All other bits in Operand are\r
+ in Operand and the value specified by AndData, followed by a bitwise \r
+ OR with value specified by OrData. All other bits in Operand are\r
preserved. The new 16-bit value is returned.\r
\r
If 16-bit operations are not supported, then ASSERT().\r
{\r
ASSERT (EndBit < 32);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT32)BitFieldReadUint (Operand, StartBit, EndBit);\r
+ return (UINT32)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);\r
}\r
\r
/**\r
Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the\r
result.\r
\r
- Performs a bitwise inclusive OR between the bit field specified by StartBit\r
+ Performs a bitwise OR between the bit field specified by StartBit\r
and EndBit in Operand and the value specified by OrData. All other bits in\r
Operand are preserved. The new 32-bit value is returned.\r
\r
{\r
ASSERT (EndBit < 32);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT32)BitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
+ return (UINT32)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
}\r
\r
/**\r
{\r
ASSERT (EndBit < 32);\r
ASSERT (StartBit <= EndBit);\r
- return (UINT32)BitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
+ return (UINT32)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
}\r
\r
/**\r
bitwise OR, and returns the result.\r
\r
Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
- in Operand and the value specified by AndData, followed by a bitwise\r
- inclusive OR with value specified by OrData. All other bits in Operand are\r
+ in Operand and the value specified by AndData, followed by a bitwise \r
+ OR with value specified by OrData. All other bits in Operand are\r
preserved. The new 32-bit value is returned.\r
\r
If 32-bit operations are not supported, then ASSERT().\r
Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the\r
result.\r
\r
- Performs a bitwise inclusive OR between the bit field specified by StartBit\r
+ Performs a bitwise OR between the bit field specified by StartBit\r
and EndBit in Operand and the value specified by OrData. All other bits in\r
Operand are preserved. The new 64-bit value is returned.\r
\r
bitwise OR, and returns the result.\r
\r
Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
- in Operand and the value specified by AndData, followed by a bitwise\r
- inclusive OR with value specified by OrData. All other bits in Operand are\r
+ in Operand and the value specified by AndData, followed by a bitwise \r
+ OR with value specified by OrData. All other bits in Operand are\r
preserved. The new 64-bit value is returned.\r
\r
If 64-bit operations are not supported, then ASSERT().\r