Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
93 lines (86 sloc) 2.73 KB
#Maintained by: RehabMan for: Laptop Patches
#battery_Acer-Aspire-E1-571.txt
# initial work by ayyoouubb 2014-02-26,
# finished/corrected by RehabMan 2014-02-26
# works for:
# Acer Aspire E1-571
# Acer Aspire V5-171-6675 (per shinzon)
# Gateway NE56R49U
# Dell Precision M3800
# Acer Travelmate T253M (per Simmy)
# Acer Aspire V3-571G (per mpckid)
# create B1B2 Method
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;
# utility methods to read/write buffers from/to EC by RehabMan
into method label RE1B parent_label EC0 remove_entry;
into method label RECB parent_label EC0 remove_entry;
into device label EC0 insert
begin
Method (RE1B, 1, NotSerialized)\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
{\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 method label WE1B parent_label EC0 remove_entry;
into method label WECB parent_label EC0 remove_entry;
into device label EC0 insert
begin
Method (WE1B, 2, NotSerialized)\n
{\n
OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
Store(Arg1, BYTE)\n
}\n
Method (WECB, 3, Serialized)\n
{\n
ShiftRight(Arg1, 3, Arg1)\n
Name(TEMP, Buffer(Arg1) { })\n
Store(Arg2, TEMP)\n
Add(Arg0, Arg1, Arg1)\n
Store(0, Local0)\n
While (LLess(Arg0, Arg1))\n
{\n
WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
Increment(Arg0)\n
Increment(Local0)\n
}\n
}\n
end;
# 16-bit register fixes (ERIB)
into device label EC0 code_regex ERIB,\s+16, replace_matched begin IB00,8,IB01,8, end;
into method label FANG code_regex \(ERIB, replaceall_matched begin (B1B2(IB00,IB01), end;
into method label FANW code_regex \(ERIB, replaceall_matched begin (B1B2(IB00,IB01), end;
into method label FANG code_regex Store\s+\((.*),\s+ERIB\) replaceall_matched
begin
Store(%1,IB00)
Store(ShiftRight(%1,8),IB01)
end;
into method label FANW code_regex Store\s+\((.*),\s+ERIB\) replaceall_matched
begin
Store(%1,IB00)
Store(ShiftRight(%1,8),IB01)
end;
# 256-bit register fixes (SMD0)
into device label EC0 code_regex (SMD0,)\s+(256) replace_matched begin SMDX,%2,//%1%2 end;
into method label CFUN code_regex \(SMD0 replaceall_matched begin (RECB(0x64,256) end;
into method label CFUN code_regex Store\s+\((.*),\s+SMD0\) replaceall_matched begin WECB(0x64,256,%1) end;