aboutsummaryrefslogtreecommitdiff
path: root/sys/isa/atrtc.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1996-10-25 13:46:21 +0000
committerBruce Evans <bde@FreeBSD.org>1996-10-25 13:46:21 +0000
commit2d872b777dccef4b901cde6405ed9e65372413bc (patch)
tree89124a71cce112b055136c43f3f08a65864e98ca /sys/isa/atrtc.c
parent835bd1ce62ebd0b706c83528cc57a9f4a005d617 (diff)
downloadsrc-2d872b777dccef4b901cde6405ed9e65372413bc.tar.gz
src-2d872b777dccef4b901cde6405ed9e65372413bc.zip
Print the clock calibration messages all on one (long) line again so
that they are easy to grep for. Removed now-unused i586 counter variables. Fixed some style bugs.
Notes
Notes: svn path=/head/; revision=19173
Diffstat (limited to 'sys/isa/atrtc.c')
-rw-r--r--sys/isa/atrtc.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c
index 17e8732d4faf..cb85c35311e2 100644
--- a/sys/isa/atrtc.c
+++ b/sys/isa/atrtc.c
@@ -34,7 +34,11 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.69 1996/09/14 10:53:34 bde Exp $
+ * $Id: clock.c,v 1.70 1996/10/09 19:47:31 bde Exp $
+ */
+
+/*
+ * Routines to handle clock hardware.
*/
/*
@@ -44,10 +48,6 @@
* reintroduced and updated by Chris Stenton <chris@gnome.co.uk> 8/10/94
*/
-/*
- * Primitive clock interrupt routines.
- */
-
#include "opt_clock.h"
#include "opt_cpu.h"
@@ -99,16 +99,12 @@
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)
-u_int i586_ctr_bias;
+u_int i586_ctr_bias;
u_int i586_ctr_comultiplier;
u_int i586_ctr_freq;
u_int i586_ctr_multiplier;
-long long i586_last_tick;
-unsigned long i586_avg_tick;
#endif
int statclock_disable;
u_int stat_imask = SWI_CLOCK_MASK;
@@ -117,22 +113,23 @@ u_int timer_freq = TIMER_FREQ;
#else
u_int timer_freq = 1193182;
#endif
-int timer0_max_count;
-u_int timer0_overflow_threshold;
-u_int timer0_prescaler_count;
+int timer0_max_count;
+u_int timer0_overflow_threshold;
+u_int timer0_prescaler_count;
+int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
static int beeping = 0;
static u_int clk_imask = HWI_MASK | SWI_MASK;
static const u_char daysinmonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};
-static u_int hardclock_max_count;
+static u_int hardclock_max_count;
/*
* XXX new_function and timer_func should not handle clockframes, but
* timer_func currently needs to hold hardclock to handle the
* timer0_state == 0 case. We should use register_intr()/unregister_intr()
* to switch between clkintr() and a slightly different timerintr().
*/
-static void (*new_function) __P((struct clockframe *frame));
-static u_int new_rate;
+static void (*new_function) __P((struct clockframe *frame));
+static u_int new_rate;
static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF;
static u_char rtc_statusb = RTCSB_24HR | RTCSB_PINTR;
@@ -144,7 +141,7 @@ static u_char rtc_statusb = RTCSB_24HR | RTCSB_PINTR;
static u_char timer0_state;
static u_char timer2_state;
-static void (*timer_func) __P((struct clockframe *frame)) = hardclock;
+static void (*timer_func) __P((struct clockframe *frame)) = hardclock;
#if defined(I586_CPU) || defined(I686_CPU)
static void set_i586_ctr_freq(u_int i586_freq, u_int i8254_freq);
@@ -347,7 +344,7 @@ getit(void)
disable_intr();
/* Select timer0 and latch counter value. */
- outb(TIMER_MODE, TIMER_SEL0);
+ outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
low = inb(TIMER_CNTR0);
high = inb(TIMER_CNTR0);
@@ -489,7 +486,7 @@ calibrate_clocks(void)
u_int count, prev_count, tot_count;
int sec, start_sec, timeout;
- printf("Calibrating clock(s) relative to mc146818A clock...\n");
+ printf("Calibrating clock(s) relative to mc146818A clock ... ");
if (!(rtcin(RTC_STATUSD) & RTCSD_PWR))
goto fail;
timeout = 100000000;
@@ -622,7 +619,7 @@ startrtclock()
if (delta < timer_freq / 100) {
#ifndef CLK_USE_I8254_CALIBRATION
if (bootverbose)
- printf(
+ printf(
"CLK_USE_I8254_CALIBRATION not specified - using default frequency\n");
freq = timer_freq;
#endif
@@ -641,7 +638,7 @@ startrtclock()
#ifndef CLK_USE_I586_CALIBRATION
if (i586_ctr_freq != 0) {
if (bootverbose)
- printf(
+ printf(
"CLK_USE_I586_CALIBRATION not specified - using old calibration method\n");
i586_ctr_freq = 0;
}