\r
**/\r
\r
+/**\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
+ @param Operand Operand on which to perform the bitfield operation.\r
+ @param StartBit The ordinal of the least significant bit in the bit field.\r
+ @param EndBit The ordinal of the most significant bit in the bit field.\r
+\r
+ @return The bit field read.\r
+\r
+**/\r
unsigned int\r
-EFIAPI\r
BitFieldReadUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
return (Operand & ~((unsigned int)-2 << EndBit)) >> StartBit;\r
}\r
\r
+/**\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
+ in Operand and the value specified by AndData. All other bits in Operand are\r
+ preserved. The new value is returned.\r
+\r
+ @param Operand Operand on which to perform the bitfield operation.\r
+ @param StartBit The ordinal of the least significant bit in the bit field.\r
+ @param EndBit The ordinal of the most significant bit in the bit field.\r
+ @param OrData The value to OR with the read value from the value\r
+\r
+ @return The new value.\r
+\r
+**/\r
unsigned int\r
-EFIAPI\r
BitFieldOrUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
// ~((unsigned int)-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) & ~((unsigned int) -2 << EndBit));\r
}\r
\r
+/**\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
+ in Operand and the value specified by AndData. All other bits in Operand are\r
+ preserved. The new value is returned.\r
+\r
+ @param Operand Operand on which to perform the bitfield operation.\r
+ @param StartBit The ordinal of the least significant bit in the bit field.\r
+ @param EndBit The ordinal of the most significant bit in the bit field.\r
+ @param AndData The value to And with the read value from the value\r
+\r
+ @return The new value.\r
+\r
+**/\r
unsigned int\r
-EFIAPI\r
BitFieldAndUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
// ~((unsigned int)-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) & ~((unsigned int) -2 << EndBit));\r
}\r
\r
/**\r