Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jul 2000 18:08:48 +0900
From:      Mitsuru IWASAKI <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 
Message-ID:  <20000723180848Y.iwasaki@jp.FreeBSD.org>
In-Reply-To: <200007230502.XAA15719@harmony.village.org>
References:  <200007230449.VAA62622@freefall.freebsd.org> <200007230502.XAA15719@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000723180848Y.iwasaki>