[acpi-jp 3117] RE: ACPI-CA 20040311 imported

Moore, Robert robert.moore at intel.com
Mon Mar 29 10:24:13 PST 2004


There's nothing in the ACPI spec that precludes recursive methods.
However, I agree that it is a very scary thing to do.  For this reason,
I have the iASL compiler issue a remark when it detects a recursive
method call.

All AML interpreters that I know of implement nested and recursive
method calls without chewing up the kernel stack, i.e., a state is
allocated for each nested call and linked to the previous method state.

Bob


-----Original Message-----
From: Bruno Ducrot [mailto:ducrot at poupinou.org] 
Sent: Sunday, March 28, 2004 7:57 AM
To: Moore, Robert
Cc: Nate Lawson; acpi-jp at jp.FreeBSD.org; current at freebsd.org
Subject: Re: [acpi-jp 3117] RE: ACPI-CA 20040311 imported

On Fri, Mar 26, 2004 at 01:52:21PM -0800, Moore, Robert wrote:
> Here's an example of ASL recursion:
> 
> Method(PWUP,0,NotSerialized)
> {
>     If(LAnd(\_SB.PCI0.CBS0.PWRS,\_SB.PCI0.CBS1.PWRS))
>     {
>         If(LNot(And(_ADR /* \_SB.PCI0.CBS0._ADR */,0xFFFF)))
>         {
>             And(MCTL /* \_SB.PCI0.CBS0.MCTL */,0x7C,Local0)
>             Or(Local0,BMCL /* \_SB.PCI0.CBS0.BMCL */,MCTL /*
> \_SB.PCI0.CBS0.MCTL */)
>         }
>         Else
>         {
>             \_SB.PCI0.CBS0.PWUP()
>         }
>     }
> }

I assume that PWRS are some hardware io (pci conf probably), able to
detect if the cardbus is powered or not.
I assume _ADR can not be made dynamic.  So far, this function look like:

Method(PWUP, 0, NotSerialized) {
	While (Not((LAnd(\_SB.PCI0.CBS0.PWRS,\_SB.PCI0.CBS1.PWRS))) {
		Noop
	}
}
and is probably called from _WAK, or more likely from _PS0 so far I
guess it is ok to busy loop (in both form).

Why not writting the busy loop instead?

In the original form, there is the possibility to crash the system
by overflowing the kernel stack if the bus is not powered quickly.



--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


More information about the freebsd-current mailing list