Date: Wed, 1 May 2002 16:43:43 -0700 (PDT) From: Alan Larson <larson@eng.paix.net> To: dwmalone@maths.tcd.ie, larson@eng.paix.net Cc: freebsd-bugs@freebsd.org Subject: Re: halt -p doesn't if apm not enabled. Message-ID: <200205012343.QAA36342@ground0.paix.net> In-Reply-To: <20020324001436.GC91340@synge.maths.tcd.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
> From dwmalone@maths.tcd.ie Sat Mar 23 16:14:42 2002 > Date: Sun, 24 Mar 2002 00:14:36 +0000 > From: David Malone <dwmalone@maths.tcd.ie> > To: Alan Larson <larson@eng.paix.net> > Cc: freebsd-bugs@freebsd.org > Subject: Re: halt -p doesn't if apm not enabled. > References: <200203222300.PAA30437@ground0.paix.net> > Mime-Version: 1.0 > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > In-Reply-To: <200203222300.PAA30437@ground0.paix.net> > User-Agent: Mutt/1.3.25i > Sender: dwmalone@maths.tcd.ie > > On Fri, Mar 22, 2002 at 03:00:10PM -0800, Alan Larson wrote: > > --- 285,292 ---- > > { > > struct apm_softc *sc = &apm_softc; > > > > ! if (!(howto & RB_POWEROFF)) /* Powering off? */ > > ! return; /* no */ > > sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; > > sc->bios.r.ebx = PMDV_ALLDEV; > > sc->bios.r.ecx = PMST_OFF; > > Will this not cause a problem if the BIOS doesn't support APM, > or is this done elsewhere in the code? > > David. > I don't think so, since it calls apm_bioscall(), which calls apm_check_function_supported() right at the start. Since the only requirement in the present code to get through to power off the system is that apm_softc.active be true, and that is set true by the ioctl to enable apm (without further testing), it seems quite safe to attempt the power off even if apm hasn't been enabled. The enabled state gives us no assurances that we can power the system off. Alan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205012343.QAA36342>