Jump to content

How to fix recent DSDT common error caused by IASL bug


Jake Lo

Recommended Posts

  • Moderators

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 3
Link to comment
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

Link to comment
Share on other sites

  • Administrators

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
Link to comment
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

Link to comment
Share on other sites

  • Moderators

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

Link to comment
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

Link to comment
Share on other sites

×
×
  • Create New...