From owner-freebsd-bugs Wed May 1 16:43:52 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from ground0.paix.net (ground0.paix.net [128.177.247.242]) by hub.freebsd.org (Postfix) with ESMTP id 0BF1237B41A for ; Wed, 1 May 2002 16:43:48 -0700 (PDT) Received: (from larson@localhost) by ground0.paix.net (8.9.3/8.9.1) id QAA36342; Wed, 1 May 2002 16:43:43 -0700 (PDT) env-from (larson@eng.paix.net) Date: Wed, 1 May 2002 16:43:43 -0700 (PDT) From: Alan Larson Message-Id: <200205012343.QAA36342@ground0.paix.net> To: dwmalone@maths.tcd.ie, larson@eng.paix.net Subject: Re: halt -p doesn't if apm not enabled. Cc: freebsd-bugs@freebsd.org In-Reply-To: <20020324001436.GC91340@synge.maths.tcd.ie> Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > From dwmalone@maths.tcd.ie Sat Mar 23 16:14:42 2002 > Date: Sun, 24 Mar 2002 00:14:36 +0000 > From: David Malone > To: Alan Larson > 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