Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/arch/i386/i386 Pull up revision 1.59 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/0840ed161f97
branches:  netbsd-1-5
changeset: 490637:0840ed161f97
user:      he <he%NetBSD.org@localhost>
date:      Sun Feb 04 18:40:22 2001 +0000

description:
Pull up revision 1.59 (requested by chuck):
  Ignore garbage left in registers by some APM BIOSes (IBM Thinkpad)
  when event is a duplicate.  Gets rid of annoying ``APM get event:
  unknown error code'' messages.  Fixes PR#12067.

diffstat:

 sys/arch/i386/i386/apm.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r c8d5c3538fc0 -r 0840ed161f97 sys/arch/i386/i386/apm.c
--- a/sys/arch/i386/i386/apm.c  Sun Feb 04 18:28:09 2001 +0000
+++ b/sys/arch/i386/i386/apm.c  Sun Feb 04 18:40:22 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apm.c,v 1.50.2.2 2001/02/03 17:42:23 he Exp $ */
+/*     $NetBSD: apm.c,v 1.50.2.3 2001/02/04 18:40:22 he Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -741,7 +741,12 @@
         * thinkpad) where it keeps posting the standby/suspend event
         * until forward progress is made.
         */
-       while (apm_get_event(&regs) == 0) {
+       while (1) {
+               if (apm_get_event(&regs) != 0) {        /* out of events? */
+                       if (APM_ERR_CODE(&regs) != APM_ERR_NOEVENTS)
+                               apm_perror("get event", &regs);
+                       break;
+               }
                if (!apm_event_handle(sc, & regs)) {
                        DPRINTF(APMDEBUG_EVENTS | APMDEBUG_ANOM,
                          ("apm_periodic_check: duplicate event (break)\n"));
@@ -749,8 +754,6 @@
                }
        }
 
-       if (APM_ERR_CODE(&regs) != APM_ERR_NOEVENTS)
-               apm_perror("get event", &regs);
        if (apm_suspend_now) {
                apm_suspend_pending = 0;
                apm_suspend(sc);



Home | Main Index | Thread Index | Old Index