#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
+ 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
+ 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
+ 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
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
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
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
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
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
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