<div dir="ltr"><div>Hi Rudolf,</div><div><br></div>I'm for this change. I don't think it would be too invasive and should be easy to test with the compiler. <div><br></div><div>Marc</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 19, 2016 at 2:49 PM Rudolf Marek <<a href="mailto:r.marek@assembler.cz">r.marek@assembler.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
Just FYI [1], maybe you already know.<br>
<br>
There is an alternate syntax available for ACPI ASL sources.<br>
It just converts Polish notation  of ASL to something less geeky like C<br>
operators. It says that the tool to convert the sources is in development (to<br>
ratain comments). I think it would make ACPI more readable if coreboot would<br>
switch to ASL 2.0. Note that the change is only on syntax side! Latest ACPICA<br>
iasl already decompiles to this syntax by default!<br>
<br>
Example before:<br>
<br>
      Method (SRDY, 0, Serialized)<br>
        {<br>
                Store (200, Local0)     // Timeout 200ms<br>
                While (Local0) {<br>
                        If (And(HSTS, 0x40)) {          // IN_USE?<br>
                                Sleep(1)                // Wait 1ms<br>
                                Decrement(Local0)       // timeout--<br>
                                If (LEqual(Local0, 0)) {<br>
                                        Return (1)<br>
                                }<br>
                        } Else {<br>
                                Store (0, Local0)       // We're ready<br>
                        }<br>
                }<br>
<br>
                Store (4000, Local0)    // Timeout 200ms (50us * 4000)<br>
                While (Local0) {<br>
                        If (And (HSTS, 0x01)) {         // Host Busy?<br>
                                Stall(50)               // Wait 50us<br>
                                Decrement(Local0)       // timeout--<br>
                                If (LEqual(Local0, 0)) {<br>
                                        KILL()<br>
                                }<br>
                        } Else {<br>
                                Return (0)              // Success<br>
                        }<br>
                }<br>
<br>
                Return (1)              // Failure<br>
        }<br>
<br>
<br>
After:<br>
<br>
        Method (SRDY, 0, Serialized)<br>
        {<br>
            Local0 = 0xC8<br>
            While (Local0)<br>
            {<br>
                If (HSTS & 0x40)<br>
                {<br>
                    Sleep (0x01)<br>
                    Local0--<br>
                    If (Local0 == 0x00)<br>
                    {<br>
                        Return (0x01)<br>
                    }<br>
                }<br>
                Else<br>
                {<br>
                    Local0 = 0x00<br>
                }<br>
            }<br>
<br>
            Local0 = 0x0FA0<br>
            While (Local0)<br>
            {<br>
                If (HSTS & 0x01)<br>
                {<br>
                    Stall (0x32)<br>
                    Local0--<br>
                    If (Local0 == 0x00)<br>
                    {<br>
                        KILL ()<br>
                    }<br>
                }<br>
                Else<br>
                {<br>
                    Return (0x00)<br>
                }<br>
            }<br>
<br>
            Return (0x01)<br>
        }<br>
<br>
<br>
Thanks<br>
Rudolf<br>
<br>
<br>
[1] <a href="https://acpica.org/sites/acpica/files/ASL2.0Overview.pdf" rel="noreferrer" target="_blank">https://acpica.org/sites/acpica/files/ASL2.0Overview.pdf</a><br>
<br>
<br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="https://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://www.coreboot.org/mailman/listinfo/coreboot</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><a href="http://marcjonesconsulting.com">http://marcjonesconsulting.com</a></div></div>