ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-i386 / mach-pc9800 / mach_timer.h
1 /*
2  *  include/asm-i386/mach-pc9800/mach_timer.h
3  *
4  *  Machine specific calibrate_tsc() for PC-9800.
5  *  Written by Osamu Tomita <tomita@cinet.co.jp>
6  */
7 /* ------ Calibrate the TSC ------- 
8  * PC-9800:
9  *  CTC cannot be used because some models (especially
10  *  note-machines) may disable clock to speaker channel (#1)
11  *  unless speaker is enabled.  We use ARTIC instead.
12  */
13 #ifndef _MACH_TIMER_H
14 #define _MACH_TIMER_H
15
16 #define CALIBRATE_LATCH (5 * 307200/HZ) /* 0.050sec * 307200Hz = 15360 */
17
18 static inline void mach_prepare_counter(void)
19 {
20         /* ARTIC can't be stopped nor reset. So we wait roundup. */
21         while (inw(0x5c));
22 }
23
24 static inline void mach_countup(unsigned long *count)
25 {
26         do {
27                 *count = inw(0x5c);
28         } while (*count < CALIBRATE_LATCH);
29 }
30
31 #endif /* !_MACH_TIMER_H */