From owner-acpi-jp@jp.freebsd.org  Thu Oct 25 01:22:51 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id BAA96517;
	Thu, 25 Oct 2001 01:22:51 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from tasogare.imasy.or.jp (root@tasogare.imasy.or.jp [202.227.24.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id BAA96512
	for <acpi-jp@jp.freebsd.org>; Thu, 25 Oct 2001 01:22:50 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92])
	(authenticated as iwa with CRAM-MD5)
	by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id f9OGMlm16160;
	Thu, 25 Oct 2001 01:22:47 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Date: Thu, 25 Oct 2001 01:22:43 +0900 (JST)
Message-Id: <20011025.012243.71082514.iwasaki@jp.FreeBSD.org>
To: acpi-jp@jp.freebsd.org
Cc: arch@freebsd.org, audit@freebsd.org
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
X-Mailer: Mew version 2.0 on Emacs 20.7 / Mule 4.0 (HANANOEN)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: acpi-jp 1368
Subject: [acpi-jp 1368] ACPI: APM compatibility implementation
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

Hi,

I've just started implementation of APM compatibility stuff for
FreeBSD/i386.
The goal is to support most APM applications (binary) w/o any changes
on ACPI enabled kernel.
This emulates APM device node interface APIs (mainly ioctl) and
provides APM services for the applications.

The patches at:
http://people.freebsd.org/~iwasaki/acpi/acpi_compat_apm-20011025.diff

Currently following ioctls are implemented;
 - APMIO_SUSPEND (mapped S3 as default but can be changed by sysctl)
 - APMIO_STANDBY (mapped S1 as default but can be changed by sysctl)
 - APMIO_GETINFO and APMIO_GETINFO_OLD
 - APMIO_GETPWSTATUS

Many APM applications are already supported.

apmopen, apmclose, apmwrite, apmpoll and following ioctls are fake :-p
 - APMIO_ENABLE
 - APMIO_DISABLE
 - APMIO_HALTCPU
 - APMIO_NOTHALTCPU
 - APMIO_DISPLAY
 - APMIO_BIOS

My apm reports correct info with ACPI kernel as follows.

% apm
APM version: 1.2
APM Managment: Enabled
AC Line status: off-line
Battery status: high
Remaining battery life: 99%
Remaining battery time:  3:18:00
Number of batteries: 1
Battery 0:
        Battery status: high
        Remaining battery life: 99%
        Remaining battery time:  3:18:00
Resume timer: Thu Jan  1 08:59:59 1970
Resume on ring indicator: disabled
APM Capacities:
        unknown

Any comments are welcome.  I'll commit this coming weekend.

Thanks
