按照r大神的电池状态dsdt修改教程 https://www.tonymacx86.com/threads/guide-how-to-patch-dsdt-for-working-battery-status.116102/
和hotpatch解决电池状态教程 https://www.tonymacx86.com/threads/guide-using-clover-to-hotpatch-acpi.200137/post-1308261,最终生成的SSDT-BATT.dsl文件如下:
DefinitionBlock("", "SSDT", 2, "hack", "batt", 0)
{
Method (B1B2, 2, NotSerialized)
{
Return(Or(Arg0, ShiftLeft(Arg1, 8)))
}
Method (B1B4, 4, NotSerialized)
{
Store(Arg3, Local0)
Or(Arg2, ShiftLeft(Local0, 8), Local0)
Or(Arg1, ShiftLeft(Local0, 8), Local0)
Or(Arg0, ShiftLeft(Local0, 8), Local0)
Return(Local0)
}
Scope (_SB.PCI0.LPCB)
{
Device (H_EC)
{
OperationRegion (ECF3, EmbeddedControl, Zero, 0xFF)
Field (ECF3, ByteAcc, Lock, Preserve)
{
Offset (0x10),
BDNX,56,//BDN0,56,
Offset (0x1C),
DAY0, 8,
HUR0, 8,
MIN0, 8,
SEC0, 8,
BMNX,128,//BMN0,128,
BCTX,128,//BCT0,128,
Offset (0x87),
LB1, 8,
LB2, 8,
DC00,8,DC01,8,
BDC1, 16,
FC00,8,FC01,8,
FC10,8,FC11,8,
Offset (0x93),
DV00,8,DV01,8,
DV10,8,DV11,8,
Offset (0x9B),
BR00,8,BR01,8,
BPR1, 16,
RC00,8,RC01,8,
BRC1, 16,
CC00,8,CC01,8,
BCC1, 16,
VC10,8,VC11,8,
CV20,8,CV21,8,
CV30,8,CV31,8,
CV40,8,CV41,8,
CV11, 16,
CV12, 16,
CV13, 16,
CV14, 16,
HPBA, 16,
HPBB, 16,
STS0, 8,
STS1, 8,
MD00,8,MD01,8,
MD10,8,MD11,8,
PV00,8,PV01,8,
BPV1, 16,
SN00,8,SN01,8,
SN10,8,SN11,8,
BV00,8,BV01,8,
BCV1, 16,
RG00,8,RG01,8,
CRG1, 16,
TY00,8,TY01,8,TY02,8,TY03,8,
Offset (0xEB),
, 2,
HDSD, 1,
, 1,
PSON, 1,
, 1,
, 1,
PSRW, 1,
BT00,8,BT01,8,
}
Method (BTIF, 1, Serialized)
{
ShiftLeft (One, Arg0, Local7)
BTDR (One)
If (LEqual (BSTA (Local7), 0x0F))
{
Return (0xFF)
}
Acquire (BTMX, 0xFFFF)
Store (NGBF, Local0)
Release (BTMX)
If (LEqual (And (Local0, Local7), Zero))
{
Return (Zero)
}
Store (NDBS, Index (NBST, Arg0))
Acquire (BTMX, 0xFFFF)
Or (NGBT, Local7, NGBT)
Release (BTMX)
Acquire (ECMX, 0xFFFF)
If (ECRG)
{
Store (Arg0, BSEL)
Switch (Arg0)
{
Case (Zero)
{
Store (B1B2(FC00,FC01), Local0)
Store (Local0, Index (DerefOf (Index (NBTI, Arg0)), One))
Store (Local0, Index (DerefOf (Index (NBTI, Arg0)), 0x02))
Store (B1B2(DV00,DV01), Index (DerefOf (Index (NBTI, Arg0)), 0x04))
}
Case (One)
{
Store (B1B2(FC10,FC11), Local0)
Store (Local0, Index (DerefOf (Index (NBTI, Arg0)), One))
Store (Local0, Index (DerefOf (Index (NBTI, Arg0)), 0x02))
Store (B1B2(DV10,DV11), Index (DerefOf (Index (NBTI, Arg0)), 0x04))
}
}
Multiply (Local0, NLB1, Local1)
Divide (Add (Local1, 0x63), 0x64, Local3, Local2)
Store (Local2, Index (DerefOf (Index (NBTI, Arg0)), 0x05))
Store (NLB1, Index (DerefOf (Index (NBTI, Arg0)), 0x05))
Store (NLB2, Index (DerefOf (Index (NBTI, Arg0)), 0x06))
Switch (Arg0)
{
Case (Zero)
{
Store (B1B2(SN00,SN01), Local0)
Store (B1B2(MD00,MD01), Local1)
}
Case (One)
{
Store (B1B2(SN10,SN11), Local0)
Store (B1B2(MD10,MD11), Local1)
}
}
}
Release (ECMX)
Store (GBSS (Local0, Local1), Local2)
Store (Local2, Index (DerefOf (Index (NBTI, Arg0)), 0x0A))
Acquire (BTMX, 0xFFFF)
And (NGBF, Not (Local7), NGBF)
Release (BTMX)
Return (Zero)
}
Method (BTST, 2, Serialized)
{
Store (B1B2(BR00,BR01), Local0)
If (And (Local0, 0x8000))
{
If (LEqual (Local0, 0xFFFF))
{
Store (0xFFFFFFFF, Index (DerefOf (Index (NBST, Arg0)), One))
}
Else
{
Not (Local0, Local1)
Increment (Local1)
And (Local1, 0xFFFF, Local3)
If (LAnd (LEqual (^^^^WMID.BRTE, Zero), LEqual (RPWR, Zero)))
{
Store (0xFFFFFFFF, Local3)
}
Store (Local3, Index (DerefOf (Index (NBST, Arg0)), One))
}
}
Else
{
Store (Local0, Index (DerefOf (Index (NBST, Arg0)), One))
}
Store (B1B2(RC00,RC01), Index (DerefOf (Index (NBST, Arg0)), 0x02))
Store (B1B2(PV00,PV01), Index (DerefOf (Index (NBST, Arg0)), 0x03))
Store (BST0, Local2)
Store (Local2, Index (DerefOf (Index (NBST, Arg0)), Zero))
Return (Zero)
}
Method (ITLB, 0, NotSerialized)
{
Acquire (ECMX, 0xFFFF)
If (ECRG)
{
Add (B1B2(FC10,FC11), B1B2(FC00,FC01), Local1)
Divide (Add (Local1, 0x63), 0x64, Local2, Local3)
Multiply (Local3, LB1, NLB1)
Multiply (Local3, LB2, NLB2)
}
Release (ECMX)
}
Method (GBTI, 1, NotSerialized)
{
Acquire (ECMX, 0xFFFF)
If (ECRG)
{
If (And (BTAP, ShiftLeft (One, Arg0)))
{
Store (Arg0, BSEL)
Store (Package (0x03)
{
Zero,
0x80,
Buffer (0x80){}
}, Local0)
Store (B1B2(DC00,DC01), Index (DerefOf (Index (Local0, 0x02)), Zero))
Store (ShiftRight (B1B2(DC00,DC01), 0x08), Index (DerefOf (Index (Local0, 0x02)), One))
Store (B1B2(FC00,FC01), Index (DerefOf (Index (Local0, 0x02)), 0x02))
Store (ShiftRight (B1B2(FC00,FC01), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x03))
Store (B1B2(RC00,RC01), Index (DerefOf (Index (Local0, 0x02)), 0x04))
Store (ShiftRight (B1B2(RC00,RC01), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x05))
Store (B1B2(CC00,CC01), Index (DerefOf (Index (Local0, 0x02)), 0x08))
Store (ShiftRight (B1B2(CC00,CC01), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x09))
Store (B1B2(BT00,BT01), Local1)
Subtract (Local1, 0x0AAC, Local1)
Divide (Local1, 0x0A, Local2, Local3)
Store (Local3, Index (DerefOf (Index (Local0, 0x02)), 0x0A))
Store (ShiftRight (Local3, 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x0B))
Store (B1B2(PV00,PV01), Index (DerefOf (Index (Local0, 0x02)), 0x0C))
Store (ShiftRight (B1B2(PV00,PV01), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x0D))
Store (B1B2(BR00,BR01), Local1)
If (Local1)
{
If (And (BST0, One))
{
And (Local1, 0xFFFF, Local1)
}
}
Store (Local1, Index (DerefOf (Index (Local0, 0x02)), 0x0E))
Store (ShiftRight (Local1, 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x0F))
Store (B1B2(DV00,DV01), Index (DerefOf (Index (Local0, 0x02)), 0x10))
Store (ShiftRight (B1B2(DV00,DV01), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x11))
Store (BST0, Index (DerefOf (Index (Local0, 0x02)), 0x12))
Store (ShiftRight (BST0, 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x13))
Store (B1B2(VC10,VC11), Index (DerefOf (Index (Local0, 0x02)), 0x14))
Store (ShiftRight (B1B2(VC10,VC11), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x15))
Store (B1B2(CV20,CV21), Index (DerefOf (Index (Local0, 0x02)), 0x16))
Store (ShiftRight (B1B2(CV20,CV21), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x17))
Store (B1B2(CV30,CV31), Index (DerefOf (Index (Local0, 0x02)), 0x18))
Store (ShiftRight (B1B2(CV30,CV31), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x19))
Store (B1B2(CV40,CV41), Index (DerefOf (Index (Local0, 0x02)), 0x1A))
Store (ShiftRight (B1B2(CV40,CV41), 0x08), Index (DerefOf (Index (Local0, 0x02)), 0x1B))
CreateField (DerefOf (Index (Local0, 0x02)), 0xE0, 0x80, BTSN)
Store (GBSS (B1B2(SN00,SN01), B1B2(MD00,MD01)), BTSN)
Store (RDN0(), Local1)
CreateField (DerefOf (Index (Local0, 0x02)), 0x0160, Multiply (SizeOf (Local1), 0x08), BMAN)
Store (Local1, BMAN)
CreateField (DerefOf (Index (Local0, 0x02)), 0x01F0, 0x80, CTN)
Store (RECB(0x30,128), CTN)
CreateField (DerefOf (Index (Local0, 0x02)), 0x0278, 0x38, BDN)
Store (RECB(0x10,56), BDN)
CreateField (DerefOf (Index (Local0, 0x02)), 0x02B0, 0x20, BTY)
Store (B1B4(TY00,TY01,TY02,TY03), BTY)
CreateField (DerefOf (Index (Local0, 0x02)), 0x02E0, 0x10, BMD)
Store (B1B2(MD00,MD01), BMD)
CreateField (DerefOf (Index (Local0, 0x02)), 0x02F0, 0x10, CRG)
If (And (BST0, One))
{
Store (Zero, CRG)
}
Else
{
Store (B1B2(RG00,RG01), CRG)
}
CreateField (DerefOf (Index (Local0, 0x02)), 0x0300, 0x10, BCV)
Store (B1B2(BV00,BV01), BCV)
Store (B1B2(BR00,BR01), Local1)
If (Local1)
{
If (And (BST0, One))
{
Add (Not (Local1), One, Local1)
And (Local1, 0xFFFF, Local1)
}
}
CreateField (DerefOf (Index (Local0, 0x02)), 0x0310, 0x10, CURT)
Store (Local1, CURT)
CreateField (DerefOf (Index (Local0, 0x02)), 0x0350, 0x08, BNUM)
Store (One, BNUM)
}
}
Else
{
Store (Package (0x02)
{
0x0D,
Zero
}, Local0)
}
Release (ECMX)
Return (Local0)
}
Method (_Q09, 0, NotSerialized) // _Qxx: EC Query
{
H2OP (0x09)
PWUP (0x05, One)
Notify (BAT0, 0x80)
If (LEqual (B1B2(RC00,RC01), B1B2(FC00,FC01)))
{
Notify (BAT0, 0x81)
}
}
Method (RE1B, 1, NotSerialized)
{
OperationRegion(ERAM, EmbeddedControl, Arg0, 1)
Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }
Return(BYTE)
}
Method (RECB, 2, Serialized)
{
ShiftRight(Arg1, 3, Arg1)
Name(TEMP, Buffer(Arg1) { })
Add(Arg0, Arg1, Arg1)
Store(0, Local0)
While (LLess(Arg0, Arg1))
{
Store(RE1B(Arg0), Index(TEMP, Local0))
Increment(Arg0)
Increment(Local0)
}
Return(TEMP)
}
Method (RMN0, 0, Serialized) { Return(RECB(0x21,128)) }
}
}
}
但是编译为aml文件时候总是出现以下错误,无法继续,哪位大神能帮忙编译一下不,就差电池了
|