Moderators Jake Lo Posted January 25, 2018 Moderators Share Posted January 25, 2018 If you had been patching your own DSDT recently, you most likely encountered this common error dialogue 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! 3 Link to comment Share on other sites More sharing options...
shiecldk Posted April 21, 2018 Share Posted April 21, 2018 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) } File: DSDT.dsl Link to comment Share on other sites More sharing options...
Administrators Hervé Posted April 21, 2018 Administrators Share Posted April 21, 2018 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) } 1 Link to comment Share on other sites More sharing options...
Moderators Jake Lo Posted April 21, 2018 Author Moderators Share Posted April 21, 2018 @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 1 Link to comment Share on other sites More sharing options...
nguyendj Posted May 28, 2018 Share Posted May 28, 2018 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 More sharing options...
Moderators Jake Lo Posted May 28, 2018 Author Moderators Share Posted May 28, 2018 Post your before and after DSDT.aml Don't know what error you're referring to. Warnings can be ignored. Link to comment Share on other sites More sharing options...
nguyendj Posted May 29, 2018 Share Posted May 29, 2018 This is my after fix dsdt. if I put it in acpi/patch os won't boot And I attached also my debug DSDT.dsl.zip debug_10847.zip Link to comment Share on other sites More sharing options...
Moderators Jake Lo Posted May 29, 2018 Author Moderators Share Posted May 29, 2018 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 More sharing options...
Administrators Hervé Posted May 29, 2018 Administrators Share Posted May 29, 2018 Which is why the code as formatted in my post #3 is useful and avoids such typos... Link to comment Share on other sites More sharing options...
nguyendj Posted May 30, 2018 Share Posted May 30, 2018 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 Link to comment Share on other sites More sharing options...
Recommended Posts