xref: /freebsd/sys/x86/include/clock.h (revision f06f1d1fdb969fa7a0a6eefa030d8536f365eb6e)
1*f06f1d1fSMark Johnston /*-
2*f06f1d1fSMark Johnston  * Kernel interface to machine-dependent clock driver.
3*f06f1d1fSMark Johnston  * Garrett Wollman, September 1994.
4*f06f1d1fSMark Johnston  * This file is in the public domain.
5*f06f1d1fSMark Johnston  *
6*f06f1d1fSMark Johnston  * $FreeBSD$
7*f06f1d1fSMark Johnston  */
8*f06f1d1fSMark Johnston 
9*f06f1d1fSMark Johnston #ifndef _MACHINE_CLOCK_H_
10*f06f1d1fSMark Johnston #define	_MACHINE_CLOCK_H_
11*f06f1d1fSMark Johnston 
12*f06f1d1fSMark Johnston #ifdef _KERNEL
13*f06f1d1fSMark Johnston /*
14*f06f1d1fSMark Johnston  * i386 to clock driver interface.
15*f06f1d1fSMark Johnston  * XXX large parts of the driver and its interface are misplaced.
16*f06f1d1fSMark Johnston  */
17*f06f1d1fSMark Johnston extern int	clkintr_pending;
18*f06f1d1fSMark Johnston extern u_int	i8254_freq;
19*f06f1d1fSMark Johnston extern int	i8254_max_count;
20*f06f1d1fSMark Johnston extern uint64_t	tsc_freq;
21*f06f1d1fSMark Johnston extern int	tsc_is_invariant;
22*f06f1d1fSMark Johnston extern int	tsc_perf_stat;
23*f06f1d1fSMark Johnston #ifdef SMP
24*f06f1d1fSMark Johnston extern int	smp_tsc;
25*f06f1d1fSMark Johnston #endif
26*f06f1d1fSMark Johnston 
27*f06f1d1fSMark Johnston void	i8254_init(void);
28*f06f1d1fSMark Johnston void	i8254_delay(int);
29*f06f1d1fSMark Johnston void	clock_init(void);
30*f06f1d1fSMark Johnston 
31*f06f1d1fSMark Johnston /*
32*f06f1d1fSMark Johnston  * Driver to clock driver interface.
33*f06f1d1fSMark Johnston  */
34*f06f1d1fSMark Johnston 
35*f06f1d1fSMark Johnston void	startrtclock(void);
36*f06f1d1fSMark Johnston void	init_TSC(void);
37*f06f1d1fSMark Johnston void	resume_TSC(void);
38*f06f1d1fSMark Johnston 
39*f06f1d1fSMark Johnston #define	HAS_TIMER_SPKR 1
40*f06f1d1fSMark Johnston int	timer_spkr_acquire(void);
41*f06f1d1fSMark Johnston int	timer_spkr_release(void);
42*f06f1d1fSMark Johnston void	timer_spkr_setfreq(int freq);
43*f06f1d1fSMark Johnston 
44*f06f1d1fSMark Johnston #endif /* _KERNEL */
45*f06f1d1fSMark Johnston 
46*f06f1d1fSMark Johnston #endif /* !_MACHINE_CLOCK_H_ */
47