Help - Search - Members - Calendar
Full Version: DSDT compiling error
Project OS X Forums > Snow Leopard Guides & Tutorials > DSDT Patching
Gringo Vermelho
I know this is probably not that important (ie not breaking any functionality) but it's annoying the hell out of me because it's probably something very simple like a missing bracket somewhere. What am I missing?

Here's the error:

CODE
dsdt.dsl 10004:         Return (Package (0x02)
Warning  1099 -                       ^ Statement is unreachable


And here's the whole section:

CODE
Method (_WAK, 1, NotSerialized)
    {
        ShiftLeft (Arg0, 0x04, DBG8)
        WAK (Arg0)
        If (IOWK) {}
        Else
        {
            Notify (\_SB.PWRB, 0x02)
        }

        If (ASSB)
        {
            Store (WSSB, ASSB)
            Store (WOTB, AOTB)
            Store (WAXB, AAXB)
        }

        If (DerefOf (Index (WAKP, Zero)))
        {
            Store (Zero, Index (WAKP, One))
        }
        Else
        {
            Store (Arg0, Index (WAKP, One))
        }

        Return (WAKP)
        Return (Package (0x02)
        {
            Zero,
            Zero
        })
    }


Thanks for any ideas/pointers..
Slice
This warning about 2 returns
CODE
        Return (WAKP)
        Return (Package (0x02)

Second return never be happen.
Gringo Vermelho
Do you have any idea what I can do to fix it?
apocolipse269
QUOTE (Gringo Vermelho @ Aug 12 2009, 10:09 AM) *
Do you have any idea what I can do to fix it?


I'm still learnign DSDT stuff but based on my knowledge of most other structured programming languages, as slice said the second return will never happen. its right below a return, therefor the return preceeding it will happen, and the method will be finished.
Slice
QUOTE (Gringo Vermelho @ Aug 12 2009, 02:09 PM) *
Do you have any idea what I can do to fix it?

I think second return is not needed.
18seven
QUOTE (Slice @ Aug 12 2009, 03:21 PM) *
I think second return is not needed.


Correct.

Delete:

Return (Package (0x02)
{
Zero,
Zero
})
Gringo Vermelho
Deleted.

I guess it was put there by the WAK fix in koalala's DSDT patcher?

Thanks for the explanation and help, I appreciate it.

I've got a handful of 'use of compiler reserved name" errors, are they anything to worry about?


18seven
QUOTE (Gringo Vermelho @ Aug 14 2009, 09:33 PM) *
I've got a handful of 'use of compiler reserved name" errors, are they anything to worry about?


You mean warnings right. Please post your dsl.
Gringo Vermelho
Remarks. Here's the output:

CODE
dsdt.dsl  2723:                             Name (_T_0, Zero)
Remark   5110 -        Use of compiler reserved name ^  (_T_0)

dsdt.dsl  2805:                             Name (_T_0, Zero)
Remark   5110 -        Use of compiler reserved name ^  (_T_0)

dsdt.dsl  2853:                             Name (_T_0, Zero)
Remark   5110 -        Use of compiler reserved name ^  (_T_0)

dsdt.dsl  2919:                             Name (_T_0, Zero)
Remark   5110 -        Use of compiler reserved name ^  (_T_0)

dsdt.dsl  2989:                             Name (_T_0, Zero)
Remark   5110 -        Use of compiler reserved name ^  (_T_0)

dsdt.dsl  5755:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  5771:                 Name (_T_0, Zero)
Remark   5110 -                          ^ Use of compiler reserved name (_T_0)

dsdt.dsl  5863:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  5962:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  6457:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  6500:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  6584:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  6598:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  6717:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  6787:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  6878:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  6892:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7019:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7089:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7093:                 Name (_T_1, Zero)
Remark   5110 -                          ^ Use of compiler reserved name (_T_1)

dsdt.dsl  7331:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7394:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7562:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7595:                     Name (_T_1, Zero)
Remark   5110 -                              ^ Use of compiler reserved name (_T_1)

dsdt.dsl  7636:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7692:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7862:             Name (_T_0, Zero)
Remark   5110 -                      ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7890:                 Name (_T_0, Zero)
Remark   5110 -                          ^ Use of compiler reserved name (_T_0)

dsdt.dsl  7943:                     Name (_T_1, Zero)
Remark   5110 -                              ^ Use of compiler reserved name (_T_1)

dsdt.dsl  9615:         Method (VGET, 1, NotSerialized)
Warning  1087 -                    ^ Not all control paths return a value (VGET)

dsdt.dsl  9660:         Method (TGET, 1, NotSerialized)
Warning  1087 -                    ^ Not all control paths return a value (TGET)

dsdt.dsl  9722:         Method (FGET, 1, NotSerialized)
Warning  1087 -                    ^ Not all control paths return a value (FGET)

dsdt.dsl  9758:             Store (VGET (Local0), Local1)
Warning  1092 -                       ^ Called method may not always return a value

dsdt.dsl  9800:             Store (TGET (Local0), Local1)
Warning  1092 -                       ^ Called method may not always return a value

dsdt.dsl  9833:             Store (FGET (Local0), Local1)
Warning  1092 -                       ^ Called method may not always return a value

dsdt.dsl 10082:                 Name (_T_0, Zero)
Remark   5110 -                          ^ Use of compiler reserved name (_T_0)

dsdt.dsl 10150:                                         ShiftRight (BUF2, 0x04)
Warning  1105 -             Result is not used, operator has no effect ^

dsdt.dsl 10218:                     Name (_T_1, Zero)
Remark   5110 -                              ^ Use of compiler reserved name (_T_1)



...and here's the DSDT. Thanks for looking.
Click to view attachment
18seven
QUOTE (Gringo Vermelho @ Aug 15 2009, 07:20 PM) *
Remarks. Here's the output:

Err, yeah remarks. This is all pretty new to me and these fix' are pieced together from observing 67GTA's fix', good stuff.

"Remark" 5110" change _T_# to T_#
"Warning 1087" just silence the compiler with a return null and the bonus is "Warning 1092" will go bye bye as well
"Warning 1105" ShiftRight (BUF2, 0x04) wtf, "Store (BUF2, Local4)" is more like it.

Before
Compilation complete. 0 Errors, 7 Warnings, 31 Remarks, 69 Optimizations

After
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 69 Optimizations

Don't say I never gave you nothin'.
Click to view attachment
Gringo Vermelho
Cool, thanks for everything, especially for taking the time to explain the fixes you made as well.

I've visited 67GTA's epic thread on Ubuntuforums several times but I guess I need to start studying the ASL language at a more basic level because I can't understand almost anything I'm reading.

Coincidentally, right before I went back here to check I saw someone mention the _T fix over on insanelymac, apparently most DSDTs from ASUS boards need that fixed.

Did you fix those by hand or is it safe to do a search and replace on all instances of _T_0 and _T_1?

Rock on.
Gringo Vermelho
I flashed the latest BIOS to my board, extracted the DSDT from it and patched it exactly like the old one.
Boots fine the first time, but sleep stopped working - my monitor switches off but the computer enters some catatonic state, LED doesn't flash, it can't wake up and I have to hard reboot. Then on the following boot, it will freeze at the IOAPIC message and I have to jump through hoops to get it to boot again. Shutdown seems to have broken as well but since it's such a pain to test I can't be 100% sure of that yet. Reboot works.

I thought this was odd so out of curiosity I went looking for a file comparison tool (and found Winmerge which is great btw). Comparing the working DSDT (as attached above) to the new one, I can pat myself on the back for getting all the patching right, it's exactly the same as the old DSDT. To answer my own question, a search and replace on the _T_x stuff works fine.

But...I also found several changes and additions by ASUS to the new DSDT. This is the output from Winmerge, the upper lines are from the old, working DSDT, lower ones from the new one.

CODE
55c55
<     OperationRegion (BIOS, SystemMemory, 0x7FF7E064, 0xFF)
---
>     OperationRegion (BIOS, SystemMemory, 0xFFFFFF00, 0xFF)
1431c1431
<             Name (_HID, EisaId ("PNP0A08"))
---
>             Name (_HID, EisaId ("PNP0A03"))
2540c2540
<                     OperationRegion (RAMW, SystemMemory, 0x7FFF0000, 0x00010000)
---
>                     OperationRegion (RAMW, SystemMemory, 0xAABBCCDD, 0x00010000)
2692c2692
<                             Store (GNVS (0xA748), Local0)
---
>                             Store (GNVS (0xA750), Local0)
2724c2724
<                             Store (GNVS (0x1774), T_0)
---
>                             Store (GNVS (0x177C), T_0)
5759c5759
<                 Store (GNVS (0x1773), ASB1)
---
>                 Store (GNVS (0x177B), ASB1)
5775c5775
<                     SNVS (0x1773, Arg1)
---
>                     SNVS (0x177B, Arg1)
5869c5869
<                     Subtract (GNVS (0xA748), 0xC8, ASB1)
---
>                     Subtract (GNVS (0xA750), 0xC8, ASB1)
5968c5968
<                     Subtract (GNVS (0xA748), 0xC8, Local3)
---
>                     Subtract (GNVS (0xA750), 0xC8, Local3)
5991c5991
<                             SNVS (0x1773, One)
---
>                             SNVS (0x177B, One)
6001c6001
<                         SNVS (0xA748, Local2)
---
>                         SNVS (0xA750, Local2)
6013c6013
<                             SNVS (0x16FB, 0x04)
---
>                             SNVS (0x16FD, 0x04)
6461c6461
<                 Store (GNVS (0x16F1), ASB1)
---
>                 Store (GNVS (0x16F3), ASB1)
6480c6480
<                             Store (GNVS (0x16F5), ASB1)
---
>                             Store (GNVS (0x16F7), ASB1)
6504c6504
<                 If (LNotEqual (GNVS (0x16F1), Arg1))
---
>                 If (LNotEqual (GNVS (0x16F3), Arg1))
6508c6508
<                         SNVS (0x16F1, Arg1)
---
>                         SNVS (0x16F3, Arg1)
6532c6532
<                         If (LNotEqual (GNVS (0x16F5), Arg1))
---
>                         If (LNotEqual (GNVS (0x16F7), Arg1))
6536c6536
<                                 SNVS (0x16F5, Arg1)
---
>                                 SNVS (0x16F7, Arg1)
6882c6882,6890
<                 Store (GNVS (0x34E8), ASB1)
---
>                 If (LOr (LGreaterEqual (GNVS (0x4484), 0x09), LEqual (GNVS (0x34E8),
>                     0x05)))
>                 {
>                     Store (Zero, ASB1)
>                 }
>                 Else
>                 {
>                     Store (GNVS (0x34E8), ASB1)
>                 }
7776c7784
<             Store (GNVS (0xA748), Local2)
---
>             Store (GNVS (0xA750), Local2)
7868c7876
<                 Multiply (GNVS (0xA748), Local0, Local0)
---
>                 Multiply (GNVS (0xA750), Local0, Local0)
7877c7885
<                     Multiply (GNVS (0xA748), Local0, Local0)
---
>                     Multiply (GNVS (0xA750), Local0, Local0)
9285c9293
<             ShiftRight (Local1, 0x08, Local1)
---
>             ShiftRight (Local1, 0x07, Local1)
9309c9317
<                 ShiftLeft (Local3, 0x08, Local3)
---
>                 ShiftLeft (Local3, 0x07, Local3)
9328c9336
<                     ShiftLeft (Local3, 0x08, Local3)
---
>                     ShiftLeft (Local3, 0x07, Local3)
9352c9360
<                     ShiftLeft (Local3, 0x08, Local3)
---
>                     ShiftLeft (Local3, 0x07, Local3)


Something has been rearranged that breaks S3 sleep (or I did something wrong). Most changes seems to be to SNVS and GNVS but I can't find any details on what those are. And memory region changes probably don't help either. Of course I have no idea what I'm talking about so I could be on the wrong track.

I'm wondering if I would have to reinstall OS X in order to get it working again with the new DSDT, or if some system configuration somewhere can be reset. Or if something can be edited in the new DSDT.

In the meantime I can just use the old DSDT of course.
Gringo Vermelho
I've got it working with the DSDT from the 2101 BIOS. I'm going to take a wild guess that all the GNVS and SNVS stuff is part of ASUS Express Gate and doesn't make any difference to OSX.

This is probably old news to most of the users here, but Kabyl alerted me to the fact that it isn't a good idea to extract the DSDT table from a BIOS ROM file (as I've been doing, using koalala's ACPIPatcher).
When the system is running, the BIOS modifies some addresses in the DSDT depending on your hardware configuration, so if you extract it straight from a BIOS file your DSDT won't have these necessary modifications, possibly preventing your precious hackintosh from booting.
Therefore, the DSDT tables should always be dumped when the system is running.

Again, the upper lines are from the DSDT extracted from a running system, lower lines are from the DSDT extracted from the 2101 BIOS update file:

CODE
55c55
<     OperationRegion (BIOS, SystemMemory, 0x7FF7E064, 0xFF)
---
>     OperationRegion (BIOS, SystemMemory, 0xFFFFFF00, 0xFF)
1431c1431
<             Name (_HID, EisaId ("PNP0A08"))
---
>             Name (_HID, EisaId ("PNP0A03"))
2540c2540
<                     OperationRegion (RAMW, SystemMemory, 0x7FFF0000, 0x00010000)
---
>                     OperationRegion (RAMW, SystemMemory, 0xAABBCCDD, 0x00010000)


I dumped the DSDT with Everest in Windows, fixed it like the old one, and it's working fine after flushing the caches with AppleJack and a couple of reboots. I've also enabled ACPI 2.0 in the BIOS now, I heard Snow Leopard likes when this is enabled. Shutdown, reboot and S3 sleep all work and I don't need OpenHaltRestart anymore.

--

I would like to try overriding the OS detection and setting the OS as Windows 2006 permanently in the DSDT but in the guides I've found the OS version selection code looks very different from mine. I haven't been able to even get it to compile after editing it.

It looks like I could remove most of it and set "Store (Zero, OSVR)" somewhere?

CODE
    Name (OSVR, Ones)
    Method (OSFL, 0, NotSerialized)
    {
        If (LNotEqual (OSVR, Ones))
        {
            Return (OSVR)
        }

        If (LEqual (PICM, Zero))
        {
            Store (0xAC, DBG8)
        }

        Store (One, OSVR)
        If (CondRefOf (_OSI, Local1))
        {
            If (_OSI ("Windows 2000"))
            {
                Store (0x04, OSVR)
            }

            If (_OSI ("Windows 2001"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2001 SP1"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2001 SP2"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2001.1"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2001.1 SP1"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2006"))
            {
                Store (Zero, OSVR)
            }
        }
        Else
        {
            If (MCTH (_OS, "Microsoft Windows NT"))
            {
                Store (0x04, OSVR)
            }
            Else
            {
                If (MCTH (_OS, "Microsoft WindowsME: Millennium Edition"))
                {
                    Store (0x02, OSVR)
                }

                If (MCTH (_OS, "Linux"))
                {
                    Store (0x03, OSVR)
                }
            }
        }

        Return (OSVR)
    }


Any ideas? Or maybe I just don't know how to read this thing at all and it's actually already setting Store "(Zero, OSVR)"..?

Here's my patched DSDT so far - from the 2101 BIOS for the ASUS P5Q-E.
It has all compiling errors fixed, CPU aliases removed, WAK, MUTE, Local0, HPET, RTC and PWRB sleep fixed, DTGP, HDEF, and 88E8056 GIGE inserted.
Thanks to Fassl, Kabyl, Pere, Roisoft, Koalala, THe KiNG and 18seven for providing tools and invaluable help.
Click to view attachment
Gringo Vermelho
Got it!

CODE
    Name (OSVR, Ones)
    Method (OSFL, 0, NotSerialized)
    {
        If (LNotEqual (OSVR, Ones))
        {
            Return (OSVR)
        }

        If (LEqual (PICM, Zero))
        {
            Store (0xAC, DBG8)
        }

        Store (One, OSVR)
        If (CondRefOf (_OSI, Local1))
        {
            If (_OSI ("Windows 2000"))
            {
                Store (0x04, OSVR)
            }

            If (_OSI ("Windows 2001"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2001 SP1"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2001 SP2"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2001.1"))
            {
                Store (Zero, OSVR)
            }

            If (_OSI ("Windows 2001.1 SP1"))
            {
                Store (Zero, OSVR)
            }

            If (LOr (_OSI ("Darwin"), _OSI ("Windows 2006")))
            {
                Store (Zero, OSVR)
            }
        }
        Else
        {
            If (MCTH (_OS, "Microsoft Windows NT"))
            {
                Store (0x04, OSVR)
            }
            Else
            {
                If (MCTH (_OS, "Microsoft WindowsME: Millennium Edition"))
                {
                    Store (0x02, OSVR)
                }

                If (MCTH (_OS, "Linux"))
                {
                    Store (0x03, OSVR)
                }
            }
        }

        Return (OSVR)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.