From owner-freebsd-acpi@FreeBSD.ORG Fri Sep 5 17:10:43 2008 Return-Path: Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8941065670 for ; Fri, 5 Sep 2008 17:10:43 +0000 (UTC) (envelope-from nate@root.org) Received: from nlpi087.prodigy.net (nlpi087.prodigy.net [207.115.36.103]) by mx1.freebsd.org (Postfix) with ESMTP id E94058FC19 for ; Fri, 5 Sep 2008 17:10:42 +0000 (UTC) (envelope-from nate@root.org) X-ORBL: [71.139.2.87] Received: from [10.0.5.18] (ppp-71-139-2-87.dsl.snfc21.pacbell.net [71.139.2.87]) by nlpi087.prodigy.net (8.13.8 out.dk.spool/8.13.8) with ESMTP id m85HAeZZ026856; Fri, 5 Sep 2008 12:10:41 -0500 Message-ID: <48C16810.2030003@root.org> Date: Fri, 05 Sep 2008 10:10:40 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Pietro Cerutti References: <48C14091.4060309@FreeBSD.org> In-Reply-To: <48C14091.4060309@FreeBSD.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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) X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2008 17:10:43 -0000 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