Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / include / asm-sparc64 / timer.h
blob4aa85bedef9c1a04651718c35f62da9170255f1d
1 /* $Id: timer.h,v 1.3 2000/05/09 17:40:15 davem Exp $
2 * timer.h: System timer definitions for sun5.
4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
5 */
7 #ifndef _SPARC64_TIMER_H
8 #define _SPARC64_TIMER_H
10 /* How timers work:
12 * On uniprocessors we just use counter zero for the system wide
13 * ticker, this performs thread scheduling, clock book keeping,
14 * and runs timer based events. Previously we used the Ultra
15 * %tick interrupt for this purpose.
17 * On multiprocessors we pick one cpu as the master level 10 tick
18 * processor. Here this counter zero tick handles clock book
19 * keeping and timer events only. Each Ultra has it's level
20 * 14 %tick interrupt set to fire off as well, even the master
21 * tick cpu runs this locally. This ticker performs thread
22 * scheduling, system/user tick counting for the current thread,
23 * and also profiling if enabled.
26 #include <linux/config.h>
28 /* Two timers, traditionally steered to PIL's 10 and 14 respectively.
29 * But since INO packets are used on sun5, we could use any PIL level
30 * we like, however for now we use the normal ones.
32 * The 'reg' and 'interrupts' properties for these live in nodes named
33 * 'counter-timer'. The first of three 'reg' properties describe where
34 * the sun5_timer registers are. The other two I have no idea. (XXX)
36 struct sun5_timer {
37 u64 count0;
38 u64 limit0;
39 u64 count1;
40 u64 limit1;
43 #define SUN5_LIMIT_ENABLE 0x80000000
44 #define SUN5_LIMIT_TOZERO 0x40000000
45 #define SUN5_LIMIT_ZRESTART 0x20000000
46 #define SUN5_LIMIT_CMASK 0x1fffffff
48 /* Given a HZ value, set the limit register to so that the timer IRQ
49 * gets delivered that often.
51 #define SUN5_HZ_TO_LIMIT(__hz) (1000000/(__hz))
53 #ifdef CONFIG_SMP
54 extern unsigned long timer_tick_offset;
55 extern void timer_tick_interrupt(struct pt_regs *);
56 #endif
58 #endif /* _SPARC64_TIMER_H */