<div dir="ltr">I've even seen this done, or maybe I did it, I forget, but it's a one time pass through something like cpp:<div>#define Store(src, dst) dst = src</div><div><br></div><div>to produce the final output.</div><div><br></div><div>repeat for all ops of interest. Then, if there is a switch to ASL to not accept pre-asl-2.0 code you do a clean up stage as needed.</div><div>You only need the cpp hack once as you want to switch to the transformed output.</div><div><br></div><div>Not pretty, but maybe ACPI is so simple that it  would work.</div><div><br></div><div>ron</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 20, 2016 at 12:11 PM ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It would be nice if there were a source to source transformation tool out there but failing that RPN to infix is pretty simple to automate.</div><div dir="ltr"><div><br></div><div>ron</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 20, 2016 at 12:03 PM Duncan Laurie <<a href="mailto:dlaurie@chromium.org" target="_blank">dlaurie@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>So far I've been asking people in ACPI patches to not introduce ASL 2.0 syntax into existing ASL code as it can be confusing if the two are mixed.  So we should either convert everything or at least only use ASL 2.0 syntax in new files.</div><div><br></div>The problem with auto-converting sources with the disassembly/assembly trick is you lose all the comments.<div><br></div><div>The problem with doing it by hand is it very easy to mess something up.</div></div><div dir="ltr"><div><br></div><div>-duncan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 20, 2016 at 11:39 AM, Marc Jones <span dir="ltr"><<a href="mailto:marcj303@gmail.com" target="_blank">marcj303@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><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" target="_blank">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></div><span><font color="#888888"><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><a href="http://marcjonesconsulting.com" target="_blank">http://marcjonesconsulting.com</a></div></div>
</font></span><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><br></div>
--<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></blockquote></div></blockquote></div>