Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Sep 2008 10:10:40 -0700
From:      Nate Lawson <nate@root.org>
To:        Pietro Cerutti <gahr@FreeBSD.org>
Cc:        freebsd-acpi@FreeBSD.org, bug-followup@FreeBSD.org
Subject:   Re: kern/124223: [acpi] [patch] acpi_battery.c -- Notify user-defined critical level via devd(8)
Message-ID:  <48C16810.2030003@root.org>
In-Reply-To: <48C14091.4060309@FreeBSD.org>
References:  <48C14091.4060309@FreeBSD.org>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48C16810.2030003>