Jump to content
Jake Lo

How to fix recent DSDT common error caused by IASL bug

Recommended Posts

If you had been patching your own DSDT recently, you most likely encountered this common error dialogue

IASL_Bug2.png

when clicking on the 1st 2 errors, they'll take you to these set of codes

 

 

If (LEqual (PM6H, One))

{

     CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW)  // _RW_: Read-Write Status

     Store (Zero, ECRW (If (PM0H

             {

                  CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN)  // _LEN: Length

                  Store (Zero, F0LN)

             }))

}

 

 

 

To fix the errors,  I created this patch which you can just apply with latest version of MacIASL

 

 

# Fix IASL bug on some DSDT

into method label _CRS code_regex Store\s+\(Zero,\s+ECRW\s+\(If\s+\(PM0H\) replace_matched

begin

Store (Zero, ECRW) } If (PM0H)

end;

 

into method label _CRS code_regex Store\s+\(Zero,\s+F0LN\)\s+?\}\)\) replace_matched

begin

Store (Zero, F0LN)

end;

 

 

This will fix all 3 errors listed above. Enjoy!

  • Like 1

Share this post


Link to post
Share on other sites

Hi Jack,

 

I applied your fix, the error seems to be remaining:

If (LEqual (PM6H, One))
                {
                    CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW)  // _RW_: Read-Write Status
                    Store (Zero, ECRW (If (PM0H)
                            {
                                CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN)  // _LEN: Length
                                Store (Zero, F0LN)
                            }))
                }

-->

If (LEqual (PM6H, One))
                {
                    CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW)  // _RW_: Read-Write Status
                    Store (Zero, ECRW) } If (PM0H)
                            {
                                CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN)  // _LEN: Length
                                Store (Zero, F0LN)
                }

 

 

 

Screen Shot 2018-04-20 at 11.17.24 PM.png

 

File:

 

DSDT.dsl

Share this post


Link to post
Share on other sites

Your code remains incorrect; change it as follows:

If (LEqual (PM6H, One))
{
    CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW) // _RW_: Read-Write Status
    Store (Zero, ECRW)
}

If (PM0H)
{
    CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN) // _LEN: Length
    Store (Zero, F0LN)
}

 

  • Like 1

Share this post


Link to post
Share on other sites

@shiecldk

The errors are different after you ran the fix. Most likely you didn't decompile the original *aml correctly or use different versions of MacIASL

  • Like 1

Share this post


Link to post
Share on other sites

I have exact these 3 errors, (0x01 instead if One)

 

If (LEqual (PM6H, 0x01))
                {
                    CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW)  // _RW_: Read-Write Status
                    Store (Zero, ECRW (If (PM0H) --> this line marked error
                            {
                                CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN)  // _LEN: Length
                                Store (Zero, F0LN)
                            }))
                }
 

After did your patch, it came out 1 new error and many warnings

Share this post


Link to post
Share on other sites

Post your before and after DSDT.aml

Don't know what error you're referring to. Warnings can be ignored.

Share this post


Link to post
Share on other sites

Your DSDT.dsl has an extra "}"

 

Quote

 If (LEqual (PM6H, 0x01))
                {
                    CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW)  // _RW_: Read-Write Status
                    Store (Zero, ECRW)} If (PM0H)
                            {
                                CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN)  // _LEN: Length
                                Store (Zero, F0LN)
                            }
                }  // You have an extra bracket here, remove it

 

After you remove that, you'll just need to rename 

*pnp0c14

to 

PNP0c14

 

After that you should be able to compile and save it as *.aml file. You can't boot with *.dsl file

Share this post


Link to post
Share on other sites

I did fix these

 

If (LEqual (PM6H, 0x01))
                {
                    CreateBitField (BUF0, \_SB.PCI0._Y0C._RW, ECRW)  // _RW_: Read-Write Status
                    Store (Zero, ECRW)
                } 
                If (PM0H)
                            {
                                CreateDWordField (BUF0, \_SB.PCI0._Y0D._LEN, F0LN)  // _LEN: Length
                                Store (Zero, F0LN)
                            }
                }
                If (LEqual (PM0H, 0x01))
                {
                    CreateBitField (BUF0, \_SB.PCI0._Y0D._RW, F0RW)  // _RW_: Read-Write Status
                    Store (Zero, F0RW)
                }

                CreateDWordField (BUF0, \_SB.PCI0._Y0E._MIN, M1MN)  // _MIN: Minimum Base Address
                CreateDWordField (BUF0, \_SB.PCI0._Y0E._MAX, M1MX)  // _MAX: Maximum Base Address
                CreateDWordField (BUF0, \_SB.PCI0._Y0E._LEN, M1LN)  // _LEN: Length
                ShiftLeft (TLUD, 0x14, M1MN)
                Add (Subtract (M1MX, M1MN), 0x01, M1LN)
                Return (BUF0)
 

 

1st 2 error disappeared. 3rd one still there 

Screen Shot 2018-05-30 at 9.49.01 AM.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×