diff options
| author | Bruce Evans <bde@FreeBSD.org> | 2007-01-23 08:48:26 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 2007-01-23 08:48:26 +0000 |
| commit | cec54a8d96c636d9416d5f8e12df8b2b7764509a (patch) | |
| tree | 80c5b71ed106f040a78fa8a81aa0a00044aaac2a /sys/pc98 | |
| parent | f0393f063afda7922a21fb106dd66b5203ca5ccd (diff) | |
Notes
Diffstat (limited to 'sys/pc98')
| -rw-r--r-- | sys/pc98/cbus/clock.c | 21 | ||||
| -rw-r--r-- | sys/pc98/cbus/pcrtc.c | 21 | ||||
| -rw-r--r-- | sys/pc98/pc98/machdep.c | 7 |
3 files changed, 24 insertions, 25 deletions
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 8706a99db0c5..15705726cefa 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -263,13 +263,6 @@ DELAY(int n) printf("DELAY(%d)...", n); #endif /* - * Guard against the timer being uninitialized if we are called - * early for console i/o. - */ - if (timer0_max_count == 0) - set_timer_freq(timer_freq, hz); - - /* * Read the counter first, so that the rest of the setup overhead is * counted. Guess the initial overhead is 20 usec (on most systems it * takes about 1.5 usec for each of the i/o's in getit(). The loop @@ -511,10 +504,15 @@ timer_restore(void) i8254_restore(); /* restore timer_freq and hz */ } -/* - * Initialize 8254 timer 0 early so that it can be used in DELAY(). - * XXX initialization of other timers is unintentionally left blank. - */ +/* This is separate from startrtclock() so that it can be called early. */ +void +i8254_init(void) +{ + + mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_NOPROFILE); + set_timer_freq(timer_freq, hz); +} + void startrtclock() { @@ -526,7 +524,6 @@ startrtclock() else timer_freq = 2457600L; /* 2.4576 MHz */ - set_timer_freq(timer_freq, hz); freq = calibrate_clocks(); #ifdef CLK_CALIBRATION_LOOP if (bootverbose) { diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 8706a99db0c5..15705726cefa 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -263,13 +263,6 @@ DELAY(int n) printf("DELAY(%d)...", n); #endif /* - * Guard against the timer being uninitialized if we are called - * early for console i/o. - */ - if (timer0_max_count == 0) - set_timer_freq(timer_freq, hz); - - /* * Read the counter first, so that the rest of the setup overhead is * counted. Guess the initial overhead is 20 usec (on most systems it * takes about 1.5 usec for each of the i/o's in getit(). The loop @@ -511,10 +504,15 @@ timer_restore(void) i8254_restore(); /* restore timer_freq and hz */ } -/* - * Initialize 8254 timer 0 early so that it can be used in DELAY(). - * XXX initialization of other timers is unintentionally left blank. - */ +/* This is separate from startrtclock() so that it can be called early. */ +void +i8254_init(void) +{ + + mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_NOPROFILE); + set_timer_freq(timer_freq, hz); +} + void startrtclock() { @@ -526,7 +524,6 @@ startrtclock() else timer_freq = 2457600L; /* 2.4576 MHz */ - set_timer_freq(timer_freq, hz); freq = calibrate_clocks(); #ifdef CLK_CALIBRATION_LOOP if (bootverbose) { diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 06661e21b499..d35cbd8307a6 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -1971,7 +1971,6 @@ init386(first) * under witness. */ mutex_init(); - mtx_init(&clock_lock, "clk", NULL, MTX_SPIN); mtx_init(&icu_lock, "icu", NULL, MTX_SPIN | MTX_NOWITNESS); /* make ldt memory segments */ @@ -2033,6 +2032,12 @@ init386(first) lidt(&r_idt); /* + * Initialize the i8254 before the console so that console + * initialization can use DELAY(). + */ + i8254_init(); + + /* * Initialize the console before we print anything out. */ cninit(); |
