diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-07-20 13:06:35 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-07-20 19:30:01 -0400 |
commit | b7ab1784acf11b1ebf63b6dd40d45c2bbf745ef7 (patch) | |
tree | daa4eecaa4596ec46c410c61e929b4069c231a82 /src/pirtable.c | |
parent | 69013378972c07c9a1e46fa6ec274070cad1a532 (diff) | |
download | seabios-hppa-b7ab1784acf11b1ebf63b6dd40d45c2bbf745ef7.zip seabios-hppa-b7ab1784acf11b1ebf63b6dd40d45c2bbf745ef7.tar.gz seabios-hppa-b7ab1784acf11b1ebf63b6dd40d45c2bbf745ef7.tar.bz2 |
Improve accuracy of internal timers.
The TICKS_PER_DAY setting is a bios standard and needs to be 1573040
for compatibility. However, there are actually ~1573042.24 ticks in a
day. So, only use TICKS_PER_DAY when working with the BDA
timer_counter - not when calculating any internal times.
The PIT hz is actually 143181800 / 12 (~1193181.667). This can be
accurately encoded as PMTIMER hz / 3. Because the PIT hz is usually
multiplied and divided by other numbers, we can use the PMTIMER hz and
defer the division by 3 to improve accuracy.
When doing division for delay time calculations, always round up the
division so the delay is never less than the requested time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/pirtable.c')
0 files changed, 0 insertions, 0 deletions