Definition at line 123 of file krnlinit.c.
Referenced by KiInitializeKernel().
{
LARGE_INTEGER Reciprocal = {{0, 0}};
LONG BitCount = 0, Remainder = 1;
while (Reciprocal.HighPart >= 0)
{
BitCount++;
Reciprocal.HighPart = (Reciprocal.HighPart << 1) |
(Reciprocal.LowPart >> 31);
Reciprocal.LowPart <<= 1;
Remainder <<= 1;
if (Remainder >= Divisor)
{
Remainder -= Divisor;
Reciprocal.LowPart |= 1;
}
}
if (Remainder)
{
if ((Reciprocal.LowPart == 0xFFFFFFFF) &&
(Reciprocal.HighPart == (LONG)0xFFFFFFFF))
{
Reciprocal.LowPart = 0;
Reciprocal.HighPart = 0x80000000;
BitCount--;
}
else
{
if (Reciprocal.LowPart == 0xFFFFFFFF)
{
Reciprocal.LowPart = 0;
Reciprocal.HighPart++;
}
else
{
Reciprocal.LowPart++;
}
}
}
*Shift = (UCHAR)BitCount - 64;
return Reciprocal;
}