summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/isa
diff options
context:
space:
mode:
authorGerhard Roth <gerhard@cvs.openbsd.org>2013-04-17 18:35:48 +0000
committerGerhard Roth <gerhard@cvs.openbsd.org>2013-04-17 18:35:48 +0000
commit69cf0e7b3589acc86e8b1ba98b83ebaf12485a5a (patch)
treecd9ac253aaebd889cf19f8e345f4aa83506dbf34 /sys/arch/amd64/isa
parent8a423b57629a2c978995ca42330394465e786d5d (diff)
Don't set the frequency of the statclock if we don't have one.
Prevents strange hang-ups during reboot. Joint work with hshoexer@. ok mikeb@, mlarkin@, miod@, deraadt@
Diffstat (limited to 'sys/arch/amd64/isa')
-rw-r--r--sys/arch/amd64/isa/clock.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/arch/amd64/isa/clock.c b/sys/arch/amd64/isa/clock.c
index 7a6aa095b97..b2f3017cb79 100644
--- a/sys/arch/amd64/isa/clock.c
+++ b/sys/arch/amd64/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.19 2011/07/05 17:11:07 oga Exp $ */
+/* $OpenBSD: clock.c,v 1.20 2013/04/17 18:35:47 gerhard Exp $ */
/* $NetBSD: clock.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $ */
/*-
@@ -603,10 +603,14 @@ resettodr(void)
void
setstatclockrate(int arg)
{
- if (arg == stathz)
- mc146818_write(NULL, MC_REGA, MC_BASE_32_KHz | MC_RATE_128_Hz);
- else
- mc146818_write(NULL, MC_REGA, MC_BASE_32_KHz | MC_RATE_1024_Hz);
+ if (initclock_func == i8254_initclocks) {
+ if (arg == stathz)
+ mc146818_write(NULL, MC_REGA,
+ MC_BASE_32_KHz | MC_RATE_128_Hz);
+ else
+ mc146818_write(NULL, MC_REGA,
+ MC_BASE_32_KHz | MC_RATE_1024_Hz);
+ }
}
void