尹剑飞 发表于 2019-6-6 10:41

此贴致敬远景论坛上的关于dsdt相关的前辈提供的资料 进行了整理 大神勿喷(侵删)

此贴致敬远景论坛上的关于dsdt相关的前辈提供的资料 大神勿喷(侵删) 第一部分    DSDT提取 DSDT提取有很多种方法 例如:linux下利用命令 sudo cp –R /sys/fireware/apci/tables 空格 /home/你的用户名/Desktop 就可以复制tables文件夹到桌面 Windows下建议用Everst ultimate 5提取到dsdt和ssdt的bin(二进制)文件,修改后缀为aml即可 Mac下有DSDTEditor 、DSDTSE、MaciASL等等在此不做过多介绍 Clover界面下按f4提取原始dsdt,f5提取oem的dsdt 个人建议用Everst工具在windows下提取,然后修改后缀 因为在别的地方(mac或linux)提取的DSDT需要修改的错误相对比较多(个人感觉) 第二部分   部分DSDT错误修复 dsdt.dsl 2626:                  Field (ECR, DWordAcc, Lock, Preserve)
Error    1048 -                           ^ Host Operation Regionrequires ByteAcc access 解决办法:修改Field (ECR, DWordAcc, Lock, Preserve)                改为Field (ECR, ByteAcc, Lock, Preserve) dsdt.dsl 2672:                  Method (_GLK, 1, NotSerialized)
Warning2024 -                               ^ Reserved method hastoo many arguments ( _GLK requires 0) 解决办法:修改Method (_GLK, 1,NotSerialized)                     为   Method (_GLK) dsdt.dsl163:   Method (_WAK, 1, NotSerialized)
Warning2026 -                ^Reserved method must return a value (_WAK) 解决办法:在_WAK method末尾添加Return(Package(0x02){0x00,0x00}) 参考文章:https://blog.csdn.net/nksmiles/article/details/7466067 DSDT.dsl12266: Or (0x08,^^PCI0.LPCB.EC.INF2)
Error    6114 -Result is not used, operator has no effect ^

DSDT.dsl12270: And (0xF7,^^PCI0.LPCB.EC.INF2)
Error    6114 -Result is not used, operator has no effect ^
正确:
If (And (ARGS, 0x02))
{
Or (^^PCI0.LPCB.EC.INF2, 0x08, ^^PCI0.LPCB.EC.INF2)
}
Else
{
And (^^PCI0.LPCB.EC.INF2, 0xF7, ^^PCI0.LPCB.EC.INF2) syntax error, unexpected PARSEOP_ARG0   可用Maciasl打fix_ADBG Error 补丁

Method (ADBG, 1, Serialized)
    {
      If (CondRefOf (MDBG))
      {
            Return (MDBG)
            Arg0
      }

可以删除Arg0,也可改成这样

Method (ADBG, 1, Serialized)
    {
      If (CondRefOf (MDBG))
      {
            Return (MDBG)
            Store (Arg0,MDBG)
      }
      Return (Zero)
    }
新改法
Error    6086 -                     ^ Not a controlmethod, cannot invoke (MDBG is a Integer)
   Method (ADBG, 1, Serialized)
   {
         If (CondRefOf (MDBG))
         {
             Return (MDBG (Arg0))
//            Arg0      }

然后改External (MDBG, IntObj)   为External(MDBG, MethodObj)
DSDT.dsl   4262:                  Store (\_GPE.MMTB(Local3, \_GPE.OSUP (Local3)), Store (Local2, REG6))
Error    6126 -                                 syntax error, unexpected PARSEOP_STORE ^
               Store (REG6,Local2)
                  Store(0x00F0F000, REG6)
                  Store(\_GPE.MMTB (Local3, \_GPE.OSUP (Local3)), Store (Local2, REG6))
                  Release(OSUM)
                  Acquire(WFDM, 0xFFFF)
                  Store (One,WKFN)
                  Release(WFDM)
改成
                  Store(REG6, Local2)
                  Store(0x00F0F000, REG6)
                  Store (\_GPE.MMTB(),Local3)
                  \_GPE.OSUP(Local3)
                  Store(Local2, REG6)
                  Release(OSUM)
                  Acquire(WFDM, 0xFFFF)
                  Store (One,WKFN)
                  Release(WFDM)

                Store (REG6,Local1)
                  Store(0x00F0F000, REG6)
                  Store(\_GPE.MMTB(), Local2)
                  \_GPE.OSUP(Local2)
               Store(Local1, REG6)
                  Release(OSUM)


继续编译
DSDT.dsl   76:   External(_SB_.PCI0.PEG0)
Error    6074 -                               ^ Name already exists in scope (_SB_.PCI0.PEG0)

DSDT.dsl   77:   External(_SB_.PCI0.PEG0.PEGP)
Error    6074 -   Name already exists inscope ^(_SB_.PCI0.PEG0.PEGP)

DSDT.dsl   78:   External(_SB_.PCI0.PEG1)
Error    6074 -                               ^ Name already exists in scope (_SB_.PCI0.PEG1)

DSDT.dsl   79:   External(_SB_.PCI0.PEG2)
Error    6074 -                               ^ Name already exists in scope (_SB_.PCI0.PEG2)

ASL Input:   DSDT.dsl - 14719 lines, 467630 bytes, 5766keywords

Compilation complete. 4 Errors, 37 Warnings, 53 Remarks, 103 Optimizations

删除
76
77
78
79   行



Return (One)
Warning3104 -                                     ^ Reserved method should not return avalue

                     If (LEqual (^^^GFX0.HGCK, One))
                     {
//                         Return (One)
                     }

用//注销或删除Return (One)



                                     0x0EC00000,         
Error    6043 -                              ^ Invalid combination of Length and Min/Max fixed flags

                      0x00004000,         
Error    6043 -                              ^ Invalid combination of Length and Min/Max fixed flags

google搜索“0xFED44FFF - 0xFED40000 + 1=”         
0xFEBFFFFF-0xF0000000+1=               出来的数值是正确的,编译却仍报错,把 0x0EC00000,0x00004000改为0x00000000就通过了。

0x09
Error    6126 -                     ^ syntax error, unexpectedPARSEOP_INTEGER
0x04
Error    6126 -                           ^syntax error, unexpected PARSEOP_INTEGER
            Method (_PRW, 0,NotSerialized)// _PRW: Power Resources for Wake
            {
                  Return(GPRW)
//                0x09
//                0x04

            改为   Method (_PRW, 0, NotSerialized)// _PRW: Power Resources forWake
            {
                  Return(GPRW ())
            }
用这组合编译就能避免这错误
iasl -e DSDT.aml SSDT-1.aml -d SSDT-3.aml


OperationRegion (MSID, SystemMemory, EBAS(0x50), Field (MSID, DWordAcc, Lock, Preserve)
Error    6126 -                           syntaxerror, unexpected PARSEOP_FIELD ^

         OperationRegion (MSID, SystemMemory, EBAS, 0x50)
          Field (MSID, DWordAcc, Lock, Preserve)
          {
            VEID,    16,
            Offset (0x40),
            NVID,    32,
            Offset (0x4C),
            ATID,   32
          }



OperationRegion (RPCX, SystemMemory, Add (\XBAS (0x8000), Zero, 0x1000),Field (RPCX, ByteAcc, NoLock, Preserve)
Error    6126 -                         syntax error,unexpected PARSEOP_INTEGER, expecting ')' ^


改为 OperationRegion (RPCX, SystemMemory, Add(\XBAS, 0x8000), 0x1000),Field (RPCX, ByteAcc, NoLock,Preserve)
          {
PLD_Revision       = 0x1, Error    6105 -                                    ^ Invalid objecttype for reserved name (_PLD: found Buffer, Package required)


Name (_PLD, Package() { ToPLD (
          PLD_Revision      = 0x1,
          PLD_IgnoreColor    = 0x1,
          ...
          PLD_VerticalOffset = 0x0,
          PLD_HorizontalOffset = 0x0)}
)// _PLD: Physical Location of Device



DSDT.dsl11658:                           If (IGDS (^^^GFX0.GHDS (Zero), Sleep (0x01F4))) {}
Error    6126 -                                                ^ syntax error, unexpectedPARSEOP_SLEEP,expecting ',' or ')'

正确如下
          Method (_Q1C, 0,NotSerialized)// _Qxx: EC Query
         {
               If (LAnd (ECOK (),Ones))
               {
                  If (LEqual (Zero, APTG))
                  {
                        If (LNotEqual (OSYS, 0x03E8))
                        {
                            If (IGDS)
                            {
                              ^^^GFX0.GHDS (Zero)
                            }
                        }
                  }

                  Sleep (0x01F4)
                  Notify (VPC0, 0x80)
               }
         }

dsdt.dsl19910:                  Local0
Error    6126 -                     ^ syntax error, unexpectedPARSEOP_LOCAL0
正确的应当是这样的
         Name (ASBN, Zero)
         Method (SBRN, 0, Serialized)
         {
               If (^^^GFX0.PRST ())
               {
                  Store (^^^GFX0.GCBL (^^^GFX0.CBLV), Local0)
                  Subtract (0x0A, Local0, Local1)
                  If (LNotEqual (Local1, LBTN))



dsdt.dsl18207:                               Divide (Multiply (DerefOf (Index (PWAC, Local3)), 0x64),0xFF,
Error    6114 - Result is not used, operator has no effect ^
正确的是这样的
      ^^^GFX0.AINT (One, Divide (Multiply (DerefOf (Index (PWAC,Local3)), 0x64
                                    ),0xFF, ))         

    Return (Zero)
Error    6105 -                           ^Invalid object type for reserved name (_ROM: found Integer, Buffer required)
          Method (_ROM, 2,NotSerialized)// _ROM: Read-Only Memory
          {
            If (RBUF)
            {
                  Add (Arg0,RBUF, Local0)
                  Name (VBUF,Buffer (Arg1) {})
                   OperationRegion (VROM, SystemMemory, Local0, 0x1000)
                  Field(VROM, ByteAcc, NoLock, Preserve)
                  {
                     ROMI,   32768
                  }

                  Store(ROMI, VBUF)
                  Return(VBUF)
            }
            Else
            {
                  Return(Zero)
            }
          }
改成Return (Local0)通过编译      一般是改成Return (Buffer(Zero){})



ssdt-2.dsl    495:                      Zero
Error    6105 -                           ^Invalid object type for reserved name
(_PSS: found Integer at index 0, Package required)

          Method (_PSS, 0,NotSerialized)// _PSS: Performance Supported States
         {
               If (CondRefOf (\_PR.CPU0._PSS))
               {
                  Return (\_PR.CPU0._PSS)
               }
               Else
               {
                  Return (Package (0x01)
                                    {
                                              Zero
                                    })

解决了,正确的如下
         Method (_PSS, 0,NotSerialized)// _PSS: Performance Supported States
         {
               If (CondRefOf(\_PR.CPU0._PSS))
               {
                  Return (\_PR.CPU0._PSS)
               }
               Else
               {
                  Return (Package (0x01) {Package (0x06)
                  {
                        Zero
                  }})


ssdt-2.dsl    537:                     Zero
Error    6105 -                           ^Invalid object type for reserved name
(_PTC: found Integer at index 0, Buffer required)

         Method (_PTC, 0,NotSerialized)// _PTC: Processor Throttling Control
         {
               If (CondRefOf(\_PR.CPU0._PTC))
               {
                  Return (\_PR.CPU0._PTC)
               }
               Else
               {
                  Return (Package (0x02) {Buffer (0x10)
                  {
                        Zero
                  }})

         Method (_TSS, 0,NotSerialized)// _TSS: Throttling Supported States
         {
               If (CondRefOf(\_PR.CPU0._TSS))
               {
                  Return (\_PR.CPU0._TSS)
               }
               Else
               {
                  Return (Package (0x01) {Package (0x05)
                  {
                        Zero
                  }})

         Method (_TSD, 0,NotSerialized)// _TSD: Throttling State Dependencies
         {
               If (CondRefOf(\_PR.CPU0._TSD))
               {
                  Return (\_PR.CPU0._TSD)
               }
               Else
               {
                  Return (Package (0x01) {Package (0x05)
                  {
                        Zero
                  }})

> DSDT.asl   694:                  SRST,   1,
> Error   1051 -                      ^ Access width of Field Unitextends
> beyond region limit
>
> DSDT.asl   697:                  ACPW,   1
> Error   1051 -                      ^ Access width of Field Unitextends
> beyond region limit

            OperationRegion(GPIO,SystemIO, 0x1180, 0x3b)

AccessAs(DWordAcc) means (If I understand this properly) get any
variables as 32bit.39+4 = 3c.Increase your range from0x3b to 0x3c
and see if it works.

> DSDT.asl1455:                  Field(ERAM, AnyAcc, Lock, Preserve) {
> Error   1048 -                            ^ HostOperation Region requires
> ByteAc

I'd change AnyAcc to ByteAcc here.

修改AnyAcc 为ByteAcc      还有WordAccDwordAccQWordAcc
DSDT.dsl    923:                  Field (U1D3, WordAcc, NoLock, Preserve)    改WordAcc 为AnyAcc
Error    6029 -                            ^Access width is greater than region size

DSDT.dsl    925:                      UR49,   3
Error    6030 -                         ^ Access width ofField Unit extends beyond region limit

Access width of Field Unit extends beyond region limit


DSDT.dsl   3967:      Method (_WAK, 1, NotSerialized)
Warning3107 -               ^ Reserved method must return a value (Integer/Packagerequired for _WAK)
在最后添加 Return(Package(0x02){0x00, 0x00})

      Method (_WAK, 1, NotSerialized)// _WAK: Wake
      {
            
             }
             Return(Package(0x02){0x00,0x00})
          }

DSDT.dsl18403:            Acquire (MUTE, 0x03E8)
Warning3130 -                                 ^ Result is not used, possible operator timeout will bemissed

关于这个错误,变量MUTE 0xXXXX调整为0xFFFF
Acquire (MUTE, 0x03E8)
转换为下面的代码,它必须更换任何它给出错误的位置
Acquire (MUTE, 0xFFFF)


DSDT.dsl17562:                  And (Local0, 0x7F)
Error    6114 -                            ^Result is not used, operator has no effect

DSDT.dsl17565:                  And (Local0, 0x7F)
Error    6114 -                            ^Result is not used, operator has no effect

改And (Local0, 0x7F)为 And (Local0, 0x7F, Local0)

          Method (MXMX, 1, Serialized)
         {
               If (LEqual (Arg0, One))
               {
                  P8XH (One, 0x99, P8XH (Zero, One, Return (One)))
               }

               Return (Zero)
         }

正确如下
         Method (MXMX, 1, Serialized)
         {
               If (LEqual (Arg0, One))
               {
                  P8XH (One, 0x99)
            P8XH (Zero, One)
         Return (One)
               }

If (CondRefOf (\_SB.PCI0.XHC.PS3X))
   
{
                     
Store (Zero, \_SB.PCI0.XHC.PS3X)            
               
    }

PS3X注销或改成上面
If (CondRefOf (\_SB.PCI0.XHC.PS0X))
                  
{
                                 
Store (Zero, \_SB.PCI0.XHC.PS0X)

//   PS0X                联合编译PS0X   正确为PS0X ()单这样改会出错
}

也可以改为Store(Zero,PS0X) ssdt4.dsl    196:                               REVI
Error    6126 -                                 ^ syntax error, unexpected PARSEOP_NAMESEG, expecting '('

ssdt4.dsl    529:                  Arg0
Error    6126 -                      ^ syntax error, unexpectedPARSEOP_ARG0
                               Return (\_SB.PCI0.GFX0._DSM(MUID, REVI, SFNC, XRG0))


    Return(\_SB.PCI0.GFX0.DD02._BCM (Arg0))




内容由于篇幅限制,完整文档皆放入压缩包中需要的可自行下载







VeChar 发表于 2019-6-6 10:54

感谢楼主分享!

draco6040 发表于 2019-6-6 11:08

感谢楼主分享!虽然不明觉厉

立正向左转 发表于 2019-6-6 11:10

谢谢楼主分享,虽然我还是不会搞

Chaphol 发表于 2019-6-6 12:06

感谢分享哈哈

gameboyforever 发表于 2019-6-6 13:17

谢谢分享 有时间的话学习一下

eoan 发表于 2019-6-6 13:26

不错,对于一部分问题看这个就可以解决了的

百赖小生 发表于 2019-6-6 14:25

感谢楼主总结分享。省的去爬贴了。

来吃个苹果 发表于 2019-6-6 14:35


感谢楼主分享!

ForEvEr_Gai 发表于 2019-6-6 15:19

感谢楼主分享
话说谁给解释下 台式机 用dsdt的必要性?

T_MAX_ 发表于 2019-6-10 21:50

感谢楼主分享!

loveyouwolf 发表于 2019-6-14 01:11

多谢分享!!!!

chinesetest 发表于 2019-6-14 11:11

只要能用就行

大司马2018 发表于 2019-6-14 15:15

感谢分享,正好需要这个

shakayx 发表于 2019-6-14 15:44

请问LZ这个怎么修改呢?



bili282 发表于 2019-6-14 23:46

表示看不懂,支持一下

YANGYANG2009 发表于 2019-6-15 00:46

学习中,看来还有很长路要走

xiaohaohao1111 发表于 2019-6-15 10:43

感谢楼主!!

little_ben 发表于 2019-6-15 23:12

shakayx 发表于 2019-6-14 15:44 https://www.pcbeta.com/static/image/common/back.gif
请问LZ这个怎么修改呢?

2t数据是格式的exfat,还是用paragon?

尹剑飞 发表于 2019-6-17 16:08

shakayx 发表于 2019-6-14 15:44 https://www.pcbeta.com/static/image/common/back.gif
请问LZ这个怎么修改呢?

不是错误的,最好别改,ssdt中可能用的到,这句的意思是,switch 表达式非静态整数
页: [1] 2
查看完整版本: 此贴致敬远景论坛上的关于dsdt相关的前辈提供的资料 进行了整理 大神勿喷(侵删)