From owner-acpi-jp@jp.freebsd.org  Sat Sep 16 11:34:50 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id LAA92602;
	Sat, 16 Sep 2000 11:34:50 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from tasogare.imasy.or.jp (daemon@tasogare.imasy.or.jp [202.227.24.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id LAA92597
	for <acpi-jp@jp.freebsd.org>; Sat, 16 Sep 2000 11:34:49 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92])
	by tasogare.imasy.or.jp (8.10.2+3.3W/3.7W-tasogare/smtpfeed 1.07) with ESMTP id e8G2Yir36464
	for <acpi-jp@jp.freebsd.org>; Sat, 16 Sep 2000 11:34:45 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
To: acpi-jp@jp.freebsd.org
In-Reply-To: <20000913183421Z.iwasaki@jp.freebsd.org>
References: <20000912092720B.iwasaki@jp.freebsd.org>
	<20000912104907H.iwasaki@jp.freebsd.org>
	<20000913183421Z.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=iso-2022-jp
Content-Transfer-Encoding: 7bit
Message-Id: <20000916113400T.iwasaki@jp.FreeBSD.org>
Date: Sat, 16 Sep 2000 11:34:00 +0900
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
X-Dispatcher: imput version 20000228(IM140)
Lines: 303
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 637
Subject: [acpi-jp 637] Re: zzz and ACPI (was: Re: acpi_send_pm_event())
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

> > $B$3$l$r;HMQ$7$?(B IndexField $B$X$N(B StoreOp $B4XO"$N(B Fix $B$r$^$H$a$^$7$?!#(B
> > # region $B4X78$b$d$i$J$-$c$G$9$M$'(B...
> 
> $B$^$@J70O5$$@$1$G$9$,!"(Bregion $B4X78$bCe<j$7$^$7$?!#B?J,!"2?$r$7$?$$$+(B
> $B$0$i$$$ODO$a$k$H;W$$$^$9$N$G!"$H$j$"$($:N.$7$F$*$-$^$9!#(B
> $BA4A3IT40A4$@$H;W$&$H$3$m$O(B XXX $B$G%^!<%/$7$F$$$^$9$N$G!"$$$$9M$($,(B
> $B$"$C$?$i65$($F$/$@$5$$$^$;!#(B

region I/O $B$N%3!<%I2~NI$G$9$,!"$@$$$?$$NI$5$=$&$J46$8$K$J$C$F$-$?$N$G!"(B
$B%F%9%H%1!<%99M$($F$/$l$k?M!"Jg=8$7$^$9!#(B
# $B%S%C%HD9$H%"%i%$%a%s%H$N$+$i$_$G$G$-$k$@$10UCO0-$J$d$D$r4uK>(B :-)
ASL $B$G=q$1$J$/$F$b6qBNE*$K@bL@$7$F$/$l$l$P!"$3$A$i$G(B AML $B$K%3%s%Q%$%k$7$^$9!#(B

$B8=:_!"(Bkernel/userland $B$K(B primitive $B$J(B I/O $B$N=j$@$1:n$j9~$s$G!"$[$H$s$I$N(B
region I/O $B$N%3!<%I$O(B aml_common.c $B$XDI$$=P$7$F(B kernel/userland $B$G6&M-$9$k(B
$B$h$&$K$7$?$N$G!"$+$J$j$9$C$-$j$7$?$H;W$$$^$9!#(B32bits $B6-3&$K$^$?$,$k(B
$B%U%#!<%k%I$N%"%/%;%9$@$1$OL$BP1~$G!"=>Mh$N(B byte $BC10L$G$N%3!<%I$KMj$C$F(B
$B$$$^$9$,!"$*$$$*$$D>$7$?$$$H;W$C$F$$$^$9!#$$$$9M$($,$"$C$?$i65$($F$/$@$5$$!#(B

$B0J2<$N$h$&$J%F%9%H%W%m%0%i%`$r(B ASL $B$G=q$$$F;n$7$?$i!"(B32bits $B6-3&$^$?$,$j(B
$BLdBj$r=|$$$F!":#$N$H$3$mBg>fIW$J46$8$G$9!#Nc$($P(B AccessType $B$,(B DWordAcc $B$G(B
$B%S%C%HD9$,(B 1 $B$N%U%#!<%k%I$K$O!"(B32 $B%S%C%HC10L$G%"%/%;%9$7$FBP>]$N%S%C%H$@$1(B
$BA`:n$7$F$$$^$9$7!"J#?t$N%P%$%H$K$^$?$,$k%U%#!<%k%I$X$N%"%/%;%9$b!"(B
AccessType = DWordAcc $B$*$h$S(B AnyAcc $B$NN>J}$N>l9g$G$h$5$=$&$G$9!#(B
AnyAcc $B$N>l9g$O!"%S%C%HD9$r$_$F%"%/%;%9$9$kC10L$r7h$a$F$$$^$9!#(B

Method(TEST, 0) {
	OperationRegion(SMEM, SystemMemory, 0x00000000, 0x00010000)
        Field(SMEM, AnyAcc, NoLock, WriteAsZeros) {	/* 0 $BKd$a(B */
		AF01,	1,
		AF03,	3,
		AF05,	5,	/* 2 byte $B$K$^$?$,$k(B */
		AF07,	7,
		AF09,	9,	/* WordAcc. $B$3$N$X$s$O(B align $B$5$l$k(B */
	}
        Field(SMEM, ByteAcc, NoLock, WriteAsOnes) {	/* 1 $BKd$a(B */
		BF02,	2,
		BF03,	3,
		BF16,	16,	/* $B$3$N$X$s$O(B align $B$5$l$k(B */
		BF32,	32
	}
        Field(SMEM, WordAcc, NoLock, Preserve) {
		WF04,	4,
		WF05,	5,
		WF16,	16,	/* $B$3$N$X$s$O(B align $B$5$l$k(B */
		WF32,	32
	}
        Field(SMEM, DWordAcc, NoLock, Preserve) {
		DF01,	1,
		DF03,	3,
		DF05,	5,	/* 2 byte $B$K$^$?$,$k(B */
		DF16,	16,	/* $B$3$N$X$s$O(B align $B$5$l$k(B */
		DF17,	17,	/* $B$3$N$X$s$O(B align $B$5$l$k(B */
		DF19,	19,	/* $BFq$7$$(B (;_;). 32 bits $B6-3&$K$^$?$,$k(B */
		DF32,	32	/* $B$3$N$X$s$O(B align $B$5$l$k(B */
	}

	/* test for AnyAcc */
	If (LNot(LEqual(Store(One, AF01), One))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x7, AF03), 0x7))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x15, AF05), 0x15))) {	/* bit 4-7@0x0	and */
		Store("Wrong!!", Debug)			/* bit 0@0x1 */
	}
	If (LNot(LEqual(Store(0x77, AF07), 0x77))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x123, AF09), 0x123))) {
		Store("Wrong!!", Debug)
	}

	/* test for ByteAcc */
	If (LNot(LEqual(Store(One, BF02), One))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(One, BF03), One))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x1234, BF16), 0x1234))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x12345678, BF32), 0x12345678))) {
		Store("Wrong!!", Debug)
	}

	/* test for WordAcc */
	If (LNot(LEqual(Store(Zero, WF04), Zero))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(Zero, WF05), Zero))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x4321, WF16), 0x4321))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x87654321, WF32), 0x87654321))) {
		Store("Wrong!!", Debug)
	}

	/* test for DWordAcc */
	If (LNot(LEqual(Store(One, DF01), One))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x7, DF03), 0x7))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x15, DF05), 0x15))) {	/* bit 4-7@0x0	and */
		Store("Wrong!!", Debug)			/* bit 0@0x1 */
	}
	If (LNot(LEqual(Store(0x1234, DF16), 0x1234))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x12345, DF17), 0x12345))) {
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x12345, DF19), 0x12345))) { /* $BFq$7$$$J$!(B... */
		Store("Wrong!!", Debug)
	}
	If (LNot(LEqual(Store(0x12345678, DF32), 0x12345678))) {
		Store("Wrong!!", Debug)
	}
}

$B$H$j$"$($:(B amldb $B$N<B9T7k2L$b$D$1$F$*$-$^$9!#(B

Loading test.aml...done
Method: Arg 0 From 0x2806002c To 0x280602cc
[\TEST. START]
(snip)
If(LNot(LEqual(Store(One, AF01)
[aml_region_write(0, 64, 0x1, 0x0, 0x0, 0x1)]
	->[0:0x1@0x0:0,1]
[write(0, 0x1, 0x0)]
[aml_region_read(0, 64, 0x0, 0x0, 0x1)]
	[0:0x1@0x0:0,1]
	[read(0, 0x0)&mask:0x1]
[read(0, 0x0)->0x1], One)))
If(LNot(LEqual(Store(0x7, AF03)
[aml_region_write(0, 64, 0x7, 0x0, 0x1, 0x3)]
	->[0:0xe@0x0:1,3]
[write(0, 0x7, 0x0)]
[aml_region_read(0, 64, 0x0, 0x1, 0x3)]
	[0:0xe@0x0:1,3]
	[read(0, 0x0)&mask:0x7]
[read(0, 0x0)->0x7], 0x7)))
If(LNot(LEqual(Store(0x15, AF05)
[aml_region_write(0, 64, 0x15, 0x0, 0x4, 0x5)]
	->[0:0x150@0x0:4,5]
[write(0, 0x15, 0x0)]
[aml_region_read(0, 64, 0x0, 0x4, 0x5)]
	[0:0x150@0x0:4,5]
	[read(0, 0x0)&mask:0x15]
[read(0, 0x0)->0x15], 0x15)))
If(LNot(LEqual(Store(0x77, AF07)
[aml_region_write(0, 64, 0x77, 0x0, 0x9, 0x7)]
	->[0:0xee@0x1:1,7]
[write(0, 0x77, 0x1)]
[aml_region_read(0, 64, 0x0, 0x9, 0x7)]
	[0:0xee@0x1:1,7]
	[read(0, 0x1)&mask:0x77]
[read(0, 0x1)->0x77], 0x77)))
If(LNot(LEqual(Store(0x123, AF09)
[aml_region_write(0, 64, 0x123, 0x0, 0x10, 0x9)]
	->[0:0x123@0x2:0,9]
[write(0, 0x123, 0x2)]
[aml_region_read(0, 64, 0x0, 0x10, 0x9)]
	[0:0x123@0x2:0,9]
	[read(0, 0x2)&mask:0x123]
[read(0, 0x2)->0x123], 0x123)))
If(LNot(LEqual(Store(One, BF02)
[aml_region_write(0, 33, 0x1, 0x0, 0x0, 0x2)]
	->[0:0xfd@0x0:0,2]
[write(0, 0x1, 0x0)]
[aml_region_read(0, 33, 0x0, 0x0, 0x2)]
	[0:0xfd@0x0:0,2]
	[read(0, 0x0)&mask:0x1]
[read(0, 0x0)->0x1], One)))
If(LNot(LEqual(Store(One, BF03)
[aml_region_write(0, 33, 0x1, 0x0, 0x2, 0x3)]
	->[0:0xe7@0x0:2,3]
[write(0, 0x1, 0x0)]
[aml_region_read(0, 33, 0x0, 0x2, 0x3)]
	[0:0xe7@0x0:2,3]
	[read(0, 0x0)&mask:0x1]
[read(0, 0x0)->0x1], One)))
If(LNot(LEqual(Store(0x1234, BF16)
[aml_region_write(0, 33, 0x1234, 0x0, 0x10, 0x10)]
	->[0:0x1234@0x2:0,16]
[write(0, 0x1234, 0x2)]
[aml_region_read(0, 33, 0x0, 0x10, 0x10)]
	[0:0x1234@0x2:0,16]
	[read(0, 0x2)&mask:0x1234]
[read(0, 0x2)->0x1234], 0x1234)))
If(LNot(LEqual(Store(0x12345678, BF32)
[aml_region_write(0, 33, 0x12345678, 0x0, 0x20, 0x20)]
	->[0:0x12345678@0x4:0,32]
[write(0, 0x12345678, 0x4)]
[aml_region_read(0, 33, 0x0, 0x20, 0x20)]
	[0:0x12345678@0x4:0,32]
	[read(0, 0x4)&mask:0x12345678]
[read(0, 0x4)->0x12345678], 0x12345678)))
If(LNot(LEqual(Store(Zero, WF04)
[aml_region_write(0, 2, 0x0, 0x0, 0x0, 0x4)]
	[0:0xeee7@0x0:0,4]	->[0:0xeee0@0x0:0,4]
[write(0, 0x0, 0x0)]
[aml_region_read(0, 2, 0x0, 0x0, 0x4)]
	[0:0xeee0@0x0:0,4]
	[read(0, 0x0)&mask:0x0]
[read(0, 0x0)->0x0], Zero)))
If(LNot(LEqual(Store(Zero, WF05)
[aml_region_write(0, 2, 0x0, 0x0, 0x4, 0x5)]
	[0:0xeee0@0x0:4,5]	->[0:0xee00@0x0:4,5]
[write(0, 0x0, 0x0)]
[aml_region_read(0, 2, 0x0, 0x4, 0x5)]
	[0:0xee00@0x0:4,5]
	[read(0, 0x0)&mask:0x0]
[read(0, 0x0)->0x0], Zero)))
If(LNot(LEqual(Store(0x4321, WF16)
[aml_region_write(0, 2, 0x4321, 0x0, 0x10, 0x10)]
	[0:0x1234@0x2:0,16]	->[0:0x4321@0x2:0,16]
[write(0, 0x4321, 0x2)]
[aml_region_read(0, 2, 0x0, 0x10, 0x10)]
	[0:0x4321@0x2:0,16]
	[read(0, 0x2)&mask:0x4321]
[read(0, 0x2)->0x4321], 0x4321)))
If(LNot(LEqual(Store(0x87654321, WF32)
[aml_region_write(0, 2, 0x87654321, 0x0, 0x20, 0x20)]
	[0:0x12345678@0x4:0,32]	->[0:0x87654321@0x4:0,32]
[write(0, 0x87654321, 0x4)]
[aml_region_read(0, 2, 0x0, 0x20, 0x20)]
	[0:0x87654321@0x4:0,32]
	[read(0, 0x4)&mask:0x87654321]
[read(0, 0x4)->0x87654321], 0x87654321)))
If(LNot(LEqual(Store(One, DF01)
[aml_region_write(0, 3, 0x1, 0x0, 0x0, 0x1)]
	[0:0x4321ee00@0x0:0,1]	->[0:0x4321ee01@0x0:0,1]
[write(0, 0x1, 0x0)]
[aml_region_read(0, 3, 0x0, 0x0, 0x1)]
	[0:0x4321ee01@0x0:0,1]
	[read(0, 0x0)&mask:0x1]
[read(0, 0x0)->0x1], One)))
If(LNot(LEqual(Store(0x7, DF03)
[aml_region_write(0, 3, 0x7, 0x0, 0x1, 0x3)]
	[0:0x4321ee01@0x0:1,3]	->[0:0x4321ee0f@0x0:1,3]
[write(0, 0x7, 0x0)]
[aml_region_read(0, 3, 0x0, 0x1, 0x3)]
	[0:0x4321ee0f@0x0:1,3]
	[read(0, 0x0)&mask:0x7]
[read(0, 0x0)->0x7], 0x7)))
If(LNot(LEqual(Store(0x15, DF05)
[aml_region_write(0, 3, 0x15, 0x0, 0x4, 0x5)]
	[0:0x4321ee0f@0x0:4,5]	->[0:0x4321ef5f@0x0:4,5]
[write(0, 0x15, 0x0)]
[aml_region_read(0, 3, 0x0, 0x4, 0x5)]
	[0:0x4321ef5f@0x0:4,5]
	[read(0, 0x0)&mask:0x15]
[read(0, 0x0)->0x15], 0x15)))
If(LNot(LEqual(Store(0x1234, DF16)
[aml_region_write(0, 3, 0x1234, 0x0, 0x10, 0x10)]
	[0:0x4321ef5f@0x0:16,16]	->[0:0x1234ef5f@0x0:16,16]
[write(0, 0x1234, 0x2)]
[aml_region_read(0, 3, 0x0, 0x10, 0x10)]
	[0:0x1234ef5f@0x0:16,16]
	[read(0, 0x0)&mask:0x1234]
[read(0, 0x2)->0x1234], 0x1234)))
If(LNot(LEqual(Store(0x12345, DF17)
[aml_region_write(0, 3, 0x12345, 0x0, 0x20, 0x11)]
	[0:0x87654321@0x4:0,17]	->[0:0x87652345@0x4:0,17]
[write(0, 0x12345, 0x4)]
[aml_region_read(0, 3, 0x0, 0x20, 0x11)]
	[0:0x87652345@0x4:0,17]
	[read(0, 0x4)&mask:0x12345]
[read(0, 0x4)->0x12345], 0x12345)))
If(LNot(LEqual(Store(0x12345, DF19)
[aml_region_write(0, 3, 0x12345, 0x0, 0x31, 0x13)]
	[offsetlow = 0x1, masklow = 0x1, ~masklow = 0xfe]
	[offsethigh = 0x4, maskhigh = 0xf0, ~maskhigh = 0xf]
	[0:0x65@0x6]->[0:0x8b@0x6]
	[0:0x87@0x7]->[0:0x46@0x7]
	[0:0x0@0x8]->[0:0x2@0x8]
[write(0, 0x12345, 0x6)]
[aml_region_read(0, 3, 0x0, 0x31, 0x13)]
	[offsetlow = 0x1, masklow = 0x1, ~masklow = 0xfe]
	[offsethigh = 0x4, maskhigh = 0xf0, ~maskhigh = 0xf]
	[0:0x8b@0x6]
	[0:0x46@0x7]
	[0:0x2@0x8]
	[read(0, 0x4)&mask:0x12345]
[read(0, 0x6)->0x12345], 0x12345)))
If(LNot(LEqual(Store(0x12345678, DF32)
[aml_region_write(0, 3, 0x12345678, 0x0, 0x60, 0x20)]
	[0:0x0@0xc:0,32]	->[0:0x12345678@0xc:0,32]
[write(0, 0x12345678, 0xc)]
[aml_region_read(0, 3, 0x0, 0x60, 0x20)]
	[0:0x12345678@0xc:0,32]
	[read(0, 0xc)&mask:0x12345678]
[read(0, 0xc)->0x12345678], 0x12345678)))
[\TEST. END]
TEST  Method: Arg 0 From 0x2806002c To 0x280602cc
NO object
