clock.h (22975) | clock.h (25164) |
---|---|
1/* 2 * Kernel interface to machine-dependent clock driver. 3 * Garrett Wollman, September 1994. 4 * This file is in the public domain. 5 * | 1/* 2 * Kernel interface to machine-dependent clock driver. 3 * Garrett Wollman, September 1994. 4 * This file is in the public domain. 5 * |
6 * $Id$ | 6 * $Id: clock.h,v 1.24 1997/02/22 09:33:59 peter Exp $ |
7 */ 8 9#ifndef _MACHINE_CLOCK_H_ 10#define _MACHINE_CLOCK_H_ 11 | 7 */ 8 9#ifndef _MACHINE_CLOCK_H_ 10#define _MACHINE_CLOCK_H_ 11 |
12#if defined(I586_CPU) || defined(I686_CPU) | 12#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) |
13#define CPU_CLOCKUPDATE(otime, ntime) cpu_clockupdate((otime), (ntime)) 14#else 15#define CPU_CLOCKUPDATE(otime, ntime) (*(otime) = *(ntime)) 16#endif 17 18#define CPU_THISTICKLEN(dflt) dflt 19 20#define I586_CTR_COMULTIPLIER_SHIFT 20 21#define I586_CTR_MULTIPLIER_SHIFT 32 22 23#ifdef KERNEL 24/* 25 * i386 to clock driver interface. 26 * XXX almost all of it is misplaced. i586 stuff is done in isa/clock.c 27 * and isa stuff is done in i386/microtime.s and i386/support.s. 28 */ 29extern int adjkerntz; 30extern int disable_rtc_set; | 13#define CPU_CLOCKUPDATE(otime, ntime) cpu_clockupdate((otime), (ntime)) 14#else 15#define CPU_CLOCKUPDATE(otime, ntime) (*(otime) = *(ntime)) 16#endif 17 18#define CPU_THISTICKLEN(dflt) dflt 19 20#define I586_CTR_COMULTIPLIER_SHIFT 20 21#define I586_CTR_MULTIPLIER_SHIFT 32 22 23#ifdef KERNEL 24/* 25 * i386 to clock driver interface. 26 * XXX almost all of it is misplaced. i586 stuff is done in isa/clock.c 27 * and isa stuff is done in i386/microtime.s and i386/support.s. 28 */ 29extern int adjkerntz; 30extern int disable_rtc_set; |
31#if defined(I586_CPU) || defined(I686_CPU) | 31#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) |
32extern u_int i586_ctr_bias; 33extern u_int i586_ctr_comultiplier; 34extern u_int i586_ctr_freq; 35extern u_int i586_ctr_multiplier; 36#endif 37extern int statclock_disable; 38extern u_int timer_freq; 39extern int timer0_max_count; --- 36 unchanged lines hidden (view full) --- 76 77 outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); 78 low = inb(TIMER_CNTR0); 79 high = inb(TIMER_CNTR0); 80 return (timer0_prescaler_count + timer0_max_count 81 - ((high << 8) | low)); 82} 83 | 32extern u_int i586_ctr_bias; 33extern u_int i586_ctr_comultiplier; 34extern u_int i586_ctr_freq; 35extern u_int i586_ctr_multiplier; 36#endif 37extern int statclock_disable; 38extern u_int timer_freq; 39extern int timer0_max_count; --- 36 unchanged lines hidden (view full) --- 76 77 outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); 78 low = inb(TIMER_CNTR0); 79 high = inb(TIMER_CNTR0); 80 return (timer0_prescaler_count + timer0_max_count 81 - ((high << 8) | low)); 82} 83 |
84#if defined(I586_CPU) || defined(I686_CPU) | 84#if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) |
85/* 86 * When we update `time', on i586's we also update `i586_ctr_bias' 87 * atomically. `i586_ctr_bias' is the best available approximation to 88 * the value of the i586 counter (mod 2^32) at the time of the i8254 89 * counter transition that caused the clock interrupt that caused the 90 * update. clock_latency() gives the time between the transition and 91 * the update to within a few usec provided another such transition 92 * hasn't occurred. We don't bother checking for counter overflow as --- 30 unchanged lines hidden --- | 85/* 86 * When we update `time', on i586's we also update `i586_ctr_bias' 87 * atomically. `i586_ctr_bias' is the best available approximation to 88 * the value of the i586 counter (mod 2^32) at the time of the i8254 89 * counter transition that caused the clock interrupt that caused the 90 * update. clock_latency() gives the time between the transition and 91 * the update to within a few usec provided another such transition 92 * hasn't occurred. We don't bother checking for counter overflow as --- 30 unchanged lines hidden --- |