<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 20, 2016 at 1:02 PM Duncan Laurie <<a href="mailto:dlaurie@chromium.org">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></div></blockquote><div><br></div><div>I agree. We don't want mixed. Maybe a comment at the top of the file if it is an ACPI2.0 format.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div>The problem with auto-converting sources with the disassembly/assembly trick is you lose all the comments.<div><br></div></div></blockquote><div><br></div><div>I don't know how many changes there are and how much could be partial automated. We need to understand the scale of the work involved and have a plan to integrate the changes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></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></blockquote><div><br></div><div>But that *should* be easy to check. The disassembly should match before and after.</div><div><br></div><div>Marc</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></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>
</blockquote></div></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>