Contribute
Register

[solved] Compiling in MacASL: spits out 6 errors

Status
Not open for further replies.
Joined
Jan 8, 2016
Messages
32
Motherboard
Gigabyte GA-H170M-DS3H
CPU
i7-6700
Graphics
GTX 750 Ti
Hi everyone,

So my end goal is to disable USB wake from sleep by applying either "usb_prw_0x0d_xhc.txt" or the "usb_prw_0x6d_xhc.txt" patch from RehabMan's repository. But before the (patched) DSDT.dsl can be compiled the following errors need to be cleared.

So far I did the following:
  • Used Clover + F4 to get DSDT.aml and the SSDT.aml files
  • Used iasl in Terminal (iasl -da -dl DSDT.aml SSDT*.aml) to decompile DSDT.aml and SSDTs in order to get DSDT.dsl.
  • Opened DSDT.dsl in MaciASL
When trying to compile the (unmodified, for testing's sake) DSDT.dsl file MaciASL spits out 6 errors. Tried both the 5.0A and 5.1 compiler: same result. 4.0 causes even more errors.
  • [FIXED THIS ONE] 13920 6126 syntax error, unexpected PARSEOP_ARG0 [FIXED THIS ONE]
  • 15571 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15733 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15746 6126 syntax error, unexpected PARSEOP_STORE
  • 15748 6126 syntax error, unexpected PARSEOP_STORE
  • 15757 6126 syntax error, unexpected PARSEOP_METHOD, expecting $end and premature End-Of-File
How can these errors be fixed? I don't have enough knowdledge on the subject to fix it on my own. Help is greatly appreciated!

Link to the terminal log

Link to the DSDT.dsl file

Update: Managed to get rid of 1 error by using refs.txt in the disassembly process as described in this thread.
 
Last edited:
Hi everyone,

So my end goal is to disable USB wake from sleep by applying either "usb_prw_0x0d_xhc.txt" or the "usb_prw_0x6d_xhc.txt" patch from RehabMan's repository. But before the (patched) DSDT.dsl can be compiled the following errors need to be cleared.

So far I did the following:
  • Used Clover + F4 to get DSDT.aml
  • Used iasl in Terminal (iasl -da -dl *.aml) to decompile DSDT.aml in order to get DSDT.dsl. The following warning was given:
  • "iASL Warning: There were 26 external control methods found during disassembly, but only 9 were resolved (17 unresolved). Additional ACPI tables may be required to properly disassemble the code. This resulting disassembler output file may not compile because the disassembler did not know how many arguments to assign to the unresolved methods. Note: SSDTs can be dynamically loaded at runtime and may or may not be available via the host OS."
  • Opened DSDT.dsl in MaciASL
When trying to compile the (unmodified, for testing's sake) DSDT.dsl file MaciASL spits out 6 errors. Tried both the 5.0A and 5.1 compiler: same result. 4.0 causes even more errors.
  • [FIXED THIS ONE] 13920 6126 syntax error, unexpected PARSEOP_ARG0 [FIXED THIS ONE]
  • 15571 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15733 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15746 6126 syntax error, unexpected PARSEOP_STORE
  • 15748 6126 syntax error, unexpected PARSEOP_STORE
  • 15757 6126 syntax error, unexpected PARSEOP_METHOD, expecting $end and premature End-Of-File
How can these errors be fixed? I don't have enough knowdledge on the subject to fix it on my own. Help is greatly appreciated!

Link to the DSDT.dsl file

Update: Managed to get rid of 1 error by using refs.txt in the disassembly process as described in this thread.

Disassemble with SSDTs as context: iasl -da -dl DSDT.aml SSDT*.aml
 
Disassemble with SSDTs as context: iasl -da -dl DSDT.aml SSDT*.aml

Placed the DSDT and SSDTs in the same folder and put "iasl -da -dl DSDT.aml SSDT*.aml" into terminal. The resulting DSDT.dsl file still gives the same errors. The "external control methods" for the DSDT that are mentioned in Terminal did decrease from 26 to 19 using your method.

Am I missing something?

Terminal log can be found here
 
Last edited:
Placed the DSDT and SSDTs in the same folder and put "iasl -da -dl DSDT.aml SSDT*.aml" into terminal. The resulting DSDT.dsl file still gives the same errors. The "external control methods" for the DSDT that are mentioned in Terminal did decrease from 26 to 19 using your method.

Am I missing something?

Terminal log can be found here

No idea without seeing your files and the specifics of the error.
 
No idea without seeing your files and the specifics of the error.

Link to DSDT + SSDTs
Link to Terminal log (disassembly)
Link to disassembled DSDT + SSDTs

Compiling errors in MaciASL:
  • 15571 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15733 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15746 6126 syntax error, unexpected PARSEOP_STORE
  • 15748 6126 syntax error, unexpected PARSEOP_STORE
  • 15757 6126 syntax error, unexpected PARSEOP_METHOD, expecting $end and premature End-Of-File
 
Link to DSDT + SSDTs
Link to Terminal log (disassembly)
Link to disassembled DSDT + SSDTs

Compiling errors in MaciASL:
  • 15571 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15733 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15746 6126 syntax error, unexpected PARSEOP_STORE
  • 15748 6126 syntax error, unexpected PARSEOP_STORE
  • 15757 6126 syntax error, unexpected PARSEOP_METHOD, expecting $end and premature End-Of-File

No errors if you disassemble your files with refs.txt as per guide: http://www.tonymacx86.com/threads/guide-patching-laptop-dsdt-ssdts.152573/

iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml

Or you can fix the code quite easily...

From:
Code:
            Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
            {
                If (PCIC (Arg0))
                {
                    Return (PCID (Arg0, Arg1, Arg2, Arg3))
                }

                If (CondRefOf (\_SB.PCI0.SAT0.SDSM))
                {
                    Return (SDSM)
                    Arg0
                    Arg1
                    Arg2
                    Arg3
                }

                Return (Zero)
            }

To:
Code:
            Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
            {
                If (PCIC (Arg0))
                {
                    Return (PCID (Arg0, Arg1, Arg2, Arg3))
                }

                Return (Zero)
            }

From:
Code:
    Method (ADBG, 1, Serialized)
    {
        If (CondRefOf (MDBG))
        {
            Return (MDBG)
            Arg0
        }

        Return (Zero)
    }

To:
Code:
    Method (ADBG, 1, Serialized)
    {
        Return (Zero)
    }

Since SDSM and the MDBG symbols are not defined anywhere, you know that the CondRefOf will return false, and therefore it is safe to remove all the code inside the CondRefOf block as it would never execute anyway.
 
No errors if you disassemble your files with refs.txt as per guide: http://www.tonymacx86.com/threads/guide-patching-laptop-dsdt-ssdts.152573/

iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml

Or you can fix the code quite easily...

From:
Code:
            Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
            {
                If (PCIC (Arg0))
                {
                    Return (PCID (Arg0, Arg1, Arg2, Arg3))
                }

                If (CondRefOf (\_SB.PCI0.SAT0.SDSM))
                {
                    Return (SDSM)
                    Arg0
                    Arg1
                    Arg2
                    Arg3
                }

                Return (Zero)
            }

To:
Code:
            Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
            {
                If (PCIC (Arg0))
                {
                    Return (PCID (Arg0, Arg1, Arg2, Arg3))
                }

                Return (Zero)
            }

From:
Code:
    Method (ADBG, 1, Serialized)
    {
        If (CondRefOf (MDBG))
        {
            Return (MDBG)
            Arg0
        }

        Return (Zero)
    }

To:
Code:
    Method (ADBG, 1, Serialized)
    {
        Return (Zero)
    }

Since SDSM and the MDBG symbols are not defined anywhere, you know that the CondRefOf will return false, and therefore it is safe to remove all the code inside the CondRefOf block as it would never execute anyway.

After disassembly using the exact method from the guide and using refs.txt (iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml) I still get the same errors. Even after manually finding and replacing the code you mentioned MaciASL is still spitting out the same errors.

Link to DSDT with your feedback applied

And just to be sure, manually modifying the code is as simple as locating the relevant code and replacing it with what you posted, then hitting compile in MaciASL. No extra steps neccesary?

Since you're not experiencing the errors and if it's not too much to ask, would you be able to modify the DSDT and post a link?
 
Last edited:
After disassembly using the exact method from the guide and using refs.txt (iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml) I still get the same errors. Even after manually finding and replacing the code you mentioned MaciASL is still spitting out the same errors.

Any idea about what on earth I'm doing wrong?

No idea when you don't provide the files.

Possible mistakes:
- refs.txt is empty
- wrong version of iasl in use

Same errors not possible with the edited code I mentioned in my previous post.

And just to be sure, manually modifying the code is as simple as locating the relevant code and replacing it with what you posted, then hitting compile in MaciASL. No extra steps neccesary?

Correct. And if you look at my from/to, it is quite easy to see the changes I made...

Since you're not experiencing the errors and if it's not too much to ask, would you be able to modify the DSDT and post a link?

No. Patching your own files is something you need to learn.
 
No idea when you don't provide the files.

Possible mistakes:
- refs.txt is empty
- wrong version of iasl in use

Same errors not possible with the edited code I mentioned in my previous post.



Correct. And if you look at my from/to, it is quite easy to see the changes I made...



No. Patching your own files is something you need to learn.

refs.txt
DSDT with your changes applied

I edited the original code between:
  • Line 13924 and 13937
  • Line 17345 and 17353
Downloaded iasl from the RehabMan Bitbucket. It doesn't say which version.

MaciASL 1.4

Settings

General
"code coloring" is ticked

iASL
ACPI Specification --> 5.1
"Enable remark messages" and "Enable optimization messages" are ticked

Sources
"RehabMan"
"Sourceforge"
"Gigabyte"
"ASUS"

Compiling errors persistent in MaciASL:
  • 15571 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15733 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15746 6126 syntax error, unexpected PARSEOP_STORE
  • 15748 6126 syntax error, unexpected PARSEOP_STORE
  • 15757 6126 syntax error, unexpected PARSEOP_METHOD, expecting $end and premature End-Of-File
I would like to learn how to do this. If you need more info, please let me know.
 
Last edited:
refs.txt
DSDT with your changes applied

I edited the original code between:
  • Line 13924 and 13937
  • Line 17345 and 17353
Downloaded iasl from the RehabMan Bitbucket. It doesn't say which version.

MaciASL 1.4

Settings

General
"code coloring" is ticked

iASL
ACPI Specification --> 5.1
"Enable remark messages" and "Enable optimization messages" are ticked

Sources
"RehabMan"
"Sourceforge"
"Gigabyte"
"ASUS"

Compiling errors persistent in MaciASL:
  • 15571 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15733 6126 syntax error, unexpected PARSEOP_NAMESEG, expecting '('
  • 15746 6126 syntax error, unexpected PARSEOP_STORE
  • 15748 6126 syntax error, unexpected PARSEOP_STORE
  • 15757 6126 syntax error, unexpected PARSEOP_METHOD, expecting $end and premature End-Of-File
I would like to learn how to do this. If you need more info, please let me know.

No errors in your "adjusted" DSDT.dsl. Make sure you're using ACPI 6.1 (available in my version of MaciASL).
 
Status
Not open for further replies.
Back
Top