From owner-cvs-all Sun Jul 23 2: 9: 8 2000 Delivered-To: cvs-all@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 9402D37BAAC; Sun, 23 Jul 2000 02:08:59 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.10.1+3.3W/3.7W-tasogare/smtpfeed 1.07) with ESMTP id e6N98tp21089; Sun, 23 Jul 2000 18:08:55 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: imp@village.org Cc: nsayer@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/apm apm.c In-Reply-To: <200007230502.XAA15719@harmony.village.org> References: <200007230449.VAA62622@freefall.freebsd.org> <200007230502.XAA15719@harmony.village.org> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000723180848Y.iwasaki@jp.FreeBSD.org> Date: Sun, 23 Jul 2000 18:08:48 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 49 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > In message <200007230449.VAA62622@freefall.freebsd.org> Nick Sayer writes: > : nsayer 2000/07/22 21:49:43 PDT > : Modified files: > : usr.sbin/apm apm.c > : Log: > : apm -d also needs a writable file descriptor. > > If that's the case, then we need a MFC, since it is broken there. apm > -d doesn't work on my laptop, so I didn't test it. :-( > > Warner Could you try this patch? # I've ported this from Linux. Index: apm.c =================================================================== RCS file: /home/ncvs/src/sys/i386/apm/apm.c,v retrieving revision 1.115 diff -u -r1.115 apm.c --- apm.c 2000/07/19 06:32:00 1.115 +++ apm.c 2000/07/23 09:09:04 @@ -269,12 +269,21 @@ sc->bios.r.ebx = PMDV_DISP0; sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND; sc->bios.r.edx = 0; - if (apm_bioscall()) { - printf("Display off failure: errcode = %d\n", - 0xff & (sc->bios.r.eax >> 8)); - return 1; + if (apm_bioscall() == 0) { + return 0; } - return 0; + + /* If failed, then try to blank all display devices instead. */ + sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; + sc->bios.r.ebx = 0x01ff; /* all display devices */ + sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND; + sc->bios.r.edx = 0; + if (apm_bioscall() == 0) { + return 0; + } + printf("Display off failure: errcode = %d\n", + 0xff & (sc->bios.r.eax >> 8)); + return 1; } /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message