/* Round up a positive 64-bit value to the next whole power of two, and return the bit position of the highest bit set in the result. Equivalent to ceil(log2(x)). */
STATIC INTN HighBitSetRoundUp64(IN UINT64 Operand)
/* Round up a positive 64-bit value to the next whole power of two, and return the bit position of the highest bit set in the result. Equivalent to ceil(log2(x)). */
STATIC INTN HighBitSetRoundUp64(IN UINT64 Operand)
{
  INTN  HighBit;
  HighBit = HighBitSet64 (Operand);
  if (HighBit == -1) {
    return HighBit;
  }
  if ((Operand & (Operand - 1)) != 0) {
    ++HighBit;
  }
  return (HighBit < 64) ? HighBit : -1;
}