Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 ignore garbage left in registers by some ...



details:   https://anonhg.NetBSD.org/src/rev/451fbb710a2c
branches:  trunk
changeset: 503040:451fbb710a2c
user:      chuck <chuck%NetBSD.org@localhost>
date:      Mon Jan 29 19:26:36 2001 +0000

description:
ignore garbage left in registers by some APM bios (IBM thinkpad) when
event is a duplicate.

gets rid of annoying "APM get event: unknown error code (0x530b)" messages.

PR#12067 (YAMAMOTO Takashi)

diffstat:

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

diffs (32 lines):

diff -r ba2771e54522 -r 451fbb710a2c sys/arch/i386/i386/apm.c
--- a/sys/arch/i386/i386/apm.c  Mon Jan 29 17:06:06 2001 +0000
+++ b/sys/arch/i386/i386/apm.c  Mon Jan 29 19:26:36 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apm.c,v 1.58 2001/01/21 03:23:31 chuck Exp $ */
+/*     $NetBSD: apm.c,v 1.59 2001/01/29 19:26:36 chuck Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -754,7 +754,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"));
@@ -762,8 +767,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