Jump to content

Help fixing errors


ammoune78
 Share

3 posts in this topic

Recommended Posts

I'm trying to convert SSDTs from ACPI 6,3 to 5,0, and i've got some errors while converting the code.

So here's the two SSDTs that i'm trying to create:

 

SSDT-EC

Original ACPI 6,3:

DefinitionBlock ("", "SSDT", 2, "DRTNIA", "SsdtEC", 0x00001000)
{
    External (_SB_.PCI0.LPCB, DeviceObj)
    External (_SB_.PCI0.LPCB.H_EC, DeviceObj)
      
    If ((CondRefOf (\_SB.PCI0.LPCB.H_EC)))
    {
        If ((((CondRefOf (\_SB.PCI0.LPCB.H_EC._HID) && CondRefOf (\_SB.PCI0.LPCB.H_EC._CRS)) && CondRefOf (\_SB.PCI0.LPCB.H_EC._GPE
            )) && !CondRefOf (\_SB.PCI0.LPCB.H_EC._STA)))
        {
            Scope (\_SB.PCI0.LPCB.H_EC)
            {
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If (_OSI ("Darwin"))
                    {
                        Return (Zero)
                    }
                    Else
                    {
                        Return (0x0F)
                    }
                }
            }
        }
    }

    Scope (\_SB)
    {
        Device (EC)
        {
            Name (_HID, "ACID0001")  // _HID: Hardware ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (_OSI ("Darwin"))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }
        }
    }
}

 

Early created ACPI 5,0:

DefinitionBlock ("", "SSDT", 2, "DRTNIA", "SSDT-EC", 0x00001000)
{
    External (_SB_.PCI0.LPCB, DeviceObj)
    External (_SB_.PCI0.LPCB.H_EC, DeviceObj)

    If (CondRefOf (\_SB.PCI0.LPCB.H_EC))
    {
        If (LAnd (CondRefOf (\_SB.PCI0.LPCB.H_EC._HID), (LAnd (CondRefOf (\_SB.PCI0.LPCB.H_EC._CRS), (Land (CondRefOf (\_SB.PCI0.H_EC._GPE
            ), (LAnd (LNot (CondRefOf (\_SB.PCI0.LPCB.H_EC._STA)))
        {
            Scope (\_SB.PCI0.LPCB.H_EC)
            {
                Method (_STA, 0, NotSerialized)
                {
                    If (_OSI ("Darwin"))
                    {
                        Return (Zero)
                    }
                    Else
                    {
                        Return (0x0F)
                    }
                }
            }
        }
    }

    Scope (\_SB)
    {
        Device (EC)
        {
            Name (_HID, "ACID0001")
            Method (_STA, 0, NotSerialized)
            {
                If (_OSI ("Darwin"))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }
        }
    }
}

Here I've these errors:

8, 6126, syntax error, unexpected '('

9, 6126, syntax error, unexpected ')', expecting ','

28, 6126, syntax error, unexpected PARSEOP_SCOPE, expecting $end and premature End-Of-File

 

SSDT-PLUG

Original ACPI 6,3:

DefinitionBlock ("", "SSDT", 2, "DRTNIA", "CpuPlug", 0x00003000)
{
    External (_PR_.CPU0, ProcessorObj)

    Method (PMPM, 4, NotSerialized)
    {
        If ((Arg2 == Zero))
        {
            Return (Buffer (One)
            {
                 0x03                                             // .
            })
        }

        Return (Package (0x02)
        {
            "plugin-type", 
            One
        })
    }

    If (CondRefOf (\_PR.CPU0))
    {
        If ((ObjectType (\_PR.CPU0) == 0x0C))
        {
            Scope (\_PR.CPU0)
            {
                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    Return (PMPM (Arg0, Arg1, Arg2, Arg3))
                }
            }
        }
    }
}

 

Early Created ACPI 5,0:

DefinitionBlock ("", "SSDT", 2, "DRTNIA", "CpuPlug", 0x00003000)
{
    External (_PR_.CPU0, ProcessorObj)

    Method (PMPM, 4, NotSerialized)
    {
        If (LEqual (Arg2, Zero))
        {
            Return (Buffer (One))
            {
                0x03
            })
        }
        
        Return (Package (0x02)
        {
            "plugin-type",
            One
        })
    }
    
    If (CondRefOf (\_PR.CPU0))
    {
        If (LEqual (ObjectType (\_PR.CPU0), 0x0C))
        {
            Scope (\_PR.CPU0)
            {
                Method (_DSM, 4, NotSerialized)
                {
                    Return (PMPM (Arg0, Arg1, Arg2, Arg3))
                }
            }
        }
    }
}

Here i've these errors:

9, 6126, syntax error, unexpected ')', expecting '{'

 

Please, it's a complete head-ache, 4 hours and didn't yet found the fix. If someone found my mistake, please help!

Link to comment
Share on other sites

Really thank you @gengik84, now i can learn something with that help. For the EC SSDT i had a doubt that all LAnd ConRefOf was right, while i most declare LAnd first the for each object CondRefOf declaration, then forgot the _STA declaration as external. One the second, I wasn't expecting that, because normally it says return buffer is to longer or shorter than it should be, but really i was surprised. Sometimes the error message is not clear, the best is looking at the code itself. But in my state, i wasn't about to solve that errors alone yesterday.

Did you read the ACPI documentation to know the code from ACPICA? Because it's my passion, and it's one of the thinks that i want to learn. Can you suggest me some orientation?

Thank you mate

Link to comment
Share on other sites

 Share

×
×
  • Create New...