Date: Fri, 5 Sep 2008 17:30:05 GMT From: Nate Lawson <nate@root.org> To: freebsd-acpi@FreeBSD.org Subject: Re: kern/124223: [acpi] [patch] acpi_battery.c -- Notify user-defined critical level via devd(8) Message-ID: <200809051730.m85HU5q6000155@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/124223; it has been noted by GNATS. From: Nate Lawson <nate@root.org> To: Pietro Cerutti <gahr@FreeBSD.org> Cc: bug-followup@FreeBSD.org, freebsd-acpi@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809051730.m85HU5q6000155>