Files
0ad/source/lib/sysdep/win/whrt/pit.h
T
janwas 52ae284a7e new timer code (esp. HPET) now operational. TSC still disabled pending calibration code.
add update mechanism (needed to safely handle counter rollover) and
lock-free synchronization.

refactor:
. Counters now have Activate/Shutdown interface rather than throwing
exceptions from the ctor.
. whrt is responsible for caching frequency/resolution etc.
. fix counterBits handling

This was SVN commit r5105.
2007-05-28 09:25:38 +00:00

26 lines
882 B
C

/**
* =========================================================================
* File : pit.h
* Project : 0 A.D.
* Description : Timer implementation using 82C53/4 PIT
* =========================================================================
*/
// license: GPL; see lib/license.txt
#ifndef INCLUDED_PIT
#define INCLUDED_PIT
// note: we don't access the PIT for two reasons:
// - it rolls over every 55 ms (1.193 MHz, 16 bit) and would have to be
// read at least that often, which would require setting high thread
// priority (dangerous).
// - reading it is slow and cannot be done by two independent users
// (the second being QPC) since the counter value must be latched.
//
// there are enough other counters anway.
static const i64 PIT_FREQ = 1193182; // (= master oscillator frequency/12)
#endif // #ifndef INCLUDED_PIT