kern/124223: [acpi] [patch] acpi_battery.c -- Notify user-defined critical level via devd(8)

Nate Lawson nate at root.org
Fri Sep 5 17:30:05 UTC 2008


The following reply was made to PR kern/124223; it has been noted by GNATS.

From: Nate Lawson <nate at root.org>
To: Pietro Cerutti <gahr at FreeBSD.org>
Cc: bug-followup at FreeBSD.org, freebsd-acpi at FreeBSD.org
Subject: Re: kern/124223: [acpi] [patch] acpi_battery.c -- Notify  user-defined
 critical level via devd(8)
Date: Fri, 05 Sep 2008 10:10:40 -0700

 There are a few problems with your approach.
 
 Critical status is already reported with a flag when usermode polls for
 the battery status:
 > if (sc->bst.state & ACPI_BATT_STAT_CRITICAL) {
 >     if ((sc->flags & ACPI_BATT_STAT_CRITICAL) == 0) {
 > 	    sc->flags |= ACPI_BATT_STAT_CRITICAL;
 > 	    device_printf(dev, "critically low charge!\n");
 >     }
 > }
 
 Since usermode utilities already poll, they can handle that flag or
 implement their own notion of critical battery level.  Why introduce a
 new kernel thread to do that same polling?
 
 Don't common battery status tools that poll (say, xbatt) have their own
 way to set a critical level?
 
 -Nate
 
 Pietro Cerutti wrote:
 > POKE!
 > 
 > Anybody interested in reviewing it?
 
 -- 
 Nate


More information about the freebsd-acpi mailing list