diff options
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/machdep.c | 5 | ||||
-rw-r--r-- | sys/i386/i386/tsc.c | 12 | ||||
-rw-r--r-- | sys/i386/include/clock.h | 4 | ||||
-rw-r--r-- | sys/i386/include/cpu.h | 8 | ||||
-rw-r--r-- | sys/i386/isa/clock.c | 12 |
5 files changed, 26 insertions, 15 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index e2f7699..acf456c 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.178 1996/03/11 02:21:42 hsu Exp $ + * $Id: machdep.c,v 1.179 1996/03/26 19:57:51 wollman Exp $ */ #include "npx.h" @@ -1094,6 +1094,9 @@ SYSCTL_INT(_machdep, CPU_DISRTCSET, disable_rtc_set, SYSCTL_STRUCT(_machdep, CPU_BOOTINFO, bootinfo, CTLFLAG_RD, &bootinfo, bootinfo, ""); +SYSCTL_INT(_machdep, CPU_WALLCLOCK, wall_cmos_clock, + CTLFLAG_RW, &wall_cmos_clock, 0, ""); + /* * Initialize 386 and configure to run kernel */ diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c index b4a01ce..97b0de7 100644 --- a/sys/i386/i386/tsc.c +++ b/sys/i386/i386/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.53 1996/03/23 21:36:03 nate Exp $ + * $Id: clock.c,v 1.54 1996/03/31 04:05:36 bde Exp $ */ /* @@ -92,8 +92,10 @@ */ #define TIMER0_MIN_MAX_COUNT TIMER_DIV(20000) -int adjkerntz = 0; /* offset from CMOS clock */ -int disable_rtc_set = 0; /* disable resettodr() if != 0 */ +int adjkerntz; /* local offset from GMT in seconds */ +int disable_rtc_set; /* disable resettodr() if != 0 */ +int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */ + u_int idelayed; #if defined(I586_CPU) || defined(I686_CPU) unsigned i586_ctr_rate; @@ -491,7 +493,7 @@ inittodr(time_t base) /* sec now contains the number of seconds, since Jan 1 1970, in the local time zone */ - sec += tz.tz_minuteswest * 60 + adjkerntz; + sec += tz.tz_minuteswest * 60 + wall_cmos_clock ? adjkerntz : 0; s = splclock(); time.tv_sec = sec; @@ -524,7 +526,7 @@ resettodr() /* Calculate local time to put in RTC */ - tm -= tz.tz_minuteswest * 60 + adjkerntz; + tm -= tz.tz_minuteswest * 60 + wall_cmos_clock ? adjkerntz : 0; writertc(RTC_SEC, bin2bcd(tm%60)); tm /= 60; /* Write back Seconds */ writertc(RTC_MIN, bin2bcd(tm%60)); tm /= 60; /* Write back Minutes */ diff --git a/sys/i386/include/clock.h b/sys/i386/include/clock.h index f7ba36e95..e390415 100644 --- a/sys/i386/include/clock.h +++ b/sys/i386/include/clock.h @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $Id: clock.h,v 1.9 1996/01/30 18:56:24 wollman Exp $ + * $Id: clock.h,v 1.10 1996/03/31 04:05:17 bde Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -54,6 +54,8 @@ */ extern int adjkerntz; extern int disable_rtc_set; +extern int wall_cmos_clock; + #if defined(I586_CPU) || defined(I686_CPU) extern unsigned i586_ctr_rate; /* fixed point */ extern long long i586_last_tick; diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 4fc989d..08cb30287 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91 - * $Id: cpu.h,v 1.21 1995/07/16 10:33:28 phk Exp $ + * $Id: cpu.h,v 1.22 1996/03/29 14:14:07 bde Exp $ */ #ifndef _MACHINE_CPU_H_ @@ -112,10 +112,11 @@ struct cpu_nameclass { * CTL_MACHDEP definitions. */ #define CPU_CONSDEV 1 /* dev_t: console terminal device */ -#define CPU_ADJKERNTZ 2 /* int: timezone offset for resettodr() */ +#define CPU_ADJKERNTZ 2 /* int: timezone offset (seconds) */ #define CPU_DISRTCSET 3 /* int: disable resettodr() call */ #define CPU_BOOTINFO 4 /* struct: bootinfo */ -#define CPU_MAXID 5 /* number of valid machdep ids */ +#define CPU_WALLCLOCK 5 /* int: indicates wall CMOS clock */ +#define CPU_MAXID 6 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ @@ -123,6 +124,7 @@ struct cpu_nameclass { { "adjkerntz", CTLTYPE_INT }, \ { "disable_rtc_set", CTLTYPE_INT }, \ { "bootinfo", CTLTYPE_STRUCT }, \ + { "wall_cmos_clock", CTLTYPE_INT }, \ } #ifdef KERNEL diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index b4a01ce..97b0de7 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.53 1996/03/23 21:36:03 nate Exp $ + * $Id: clock.c,v 1.54 1996/03/31 04:05:36 bde Exp $ */ /* @@ -92,8 +92,10 @@ */ #define TIMER0_MIN_MAX_COUNT TIMER_DIV(20000) -int adjkerntz = 0; /* offset from CMOS clock */ -int disable_rtc_set = 0; /* disable resettodr() if != 0 */ +int adjkerntz; /* local offset from GMT in seconds */ +int disable_rtc_set; /* disable resettodr() if != 0 */ +int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */ + u_int idelayed; #if defined(I586_CPU) || defined(I686_CPU) unsigned i586_ctr_rate; @@ -491,7 +493,7 @@ inittodr(time_t base) /* sec now contains the number of seconds, since Jan 1 1970, in the local time zone */ - sec += tz.tz_minuteswest * 60 + adjkerntz; + sec += tz.tz_minuteswest * 60 + wall_cmos_clock ? adjkerntz : 0; s = splclock(); time.tv_sec = sec; @@ -524,7 +526,7 @@ resettodr() /* Calculate local time to put in RTC */ - tm -= tz.tz_minuteswest * 60 + adjkerntz; + tm -= tz.tz_minuteswest * 60 + wall_cmos_clock ? adjkerntz : 0; writertc(RTC_SEC, bin2bcd(tm%60)); tm /= 60; /* Write back Seconds */ writertc(RTC_MIN, bin2bcd(tm%60)); tm /= 60; /* Write back Minutes */ |