- 积分
- 98
- 最后登录
- 2024-1-17
- 精华
- 0
- 阅读权限
- 20
- 主题
- 7
- UID
- 1716447
- 帖子
- 246
- PB币
- 19
- 威望
- 0
- 贡献
- 0
- 技术
- 0
- 活跃
- 643
- UID
- 1716447
- 帖子
- 246
- PB币
- 19
- 贡献
- 0
- 技术
- 0
- 活跃
- 643
|
1.我电脑的电池信息在SSDT-7上,只有16位和256位字段;
- OperationRegion (ECRM, EmbeddedControl, Zero, 0x0100)
- Field (ECRM, ByteAcc, Lock, Preserve)
- {
- Offset (0x11),
- ....省略
-
- SMBD, 256, //有一处还是两处?地方被调用, Method (SMBR, 3, NotSerialized) 里面ElseIf (LEqual (Local0, SRBL)){Store (SMBD, SDAT) Else Store (SMBD, SDAT)
- .
- ...省略
- .
- Offset (0x92),
- BA1T, 16, //有两处地方被调用,Method (_BIF, 0, NotSerialized)里面 If (SMOK){Store (ECR2 (RefOf (BA1T)), Index (BBIF, 0x04)); Method (_BST, 0, NotSerialized)里面If (SMOK){Store (ECR2 (RefOf (BA1T)), Index (BBST, 0x03))
- BA2T, 16, //有一处地方被调用,Method (_BST, 0, NotSerialized)里面If (SMOK){Store (ECR2 (RefOf (BA2T)), DATW)
- Offset (0x98),
- BA3T, 16, //有一处地方被调用,Method (_BST, 0, NotSerialized)里面if (SMOK){Store (ECR2 (RefOf (BA3T)), Index (BBST, 0x02))
- BA4T, 16, //有一处地方被调用,Method (_BST, 0, NotSerialized)里面if (SMOK){Store (ECR2 (RefOf (BA4T)), Index (BBIF, 0x02))
- Offset (0x9E),
- BA5T, 16, //有一处地方被调用,Method (_BST, 0, NotSerialized)里面if (SMOK){If (And (ECR2 (RefOf (BA5T)), 0x10))
- Offset (0xB4),
- BA6T, 16, //有一处地方被调用,Method (_BIF, 0, NotSerialized)里面If (SMOK){Store (ECR2 (RefOf (BA6T)), Index (BBIF, One))
- Offset (0xB8),
- DC2B, 16, //无其他地方调用
- FC2B, 16, //无其他地方调用
- DV2B, 16, //无其他地方调用
- CC2B, 16, //无其他地方调用
- RC2B, 16, //无其他地方调用
- CV2B, 16//无其他地方调用
- }
- .
- ....省略
- .
- Field (ECRM, ByteAcc, Lock, Preserve)
- {
- ECSP, 256//无其他地方调用
- }
复制代码
2.本人根据daxuexinsheng大神写的帖子https://bbs.pcbeta.com/viewthread-1521462-1-1.html操作,把大于16位字段拆分成8位,但是16位字段属于特殊写入或是读取?本人没编程基础,不懂如何操作,求大神指点?
本电脑电池信息SSDT-7.AML 16位特殊字段代码:
- Store (ECR2 (RefOf (BA6T))
复制代码 与daxuexinsheng大神的教程对比:
- Store (Arg0, ENCR)
- Or (BATD, 0xC0, BATD)
- And (BATD, 0xFF3F, BATD)
复制代码 与大神的教程对比后,完全不一样。。。我电脑代码不是Store (X, X)而是Store (ECR2 (RefOf (BA6T))。。。
2.我是这样操作的:比如对BA1T, 16, 进行拆分两个8位字段BA10和BA11
- into Scope label \_SB.PCI0.LPCB.H_EC code_regex BA1T,\s+16, replace_matched begin BA10,8,BA11,8,
- end;
复制代码 然后对BA1T调用的两处位置进行读取操作:
- into method label _BIF code_regex \(BA1T replaceall_matched begin (B1B2(BA10,BA11)
- end;
- into method label _BST code_regex \(BA1T replaceall_matched begin (B1B2(BA10,BA11)
- end;
复制代码 其他16位字段同样操作,最终打完补丁,SSDT出现了5个错误,有些16位字段未拆分成功,代码如下:
- Method (_BIF, 0, NotSerialized) // _BIF: Battery Information
- {
- Name (SBUF, Buffer (0x22){})
- CreateByteField (SBUF, Zero, SSTS)
- CreateByteField (SBUF, One, LENG)
- CreateByteField (SBUF, 0x02, DATB)
- CreateWordField (SBUF, 0x02, DATW)
- CreateField (SBUF, 0x10, 0x0100, BUF1)
- Name (SMOK, Zero)
- Store (ECA2, SMOK)
- If (SMOK)
- {
- Store (ECR2 (RefOf (BA6T)), Index (BBIF, One)) //BA6T拆分失败
- }
- If (SMOK)
- {
- Store (ECR2 (RefOf (BA4T)), Index (BBIF, 0x02)) //BA4T拆分失败
- }
- If (SMOK)
- {
- Store (ECR2 (RefOf (B1B2(BA10,BA11) )), Index (BBIF, 0x04)) //这里是BA1T的拆分,但是用读取操作还是用写入操作?还是怎么操作?
- }
- Return (BBIF)
- }
复制代码 5个语法错误,如下:
- 298, 6126, syntax error, unexpected PARSEOP_CLOSE_PAREN, expecting PARSEOP_EXP_INDEX_LEFT
复制代码 这个是本人根据教程写的电池补丁,求大神帮忙指导一下:
- # add method B1B2
- into method label B1B2 remove_entry;
- into definitionblock code_regex . insert
- begin
- Method (B1B2, 2, NotSerialized)\n
- {\n
- Return(Or(Arg0, ShiftLeft(Arg1, 8)))\n
- }\n
- end;
- # add utility methods to read/write buffers from/to \_SB.PCI0.LPCB.H_EC
- into method label RE1B parent_label \_SB.PCI0.LPCB.H_EC remove_entry;
- into method label RECB parent_label \_SB.PCI0.LPCB.H_EC remove_entry;
- into Scope label \_SB.PCI0.LPCB.H_EC 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
- // Arg0 - offset in bytes from zero-based \_SB.PCI0.LPCB.H_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 method label WE1B parent_label \_SB.PCI0.LPCB.H_EC remove_entry;
- into method label WECB parent_label \_SB.PCI0.LPCB.H_EC remove_entry;
- into Scope label \_SB.PCI0.LPCB.H_EC 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
- // Arg0 - offset in bytes from zero-based EC\n
- // Arg1 - size of buffer in bits\n
- // Arg2 - value to write\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;
- # rename 16 variable
- into Scope label \_SB.PCI0.LPCB.H_EC code_regex BA1T,\s+16, replace_matched begin BA10,8,BA11,8,
- end;
- into method label _BIF code_regex \(BA1T replaceall_matched begin (B1B2(BA10,BA11)
- end;
- into method label _BST code_regex \(BA1T replaceall_matched begin (B1B2(BA10,BA11)
- end;
- into Scope label \_SB.PCI0.LPCB.H_EC code_regex BA2T,\s+16, replace_matched begin BA00,8,BA01,8,
- end;
- into method label _BST code_regex \(BA2T replaceall_matched begin (B1B2(BA00,BA01)
- end;
- into Scope label \_SB.PCI0.LPCB.H_EC code_regex BA3T,\s+16, replace_matched begin BA02,8,BA03,8,
- end;
- into method label _BST code_regex \(BA3T replaceall_matched begin (B1B2(BA02,BA03)
- end;
- into Scope label \_SB.PCI0.LPCB.H_EC code_regex BA4T,\s+16, replace_matched begin BA04,8,BA05,8,
- end;
- nto method label _BIF code_regex \(BA4T replaceall_matched begin (B1B2(BA04,BA05)
- end;
- into Scope label \_SB.PCI0.LPCB.H_EC code_regex BA5T,\s+16, replace_matched begin BA06,8,BA07,8,
- end;
- into method label _BST code_regex \(BA5T replaceall_matched begin (B1B2(BA06,BA07)
- end;
- into Scope label \_SB.PCI0.LPCB.H_EC code_regex BA6T,\s+16, replace_matched begin BA08,8,BA09,8,
- end;
- nto method label _BIF code_regex \(BA6T replaceall_matched begin (B1B2(BA08,BA09)
- end;
- into method label SMBR code_regex SMBD replaceall_matched begin RECB(0x1C, 256)
- end;
复制代码 附上SSDT-7.dsl
搞了一个晚上,思路有点乱。。。。。
|
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|