diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-12-01 17:57:09 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-12-01 17:57:09 +0000 |
commit | a62a0f262e0179df8c632f529c95abf54ef78332 (patch) | |
tree | 80e6a7a7d407d08e218332bb3fcccdaf9f28fcc1 /include/asm-sparc64 | |
parent | fd095d09f2d475dc2e8599b1b8bae1cd65e91685 (diff) |
Part #2 merging back my changes ...
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/timer.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h new file mode 100644 index 000000000..f630762f4 --- /dev/null +++ b/include/asm-sparc64/timer.h @@ -0,0 +1,51 @@ +/* $Id: timer.h,v 1.1 1997/08/05 09:44:55 ralf Exp $ + * timer.h: System timer definitions for sun5. + * + * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) + */ + +#ifndef _SPARC64_TIMER_H +#define _SPARC64_TIMER_H + +/* How timers work: + * + * On uniprocessors we just use counter zero for the system wide + * ticker, this performs thread scheduling, clock book keeping, + * and runs timer based events. Previously we used the Ultra + * %tick interrupt for this purpose. + * + * On multiprocessors we pick one cpu as the master level 10 tick + * processor. Here this counter zero tick handles clock book + * keeping and timer events only. Each Ultra has it's level + * 14 %tick interrupt set to fire off as well, even the master + * tick cpu runs this locally. This ticker performs thread + * scheduling, system/user tick counting for the current thread, + * and also profiling if enabled. + */ + +/* Two timers, traditionally steered to PIL's 10 and 14 respectively. + * But since INO packets are used on sun5, we could use any PIL level + * we like, however for now we use the normal ones. + * + * The 'reg' and 'interrupts' properties for these live in nodes named + * 'counter-timer'. The first of three 'reg' properties describe where + * the sun5_timer registers are. The other two I have no idea. (XXX) + */ +struct sun5_timer { + u64 count0; + u64 limit0; + u64 count1; + u64 limit1; +}; + +#define SUN5_LIMIT_ENABLE 0x80000000 +#define SUN5_LIMIT_TOZERO 0x40000000 +#define SUN5_LIMIT_ZRESTART 0x20000000 +#define SUN5_LIMIT_CMASK 0x1fffffff + +/* Given a HZ value, set the limit register to so that the timer IRQ + * gets delivered that often. + */ +#define SUN5_HZ_TO_LIMIT(__hz) (1000000/(__hz)) + +#endif /* _SPARC64_TIMER_H */ |