Commit 2e62352b authored by Vladimir Serbinenko's avatar Vladimir Serbinenko
Browse files

* grub-core/kern/i386/tsc.c (calibrate_tsc): Ensure that

	no division by 0 occurs.
parent e360b5d1
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/i386/tsc.c (calibrate_tsc): Ensure that
no division by 0 occurs.
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
 
* include/grub/misc.h (grub_div_roundup): Remove as it's unused.
......@@ -122,7 +122,11 @@ calibrate_tsc (void)
grub_pit_wait (0xffff);
end_tsc = grub_get_tsc ();
grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0);
grub_tsc_rate = 0;
if (end_tsc > tsc_boot_time)
grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0);
if (grub_tsc_rate == 0)
grub_tsc_rate = 5368;/* 800 MHz */
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment