From owner-acpi-jp@jp.freebsd.org  Tue May 29 02:27:50 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id CAA08583;
	Tue, 29 May 2001 02:27:50 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from shidahara1.planet.sci.kobe-u.ac.jp (shidahara1.planet.sci.kobe-u.ac.jp [133.30.50.200])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id CAA08578
	for <acpi-jp@jp.freebsd.org>; Tue, 29 May 2001 02:27:49 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
Received: from shidahara1.planet.sci.kobe-u.ac.jp (localhost [127.0.0.1])
	by shidahara1.planet.sci.kobe-u.ac.jp (8.9.3/8.9.3) with ESMTP id CAA94279
	for <acpi-jp@jp.freebsd.org>; Tue, 29 May 2001 02:33:30 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
Message-Id: <200105281733.CAA94279@shidahara1.planet.sci.kobe-u.ac.jp>
To: acpi-jp@jp.freebsd.org
Date: Tue, 29 May 2001 02:33:30 +0900
From: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: acpi-jp 1142
Subject: [acpi-jp 1142] kqueue(2) interface.
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: takawata@shidahara1.planet.sci.kobe-u.ac.jp

I wrote kqueue(2) interface for acpi.

Kernel patch is at
	http://people.freebsd.org/~takawata/devdiff2

(From CURRENT source: replacement of the file named "devdiff" in
http://people.freebsd.org/~takawata/acpica20010518diff.tar.gz)

Example is at
	http://people.freebsd.org/~takawata/kqtest.c
This can recognize
	Power button event
	Sleep button event
	LID event
	Battery Event
	Thermal zone event
Each event is distinguished by fflags member of kevent structure.
Bit of flag means as follows:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0|1|2|3|4|5|6|7|8|9|1|1|1|1|1|1|1|1|1|1|2|2|2|2|2|2|2|2|2|2|3|3|
| | | | | | | | | | |0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|P|S|L|A| | | | |T|T| | | | | | |B|B| | | | | | | | | | | | | | |
|o|l|I|C| | | | |h|h| | | | | | |a|a| | | | | | | | | | | | | | |
|w|e|D| | | | | |e|e| | | | | | |t|t| | | | | | | | | | | | | | |
|e|e| | | | | | |r|r| | | | | | |t|t| | | | | | | | | | | | | | |
|r|p| | | | | | |m|m| | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | |0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7| | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Any comment?

$BEOJUB:5*(B
$B?@8MBg3XBg3X1!<+A32J3X8&5f2J(BD3$B>pJs%a%G%#%"2J3X@l96(B
<a href="http://www.planet.sci.kobe-u.ac.jp/~takawata/key.html">
Public Key</a>
Key fingerprint =  2C 51 E2 78 2C E1 C5 2D  0F F1 20 A3 11 3A 62 2A 
