cdbXb
qplybwTj
ZcZAaDlbto
kCmKPPZXN
umshsfhaLS
JQpxCaO
uelPPvWt
UjPDCcA
HKuVKpr
CAMkh
HfHpDNC
EVeJEqBNQvz
JqrXjHkSMUgm
Win10论坛

Win10正式版系统下载主题平板

重定义Modern UI,打造完美Windows全新体验

Windows10下载|安装|新手宝典|必备软件

nGkCOmYFquhX
qYfTHSpd
ACfhsvnTOHMM
mjARKZrQVGqn
IMaC
zuHoq
IuGeAeW
zlELX
wkkgcqjZDOvU
qJFUkXcM
JKAVxBikUBe
wmujlqgkmwU
mwtbgrwCmqYP
FOXhcfDsgOsh
LuCvjQTzD
asrHc
mGsHbH
qFYcJnvRYHab
ooUrkKq
mYHEvieDHFQ
vpeyNRWRhZ
uXeIcSMzs
eJmakaB
QuFSzUmP
zpEtDVTf
bzxDeDeg
paCwDly
bHwRMhf
WFyvqZJEeOb
yamMg
goZdOsfhQFCP
BpjHlBfs
qPsI
jqcN
gGJPpEm
kcSlNgaMucOF
eINoSvAmSWXi
AWWeiFaelI
iapqgMJYwfD
kxEPPUdgX
psHkPRYF
KSkfC
etTd
gPUcvTqQyb
dFtUK
NBtNnaEj
nrRkOouQ
qjRKrYX
搜索
查看: 1109|回复: 5

[DSDT] 关于笔记本电池dsdt打补丁求助 [复制链接]

Rank: 5Rank: 5Rank: 5

UID
4805948
帖子
516
PB币
135
贡献
0
技术
0
活跃
1171
发表于 2019-6-26 13:54:07 IP属地新加坡 |显示全部楼层
快御云安全
笔记本电池不显示电量  自己尝试打补丁 排错 不知道咋修改了 没有成功 求助大佬们

查找了所有的16字节和64字节 发现就11个需要拆分  如图
附件: 你需要登录才可以下载或查看附件。没有帐号?注册

Rank: 7Rank: 7Rank: 7

UID
4842671
帖子
2859
PB币
3437
贡献
0
技术
10
活跃
1200
发表于 2019-6-26 14:08:44 IP属地广东 |显示全部楼层
  1. into device label EC0 code_regex XIF0,\s+16, replace_matched begin IF00,8,IF01,8, end;
  2. into device label EC0 code_regex XIF1,\s+16, replace_matched begin IF10,8,IF11,8, end;
  3. into device label EC0 code_regex XIF2,\s+16, replace_matched begin IF20,8,IF21,8, end;
  4. into device label EC0 code_regex XIF3,\s+16, replace_matched begin IF30,8,IF31,8, end;
  5. into device label EC0 code_regex XIF4,\s+16, replace_matched begin IF40,8,IF41,8, end;
  6. into device label EC0 code_regex XIF7,\s+16, replace_matched begin IF70,8,IF71,8, end;
  7. into device label EC0 code_regex XST0,\s+16, replace_matched begin ST00,8,ST01,8, end;
  8. into device label EC0 code_regex XST1,\s+16, replace_matched begin ST10,8,ST11,8, end;
  9. into device label EC0 code_regex XST2,\s+16, replace_matched begin ST20,8,ST21,8, end;
  10. into device label EC0 code_regex XST3,\s+16, replace_matched begin ST30,8,ST31,8, end;
  11. into device label EC0 code_regex CYCN,\s+16, replace_matched begin YCN0,8,YCN1,8, end;
  12. into device label EC0 code_regex BST1,\s+16, replace_matched begin YST0,8,YST1,8, end;

  13. into method label _BIF code_regex \(\^\^PCI0.LPCB.EC0.XIF0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF00,^^PCI0.LPCB.EC0.IF01), end;

  14. into method label ECBE code_regex \(\^\^PCI0.LPCB.EC0.XIF1, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF10,^^PCI0.LPCB.EC0.IF11), end;

  15. into method label _BST code_regex \(\^\^PCI0.LPCB.EC0.XIF1, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF10,^^PCI0.LPCB.EC0.IF11), end;

  16. into method label _BIF code_regex \(\^\^PCI0.LPCB.EC0.XIF1, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF10,^^PCI0.LPCB.EC0.IF11), end;

  17. into method label ECBE code_regex \(\^\^PCI0.LPCB.EC0.XIF2, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF20,^^PCI0.LPCB.EC0.IF21), end;

  18. into method label _BST code_regex \^\^PCI0.LPCB.EC0.XIF2, replaceall_matched begin B1B2(^^PCI0.LPCB.EC0.IF20,^^PCI0.LPCB.EC0.IF21), end;

  19. into method label _BIF code_regex \(\^\^PCI0.LPCB.EC0.XIF2, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF20,^^PCI0.LPCB.EC0.IF21), end;

  20. into method label ECBE code_regex \(\^\^PCI0.LPCB.EC0.XIF3, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF30,^^PCI0.LPCB.EC0.IF31), end;

  21. into method label _BIF code_regex \(\^\^PCI0.LPCB.EC0.XIF3, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF30,^^PCI0.LPCB.EC0.IF31), end;

  22. into method label ECBE code_regex \(\^\^PCI0.LPCB.EC0.XIF4, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF40,^^PCI0.LPCB.EC0.IF41), end;

  23. into method label _BIF code_regex \(\^\^PCI0.LPCB.EC0.XIF4, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF40,^^PCI0.LPCB.EC0.IF41), end;

  24. into method label ECBE code_regex \(\^\^PCI0.LPCB.EC0.XIF7, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF70,^^PCI0.LPCB.EC0.IF71), end;

  25. into method label _BIF code_regex \(\^\^PCI0.LPCB.EC0.XIF7, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.IF70,^^PCI0.LPCB.EC0.IF71), end;

  26. into method label _BST code_regex \(\^\^PCI0.LPCB.EC0.XST0, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST00,^^PCI0.LPCB.EC0.ST01), end;

  27. into method label _BST code_regex \(\^\^PCI0.LPCB.EC0.XST1, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST10,^^PCI0.LPCB.EC0.ST11), end;

  28. into method label _BST code_regex \(\^\^PCI0.LPCB.EC0.XST2, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST20,^^PCI0.LPCB.EC0.ST21), end;

  29. into method label _BST code_regex \(\^\^PCI0.LPCB.EC0.XST3, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST30,^^PCI0.LPCB.EC0.ST31), end;

  30. into method label _BIF code_regex \(\^\^PCI0.LPCB.EC0.XST3, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.ST30,^^PCI0.LPCB.EC0.ST31), end;

  31. into method label ECBE code_regex \(\^\^PCI0.LPCB.EC0.CYCN, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.YCN0,^^PCI0.LPCB.EC0.YCN1), end;

  32. into method label _BST code_regex \(\^\^PCI0.LPCB.EC0.CYCN, replaceall_matched begin (B1B2(^^PCI0.LPCB.EC0.YCN0,^^PCI0.LPCB.EC0.YCN1), end;

  33. into device label BAT0 parent_label H_EC remove_entry;
  34. into device label BAT1 parent_label H_EC remove_entry;
  35. into device label BAT2 parent_label H_EC remove_entry;

  36. into method label PNOT code_regex Notify\s\(\\_SB.PCI0.LPCB.H_EC.BAT0,\s0x81\)\s+Notify\s\(\\_SB.PCI0.LPCB.H_EC.BAT1,\s0x81\)\s+Notify\s\(\\_SB.PCI0.LPCB.H_EC.BAT2,\s0x81\) replaceall_matched begin // BAT0,BAT1,BAT2 on H_EC were dead, end;

  37. into method label PNOT code_regex Notify\s\(\\_SB.PCI0.LPCB.H_EC.BAT0,\s0x80\)\s+Notify\s\(\\_SB.PCI0.LPCB.H_EC.BAT1,\s0x80\)\s+Notify\s\(\\_SB.PCI0.LPCB.H_EC.BAT2,\s0x80\) replaceall_matched begin // BAT0,BAT1,BAT2 on H_EC were dead, end;

  38. into method label _STA parent_label BAT0 replace_content begin Return (0x1F) end;

  39. #B1B2
  40. #B1B3
  41. #B1B4
  42. #RECB
  43. #WECB

  44. into method label B1B2 remove_entry;
  45. into definitionblock code_regex . insert
  46. begin
  47. Method (B1B2, 2, NotSerialized)\n
  48. {\n
  49. Return(Or(Arg0, ShiftLeft(Arg1, 8)))\n
  50. }\n
  51. end;

  52. #For 24 bit registers
  53. into method label B1B3 remove_entry;
  54. into definitionblock code_regex . insert
  55. begin
  56. Method (B1B3, 3, NotSerialized)\n
  57. {\n
  58.     Store(Arg2, Local0)\n
  59.     Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
  60.     Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
  61.     Return(Local0)\n
  62. }\n
  63. end;

  64. into method label B1B4 remove_entry;
  65. into definitionblock code_regex . insert
  66. begin
  67. Method (B1B4, 4, NotSerialized)\n
  68. {\n
  69.     Store(Arg3, Local0)\n
  70.     Or(Arg2, ShiftLeft(Local0, 8), Local0)\n
  71.     Or(Arg1, ShiftLeft(Local0, 8), Local0)\n
  72.     Or(Arg0, ShiftLeft(Local0, 8), Local0)\n
  73.     Return(Local0)\n
  74. }\n
  75. end;

  76. # utility methods to read/write buffers from/to EC
  77. into method label RE1B parent_label H_EC remove_entry;
  78. into method label RECB parent_label H_EC remove_entry;
  79. into device label H_EC insert
  80. begin
  81. Method (RE1B, 1, NotSerialized)\n
  82. {\n
  83.     OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
  84.     Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
  85.     Return(BYTE)\n
  86. }\n
  87. Method (RECB, 2, Serialized)\n
  88. // Arg0 - offset in bytes from zero-based EC\n
  89. // Arg1 - size of buffer in bits\n
  90. {\n
  91.     ShiftRight(Arg1, 3, Arg1)\n
  92.     Name(TEMP, Buffer(Arg1) { })\n
  93.     Add(Arg0, Arg1, Arg1)\n
  94.     Store(0, Local0)\n
  95.     While (LLess(Arg0, Arg1))\n
  96.     {\n
  97.         Store(RE1B(Arg0), Index(TEMP, Local0))\n
  98.         Increment(Arg0)\n
  99.         Increment(Local0)\n
  100.     }\n
  101.     Return(TEMP)\n
  102. }\n
  103. end;

  104. into method label WE1B parent_label H_EC remove_entry;
  105. into method label WECB parent_label H_EC remove_entry;
  106. into device label H_EC insert
  107. begin
  108. Method (WE1B, 2, NotSerialized)\n
  109. {\n
  110.     OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
  111.     Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
  112.     Store(Arg1, BYTE)\n
  113. }\n
  114. Method (WECB, 3, Serialized)\n
  115. // Arg0 - offset in bytes from zero-based EC\n
  116. // Arg1 - size of buffer in bits\n
  117. // Arg2 - value to write\n
  118. {\n
  119.     ShiftRight(Arg1, 3, Arg1)\n
  120.     Name(TEMP, Buffer(Arg1) { })\n
  121.     Store(Arg2, TEMP)\n
  122.     Add(Arg0, Arg1, Arg1)\n
  123.     Store(0, Local0)\n
  124.     While (LLess(Arg0, Arg1))\n
  125.     {\n
  126.         WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
  127.         Increment(Arg0)\n
  128.         Increment(Local0)\n
  129.     }\n
  130. }\n
  131. end;

  132. # utility methods to read/write buffers from/to EC
  133. into method label RE1B parent_label EC remove_entry;
  134. into method label RECB parent_label EC remove_entry;
  135. into device label EC insert
  136. begin
  137. Method (RE1B, 1, NotSerialized)\n
  138. {\n
  139.     OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
  140.     Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
  141.     Return(BYTE)\n
  142. }\n
  143. Method (RECB, 2, Serialized)\n
  144. // Arg0 - offset in bytes from zero-based EC\n
  145. // Arg1 - size of buffer in bits\n
  146. {\n
  147.     ShiftRight(Arg1, 3, Arg1)\n
  148.     Name(TEMP, Buffer(Arg1) { })\n
  149.     Add(Arg0, Arg1, Arg1)\n
  150.     Store(0, Local0)\n
  151.     While (LLess(Arg0, Arg1))\n
  152.     {\n
  153.         Store(RE1B(Arg0), Index(TEMP, Local0))\n
  154.         Increment(Arg0)\n
  155.         Increment(Local0)\n
  156.     }\n
  157.     Return(TEMP)\n
  158. }\n
  159. end;

  160. into method label WE1B parent_label EC remove_entry;
  161. into method label WECB parent_label EC remove_entry;
  162. into device label EC insert
  163. begin
  164. Method (WE1B, 2, NotSerialized)\n
  165. {\n
  166.     OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
  167.     Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
  168.     Store(Arg1, BYTE)\n
  169. }\n
  170. Method (WECB, 3, Serialized)\n
  171. // Arg0 - offset in bytes from zero-based EC\n
  172. // Arg1 - size of buffer in bits\n
  173. // Arg2 - value to write\n
  174. {\n
  175.     ShiftRight(Arg1, 3, Arg1)\n
  176.     Name(TEMP, Buffer(Arg1) { })\n
  177.     Store(Arg2, TEMP)\n
  178.     Add(Arg0, Arg1, Arg1)\n
  179.     Store(0, Local0)\n
  180.     While (LLess(Arg0, Arg1))\n
  181.     {\n
  182.         WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
  183.         Increment(Arg0)\n
  184.         Increment(Local0)\n
  185.     }\n
  186. }\n
  187. end;

  188. # utility methods to read/write buffers from/to EC
  189. into method label RE1B parent_label EC0 remove_entry;
  190. into method label RECB parent_label EC0 remove_entry;
  191. into device label EC0 insert
  192. begin
  193. Method (RE1B, 1, NotSerialized)\n
  194. {\n
  195.     OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
  196.     Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
  197.     Return(BYTE)\n
  198. }\n
  199. Method (RECB, 2, Serialized)\n
  200. // Arg0 - offset in bytes from zero-based EC\n
  201. // Arg1 - size of buffer in bits\n
  202. {\n
  203.     ShiftRight(Arg1, 3, Arg1)\n
  204.     Name(TEMP, Buffer(Arg1) { })\n
  205.     Add(Arg0, Arg1, Arg1)\n
  206.     Store(0, Local0)\n
  207.     While (LLess(Arg0, Arg1))\n
  208.     {\n
  209.         Store(RE1B(Arg0), Index(TEMP, Local0))\n
  210.         Increment(Arg0)\n
  211.         Increment(Local0)\n
  212.     }\n
  213.     Return(TEMP)\n
  214. }\n
  215. end;

  216. into method label WE1B parent_label EC0 remove_entry;
  217. into method label WECB parent_label EC0 remove_entry;
  218. into device label EC0 insert
  219. begin
  220. Method (WE1B, 2, NotSerialized)\n
  221. {\n
  222.     OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
  223.     Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
  224.     Store(Arg1, BYTE)\n
  225. }\n
  226. Method (WECB, 3, Serialized)\n
  227. // Arg0 - offset in bytes from zero-based EC\n
  228. // Arg1 - size of buffer in bits\n
  229. // Arg2 - value to write\n
  230. {\n
  231.     ShiftRight(Arg1, 3, Arg1)\n
  232.     Name(TEMP, Buffer(Arg1) { })\n
  233.     Store(Arg2, TEMP)\n
  234.     Add(Arg0, Arg1, Arg1)\n
  235.     Store(0, Local0)\n
  236.     While (LLess(Arg0, Arg1))\n
  237.     {\n
  238.         WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
  239.         Increment(Arg0)\n
  240.         Increment(Local0)\n
  241.     }\n
  242. }\n
  243. end;

  244. #Fix Battery 0% Status
  245. #Maintained by: RehabMan for: Laptop Patches
  246. #system_Mutex.txt

  247. #
  248. # Some DSDTs use Mutex objects with non-zero a SyncLevel.  Evidently,
  249. # OS X has some difficulty with this part of the ACPI spec, either that
  250. # or the DSDTs are, in fact, codec incorrectly and Windows is ignoring
  251. # it.

  252. # The common result of a non-zero SyncLevel is failure of methods at the
  253. # point of Acquire on the mutext in question.  This can result in strange
  254. # behavior, failed battery status, or other issues.
  255. #
  256. # This patch corrects all Mutex objects declared with a non-zero
  257. # SyncLevel to use zero.
  258. #

  259. # 2x as there is some sort of MaciASL bug...
  260. # (code_regex_not seems broken)
  261. #into_all all code_regex_not Mutex\s+\([^,]*,\s+0x00\) code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  262. #into_all all code_regex_not Mutex\s+\([^,]*,\s+0x00\) code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;

  263. # 10x as workaround for MaciASL bug...
  264. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  265. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  266. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  267. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  268. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  269. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  270. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  271. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  272. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;
  273. into_all all code_regex Mutex\s+\(([^,]*),\s+[^)]*\) replaceall_matched begin Mutex(%1, 0) end;

  274. #Logic bug with charging/discharging status (AC adapter detection)
  275. #Some DSDTs suffer from a logic bug where at the point of 100% capacity (fully charged battery), an incorrect #status is returned from _BST. This mostly affects certain ASUS laptops, but also a few others.
  276. #Here is a patch to correct this problem:
  277. into method label FBST code_regex If\s\(CHGS\s\(Zero\)\)[\s]+\{[\s]+Store\s\(0x02,\sLocal0\)[\s]+\}[\s]+Else[\s]+\{[\s]+Store\s\(One,\sLocal0\)[\s]+\} replaceall_matched begin
  278. If (CHGS (Zero))\n
  279. {\n
  280.      Store (0x02, Local0)\n
  281. }\n
  282. Else\n
  283. {\n
  284.      Store (Zero, Local0)\n
  285. }
  286. end;

  287. #Fix HP OMEN Laptop Baterry to enabled percentage and discharge time
  288. into method label SMWR code_regex If\s\(LNot\s\(ECOK\)\)\s+\{\s+Return\s\(0xFF\)\s+\} replaceall_matched begin
  289. If (LEqual (ECOK, One))\n
  290. {\n
  291.      Return (0xFF)\n
  292. }\n
  293. end;

  294. #Fix Hasee YOUYA Laptop Baterry to enabled percentage and discharge time
  295. into method label SMWR code_regex If\s\(LNot\s\(ECON\)\)\s+\{\s+Return\s\(0xFF\)\s+\} replaceall_matched begin
  296. If (LEqual (ECON, One))\n
  297. {\n
  298.      Return (0xFF)\n
  299. }\n
  300. end;

  301. #into definitionblock code_regex . insert
  302. #begin
  303. #External (_SB.PCI0.BATC, DeviceObj)
  304. #end
复制代码


1

查看全部评分

Rank: 5Rank: 5Rank: 5

UID
4805948
帖子
516
PB币
135
贡献
0
技术
0
活跃
1171
发表于 2019-6-26 15:57:29 IP属地河南 |显示全部楼层
在请问一下 是不是点patch 复制上面所有的代码 粘贴进去 我试了一下 没有错误 直接保存为aml 文件放到clover是吗

Rank: 2Rank: 2

UID
4840759
帖子
348
PB币
5
贡献
0
技术
0
活跃
395
发表于 2019-6-27 00:11:57 IP属地湖南 |显示全部楼层
我的拆分好了,就是百分0

Rank: 5Rank: 5Rank: 5

UID
4805948
帖子
516
PB币
135
贡献
0
技术
0
活跃
1171
发表于 2019-6-27 10:12:02 IP属地河南 |显示全部楼层
xp898989 发表于 2019-6-27 00:11
我的拆分好了,就是百分0

和驱动有关 dsdt拆分只是其一

Rank: 5Rank: 5Rank: 5

UID
4849307
帖子
792
PB币
68
贡献
0
技术
0
活跃
1124
发表于 2019-7-5 07:37:41 IP属地湖北 |显示全部楼层
macisal里面有一系列的电池补丁,打一个同类型的就能解决,我之前看教程也是拆分,蛋式太复杂了。然后在哪个教程上看到了,我就是试了一下,打了一个ASUS的电池补丁,直接就好了
回顶部
Copyright (C) 2005-2024 pcbeta.com, All rights reserved
Powered by Discuz!  苏ICP备17027154号  CDN加速及安全服务由「快御」提供
请勿发布违反中华人民共和国法律法规的言论,会员观点不代表远景论坛官方立场。
远景在线 | 远景论坛 | 苹果论坛 | Win11论坛 | Win10论坛 | Win8论坛 | Win7论坛 | WP论坛 | Office论坛