summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-10-04 18:39:10 +0000
committerache <ache@FreeBSD.org>1994-10-04 18:39:10 +0000
commit9861089c206d71bfb8b80d8ba141a6a44967d3c2 (patch)
tree8798f17d6eb5de75b96e0883ee7ce6f483815ed8
parent0683676e4a00725ffd8aa4a3e395ca0c2aa4627c (diff)
downloadFreeBSD-src-9861089c206d71bfb8b80d8ba141a6a44967d3c2.zip
FreeBSD-src-9861089c206d71bfb8b80d8ba141a6a44967d3c2.tar.gz
Add disable_rtc_set variable to block resettodr() call, needed for
adjkerntz -i, per Bruce suggestion
-rw-r--r--sys/amd64/amd64/tsc.c8
-rw-r--r--sys/amd64/isa/clock.c8
-rw-r--r--sys/i386/i386/tsc.c8
-rw-r--r--sys/i386/isa/clock.c8
-rw-r--r--sys/isa/atrtc.c8
5 files changed, 30 insertions, 10 deletions
diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c
index 4e0aaf8..6a89ee1 100644
--- a/sys/amd64/amd64/tsc.c
+++ b/sys/amd64/amd64/tsc.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.22 1994/09/29 08:24:45 sos Exp $
+ * $Id: clock.c,v 1.23 1994/10/04 13:59:44 ache Exp $
*/
/*
@@ -75,6 +75,7 @@ static int beeping;
int timer0_divisor = TIMER_DIV(100); /* XXX should be hz */
u_int timer0_prescale;
int adjkerntz = 0; /* offset from CMOS clock */
+int disable_rtc_set = 0; /* disable resettodr() if != 0 */
static char timer0_state = 0, timer2_state = 0;
static char timer0_reprogram = 0;
static void (*timer_func)() = hardclock;
@@ -465,6 +466,9 @@ void resettodr()
unsigned long tm;
int y, m, fd, r, s;
+ if (disable_rtc_set)
+ return;
+
s = splclock();
tm = time.tv_sec;
splx(s);
@@ -472,7 +476,7 @@ void resettodr()
/* First, disable clock updates */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in CMOS */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + adjkerntz;
diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c
index 4e0aaf8..6a89ee1 100644
--- a/sys/amd64/isa/clock.c
+++ b/sys/amd64/isa/clock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.22 1994/09/29 08:24:45 sos Exp $
+ * $Id: clock.c,v 1.23 1994/10/04 13:59:44 ache Exp $
*/
/*
@@ -75,6 +75,7 @@ static int beeping;
int timer0_divisor = TIMER_DIV(100); /* XXX should be hz */
u_int timer0_prescale;
int adjkerntz = 0; /* offset from CMOS clock */
+int disable_rtc_set = 0; /* disable resettodr() if != 0 */
static char timer0_state = 0, timer2_state = 0;
static char timer0_reprogram = 0;
static void (*timer_func)() = hardclock;
@@ -465,6 +466,9 @@ void resettodr()
unsigned long tm;
int y, m, fd, r, s;
+ if (disable_rtc_set)
+ return;
+
s = splclock();
tm = time.tv_sec;
splx(s);
@@ -472,7 +476,7 @@ void resettodr()
/* First, disable clock updates */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in CMOS */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + adjkerntz;
diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c
index 4e0aaf8..6a89ee1 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.22 1994/09/29 08:24:45 sos Exp $
+ * $Id: clock.c,v 1.23 1994/10/04 13:59:44 ache Exp $
*/
/*
@@ -75,6 +75,7 @@ static int beeping;
int timer0_divisor = TIMER_DIV(100); /* XXX should be hz */
u_int timer0_prescale;
int adjkerntz = 0; /* offset from CMOS clock */
+int disable_rtc_set = 0; /* disable resettodr() if != 0 */
static char timer0_state = 0, timer2_state = 0;
static char timer0_reprogram = 0;
static void (*timer_func)() = hardclock;
@@ -465,6 +466,9 @@ void resettodr()
unsigned long tm;
int y, m, fd, r, s;
+ if (disable_rtc_set)
+ return;
+
s = splclock();
tm = time.tv_sec;
splx(s);
@@ -472,7 +476,7 @@ void resettodr()
/* First, disable clock updates */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in CMOS */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + adjkerntz;
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index 4e0aaf8..6a89ee1 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.22 1994/09/29 08:24:45 sos Exp $
+ * $Id: clock.c,v 1.23 1994/10/04 13:59:44 ache Exp $
*/
/*
@@ -75,6 +75,7 @@ static int beeping;
int timer0_divisor = TIMER_DIV(100); /* XXX should be hz */
u_int timer0_prescale;
int adjkerntz = 0; /* offset from CMOS clock */
+int disable_rtc_set = 0; /* disable resettodr() if != 0 */
static char timer0_state = 0, timer2_state = 0;
static char timer0_reprogram = 0;
static void (*timer_func)() = hardclock;
@@ -465,6 +466,9 @@ void resettodr()
unsigned long tm;
int y, m, fd, r, s;
+ if (disable_rtc_set)
+ return;
+
s = splclock();
tm = time.tv_sec;
splx(s);
@@ -472,7 +476,7 @@ void resettodr()
/* First, disable clock updates */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in CMOS */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + adjkerntz;
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c
index 4e0aaf8..6a89ee1 100644
--- a/sys/isa/atrtc.c
+++ b/sys/isa/atrtc.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.22 1994/09/29 08:24:45 sos Exp $
+ * $Id: clock.c,v 1.23 1994/10/04 13:59:44 ache Exp $
*/
/*
@@ -75,6 +75,7 @@ static int beeping;
int timer0_divisor = TIMER_DIV(100); /* XXX should be hz */
u_int timer0_prescale;
int adjkerntz = 0; /* offset from CMOS clock */
+int disable_rtc_set = 0; /* disable resettodr() if != 0 */
static char timer0_state = 0, timer2_state = 0;
static char timer0_reprogram = 0;
static void (*timer_func)() = hardclock;
@@ -465,6 +466,9 @@ void resettodr()
unsigned long tm;
int y, m, fd, r, s;
+ if (disable_rtc_set)
+ return;
+
s = splclock();
tm = time.tv_sec;
splx(s);
@@ -472,7 +476,7 @@ void resettodr()
/* First, disable clock updates */
writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR);
- /* Calculate local time to put in CMOS */
+ /* Calculate local time to put in RTC */
tm -= tz.tz_minuteswest * 60 + adjkerntz;
OpenPOWER on IntegriCloud