summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2001-02-19 04:57:03 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2001-02-19 04:57:03 +0000
commitdf3bcfa4b92155daf478bb54bc1b87efa61f5b18 (patch)
treea244aee9c9b56ee03ce75ebe04938f38938b860a
parent4c3ad8dfd758285bff02f738fe4fa13553800d00 (diff)
Avoid losing rtc after suspend/resume on some laptops. Ok provos@
-rw-r--r--sys/arch/i386/i386/apm.c5
-rw-r--r--sys/arch/i386/include/cpu.h3
-rw-r--r--sys/arch/i386/isa/clock.c7
3 files changed, 10 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index f04b18ca834..869ea6d2670 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.44 2001/02/06 00:15:01 mickey Exp $ */
+/* $OpenBSD: apm.c,v 1.45 2001/02/19 04:57:02 ho Exp $ */
/*-
* Copyright (c) 1998-2000 Michael Shalayeff. All rights reserved.
@@ -351,6 +351,9 @@ apm_resume(sc, regs)
/* lower bit in cx means pccard was powered down */
dopowerhooks(PWR_RESUME);
apm_record_event(sc, regs->bx);
+
+ /* acknowledge any rtc interrupt we may have missed */
+ rtcdrain(NULL);
}
int
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index 1a50e9cb4c5..6476366c944 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.33 2001/01/25 18:49:34 mickey Exp $ */
+/* $OpenBSD: cpu.h,v 1.34 2001/02/19 04:57:02 ho Exp $ */
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
/*-
@@ -200,6 +200,7 @@ void proc_trampoline __P((void));
/* clock.c */
void initrtclock __P((void));
void startrtclock __P((void));
+void rtcdrain __P((void *));
/* npx.c */
void npxdrop __P((void));
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index 0d1a0e7440f..613b3d31b08 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.22 2001/02/13 17:19:12 ho Exp $ */
+/* $OpenBSD: clock.c,v 1.23 2001/02/19 04:57:02 ho Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -207,7 +207,8 @@ rtcdrain(void *v)
{
struct timeout *to = (struct timeout *)v;
- timeout_del(to);
+ if (to != NULL)
+ timeout_del(to);
/*
* Drain any un-acknowledged RTC interrupts.
@@ -242,7 +243,7 @@ int
rtcintr(arg)
void *arg;
{
- struct clockframe *frame = arg; /* not strictly neccecary */
+ struct clockframe *frame = arg; /* not strictly necessary */
u_int stat = 0;
/*