Contribute
Register

[Guide] How to patch DSDT for working battery status

Hello. Please Help. Acer aspire 5930g. can't make the correct edit in the dsdt. Mac os el capitan

Read post #1. It is likely an existing patch is already available.
 
I am using the El Capitan for the hp specter 1323et laptop, what I did is battery zero. How can I fix the situation I do not understand anything from your guides I do not have a patch available please help me

Read post #1.
 
Hi RehabMan,
First Thanks for this priceless guide, after more than 20 installs and more crashes using other methods for battery reading. I got it work from the first time though it took around 3 days just to understand it, but I got my battery meter alive and running, My Laptop is LG R580 , I used your patch and modified it a bit to work on mine and voila.
 

Attachments

  • R580.txt
    15.5 KB · Views: 288
You forgot to disable the second battery object (no battery detected there).
Change BAT1._STA to return zero.

Thanks, that did the trick. I am attaching my contribution.
 

Attachments

  • Contribution.zip
    31.7 KB · Views: 203
This is my 20000th attempt in patching for battery stats in this laptop with zero community support.
I based myself on all the Lenovo patches I have been finding, and adapting them, and also looking at many DSDTs from Lenovos and so far I get a weird nameseg error... I wonder if someone expert on this matter could revise my patch, and hopefully correct me...

Screen Shot 2016-11-28 at 10.25.08.png


This is what I have got.

Code:
# LENOVO L420 - KosakGroove Note: This DSDT requires "Fix Mutex with non-zero SyncLevel"

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

into method label B1B4 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B4, 4, NotSerialized)\n
{\n
    Store(Arg3, Local0)\n
    Or(Arg2, ShiftLeft(Local0, 8), Local0)\n
    Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
    Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
    Return(Local0)\n
}\n
end;
into device label EC code_regex BATD,\s+16, replace_matched begin ATD0,8,ATD1,8, end;
into method label SELE code_regex \(\^PCI0\.LPCB\.EC\.BATD, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.ATD0, ^PCI0.LPCB.EC.ATD1), end;

into device label EC code_regex SMW0,\s+16, replace_matched begin MW00,8,MW01,8, end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.SMW0, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.MW00, ^PCI0.LPCB.EC.MW01), end;
into method label SMWR code_regex \(\^PCI0\.LPCB\.EC\.SMW0, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.MW00, ^PCI0.LPCB.EC.MW01), end;

into device label EC code_regex SBRC,\s+16, replace_matched begin BR00,8,BR01,8, end;
into method label GBST code_regex \(\^PCI0\.LPCB\.EC\.SBRC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BR00,^PCI0.LPCB.EC.BR01), end;

into device label EC code_regex SBFC,\s+16, replace_matched begin BF00,8,BF01,8, end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBFC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BF00, ^PCI0.LPCB.EC.BF01), end;

into device label EC code_regex SBVO,\s+16, replace_matched begin BV00,8,BV01,8, end;
into method label GBST code_regex \(\^PCI0\.LPCB\.EC\.SBVO, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BV00, ^PCI0.LPCB.EC.BV01), end;

into device label EC code_regex SBSN,\s+16, replace_matched begin SN00,8,SN01,8 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBSN, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.SN00, ^PCI0.LPCB.EC.SN01), end;

into device label EC code_regex SBDC,\s+16, replace_matched begin DC00,8,DC01,8 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.DC00, ^PCI0.LPCB.EC.DC01), end;

into device label EC code_regex SBDV,\s+16, replace_matched begin DV00,8,DV01,8 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDV, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.DV00, ^PCI0.LPCB.EC.DV01), end;

into device label EC code_regex SBAE,\s+16, replace_matched begin BA00,8,BA01,8, end;
into device label EC code_regex SBAF,\s+16, replace_matched begin BB00,8,BB01,8, end;
into device label EC code_regex SBBS,\s+16, replace_matched begin BD00,8,BD01,8, end;
into device label EC code_regex SBMD,\s+16, replace_matched begin SB00,8,SB01,8, end;
into device label EC code_regex SBCC,\s+16, replace_matched begin CC00,8,CC01,8 end;
into device label EC code_regex SBOM,\s+16, replace_matched begin OM00,8,OM01,8 end;
into device label EC code_regex SBSI,\s+16, replace_matched begin SI00,8,SI01,8 end;
into device label EC code_regex SBDT,\s+16, replace_matched begin DT00,8,DT01,8 end;
into device label EC code_regex SBCH,\s+32 replace_matched begin SH00,8,SH01,8,SH02,8,SH03,8 end;
into_all method label GBIF code_regex \(\^PCI0\.LPCB\.EC\SBCH, replaceall_matched begin (B1B4(^PCI0.LPCB.EC.SH00, ^PCI0.LPCB.EC.SH01, ^PCI0.LPCB.EC.SH02, ^PCI0.LPCB.EC.SH03), end;
into method label RE1B parent_label EC remove_entry;
into method label RECB parent_label EC remove_entry;
into device label EC insert
begin
Method (RE1B, 1, NotSerialized)\n
// Arg0 - offset in bytes from zero-based EC\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
// Arg0 - offset in bytes from zero-based EC\n
// Arg1 - size of buffer in bits\n
{\n
    ShiftRight(Arg1, 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        Store(RE1B(Arg0), Index(TEMP, Local0))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
    Return(TEMP)\n
}\n
end;

into device label EC code_regex (SBMN,)\s+(128) replace_matched begin BMNX,%2,//%1%2 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBMN, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;
into device label EC code_regex (SBDN,)\s+(128) replace_matched begin BDNX,%2,//%1%2 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDN, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;

These are the tables im working on.. untouched.

ACPI.zip

I would really appreciate some help with this
 

Attachments

  • ACPI.zip
    115.9 KB · Views: 171
This is my 20000th attempt in patching for battery stats in this laptop with zero community support.
I based myself on all the Lenovo patches I have been finding, and adapting them, and also looking at many DSDTs from Lenovos and so far I get a weird nameseg error... I wonder if someone expert on this matter could revise my patch, and hopefully correct me...

View attachment 222777

This is what I have got.

Code:
# LENOVO L420 - KosakGroove Note: This DSDT requires "Fix Mutex with non-zero SyncLevel"

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

into method label B1B4 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B4, 4, NotSerialized)\n
{\n
    Store(Arg3, Local0)\n
    Or(Arg2, ShiftLeft(Local0, 8), Local0)\n
    Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
    Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
    Return(Local0)\n
}\n
end;
into device label EC code_regex BATD,\s+16, replace_matched begin ATD0,8,ATD1,8, end;
into method label SELE code_regex \(\^PCI0\.LPCB\.EC\.BATD, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.ATD0, ^PCI0.LPCB.EC.ATD1), end;

into device label EC code_regex SMW0,\s+16, replace_matched begin MW00,8,MW01,8, end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.SMW0, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.MW00, ^PCI0.LPCB.EC.MW01), end;
into method label SMWR code_regex \(\^PCI0\.LPCB\.EC\.SMW0, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.MW00, ^PCI0.LPCB.EC.MW01), end;

into device label EC code_regex SBRC,\s+16, replace_matched begin BR00,8,BR01,8, end;
into method label GBST code_regex \(\^PCI0\.LPCB\.EC\.SBRC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BR00,^PCI0.LPCB.EC.BR01), end;

into device label EC code_regex SBFC,\s+16, replace_matched begin BF00,8,BF01,8, end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBFC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BF00, ^PCI0.LPCB.EC.BF01), end;

into device label EC code_regex SBVO,\s+16, replace_matched begin BV00,8,BV01,8, end;
into method label GBST code_regex \(\^PCI0\.LPCB\.EC\.SBVO, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BV00, ^PCI0.LPCB.EC.BV01), end;

into device label EC code_regex SBSN,\s+16, replace_matched begin SN00,8,SN01,8 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBSN, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.SN00, ^PCI0.LPCB.EC.SN01), end;

into device label EC code_regex SBDC,\s+16, replace_matched begin DC00,8,DC01,8 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.DC00, ^PCI0.LPCB.EC.DC01), end;

into device label EC code_regex SBDV,\s+16, replace_matched begin DV00,8,DV01,8 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDV, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.DV00, ^PCI0.LPCB.EC.DV01), end;

into device label EC code_regex SBAE,\s+16, replace_matched begin BA00,8,BA01,8, end;
into device label EC code_regex SBAF,\s+16, replace_matched begin BB00,8,BB01,8, end;
into device label EC code_regex SBBS,\s+16, replace_matched begin BD00,8,BD01,8, end;
into device label EC code_regex SBMD,\s+16, replace_matched begin SB00,8,SB01,8, end;
into device label EC code_regex SBCC,\s+16, replace_matched begin CC00,8,CC01,8 end;
into device label EC code_regex SBOM,\s+16, replace_matched begin OM00,8,OM01,8 end;
into device label EC code_regex SBSI,\s+16, replace_matched begin SI00,8,SI01,8 end;
into device label EC code_regex SBDT,\s+16, replace_matched begin DT00,8,DT01,8 end;
into device label EC code_regex SBCH,\s+32 replace_matched begin SH00,8,SH01,8,SH02,8,SH03,8 end;
into_all method label GBIF code_regex \(\^PCI0\.LPCB\.EC\SBCH, replaceall_matched begin (B1B4(^PCI0.LPCB.EC.SH00, ^PCI0.LPCB.EC.SH01, ^PCI0.LPCB.EC.SH02, ^PCI0.LPCB.EC.SH03), end;
into method label RE1B parent_label EC remove_entry;
into method label RECB parent_label EC remove_entry;
into device label EC insert
begin
Method (RE1B, 1, NotSerialized)\n
// Arg0 - offset in bytes from zero-based EC\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
// Arg0 - offset in bytes from zero-based EC\n
// Arg1 - size of buffer in bits\n
{\n
    ShiftRight(Arg1, 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        Store(RE1B(Arg0), Index(TEMP, Local0))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
    Return(TEMP)\n
}\n
end;

into device label EC code_regex (SBMN,)\s+(128) replace_matched begin BMNX,%2,//%1%2 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBMN, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;
into device label EC code_regex (SBDN,)\s+(128) replace_matched begin BDNX,%2,//%1%2 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDN, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;

These are the tables im working on.. untouched.

ACPI.zip

I would really appreciate some help with this

Some of your patches lack the trailing comma...

For example:
Code:
into device label EC code_regex SBSI,\s+16, replace_matched begin SI00,8,SI01,8 end;

Should be:
Code:
into device label EC code_regex SBSI,\s+16, replace_matched begin SI00,8,SI01,8, end;
 
Hi RehabMan,
First Thanks for this priceless guide, after more than 20 installs and more crashes using other methods for battery reading. I got it work from the first time though it took around 3 days just to understand it, but I got my battery meter alive and running, My Laptop is LG R580 , I used your patch and modified it a bit to work on mine and voila.

Read post #1, "Contributing".
 
Thanks, that did the trick. I am attaching my contribution.

Your profile lacks details on your hardware.

Please provide complete details in your profile/signature
("Personal Details" link from "profile menu" in upper right corner of this site)

Mobo: manufacturer/model + bootloader(Clover/Chameleon/Chimera)
CPU: detailed CPU model + motherboard chipset
Graphics: all graphics devices + laptop internal screen resolution

For example, typical Ivy laptop:
Mobo: HP ProBook 4540s (Clover)
CPU: i5-3320m/HM76
Graphics: HD4000, 1366x768

Use CPU-Z on Windows to find CPU (Core iX-xxx) and motherboard chipset (HMxx), and graphics capabilities. For a laptop, these details are important and affect critical installation procedures.

Note: When specifying your bootloader, if using Clover legacy, please be sure to specify "Clover legacy"). Specifying "Clover" will be assumed as "Clover UEFI"
 
OK REHABMAN, I got it working better thanks to you but still.....
I am getting some errors about some objects not found, even though i specifically put them in the patch.. can you give me a hand?

Screen Shot 2016-11-28 at 15.23.02.png


This is the new patch, with some more objects i found

Code:
# LENOVO L420 - KosakGroove Note: This DSDT requires "Fix Mutex with non-zero SyncLevel"

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

into method label B1B4 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B4, 4, NotSerialized)\n
{\n
    Store(Arg3, Local0)\n
    Or(Arg2, ShiftLeft(Local0, 8), Local0)\n
    Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
    Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
    Return(Local0)\n
}\n
end;
into device label EC code_regex BATD,\s+16, replace_matched begin ATD0,8,ATD1,8, end;
into device label EC code_regex SMW0,\s+16, replace_matched begin MW00,8,MW01,8, end;
into device label EC code_regex SBRC,\s+16, replace_matched begin BR00,8,BR01,8, end;
into device label EC code_regex SBFC,\s+16, replace_matched begin BF00,8,BF01,8, end;
into device label EC code_regex SBVO,\s+16, replace_matched begin BV00,8,BV01,8, end;
into device label EC code_regex SBSN,\s+16, replace_matched begin SN00,8,SN01,8, end;
into device label EC code_regex SBDC,\s+16, replace_matched begin DC00,8,DC01,8, end;
into device label EC code_regex SBDV,\s+16, replace_matched begin DV00,8,DV01,8, end;
into device label EC code_regex SBAE,\s+16, replace_matched begin BA00,8,BA01,8, end;
into device label EC code_regex SBAF,\s+16, replace_matched begin BB00,8,BB01,8, end;
into device label EC code_regex SBBS,\s+16, replace_matched begin BD00,8,BD01,8, end;
into device label EC code_regex SBMD,\s+16, replace_matched begin SB00,8,SB01,8, end;
into device label EC code_regex SBCC,\s+16, replace_matched begin CC00,8,CC01,8, end;
into device label EC code_regex SBOM,\s+16, replace_matched begin OM00,8,OM01,8, end;
into device label EC code_regex SBSI,\s+16, replace_matched begin SI00,8,SI01,8, end;
into device label EC code_regex SBDT,\s+16, replace_matched begin DT00,8,DT01,8, end;


into_all method label SELE code_regex \(\^PCI0\.LPCB\.EC\.BATD, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.ATD0, ^PCI0.LPCB.EC.ATD1), end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.SMW0, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.MW00, ^PCI0.LPCB.EC.MW01), end;
into method label SMWR code_regex \(\^PCI0\.LPCB\.EC\.SMW0, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.MW00, ^PCI0.LPCB.EC.MW01), end;
into method label GBST code_regex \(\^PCI0\.LPCB\.EC\.SBRC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BR00,^PCI0.LPCB.EC.BR01), end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBFC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BF00, ^PCI0.LPCB.EC.BF01), end;
into method label GBST code_regex \(\^PCI0\.LPCB\.EC\.SBVO, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BV00, ^PCI0.LPCB.EC.BV01), end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBSN, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.SN00, ^PCI0.LPCB.EC.SN01), end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.DC00, ^PCI0.LPCB.EC.DC01), end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDV, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.DV00, ^PCI0.LPCB.EC.DV01), end;



into device label EC code_regex SBCH,\s+32 replace_matched begin SH00,8,SH01,8,SH02,8,SH03,8, end;
into_all method label GBIF code_regex \(\^PCI0\.LPCB\.EC\SBCH, replaceall_matched begin (B1B4(^PCI0.LPCB.EC.SH00, ^PCI0.LPCB.EC.SH01, ^PCI0.LPCB.EC.SH02, ^PCI0.LPCB.EC.SH03), end;

into method label RE1B parent_label EC remove_entry;
into method label RECB parent_label EC remove_entry;
into device label EC insert
begin
Method (RE1B, 1, NotSerialized)\n
// Arg0 - offset in bytes from zero-based EC\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
// Arg0 - offset in bytes from zero-based EC\n
// Arg1 - size of buffer in bits\n
{\n
    ShiftRight(Arg1, 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        Store(RE1B(Arg0), Index(TEMP, Local0))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
    Return(TEMP)\n
}\n
end;

into device label EC code_regex (SBMN,)\s+(128) replace_matched begin BMNX,%2,//%1%2 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBMN, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;
into device label EC code_regex (SBDN,)\s+(128) replace_matched begin BDNX,%2,//%1%2 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDN, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;
into device label EC code_regex (FLD1)\s+(128) replace_matched begin D101,%2,//%1%2 end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.FLD1, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;
into device label EC code_regex (FLD2,)\s+(192) replace_matched begin D201,%2,//%1%2 end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.FLD2, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,192), end;
into device label EC code_regex (FLD3,)\s+(256) replace_matched begin D301,%2,//%1%2 end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.FLD3, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,256), end;


Here goes the dsl I am getting the errors in after the patch, plus the patch itself.
DSDT AND PATCH.zip
 

Attachments

  • DSDT AND PATCH.zip
    46.1 KB · Views: 309
OK REHABMAN, I got it working better thanks to you but still.....
I am getting some errors about some objects not found, even though i specifically put them in the patch.. can you give me a hand?

View attachment 222809

This is the new patch, with some more objects i found

Code:
# LENOVO L420 - KosakGroove Note: This DSDT requires "Fix Mutex with non-zero SyncLevel"

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

into method label B1B4 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B4, 4, NotSerialized)\n
{\n
    Store(Arg3, Local0)\n
    Or(Arg2, ShiftLeft(Local0, 8), Local0)\n
    Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
    Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
    Return(Local0)\n
}\n
end;
into device label EC code_regex BATD,\s+16, replace_matched begin ATD0,8,ATD1,8, end;
into device label EC code_regex SMW0,\s+16, replace_matched begin MW00,8,MW01,8, end;
into device label EC code_regex SBRC,\s+16, replace_matched begin BR00,8,BR01,8, end;
into device label EC code_regex SBFC,\s+16, replace_matched begin BF00,8,BF01,8, end;
into device label EC code_regex SBVO,\s+16, replace_matched begin BV00,8,BV01,8, end;
into device label EC code_regex SBSN,\s+16, replace_matched begin SN00,8,SN01,8, end;
into device label EC code_regex SBDC,\s+16, replace_matched begin DC00,8,DC01,8, end;
into device label EC code_regex SBDV,\s+16, replace_matched begin DV00,8,DV01,8, end;
into device label EC code_regex SBAE,\s+16, replace_matched begin BA00,8,BA01,8, end;
into device label EC code_regex SBAF,\s+16, replace_matched begin BB00,8,BB01,8, end;
into device label EC code_regex SBBS,\s+16, replace_matched begin BD00,8,BD01,8, end;
into device label EC code_regex SBMD,\s+16, replace_matched begin SB00,8,SB01,8, end;
into device label EC code_regex SBCC,\s+16, replace_matched begin CC00,8,CC01,8, end;
into device label EC code_regex SBOM,\s+16, replace_matched begin OM00,8,OM01,8, end;
into device label EC code_regex SBSI,\s+16, replace_matched begin SI00,8,SI01,8, end;
into device label EC code_regex SBDT,\s+16, replace_matched begin DT00,8,DT01,8, end;


into_all method label SELE code_regex \(\^PCI0\.LPCB\.EC\.BATD, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.ATD0, ^PCI0.LPCB.EC.ATD1), end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.SMW0, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.MW00, ^PCI0.LPCB.EC.MW01), end;
into method label SMWR code_regex \(\^PCI0\.LPCB\.EC\.SMW0, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.MW00, ^PCI0.LPCB.EC.MW01), end;
into method label GBST code_regex \(\^PCI0\.LPCB\.EC\.SBRC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BR00,^PCI0.LPCB.EC.BR01), end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBFC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BF00, ^PCI0.LPCB.EC.BF01), end;
into method label GBST code_regex \(\^PCI0\.LPCB\.EC\.SBVO, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.BV00, ^PCI0.LPCB.EC.BV01), end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBSN, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.SN00, ^PCI0.LPCB.EC.SN01), end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDC, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.DC00, ^PCI0.LPCB.EC.DC01), end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDV, replaceall_matched begin (B1B2(^PCI0.LPCB.EC.DV00, ^PCI0.LPCB.EC.DV01), end;



into device label EC code_regex SBCH,\s+32 replace_matched begin SH00,8,SH01,8,SH02,8,SH03,8, end;
into_all method label GBIF code_regex \(\^PCI0\.LPCB\.EC\SBCH, replaceall_matched begin (B1B4(^PCI0.LPCB.EC.SH00, ^PCI0.LPCB.EC.SH01, ^PCI0.LPCB.EC.SH02, ^PCI0.LPCB.EC.SH03), end;

into method label RE1B parent_label EC remove_entry;
into method label RECB parent_label EC remove_entry;
into device label EC insert
begin
Method (RE1B, 1, NotSerialized)\n
// Arg0 - offset in bytes from zero-based EC\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
// Arg0 - offset in bytes from zero-based EC\n
// Arg1 - size of buffer in bits\n
{\n
    ShiftRight(Arg1, 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        Store(RE1B(Arg0), Index(TEMP, Local0))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
    Return(TEMP)\n
}\n
end;

into device label EC code_regex (SBMN,)\s+(128) replace_matched begin BMNX,%2,//%1%2 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBMN, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;
into device label EC code_regex (SBDN,)\s+(128) replace_matched begin BDNX,%2,//%1%2 end;
into method label GBIF code_regex \(\^PCI0\.LPCB\.EC\.SBDN, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;
into device label EC code_regex (FLD1)\s+(128) replace_matched begin D101,%2,//%1%2 end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.FLD1, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,128), end;
into device label EC code_regex (FLD2,)\s+(192) replace_matched begin D201,%2,//%1%2 end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.FLD2, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,192), end;
into device label EC code_regex (FLD3,)\s+(256) replace_matched begin D301,%2,//%1%2 end;
into method label SMRD code_regex \(\^PCI0\.LPCB\.EC\.FLD3, replaceall_matched begin (^PCI0.LPCB.EC.RECB(0xA0,256), end;


Here goes the dsl I am getting the errors in after the patch, plus the patch itself.
DSDT AND PATCH.zip

The compiler errors help you find code your patches failed to patch, or patched incorrectly.
 
Back
Top