From owner-acpi-jp@jp.freebsd.org  Tue Nov 28 02:55:45 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id CAA37768;
	Tue, 28 Nov 2000 02:55:45 +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 CAA37763
	for <acpi-jp@jp.freebsd.org>; Tue, 28 Nov 2000 02:55:44 +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 CAA03767
	for <acpi-jp@jp.freebsd.org>; Tue, 28 Nov 2000 02:55:54 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
Message-Id: <200011271755.CAA03767@shidahara1.planet.sci.kobe-u.ac.jp>
To: acpi-jp@jp.freebsd.org
In-reply-to: Your message of "Sun, 26 Nov 2000 22:38:07 JST."
             <200011261338.WAA94991@shidahara1.planet.sci.kobe-u.ac.jp>
Date: Tue, 28 Nov 2000 02:55:54 +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+000315
X-Sequence: acpi-jp 925
Subject: [acpi-jp 925] Re: Parser BUG FIX? (Re: FYI: ACPICA new version. )
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

In message <200011261338.WAA94991@shidahara1.planet.sci.kobe-u.ac.jp>, Takanori
 Watanabe $B$5$s$$$o$/(B:
>I think it is because return result of method is overridden by that of 
>index op result and points same object as Store op operand.

This problem consist of two problem: one is Operand type checking is done for 
not actual object but return object of previous execution.
Another is that the order of object put to stack is not correct.
This is *workaround* for this problem.(This is *not* fix.)

--- /home/takawata/acpica/Subsystem/Interpreter/ammonad.c	Thu Nov 16 09:18:45 2000
+++ src/sys/contrib/dev/acpica/Subsystem/Interpreter/ammonad.c	Tue Nov 28 02:22:42 2000
@@ -354,7 +354,7 @@
     ACPI_OPERAND_OBJECT     *RetDesc = NULL;
     ACPI_OPERAND_OBJECT     *RetDesc2 = NULL;
     UINT32                  ResVal;
-    ACPI_STATUS             Status;
+    ACPI_STATUS             Status,Status1,Status2;
     UINT32                  d0;
     UINT32                  d1;
     UINT32                  d2;
@@ -370,21 +370,30 @@
     DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE,
                     AcpiPsGetOpcodeName (Opcode),
                     2, "after AcpiAmlResolveOperands");
-
     /* Get all operands */
+    Status1 = AcpiDsObjStackPopObject (&ResDesc, WalkState);
+    Status2 = AcpiDsObjStackPopObject (&ObjDesc, WalkState);
+    if (Status){
+      void *tmp;
+      printf("AcpiAmlResolveOperands FAILED, RETVAL Bug?\n");
+      tmp = ResDesc;
+      ResDesc = ObjDesc;
+      ObjDesc = tmp;
+    }
 
-    Status |= AcpiDsObjStackPopObject (&ResDesc, WalkState);
-    Status |= AcpiDsObjStackPopObject (&ObjDesc, WalkState);
+    Status = Status1|Status2;
     if (ACPI_FAILURE (Status))
     {
+      if(WalkState->MethodNode){
+	char *name = (char *)&WalkState->MethodNode->Name;
+	printf("%c%c%c%c",name[0],name[1],name[2],name[3]);
+      }
         DEBUG_PRINT (ACPI_ERROR,
             ("ExecMonadic2R/%s: bad operand(s) (0x%X)\n",
             AcpiPsGetOpcodeName (Opcode), Status));
-
         goto Cleanup;
     }
 
-
     /* Create a return object of type NUMBER for most opcodes */
 
     switch (Opcode)


$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 
