From owner-acpi-jp@jp.freebsd.org  Wed Sep  6 18:48:22 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id SAA93738;
	Wed, 6 Sep 2000 18:48:22 +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 SAA93731;
	Wed, 6 Sep 2000 18:48:20 +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 e869mGr63307;
	Wed, 6 Sep 2000 18:48:16 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
To: acpi-jp@jp.freebsd.org, haro@tk.kubota.co.jp
Cc: iwasaki@jp.freebsd.org
In-Reply-To: <20000906115713P.haro@tk.kubota.co.jp>
References: <20000904182308B.haro@tk.kubota.co.jp>
	<20000904194430S.iwasaki@jp.FreeBSD.org>
	<20000906115713P.haro@tk.kubota.co.jp>
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: <20000906184742U.iwasaki@jp.FreeBSD.org>
Date: Wed, 06 Sep 2000 18:47:42 +0900
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
X-Dispatcher: imput version 20000228(IM140)
Lines: 87
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 618
Subject: [acpi-jp 618] 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

$B5W$7$V$j$K(B AML interpreter $B$K%P%0H/8+$+$b(B?

> $B>>ED!w%/%\%?$G$9!#(B
> 
> From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
> Date: Mon, 04 Sep 2000 19:44:30 +0900
> ::> $B:G=i$OE,Ev$J(Bflag$B$r;H$C$FH=CG$5$;$h$&$H;W$C$?$N$G$9$,!"8=:_$N%3!<%I$@$H(B
> ::> ACPI_NO_ENABLE_ON_BOOT$B$r@_Dj$7$J$$8B$j6/@)E*$K(Benable$B$5$l$F$$$k$N$G!"(B
> ::> $B@h$N%Q%C%A$N$h$&$K$7$^$7$?!#(B
> ::> 
> ::> $B!t$=$m$=$m!"N)$A>e$2;~$K6/@)E*$K(Benable$B$9$k$N$b9M$($b$N$G$7$g$&$+!)(B
> ::
> ::/etc/rc.conf $B$"$?$j$K(B acpi_enable $B$H$+Dj5A$7$F(B /etc/rc.i386 $B$"$?$j(B
> ::$B$+$i(B acpiconf -e $B$G$9$+$M!#(B
> ::# $B$^$"!"$3$NJU$O$b$&>/$7<BAu$,?J$s$G$+$i$H$$$&$3$H$G!#(B
> ::## $B$G$b%Q%C%A$O?o;~Jg=8Cf(B :-)
> 
> $B<B$O$9$G$K%Q%C%A$,<j85$K$"$k$N$G!"$*Aw$j$7$^$9!#(B:-)
> $B$3$l$O0JA0!"(BACPI_NO_ENABLE_ON_BOOT$B$,F3F~$5$l$?:"$K:n$C$?$b$N$G$9!#(B

$B$"$j$,$H$&$4$6$$$^$9!#$"$H$G(B commit $B$7$F$*$-$^$9(B (_ _)

> ::PowerResource(PFN1, 0, 0)
> ::PowerResource(PUSB, 0, 0)
> ::PowerResource(PUAR, 0, 0)
> ::$B$H$"$C$F!"(BS1 $B$N:]$K$O$<$s$V(B OFF $B$K$J$k$N$G!"$3$l$NA`:n$N%?%$%_%s%0$,(B
> ::$B$^$:$=$&$J5$$,$7$^$9(B (^^;
> 
> $B$I$&$d$i(B "PowerResource(PUAR, 0, 0)"$BJU$j$G;`$s$G$k$h$&$G$9!#(B
> AML_DEBUG$B$rM-8z$K$7$F8+$?=j!"0J2<$NI=<($H$H$b$K%O%s%0$7$^$9!#(B
> 
> 	[\_SB_.PCI0.PX40.UAR1.PUAR._OFF. START]
> 	Store(Zero, U1EN)[write(1, 0x0, 0x398)]

amldb $B$G$3$l(B $B$H(B _ON $B$rF0$+$7$F$_$?$i!"JQ$J$3$H$K5$$,IU$-$^$7$?!#(B
U1EN $B$O0J2<$NDL$j!"(BSystemIO 0x398 $B$N(B IndexField $B$J$s$G$9$,!"(B
            OperationRegion(SIO1, SystemIO, 0x398, 0x2)
            Field(SIO1, ByteAcc, NoLock, Preserve) {
                INDX,   8,
                DATA,   8
            }
            IndexField(INDX, DATA, ByteAcc, NoLock, Preserve) {
                PPEN,   1,
                U1EN,   1,
                IREN,   1,
                FDEN,   1,
                Offset(0x10),
U1EN $B$HNY$N(B PPEN $B$NA`:n$,F1$8$h$&$K$J$C$F$$$k$/$5$$$G$9!#(B
# bit widths 1 $B$K$J$C$F$$$k$3$H$KCm0U(B

U1EN $B$O(B 0x399 $B$^$k$4$H=q$-9~$_!"(B
[\_SB_.PCI0.PX40.UAR1.PUAR._ON_. START]
Store(One, U1EN)
[aml_region_write(1, 1, 0x0, 0x398, 0x0, 0x8)]
        [1:0x00@0x398]->[1:0x00@0x398]
[write(1, 0x0, 0x398)]
[aml_region_write(1, 1, 0x2, 0x398, 0x8, 0x8)]
        [1:0x00@0x399]->[1:0x02@0x399]
[write(1, 0x2, 0x399)]

$B$=$7$F(B PPEN $B$b(B 0x399 $B$^$k$4$H=q$-9~$`(B...
[\_SB_.PCI0.PX40.LPT0._DIS. START]
Store(Zero, PPEN)
[aml_region_write(1, 1, 0x0, 0x398, 0x0, 0x8)]
        [1:0x00@0x398]->[1:0x00@0x398]
[write(1, 0x0, 0x398)]
[aml_region_write(1, 1, 0x0, 0x398, 0x8, 0x8)]
        [1:0x02@0x399]->[1:0x00@0x399]
[write(1, 0x0, 0x399)]

aml_store.c:aml_store_to_fieldname() $B$N(B 115$B9TL\$"$?$j$N(B
	} else if (field->f.ftype == f_t_index) {
		wname = aml_search_name(env, field->f.ifld.indexname);
		tobj.type = aml_t_num;
		tobj.num.number = field->bitoffset / 8;	/* AccessType Boundary */
		aml_store_to_name(env, &tobj, wname);
		wname = aml_search_name(env, field->f.ifld.dataname);
		tobj.num = obj->num;
		tobj.num.number = tobj.num.number << (field->bitoffset & 7);
		aml_store_to_name(env, &tobj, wname);
	}
$B$3$3$,2x$7$=$&$@$H$K$i$s$G$$$^$9!#$D$^$j!"(B
 - $B=q$-9~$`A0$K(B field->f.ifld.dataname $B$r(B aml_eval_name() $B$7$FCM$r<hF@(B
 - field->bitoffset $B$r$b$H$K(B mask $B$7$F=q$-9~$`CM$r7W;;(B
 - $B2~$a$F(B indexname/dataname $B$N=g$K%"%/%;%9$7$FCM$r=q$-9~$`(B
$B$_$?$$$J$3$H$,I,MW$+$J$!$H;W$$$^$9$,!"C/$+%D%C%3%_$*4j$$$7$^$9(B (^^;

