From owner-acpi-jp@jp.freebsd.org  Sun May 21 23:35:58 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id XAA87006;
	Sun, 21 May 2000 23:35:58 +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 XAA87001
	for <acpi-jp@jp.freebsd.org>; Sun, 21 May 2000 23:35:57 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (isdnb37.imasy.or.jp [202.227.24.165])
	by tasogare.imasy.or.jp (8.9.3+3.2W/3.7W-tasogare/smtpfeed 1.04) with ESMTP id XAA67070
	for <acpi-jp@jp.freebsd.org>; Sun, 21 May 2000 23:35:55 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
To: acpi-jp@jp.freebsd.org
In-Reply-To: <200005201601.BAA30546@shidahara1.planet.sci.kobe-u.ac.jp>
References: <20000520163530P.iwasaki@jp.FreeBSD.org>
	<200005201601.BAA30546@shidahara1.planet.sci.kobe-u.ac.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: <20000521233554E.iwasaki@jp.FreeBSD.org>
Date: Sun, 21 May 2000 23:35:54 +0900
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
X-Dispatcher: imput version 20000228(IM140)
Lines: 144
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 303
Subject: [acpi-jp 303] Re: over 32 bit region I/O
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

> $BAG@2$i$7$$$G$9!#(B

$B$I$b(B :-)

> ># bufferfield $B$K4X$7$F$O(B takawata $B$5$s$K$*G$$;$7$F$$$$(B?
> 
> $B6&DL$9$kItJ,$,Bg$-$$$N$G!";d$N<BAu$r<N$F$F!"$=$N$^$^$D$/$C$F$$$?$@$1$^$;$s$+!)(B

$BBg$-$J4*0c$$$r$7$F$$$J$1$l$P!"(Bregion I/O API $B$KNI$/;w$?(B bufferfield $BMQ$N(B
$B4X?t72$r:n$C$F!"(B32 $B%S%C%HD90J2<$N$d$D$O$=$A$i$G$9$0=hM}!"$=$l$r1[$($k>l9g$O(B
Store $B;~$^$G(B I/O $B$r$*$3$J$o$J$$$h$&$K$7$^$7$?!#(B
BufferField $B$r;H$&%d%D$O0F30>/$J$/$F!"(Bfmv6300na.dsdt.dat $B$G%F%9%H$7$^$7$?!#(B

AML>r \_SB.PCI0.IDE_.PRIM.MAST._GTF
Method: Arg 0 From 0x280f2586 To 0x280f265c
==== Running \_SB.PCI0.IDE_.PRIM.MAST._GTF. ====
AML>s
[\_SB.PCI0.IDE.PRIM.MAST._GTF. START]
If(LEqual(NCD1[read(From0 , 0x5fffeba)]
[acpi_region_read(0, 1, 0x5fffeba, 0x0, 0x8)]
        [0:0x00@0x5fffeba]
DEBUG[read(0, 0x5fffeba)&mask:0x0](default: 0x0 / 0) >>3
        [0:0x00@0x5fffeba]->[0:0x03@0x5fffeba]
, 0x3)){
    Name(IDF3, Buffer(0x15) )
AML>
    CreateField(IDF3, 0x0, 0x38, CF30) 
AML>
    CreateField(IDF3, 0x38, 0x38, CF31) 
AML>
    CreateField(IDF3, 0x70, 0x38, CF32) 
AML>
    Store(NVC0, CF30)
[acpi_region_read_into_buffer(0, 1, 0x5fffeba, 0x8, 0x38)]

AML>
    Store(NVC1, CF31)
[acpi_region_read_into_buffer(0, 1, 0x5fffeba, 0x40, 0x38)]

AML>
    Store(NVC2, CF32)
[acpi_region_read_into_buffer(0, 1, 0x5fffeba, 0x78, 0x38)]

AML>
    Return(IDF3)
}
[\_SB.PCI0.IDE.PRIM.MAST._GTF. END]
_GTF  Method: Arg 0 From 0x280f2586 To 0x280f265c
Buffer: size:21 Data 0x82474a0
==== \_SB.PCI0.IDE_.PRIM.MAST._GTF finished. ====

$B$^$?!"0J2<$N$h$&$J(B ASL $B$r=q$$$F%F%9%HMQ(BDSDT$B$r:n$C$F<B9T$7$?$H$3$m!"(B

OperationRegion(SRAM, SystemMemory, 0x00000000, 0x00010000)
Field(SRAM, AnyAcc, NoLock, Preserve) {
    Offset(0x7000),
    PRES,       32768
}

Method(TEST, 0) {
    Name(BUFF, Buffer(0x8000) {1,2,3,4,5,6,7,8,9,10 })
    CreateField(BUFF, 0x0, 0x38, CF30)
    CreateField(BUFF, 0x38, 0x10, CF31)
    CreateField(BUFF, 0x48, 0x38, CF32)
    If(LEqual(CF31, 0x0)) {
        Store("CF31 = 0x0", Debug)
    }
    Else {
        Store(CF31, Debug)
    }
    Store(CF30, CF32)   
    Store(BUFF, PRES)   
    Store(PRES, BUFF)   
    Return(BUFF)
}

AML>r TEST
Method: Arg 0 From 0x280f360c To 0x280f368b
==== Running TEST. ====
AML>s
[\TEST. START]
Name(BUFF, Buffer(0x8000) )
AML>
CreateField(BUFF, 0x0, 0x38, CF30) 
AML>
CreateField(BUFF, 0x38, 0x10, CF31) 
AML>
CreateField(BUFF, 0x48, 0x38, CF32) 
AML>
If(LEqual(CF31  [bufferfield:0x08@0x0x8273007]
        [bufferfield:0x09@0x0x8273008]
[read(bufferfield, 0x0x8273008)&mask:0x908]
, 0x0))Else {
    Store(CF31  [bufferfield:0x08@0x0x8273007]
        [bufferfield:0x09@0x0x8273008]
[read(bufferfield, 0x0x8273008)&mask:0x908]
, Debug)Num:0x908

AML>
}
AML>s
Store(CF30, CF32)
AML>
Store(BUFF, PRES)
[acpi_region_write_from_buffer(0, 0, 0x0, 0x38000, 0x8000)]

AML>
Store(PRES, BUFF)
[acpi_region_read_into_buffer(0, 0, 0x0, 0x38000, 0x8000)]

AML>
Return(BUFF)
[\TEST. END]

$B$H$$$&46$8$GFC$K%(%i!<$b$J$/!"<B9T=*N;8e$K(B region.dmp $B$r3NG'$7$F$_$k$H!"(B
0       0x7000  0x1
0       0x7001  0x2
0       0x7002  0x3
0       0x7003  0x4
0       0x7004  0x5
0       0x7005  0x6
0       0x7006  0x7
0       0x7007  0x8
0       0x7008  0x9
0       0x7009  0x1
0       0x700a  0x2
0       0x700b  0x3
0       0x700c  0x4
0       0x700d  0x5
0       0x700e  0x6
0       0x700f  0x7
0       0x7010  0x0

$B$H$$$&46$8$G4|BT$7$?DL$j$N7k2L$G$7$?(B :-)

> $B$=$&8@$($P!"(BSimulation Region Read$BJU$j$b!"=c?h$J(BSimulation$BItJ,$H!"(BSimulation
> $B$GL5$/$F$b;H$($kItJ,$K$o$1$F$$$?$@$1$k$H3Z$,=PMh$k$H;W$$$^$9!#(B

$B$3$l$O<g$K(B region.c $B$N(B acpi_simulate_region_io() $B$+$iHFMQE*$JItJ,$r(B
$B@Z$j=P$7$F(B bufferfield $BEy$G$b;H$($k$h$&$K$7$h$&$H$$$&$3$H$@$H;W$$$^$9$,!"(B
DEBUG print $B$d(B prompt $B4X78$,$"$j$d$d$3$7$$$N$G!";~4V$,$"$k;~$K!"(B
$B$H$$$&$3$H$G(B (^^;

$B$b$&>/$7@0M}$7$?$i(B commit $B$7$F$*$-$^$9!#(B
