1178172Simp/*
2178172Simp * Garrett Wollman, September 1994.
3178172Simp * This file is in the public domain.
4178172Simp * Kernel interface to machine-dependent clock driver.
5178172Simp *
6178172Simp *	JNPR: clock.h,v 1.6.2.1 2007/08/29 09:36:05 girish
7178172Simp *	from: src/sys/alpha/include/clock.h,v 1.5 1999/12/29 04:27:55 peter
8178172Simp * $FreeBSD: releng/10.3/sys/mips/include/clock.h 210100 2010-07-15 01:58:20Z imp $
9178172Simp */
10178172Simp
11178172Simp#ifndef _MACHINE_CLOCK_H_
12178172Simp#define	_MACHINE_CLOCK_H_
13178172Simp
14178172Simp#include <sys/bus.h>
15178172Simp
16178172Simp#ifdef _KERNEL
17178172Simp
18178172Simpextern int cpu_clock;
19178172Simp
20210100Simpextern uint32_t clockintr(uint32_t, struct trapframe *);
21178172Simp
22178172Simp#define wall_cmos_clock 0
23178172Simp#define adjkerntz 0
24178172Simp
25178172Simp/*
26178172Simp * Default is to assume a CPU pipeline clock of 100Mhz, and
27178172Simp * that CP0_COUNT increments every 2 cycles.
28178172Simp */
29178172Simp#define MIPS_DEFAULT_HZ		(100 * 1000 * 1000)
30178172Simp
31178172Simpvoid	mips_timer_early_init(uint64_t clock_hz);
32178172Simpvoid	mips_timer_init_params(uint64_t, int);
33178172Simp
34178172Simpextern uint64_t	counter_freq;
35178172Simpextern int	clocks_running;
36178172Simp
37205364Sneel/*
38205364Sneel * The 'platform_timecounter' pointer may be used to register a
39205364Sneel * platform-specific timecounter.
40205364Sneel *
41205364Sneel * A default timecounter based on the CP0 COUNT register is always registered.
42205364Sneel */
43205364Sneelextern struct timecounter *platform_timecounter;
44205364Sneel
45178172Simp#endif
46178172Simp
47178172Simp#endif /* !_MACHINE_CLOCK_H_ */
48