Bug in "implicit return" code

Nate Lawson nate at root.org
Sun Jan 2 20:08:26 PST 2005


I have identified a problem in the implicit return code in dsutils.c. 
Various Toshiba laptops have a _STA method that is similar to this:

DefinitionBlock ("DSDT.aml", "DSDT", 1, "TOSHIB", "8100    ", 536872468)
{
     Device (LNKA)
     {
         Name (_HID, EisaId ("PNP0C0F"))
         Method (_STA, 0, NotSerialized)
         {
             STAL (0x60)
         }
     }

     Method (STAL, 1, NotSerialized)
     {
         /* Various link accesses removed for clarity. */
         Return (0x0B)
     }
}

If you compile and run this snippet in the debugger, you'll see that 
_STA doesn't return anything even with EnableInterpreterSlack set to 
TRUE.  This means the implicit return code doesn't work properly.

I examined the AcpiDsIsResultUsed() function and found that the check 
that was failing was this one:

     /*
      * If there is no parent, we are executing at the method level.
      * An executing method typically has no parent, since each method
      * is parsed separately.
      */
     if (!Op->Common.Parent)

So it appears that there _is_ a parent and the implicit return code 
below is never executed for this method.  I'm not sure the proper way to 
change this check for the above AML case but hopefully the Intel people 
will know.

-- 
Nate


More information about the freebsd-acpi mailing list