From owner-freebsd-hackers Fri Jan 12 9:44: 9 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 8817337B401; Fri, 12 Jan 2001 09:43:47 -0800 (PST) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.11.1+3.4W/3.7W-tasogare/smtpfeed 1.07) with ESMTP id f0CHhek18470; Sat, 13 Jan 2001 02:43:40 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: current@freebsd.org, hackers@freebsd.org Subject: Re: CFR: Generalized power-management interface In-Reply-To: <20001231180216L.iwasaki@jp.FreeBSD.org> References: <20001231180216L.iwasaki@jp.FreeBSD.org> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010113024339Z.iwasaki@jp.FreeBSD.org> Date: Sat, 13 Jan 2001 02:43:39 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 59 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I've update the patch based on some comments so far and added wmpm (actually ACPI support for wmapm which is utility for WindowMaker) ports files as a example. http://people.freebsd.org/~iwasaki/acpi/power-20010113.tar.gz http://people.freebsd.org/~iwasaki/acpi/wmpm-20010113.tar.gz Note that ioctl number for power device have been changed, so rebuilding your kernel and recompiling lib/libpower/ and usr.sbin/power/ are needed. Added API is; u_int power_get_pm_type(void); I'll get device major number for /dev/power and commit them within a few days if no objection. Thanks > I've created new common framework on generalized power-management > interface for userland utilities. > > http://people.freebsd.org/~iwasaki/acpi/power-20001229.tar.gz > > This provides some PM APIs to APM applications, such as wmapm, so that > these applications can be ported smoothly to use ACPI (power > management portion). Currently following APIs are implemented; > > int power_get_syspm_info(struct power_syspm_info *); > int power_get_batt_info(u_int, struct power_batt_info *); > int power_standby(void); > int power_suspend(void); > int power_hibernate(void); > > And PM event notification mechanism is suggested to be implemented so far. > > Sample application is included in usr.sbin/power/ which is very similar > to apm(8) but supports ACPI as well. > > usr.sbin/acpi/acpibatt/ is for displaying acpi_cmbat (ACPI Control > Method Battery), can be used to verify that generalized > power-management interface is working correctly. > Note that many ACPI BIOS give us unknown battery remaining time when > ac-line is plugged in. MIB 'hw.battery.full_charge_time' can be used to > specify the full charged remaining time of batteries in minutes, like > sysctl -w hw.battery.full_charge_time=60,60 > for multiple number of batteries, or > sysctl -w hw.battery.full_charge_time=120 > for a battery installed. > > To test them, /dev/power is required as a device control file. > > % ls -l /dev/power > crw-r--r-- 1 root wheel 210, 0 12/19 04:51 /dev/power > > I'll commit them at sometime early in coming century. > > Any comments would be appreciated. Thanks! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message