use safe division for uint64

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2019-09-17 15:34:16 +03:00
parent ae995a5c76
commit 6fcdc801e2

View File

@ -399,8 +399,8 @@ VOID GetCPUProperties (VOID)
if (Num && Denom) {
gCPUStructure.ARTFrequency = DivU64x32(MultU64x32(gCPUStructure.TSCCalibr, Denom), Num);
DBG(" Calibrated ARTFrequency: %lld\n", gCPUStructure.ARTFrequency);
UINT64 Stokg = (gCPUStructure.ARTFrequency + 99999) / 100000;
gCPUStructure.ARTFrequency = Stokg * 100000;
UINT64 Stokg = DivU64x32(gCPUStructure.ARTFrequency + 99999, 100000);
gCPUStructure.ARTFrequency = MultU64x32(Stokg, 100000);
DBG(" Rounded ARTFrequency: %lld\n", gCPUStructure.ARTFrequency);
}
}