2 * Kernel interface to machine-dependent clock driver.
3 * Garrett Wollman, September 1994.
4 * This file is in the public domain.
6 * $FreeBSD: src/sys/i386/include/clock.h,v 1.38.2.1 2002/11/02 04:41:50 iwasaki Exp $
7 * $DragonFly: src/sys/platform/pc32/include/clock.h,v 1.9 2008/05/10 17:24:08 dillon Exp $
10 #ifndef _MACHINE_CLOCK_H_
11 #define _MACHINE_CLOCK_H_
16 #include <sys/types.h>
18 #ifndef _SYS_SYSTIMER_H_
19 #include <sys/systimer.h>
22 typedef struct TOTALDELAY
{
25 sysclock_t last_clock
;
28 typedef uint64_t tsc_uclock_t
;
29 typedef int64_t tsc_sclock_t
;
32 * i386 to clock driver interface.
33 * XXX large parts of the driver and its interface are misplaced.
36 extern int disable_rtc_set
;
37 extern u_int timer_freq
;
38 extern int timer0_max_count
;
39 extern int tsc_present
;
40 extern int tsc_invariant
;
41 extern int tsc_mpsync
;
42 extern int tsc_is_broken
;
43 extern int wall_cmos_clock
;
44 extern tsc_uclock_t tsc_frequency
;
45 extern tsc_uclock_t tsc_oneus_approx
; /* do not use for fine calc, min 1 */
48 * Driver to clock driver interface.
51 int CHECKTIMEOUT(TOTALDELAY
*);
53 int acquire_timer2 (int mode
);
54 int release_timer2 (void);
55 int sysbeep (int pitch
, int period
);
56 void timer_restore (void);
60 #endif /* !_MACHINE_CLOCK_H_ */