Old Stuff - Dell X200 Battery ACPI
38 min read

Old Stuff - Dell X200 Battery ACPI

Old Stuff - Dell X200 Battery ACPI

Recently I've found an old USB stick, with some information dating from 2003. One of the things I found is an AML on how to get ACPI to show the battery status properly. Here it is, in case it helps someone:

/*
  * Intel ACPI Component Architecture
  * AML Disassembler version 20030509
  *
  * Disassembly of x200_dsdt, Wed May 28 19:45:39 2003
  */
DefinitionBlock ("DSDT.aml", "DSDT", 1, "DELL  ", "X200   ", 100925440)
{
    OperationRegion (PORT, SystemIO, 0x80, 0x01)
    Field (PORT, ByteAcc, NoLock, Preserve)
    {
        P80H,   8
    }

    OperationRegion (S_IO, SystemIO, 0x0600, 0x10)
    Field (S_IO, ByteAcc, NoLock, Preserve)
    {
        Offset (0x08),
            ,   1,
        ISPE,   1,
        FPEN,   1,
            ,   3,
        CPEN,   1,
        IPPE,   1
    }

    OperationRegion (A_IO, SystemIO, 0x8000, 0x30)
    Field (A_IO, ByteAcc, NoLock, Preserve)
    {
        PMS0,   8,
        PMS1,   8,
        PME0,   8,
        PME1,   8,
        PMC0,   8,
        PMC1,   8,
        Offset (0x08),
        TMR0,   8,
        TMR1,   8,
        TMR2,   8,
        TMR3,   8,
        Offset (0x10),
        PRC0,   8,
        PRC1,   8,
        PRC2,   8,
        PRC3,   8,
        Offset (0x28),
        GPS0,   8,
        GPS1,   8,
        GPE0,   8,
        GPE1,   8,
        GPS2,   8,
        GPS3,   8,
        GPE2,   8,
        GPE3,   8
    }

    OperationRegion (GPIO, SystemIO, 0x8080, 0x3C)
    Field (GPIO, ByteAcc, NoLock, Preserve)
    {
        GU00,   8,
        GU01,   8,
        GU02,   8,
        GU03,   8,
        GIO0,   8,
        GIO1,   8,
        GIO2,   8,
        GIO3,   8,
        Offset (0x0C),
        GL00,   8,
        GL01,   8,
        GL02,   8,
        GL03,   8,
        Offset (0x18),
        GB00,   8,
        GB01,   8,
        GB02,   8,
        GB03,   8,
        Offset (0x2C),
        GIV0,   8,
        GIV1,   8,
        GIV2,   8,
        GIV3,   8,
        GU04,   8,
        GU05,   8,
        GU06,   8,
        GU07,   8,
        GIO4,   8,
        GIO5,   8,
        GIO6,   8,
        GIO7,   8,
        GL04,   8,
        GL05,   8,
        GL06,   8,
        GL07,   8
    }

    OperationRegion (MNVS, SystemMemory, 0x076F0F9C, 0x10)
    Field (MNVS, AnyAcc, Lock, Preserve)
    {
        OSYS,   16,
        CMAP,   8,
        CMBP,   8,
        FDCP,   8,
        LPTP,   8,
        BTEN,   8
    }

    OperationRegion (CMIX, SystemIO, 0x72, 0x02)
    Field (CMIX, ByteAcc, NoLock, Preserve)
    {
        I72,    8,
        D73,    8
    }

    Name (_S0, Package (0x03)
    {
        0x00,
        0x00,
        0x00
    })
    Name (_S3, Package (0x03)
    {
        0x05,
        0x05,
        0x00
    })
    Name (_S4, Package (0x03)
    {
        0x06,
        0x06,
        0x00
    })
    Name (_S5, Package (0x03)
    {
        0x07,
        0x07,
        0x00
    })
    Scope (\_PR)
    {
        Processor (CPU0, 0x00, 0x00008010, 0x06) {}
    }

    Name (\GPIC, 0x00)
    Name (\CTYP, 0x00)
    Name (\ECON, 0x00)
    Name (\ACON, 0x01)
    Name (\DSEN, 0x01)
    Name (\ENUM, 0x01)
    Name (\BTS0, 0x01)
    Name (\BCAP, 0x00)
    Method (\_PIC, 1, NotSerialized)
    {
        Store (Arg0, GPIC)
    }

    Method (_PTS, 1, NotSerialized)
    {
        If (LEqual (Arg0, 0x01))
        {
            \_SB.PHS (0x8E)
        }

        If (LEqual (Arg0, 0x04))
        {
            \_SB.PHS (0x92)
        }

        Store (Store (GPS2, Local0), GPS2)
        And (Store (GPS2, Local0), 0x80, Local0)
        If (Local0)
        {
            Store (0x01, \_SB.DCK0.DCBF)
        }
        Else
        {
            Store (0x00, \_SB.DCK0.DCBF)
        }

        Store (\_SB.PHS2 (0x9A, 0xB2, 0x00), \BCAP)
    }

    Method (_WAK, 1, NotSerialized)
    {
        If (LEqual (Arg0, 0x01))
        {
            \_SB.PHS (0x8F)
        }

        \_SB.PHS (0xA0)
        If (LEqual (Arg0, 0x04))
        {
            Store (0x00, \_SB.PCI0.PCIB.CDB.CD44)
            Notify (\_SB.PWRB, 0x02)
        }
        Else
        {
            If (LLess (OSYS, 0x07D0))
            {
                Notify (\_SB.PWRB, 0x02)
            }
            Else
            {
                Store (\_SB.PHS1 (0x98, 0x00), Local0)
                If (LEqual (Local0, 0x01))
                {
                    Notify (\_SB.PWRB, 0x02)
                }
            }
        }

        Store (\_SB.PCI0.LPCB.H_EC.ACEX, \ACON)
        If (LEqual (Arg0, 0x03))
        {
            \_SB.PHS (0x9C)
        }

        Store (Store (GPS2, Local0), GPS2)
        And (Store (GPS2, Local0), 0x20, Local0)
        And (GIV0, 0x20, Local1)
        XOr (Local0, Local1, Local0)
        If (\_SB.DCK0.DCBF)
        {
            If (Local0)
            {
                \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                \_SB.PCI0.LPCB.SIOD.WRIT (0x30, Zero)
                \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                \_SB.PCI0.LPCB.SIOD.WRIT (0x30, Zero)
                \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                Or (\_SB.PCI0.LPCB.SIOD.READ (0xF0), One, Local0)
                \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                Or (\_SB.PCI0.LPCB.SIOD.READ (0xF0), One, Local0)
                \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                Or (GIV0, 0x20, GIV0)
                Notify (\_SB.DCK0, 0x01)
            }
        }
        Else
        {
            If (LEqual (Local0, 0x00))
            {
                And (GIV0, 0xD0, GIV0)
                Notify (\_SB.DCK0, 0x00)
            }
        }

        If (LNot (LEqual (\_SB.PHS2 (0x9A, 0xB2, 0x00), BCAP)))
        {
            Notify (\_SB.BAT1, 0x81)
        }
    Return (0x0000)
    }

    Scope (\_GPE)
    {
        Method (_L05, 0, NotSerialized)
        {
            \_SB.PHS (0x93)
            Notify (\_SB.PCI0.MODM, 0x02)
        }

        Method (_L0B, 0, NotSerialized)
        {
            Notify (\_SB.PCI0, 0x02)
            Notify (\_SB.PCI0.PCIB, 0x02)
        }

        Method (_L0D, 0, NotSerialized)
        {
            Notify (\_SB.PCI0, 0x02)
        }

        Method (_L14, 0, NotSerialized)
        {
            And (GIV0, 0x10, Local0)
            XOr (Local0, 0x10, Local0)
            And (GIV0, 0xEF, Local1)
            Or (Local0, Local1, GIV0)
            Notify (\_SB.LID0, 0x80)
        }

        Method (_L15, 0, NotSerialized)
        {
            Store (0x88, P80H)
            Store (Store (GPS2, Local0), GPS2)
            And (Store (GPS2, Local0), 0x20, Local0)
            And (GIV0, 0x20, Local1)
            XOr (Local0, Local1, Local0)
            If (Local0)
            {
                Or (GIV0, 0x20, GIV0)
                Sleep (0x05DC)
                Notify (\_SB.DCK0, 0x01)
            }
            Else
            {
                And (GIV0, 0xD0, GIV0)
                Sleep (0x01F4)
                Notify (\_SB.DCK0, 0x00)
                And (Store (GIV0, Local0), 0x10, Local0)
                If (LNot (Local0))
                {
                    Store (0x55, P80H)
                    Notify (\_SB.PCI0, 0x00)
                    Sleep (0x07D0)
                    Store (0x07, \_SB.PCI0.GRFX.VFUN)
                    Store (0x00, \_SB.PCI0.GRFX.TRP0)
                    Notify (\_SB.PCI0.GRFX, 0x80)
                }
            }

            If (LNot (LEqual (\OSYS, 0x07D1)))
            {
                Store (0x99, P80H)
                Notify (\_SB.PCI0.GRFX, 0x80)
            }

            Notify (\_SB.PCI0.GRFX, 0x81)
        }

        Method (_L1C, 0, NotSerialized)
        {
            Store (\_SB.PHS1 (0x98, 0x00), Local0)
            If (LEqual (Local0, 0x01))
            {
                Notify (\_SB.PWRB, 0x02)
            }
        }
    }

    Scope (\_TZ)
    {
        ThermalZone (THRM)
        {
            Method (_TMP, 0, NotSerialized)
            {
                If (LEqual (\ECON, 0x01))
                {
                    Store (\_SB.PCI0.LPCB.H_EC.CTMP, Local0)
                    If (LNot (LEqual (Local0, 0xFF)))
                    {
                        Multiply (Local0, 0x0A, Local0)
                        Add (Local0, 0x0AAC, Local0)
                        Return (Local0)
                    }
                }

                Return (0x0C1C)
            }

            Method (_AC0, 0, NotSerialized)
            {
                Store (0x41, Local0)
                Multiply (Local0, 0x0A, Local0)
                Add (Local0, 0x0AAC, Local0)
                Return (Local0)
            }

            Name (_AL0, Package (0x01)
            {
                FAN0
            })
            Method (_PSV, 0, NotSerialized)
            {
                Store (0x55, Local0)
                Multiply (Local0, 0x0A, Local0)
                Add (Local0, 0x0AAC, Local0)
                Return (Local0)
            }

            Name (_PSL, Package (0x01)
            {
                \_PR.CPU0
            })
            Method (_CRT, 0, NotSerialized)
            {
                Store (0x78, Local0)
                Multiply (Local0, 0x0A, Local0)
                Add (Local0, 0x0AAC, Local0)
                Return (Local0)
            }

            Method (_SCP, 1, NotSerialized)
            {
                Store ("Not Support", Debug)
            }

            Name (_TC1, 0x04)
            Name (_TC2, 0x03)
            Name (_TSP, 0x012C)
        }
    }

    PowerResource (PFAN, 0x00, 0x0000)
    {
        Method (_STA, 0, NotSerialized)
        {
            Return (FANE)
        }

        Method (_ON, 0, NotSerialized)
        {
            Store (0x01, FANE)
        }

        Method (_OFF, 0, NotSerialized)
        {
            Store (0x00, FANE)
        }
    }

    Name (FANE, 0x01)
    Device (FAN0)
    {
        Name (_HID, EisaId ("PNP0C0B"))
        Name (_PR0, Package (0x01)
        {
            PFAN
        })
    }

    Scope (\_SB)
    {
        OperationRegion (PHSD, SystemMemory, 0x076F0D9D, 0x00000190)
        Field (PHSD, AnyAcc, NoLock, Preserve)
        {
            BCMD,   8,
            DID,    32,
            INFO,   3152,
            Offset (0x190)
        }

        Field (PHSD, AnyAcc, NoLock, Preserve)
        {
            Offset (0x05),
            INF,    8,
            INF1,   8,
            INF2,   8,
            INF3,   8
        }

        Field (PHSD, AnyAcc, NoLock, Preserve)
        {
            Offset (0x05),
            INFW,   16
        }

        Field (PHSD, AnyAcc, NoLock, Preserve)
        {
            Offset (0x05),
            INFD,   32
        }

        OperationRegion (PHSI, SystemIO, 0x0000FE00, 0x00000002)
        Field (PHSI, AnyAcc, NoLock, Preserve)
        {
            SMIC,   8
        }

        Mutex (MPHS, 0x00)
        Method (PHS, 1, Serialized)
        {
            Acquire (MPHS, 0xFFFF)
            Store (Arg0, BCMD)
            Store (Zero, SMIC)
            Store (0x00, BCMD)
            Store (INF, Local7)
            Release (MPHS)
            Return (Local7)
        }

        Method (PHSR, 1, Serialized)
        {
            Acquire (MPHS, 0xFFFF)
            Store (Arg0, BCMD)
            Store (Zero, SMIC)
            Store (0x00, BCMD)
            Store (INFD, Local7)
            Release (MPHS)
            Return (Local7)
        }

        Method (PHS1, 2, Serialized)
        {
            Acquire (MPHS, 0xFFFF)
            Store (Arg0, BCMD)
            Store (Arg1, INF)
            Store (Zero, SMIC)
            Store (0x00, BCMD)
            Store (INF, Local7)
            Release (MPHS)
            Return (Local7)
        }

        Method (PHS2, 3, Serialized)
        {
            Acquire (MPHS, 0xFFFF)
            Store (Arg0, BCMD)
            Store (Arg1, INF)
            Store (Arg2, INF1)
            Store (Zero, SMIC)
            Store (0x00, BCMD)
            Store (INFW, Local7)
            Release (MPHS)
            Return (Local7)
        }

        Method (PHS4, 5, Serialized)
        {
            Acquire (MPHS, 0xFFFF)
            Store (Arg0, BCMD)
            Store (Arg1, INF)
            Store (Arg2, INF1)
            Store (Arg3, INF2)
            Store (Arg4, INF3)
            Store (Zero, SMIC)
            Store (0x00, BCMD)
            Store (INFD, Local7)
            Release (MPHS)
            Return (Local7)
        }

        Device (ADP1)
        {
            Name (_HID, "ACPI0003")
            Method (_PSR, 0, NotSerialized)
            {
                If (LEqual (\ECON, 0x00))
                {
                    Store (\_SB.PHS1 (0x96, 0x02), Local0)
                }
                Else
                {
                    Store (\_SB.PCI0.LPCB.H_EC.ACEX, Local0)
                }

                Return (Local0)
            }

            Method (_PCL, 0, NotSerialized)
            {
                Return (\_SB)
            }

            Method (_STA, 0, NotSerialized)
            {
                If (LEqual (\ECON, 0x00))
                {
                    Store (0x0F, Local0)
                }
                Else
                {
                    Store (0x0F, Local0)
                }

                Return (Local0)
            }
        }

        Device (BAT1)
        {
            Name (_HID, EisaId ("PNP0C0A"))
            Name (_UID, 0x01)
            Name (BATI, Package (0x0D)
            {
                0x01,
                0xFFFFFFFF,
                0xFFFFFFFF,
                0x01,
                0xFFFFFFFF,
                0x03,
                0x0A,
                0x01,
                0x01,
                "Unknown",
                "Unknown",
                "LION",
                "Unknown"
            })
            Name (BTYP, Package (0x05)
            {
                "4S",
                "4T",
                "8D",
                "3T",
                ""
            })
            Name (BMAK, Package (0x04)
            {
                "SONY",
                "Toshiba",
                "SDI",
                ""
            })
            Method (_BIF, 0, NotSerialized)
            {
                If (LEqual (\ECON, 0x00))
                {
                    Store (\_SB.PHS2 (0x9A, 0xB0, 0x00), Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (BATI, 0x01))
                    }
                    Else
                    {
                        Store (Local0, Index (BATI, 0x01))
                    }

                    Store (\_SB.PHS2 (0x9A, 0xB2, 0x00), Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (BATI, 0x02))
                    }
                    Else
                    {
                        Store (Local0, Index (BATI, 0x02))
                    }

                    Store (\_SB.PHS2 (0x9A, 0xB4, 0x00), Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (BATI, 0x04))
                    }
                    Else
                    {
                        Store (Local0, Index (BATI, 0x04))
                    }

                    Store (0x00, Index (BATI, 0x05))
                    Store (Zero, Index (BATI, 0x06))
                }
                Else
                {
                    Store (\_SB.PCI0.LPCB.H_EC.B1DA, Local0)
                    ShiftLeft (Local0, 0x08, Local1)
                    And (Local1, 0xFF00, Local1)
                    ShiftRight (Local0, 0x08, Local0)
                    Or (Local0, Local1, Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (BATI, 0x01))
                    }
                    Else
                    {
                        Store (Local0, Index (BATI, 0x01))
                    }

                    Store (\_SB.PCI0.LPCB.H_EC.B1DF, Local0)
                    ShiftLeft (Local0, 0x08, Local1)
                    And (Local1, 0xFF00, Local1)
                    ShiftRight (Local0, 0x08, Local0)
                    Or (Local0, Local1, Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (BATI, 0x02))
                    }
                    Else
                    {
                        Store (Local0, Index (BATI, 0x02))
                    }

                    Store (\_SB.PCI0.LPCB.H_EC.B1DV, Local0)
                    ShiftLeft (Local0, 0x08, Local1)
                    And (Local1, 0xFF00, Local1)
                    ShiftRight (Local0, 0x08, Local0)
                    Or (Local0, Local1, Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (BATI, 0x04))
                    }
                    Else
                    {
                        Store (Local0, Index (BATI, 0x04))
                    }

                    Store (0x00, Index (BATI, 0x05))
                    Store (0x00, Local0)
                    Store (Local0, Index (BATI, 0x06))
                }

                Store (0x01, Index (BATI, 0x07))
                Store (0x01, Index (BATI, 0x08))
                Store ("", Index (BATI, 0x09))
                Store ("", Index (BATI, 0x0A))
                Store ("LION", Index (BATI, 0x0B))
                Store ("DELL Computer Corp.", Index (BATI, 0x0C))
                Return (BATI)
            }

            Name (STAT, Package (0x04)
            {
                0x00,
                0x00,
                0x00,
                0x00
            })
            Method (_BST, 0, NotSerialized)
            {
                If (LEqual (\ECON, 0x00))
                {
                    Store (\_SB.PHS2 (0x99, 0x84, 0x00), Local0)
                    If (LAnd (LNot (LEqual (Local0, 0x00)), LNot (LEqual (Local0, 0x05))))
                    {
                        If (LEqual (\ACON, 0x01))
                        {
                            Store (0x02, Local0)
                        }
                        Else
                        {
                            Store (0x01, Local0)
                        }
                    }

                    Store (Local0, Index (STAT, 0x00))
                    Store (\_SB.PHS2 (0x9A, 0xD4, 0x00), Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (STAT, 0x01))
                    }
                    Else
                    {
                        If (LNot (LLess (Local0, 0x8000)))
                        {
                            XOr (Local0, 0xFFFF, Local0)
                            Increment (Local0)
                        }

                        Store (Local0, Index (STAT, 0x01))
                    }

                    Store (\_SB.PHS2 (0x9A, 0xA2, 0x00), Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (STAT, 0x02))
                    }
                    Else
                    {
                        Store (Local0, Index (STAT, 0x02))
                    }

                    Store (\_SB.PHS2 (0x9A, 0xA6, 0x00), Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (STAT, 0x03))
                    }
                    Else
                    {
                        Store (Local0, Index (STAT, 0x03))
                    }
                }
                Else
                {
                    Store (\_SB.PCI0.LPCB.H_EC.B1ST, Local0)
                    If (LAnd (LNot (LEqual (Local0, 0x00)), LNot (LEqual (Local0, 0x05))))
                    {
                        If (LEqual (\ACON, 0x01))
                        {
                            Store (0x02, Local0)
                        }
                        Else
                        {
                            Store (0x01, Local0)
                        }
                    }

                    Store (Local0, Index (STAT, 0x00))
                    Store (\_SB.PCI0.LPCB.H_EC.B1CR, Local0)
                    ShiftLeft (Local0, 0x08, Local1)
                    And (Local1, 0xFF00, Local1)
                    ShiftRight (Local0, 0x08, Local0)
                    Or (Local0, Local1, Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (STAT, 0x01))
                    }
                    Else
                    {
                        If (LNot (LLess (Local0, 0x8000)))
                        {
                            XOr (Local0, 0xFFFF, Local0)
                            Increment (Local0)
                        }

                        Store (Local0, Index (STAT, 0x01))
                    }

                    Store (\_SB.PCI0.LPCB.H_EC.B1RA, Local0)
                    ShiftLeft (Local0, 0x08, Local1)
                    And (Local1, 0xFF00, Local1)
                    ShiftRight (Local0, 0x08, Local0)
                    Or (Local0, Local1, Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (STAT, 0x02))
                    }
                    Else
                    {
                        Store (Local0, Index (STAT, 0x02))
                    }

                    Store (\_SB.PCI0.LPCB.H_EC.B1VO, Local0)
                    ShiftLeft (Local0, 0x08, Local1)
                    And (Local1, 0xFF00, Local1)
                    ShiftRight (Local0, 0x08, Local0)
                    Or (Local0, Local1, Local0)
                    If (LEqual (Local0, 0xFFFF))
                    {
                        Store (0xFFFFFFFF, Index (STAT, 0x03))
                    }
                    Else
                    {
                        Store (Local0, Index (STAT, 0x03))
                    }
                }

                Return (STAT)
            }

            Method (_STA, 0, NotSerialized)
            {
                If (LEqual (\ECON, 0x00))
                {
                    If (LEqual (\_SB.PHS1 (0x96, 0x00), 0x01))
                    {
                        Store (0x1F, Local0)
                    }
                    Else
                    {
                        Store (0x0F, Local0)
                    }
                }
                Else
                {/*
                    If (LEqual (\_SB.PCI0.LPCB.H_EC.B1EX, 0x01))
                    {*/
                        Store (0x1F, Local0)
                    /*}
                    Else
                    {
                        Store (0x0F, Local0)
                    }*/
                }

                Return (Local0)
            }


/*
  *           Method (_STA, 0, NotSerialized)
  *            {
  *                If (LEqual (\ECON, 0x00))
  *                {
  *                    If (LEqual (\_SB.PHS1 (0x96, 0x00), 0x01))
  *                    {
  *                        Store (0x1F, Local0)
  *                    }
  *                    Else
  *                    {
  *                        Store (0x0F, Local0)
  *                    }
  *                }
  *                Else
  *                {
  *                    If (LEqual (\_SB.PCI0.LPCB.H_EC.B1EX, 0x01))
  *                    {
  *                        Store (0x1F, Local0)
  *                    }
  *                    Else
  *                    {
  *                        Store (0x0F, Local0)
  *                    }
  *                }
  *
  *                Return (Local0)
  *            }
  */
            Method (_PCL, 0, NotSerialized)
            {
                Return (\_SB)
            }
        }

        Device (DCK0)
        {
            Name (_HID, EisaId ("PNP0C15"))
            Name (_UID, 0x01)
            Name (_BDN, 0x01)
            Method (_STA, 0, NotSerialized)
            {
                Store (Store (GPS2, Local0), GPS2)
                And (Store (GPS2, Local0), 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (0x00)
                }
            }

            Method (_DCK, 1, NotSerialized)
            {
                If (LEqual (Arg0, 0x00))
                {
                    If (LNot (LLess (OSYS, 0x07D0)))
                    {
                        \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                        \_SB.PCI0.LPCB.SIOD.WRIT (0x30, Zero)
                        \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                        \_SB.PCI0.LPCB.SIOD.WRIT (0x30, Zero)
                        \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                        Or (\_SB.PCI0.LPCB.SIOD.READ (0xF0), One, Local0)
                        \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                        \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                        Or (\_SB.PCI0.LPCB.SIOD.READ (0xF0), One, Local0)
                        \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                        \_SB.PHS (0x91)
                    }

                    Return (0x01)
                }
                Else
                {
                    \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                    And (\_SB.PCI0.LPCB.SIOD.READ (0xF0), 0xFE, Local0)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                    And (\_SB.PCI0.LPCB.SIOD.READ (0xF0), 0xFE, Local0)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0x30, One)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0x30, One)
                    \_SB.PHS (0x90)
                    Sleep (0x03E8)
                    Return (0x01)
                }
            }

            Method (_EJ0, 1, NotSerialized)
            {
                If (LLess (OSYS, 0x07D0))
                {
                    \_SB.PHS (0x91)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0x30, Zero)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0x30, Zero)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                    Or (\_SB.PCI0.LPCB.SIOD.READ (0xF0), One, Local0)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                    Or (\_SB.PCI0.LPCB.SIOD.READ (0xF0), One, Local0)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                }

                If (LNot (LLess (OSYS, 0x07D0)))
                {
                    While (And (Store (GPS2, Local0), 0x80, Local0))
                    {
                        Sleep (0x0A)
                    }

                    Sleep (0x01F4)
                }

                Return (0x01)
            }

            Method (_EJ4, 1, NotSerialized)
            {
                If (LLess (OSYS, 0x07D0))
                {
                    \_SB.PHS (0x91)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0x30, Zero)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0x30, Zero)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x03)
                    Or (\_SB.PCI0.LPCB.SIOD.READ (0xF0), One, Local0)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                    \_SB.PCI0.LPCB.SIOD.SETD (0x01)
                    Or (\_SB.PCI0.LPCB.SIOD.READ (0xF0), One, Local0)
                    \_SB.PCI0.LPCB.SIOD.WRIT (0xF0, Local0)
                }

                Return (0x01)
            }

            Name (DCBF, 0x00)
        }

        Device (PWRB)
        {
            Name (_HID, EisaId ("PNP0C0C"))
            Name (_PRW, Package (0x02)
            {
                0x1C,
                0x05
            })
        }

        Device (LID0)
        {
            Name (_HID, EisaId ("PNP0C0D"))
            Method (_STA, 0, NotSerialized)
            {
                Return (0x0F)
            }

            Method (_LID, 0, NotSerialized)
            {
                Store (GIV0, Local0)
                And (Local0, 0x10, Local0)
                If (LEqual (Local0, 0x10))
                {
                    Return (0x01)
                }
                Else
                {
                    Return (0x00)
                }
            }
        }

        Device (SLPB)
        {
            Name (_HID, EisaId ("PNP0C0E"))
            Method (_STA, 0, NotSerialized)
            {
                Return (0x0F)
            }
        }

        Device (PCI0)
        {
            Method (_INI, 0, NotSerialized)
            {
                Store (\_SB.PHS1 (0x96, 0x02), Local0)
                If (Local0)
                {
                    Store (0x01, ACON)
                }
                Else
                {
                    Store (0x00, ACON)
                }

                If (CondRefOf (_OSI, Local0))
                {
                    Store (0x07D1, OSYS)
                    Store (0x40, I72)
                    Store (D73, Local1)
                    Or (0x03, And (0xFC, Local1, Local1), Local1)
                    Store (Local1, D73)
                }
                Else
                {
                    If (LEqual (SizeOf (_OS), 0x14))
                    {
                        Store (0x07D0, OSYS)
                        Store (0x40, I72)
                        Store (D73, Local1)
                        Or (0x02, And (0xFC, Local1, Local1), Local1)
                        Store (Local1, D73)
                    }
                    Else
                    {
                        If (LEqual (SizeOf (_OS), 0x27))
                        {
                            Store (0x07CF, OSYS)
                            Store (0x40, I72)
                            Store (D73, Local1)
                            Or (0x01, And (0xFC, Local1, Local1), Local1)
                            Store (Local1, D73)
                        }
                        Else
                        {
                            Store (0x07CE, OSYS)
                            Store (0x40, I72)
                            Store (D73, Local1)
                            Or (0x00, And (0xFC, Local1, Local1), Local1)
                            Store (Local1, D73)
                        }
                    }
                }

                If (LEqual (OSYS, 0x07CE))
                {
                    Store (0x01, ECON)
                }
            }

            Device (FIGD)
            {
                Name (_HID, EisaId ("PNP0C02"))
                Name (_UID, 0x01)
                Method (_STA, 0, NotSerialized)
                {
                    If (LNot (LLess (OSYS, 0x07D0)))
                    {
                        If (LEqual (IGDE, 0x00))
                        {
                            Return (0x0B)
                        }
                    }

                    Return (0x00)
                }

                Name (_CRS, ResourceTemplate ()
                {
                    IO (Decode16, 0x07B0, 0x07B0, 0x01, 0x0C)
                    IO (Decode16, 0x07C0, 0x07C0, 0x01, 0x20)
                    IO (Decode16, 0x0BB0, 0x0BB0, 0x01, 0x0C)
                    IO (Decode16, 0x0BC0, 0x0BC0, 0x01, 0x20)
                    IO (Decode16, 0x0FB0, 0x0FB0, 0x01, 0x0C)
                    IO (Decode16, 0x0FC0, 0x0FC0, 0x01, 0x20)
                    IO (Decode16, 0x13B0, 0x13B0, 0x01, 0x0C)
                    IO (Decode16, 0x13C0, 0x13C0, 0x01, 0x20)
                    IO (Decode16, 0x17B0, 0x17B0, 0x01, 0x0C)
                    IO (Decode16, 0x17C0, 0x17C0, 0x01, 0x20)
                    IO (Decode16, 0x1BB0, 0x1BB0, 0x01, 0x0C)
                    IO (Decode16, 0x1BC0, 0x1BC0, 0x01, 0x20)
                    IO (Decode16, 0x1FB0, 0x1FB0, 0x01, 0x0C)
                    IO (Decode16, 0x1FC0, 0x1FC0, 0x01, 0x20)
                    IO (Decode16, 0x23B0, 0x23B0, 0x01, 0x0C)
                    IO (Decode16, 0x23C0, 0x23C0, 0x01, 0x20)
                    IO (Decode16, 0x27B0, 0x27B0, 0x01, 0x0C)
                    IO (Decode16, 0x27C0, 0x27C0, 0x01, 0x20)
                    IO (Decode16, 0x2BB0, 0x2BB0, 0x01, 0x0C)
                    IO (Decode16, 0x2BC0, 0x2BC0, 0x01, 0x20)
                    IO (Decode16, 0x2FB0, 0x2FB0, 0x01, 0x0C)
                    IO (Decode16, 0x2FC0, 0x2FC0, 0x01, 0x20)
                    IO (Decode16, 0x33B0, 0x33B0, 0x01, 0x0C)
                    IO (Decode16, 0x33C0, 0x33C0, 0x01, 0x20)
                    IO (Decode16, 0x37B0, 0x37B0, 0x01, 0x0C)
                    IO (Decode16, 0x37C0, 0x37C0, 0x01, 0x20)
                    IO (Decode16, 0x3BB0, 0x3BB0, 0x01, 0x0C)
                    IO (Decode16, 0x3BC0, 0x3BC0, 0x01, 0x20)
                    IO (Decode16, 0x3FB0, 0x3FB0, 0x01, 0x0C)
                    IO (Decode16, 0x3FC0, 0x3FC0, 0x01, 0x20)
                    IO (Decode16, 0x43B0, 0x43B0, 0x01, 0x0C)
                    IO (Decode16, 0x43C0, 0x43C0, 0x01, 0x20)
                    IO (Decode16, 0x47B0, 0x47B0, 0x01, 0x0C)
                    IO (Decode16, 0x47C0, 0x47C0, 0x01, 0x20)
                    IO (Decode16, 0x4BB0, 0x4BB0, 0x01, 0x0C)
                    IO (Decode16, 0x4BC0, 0x4BC0, 0x01, 0x20)
                    IO (Decode16, 0x4FB0, 0x4FB0, 0x01, 0x0C)
                    IO (Decode16, 0x4FC0, 0x4FC0, 0x01, 0x20)
                    IO (Decode16, 0x53B0, 0x53B0, 0x01, 0x0C)
                    IO (Decode16, 0x53C0, 0x53C0, 0x01, 0x20)
                    IO (Decode16, 0x57B0, 0x57B0, 0x01, 0x0C)
                    IO (Decode16, 0x57C0, 0x57C0, 0x01, 0x20)
                    IO (Decode16, 0x5BB0, 0x5BB0, 0x01, 0x0C)
                    IO (Decode16, 0x5BC0, 0x5BC0, 0x01, 0x20)
                    IO (Decode16, 0x5FB0, 0x5FB0, 0x01, 0x0C)
                    IO (Decode16, 0x5FC0, 0x5FC0, 0x01, 0x20)
                    IO (Decode16, 0x63B0, 0x63B0, 0x01, 0x0C)
                    IO (Decode16, 0x63C0, 0x63C0, 0x01, 0x20)
                    IO (Decode16, 0x67B0, 0x67B0, 0x01, 0x0C)
                    IO (Decode16, 0x67C0, 0x67C0, 0x01, 0x20)
                    IO (Decode16, 0x6BB0, 0x6BB0, 0x01, 0x0C)
                    IO (Decode16, 0x6BC0, 0x6BC0, 0x01, 0x20)
                    IO (Decode16, 0x6FB0, 0x6FB0, 0x01, 0x0C)
                    IO (Decode16, 0x6FC0, 0x6FC0, 0x01, 0x20)
                    IO (Decode16, 0x73B0, 0x73B0, 0x01, 0x0C)
                    IO (Decode16, 0x73C0, 0x73C0, 0x01, 0x20)
                    IO (Decode16, 0x77B0, 0x77B0, 0x01, 0x0C)
                    IO (Decode16, 0x77C0, 0x77C0, 0x01, 0x20)
                    IO (Decode16, 0x7BB0, 0x7BB0, 0x01, 0x0C)
                    IO (Decode16, 0x7BC0, 0x7BC0, 0x01, 0x20)
                    IO (Decode16, 0x7FB0, 0x7FB0, 0x01, 0x0C)
                    IO (Decode16, 0x7FC0, 0x7FC0, 0x01, 0x20)
                    IO (Decode16, 0x83B0, 0x83B0, 0x01, 0x0C)
                    IO (Decode16, 0x83C0, 0x83C0, 0x01, 0x20)
                    IO (Decode16, 0x87B0, 0x87B0, 0x01, 0x0C)
                    IO (Decode16, 0x87C0, 0x87C0, 0x01, 0x20)
                    IO (Decode16, 0x8BB0, 0x8BB0, 0x01, 0x0C)
                    IO (Decode16, 0x8BC0, 0x8BC0, 0x01, 0x20)
                    IO (Decode16, 0x8FB0, 0x8FB0, 0x01, 0x0C)
                    IO (Decode16, 0x8FC0, 0x8FC0, 0x01, 0x20)
                    IO (Decode16, 0x93B0, 0x93B0, 0x01, 0x0C)
                    IO (Decode16, 0x93C0, 0x93C0, 0x01, 0x20)
                    IO (Decode16, 0x97B0, 0x97B0, 0x01, 0x0C)
                    IO (Decode16, 0x97C0, 0x97C0, 0x01, 0x20)
                    IO (Decode16, 0x9BB0, 0x9BB0, 0x01, 0x0C)
                    IO (Decode16, 0x9BC0, 0x9BC0, 0x01, 0x20)
                    IO (Decode16, 0x9FB0, 0x9FB0, 0x01, 0x0C)
                    IO (Decode16, 0x9FC0, 0x9FC0, 0x01, 0x20)
                    IO (Decode16, 0xA3B0, 0xA3B0, 0x01, 0x0C)
                    IO (Decode16, 0xA3C0, 0xA3C0, 0x01, 0x20)
                    IO (Decode16, 0xA7B0, 0xA7B0, 0x01, 0x0C)
                    IO (Decode16, 0xA7C0, 0xA7C0, 0x01, 0x20)
                    IO (Decode16, 0xABB0, 0xABB0, 0x01, 0x0C)
                    IO (Decode16, 0xABC0, 0xABC0, 0x01, 0x20)
                    IO (Decode16, 0xAFB0, 0xAFB0, 0x01, 0x0C)
                    IO (Decode16, 0xAFC0, 0xAFC0, 0x01, 0x20)
                    IO (Decode16, 0xB3B0, 0xB3B0, 0x01, 0x0C)
                    IO (Decode16, 0xB3C0, 0xB3C0, 0x01, 0x20)
                    IO (Decode16, 0xB7B0, 0xB7B0, 0x01, 0x0C)
                    IO (Decode16, 0xB7C0, 0xB7C0, 0x01, 0x20)
                    IO (Decode16, 0xBBB0, 0xBBB0, 0x01, 0x0C)
                    IO (Decode16, 0xBBC0, 0xBBC0, 0x01, 0x20)
                    IO (Decode16, 0xBFB0, 0xBFB0, 0x01, 0x0C)
                    IO (Decode16, 0xBFC0, 0xBFC0, 0x01, 0x20)
                    IO (Decode16, 0xC3B0, 0xC3B0, 0x01, 0x0C)
                    IO (Decode16, 0xC3C0, 0xC3C0, 0x01, 0x20)
                    IO (Decode16, 0xC7B0, 0xC7B0, 0x01, 0x0C)
                    IO (Decode16, 0xC7C0, 0xC7C0, 0x01, 0x20)
                    IO (Decode16, 0xCBB0, 0xCBB0, 0x01, 0x0C)
                    IO (Decode16, 0xCBC0, 0xCBC0, 0x01, 0x20)
                    IO (Decode16, 0xCFB0, 0xCFB0, 0x01, 0x0C)
                    IO (Decode16, 0xCFC0, 0xCFC0, 0x01, 0x20)
                    IO (Decode16, 0xD3B0, 0xD3B0, 0x01, 0x0C)
                    IO (Decode16, 0xD3C0, 0xD3C0, 0x01, 0x20)
                    IO (Decode16, 0xD7B0, 0xD7B0, 0x01, 0x0C)
                    IO (Decode16, 0xD7C0, 0xD7C0, 0x01, 0x20)
                    IO (Decode16, 0xDBB0, 0xDBB0, 0x01, 0x0C)
                    IO (Decode16, 0xDBC0, 0xDBC0, 0x01, 0x20)
                    IO (Decode16, 0xDFB0, 0xDFB0, 0x01, 0x0C)
                    IO (Decode16, 0xDFC0, 0xDFC0, 0x01, 0x20)
                    IO (Decode16, 0xE3B0, 0xE3B0, 0x01, 0x0C)
                    IO (Decode16, 0xE3C0, 0xE3C0, 0x01, 0x20)
                    IO (Decode16, 0xE7B0, 0xE7B0, 0x01, 0x0C)
                    IO (Decode16, 0xE7C0, 0xE7C0, 0x01, 0x20)
                    IO (Decode16, 0xEBB0, 0xEBB0, 0x01, 0x0C)
                    IO (Decode16, 0xEBC0, 0xEBC0, 0x01, 0x20)
                    IO (Decode16, 0xEFB0, 0xEFB0, 0x01, 0x0C)
                    IO (Decode16, 0xEFC0, 0xEFC0, 0x01, 0x20)
                    IO (Decode16, 0xF3B0, 0xF3B0, 0x01, 0x0C)
                    IO (Decode16, 0xF3C0, 0xF3C0, 0x01, 0x20)
                    IO (Decode16, 0xF7B0, 0xF7B0, 0x01, 0x0C)
                    IO (Decode16, 0xF7C0, 0xF7C0, 0x01, 0x20)
                    IO (Decode16, 0xFBB0, 0xFBB0, 0x01, 0x0C)
                    IO (Decode16, 0xFBC0, 0xFBC0, 0x01, 0x20)
                    IO (Decode16, 0xFFB0, 0xFFB0, 0x01, 0x0C)
                    IO (Decode16, 0xFFC0, 0xFFC0, 0x01, 0x20)
                })
            }

            Name (_HID, EisaId ("PNP0A03"))
            Name (_ADR, 0x00)
            Name (_BBN, 0x00)
            OperationRegion (HBUS, PCI_Config, 0x40, 0xC0)
            Field (HBUS, DWordAcc, NoLock, Preserve)
            {
                Offset (0x12),
                    ,   3,
                IGDE,   1,
                Offset (0x18),
                    ,   7,
                HENA,   1,
                    ,   4,
                PM0H,   2,
                Offset (0x1A),
                PM1L,   2,
                    ,   2,
                PM1H,   2,
                Offset (0x1B),
                PM2L,   2,
                    ,   2,
                PM2H,   2,
                Offset (0x1C),
                PM3L,   2,
                    ,   2,
                PM3H,   2,
                Offset (0x1D),
                PM4L,   2,
                    ,   2,
                PM4H,   2,
                Offset (0x1E),
                PM5L,   2,
                    ,   2,
                PM5H,   2,
                Offset (0x1F),
                PM6L,   2,
                    ,   2,
                PM6H,   2,
                Offset (0x20),
                DRB0,   8,
                DRB1,   8,
                DRB2,   8,
                DRB3,   8,
                DRB4,   8,
                DRB5,   8,
                DRB6,   8,
                DRB7,   8,
                Offset (0x30),
                DRA0,   3,
                    ,   1,
                DRA1,   3,
                Offset (0x31),
                DRA2,   3,
                    ,   1,
                DRA3,   3,
                Offset (0x32),
                DRA4,   3,
                    ,   1,
                DRA5,   3,
                Offset (0x33),
                DRA6,   3,
                    ,   1,
                DRA7,   3,
                Offset (0x34)
            }

            Name (BUF0, ResourceTemplate ()
            {
                WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
                    0x0000,
                    0x0000,
                    0x00FF,
                    0x0000,
                    0x0100, 0x00)
                DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x00000000,
                    0x00000000,
                    0x00000CF7,
                    0x00000000,
                    0x00000CF8, 0x00)
                IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
                DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x00000000,
                    0x00000D00,
                    0x0000FFFF,
                    0x00000000,
                    0x0000F300, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000A0000,
                    0x000BFFFF,
                    0x00000000,
                    0x00020000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000C0000,
                    0x000C3FFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000C4000,
                    0x000C7FFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000C8000,
                    0x000CBFFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000CC000,
                    0x000CFFFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000D0000,
                    0x000D3FFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000D4000,
                    0x000D7FFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000D8000,
                    0x000DBFFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000DC000,
                    0x000DFFFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000E0000,
                    0x000E3FFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000E4000,
                    0x000E7FFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000E8000,
                    0x000EBFFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000EC000,
                    0x000EFFFF,
                    0x00000000,
                    0x00004000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x000F0000,
                    0x000FFFFF,
                    0x00000000,
                    0x00010000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x00000000,
                    0xFEBFFFFF,
                    0x00000000,
                    0x00000000, 0x00)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,
                    0x00000000,
                    0x00000000,
                    0x00000000,
                    0x00000000, 0x00)
            })
            Method (_CRS, 0, Serialized)
            {
                If (PM1L)
                {
                    CreateDWordField (BUF0, 0x80, C0LN)
                    Store (Zero, C0LN)
                }

                If (LEqual (PM1L, 0x01))
                {
                    CreateBitField (BUF0, 0x0378, C0RW)
                    Store (Zero, C0RW)
                }

                If (PM1H)
                {
                    CreateDWordField (BUF0, 0x9B, C4LN)
                    Store (Zero, C4LN)
                }

                If (LEqual (PM1H, 0x01))
                {
                    CreateBitField (BUF0, 0x0450, C4RW)
                    Store (Zero, C4RW)
                }

                If (PM2L)
                {
                    CreateDWordField (BUF0, 0xB6, C8LN)
                    Store (Zero, C8LN)
                }

                If (LEqual (PM2L, 0x01))
                {
                    CreateBitField (BUF0, 0x0528, C8RW)
                    Store (Zero, C8RW)
                }

                If (PM2H)
                {
                    CreateDWordField (BUF0, 0xD1, CCLN)
                    Store (Zero, CCLN)
                }

                If (LEqual (PM2H, 0x01))
                {
                    CreateBitField (BUF0, 0x0600, CCRW)
                    Store (Zero, CCRW)
                }

                If (PM3L)
                {
                    CreateDWordField (BUF0, 0xEC, D0LN)
                    Store (Zero, D0LN)
                }

                If (LEqual (PM3L, 0x01))
                {
                    CreateBitField (BUF0, 0x06D8, D0RW)
                    Store (Zero, D0RW)
                }

                If (PM3H)
                {
                    CreateDWordField (BUF0, 0x0107, D4LN)
                    Store (Zero, D4LN)
                }

                If (LEqual (PM3H, 0x01))
                {
                    CreateBitField (BUF0, 0x07B0, D4RW)
                    Store (Zero, D4RW)
                }

                If (PM4L)
                {
                    CreateDWordField (BUF0, 0x0122, D8LN)
                    Store (Zero, D8LN)
                }

                If (LEqual (PM4L, 0x01))
                {
                    CreateBitField (BUF0, 0x0888, D8RW)
                    Store (Zero, D8RW)
                }

                If (PM4H)
                {
                    CreateDWordField (BUF0, 0x013D, DCLN)
                    Store (Zero, DCLN)
                }

                If (LEqual (PM4H, 0x01))
                {
                    CreateBitField (BUF0, 0x0960, DCRW)
                    Store (Zero, DCRW)
                }

                If (PM5L)
                {
                    CreateDWordField (BUF0, 0x0158, E0LN)
                    Store (Zero, E0LN)
                }

                If (LEqual (PM5L, 0x01))
                {
                    CreateBitField (BUF0, 0x0A38, E0RW)
                    Store (Zero, E0RW)
                }

                If (PM5H)
                {
                    CreateDWordField (BUF0, 0x0173, E4LN)
                    Store (Zero, E4LN)
                }

                If (LEqual (PM5H, 0x01))
                {
                    CreateBitField (BUF0, 0x0B10, E4RW)
                    Store (Zero, E4RW)
                }

                If (PM6L)
                {
                    CreateDWordField (BUF0, 0x018E, E8LN)
                    Store (Zero, E8LN)
                }

                If (LEqual (PM6L, 0x01))
                {
                    CreateBitField (BUF0, 0x0BE8, E8RW)
                    Store (Zero, E8RW)
                }

                If (PM6H)
                {
                    CreateDWordField (BUF0, 0x01A9, ECLN)
                    Store (Zero, ECLN)
                }

                If (LEqual (PM6H, 0x01))
                {
                    CreateBitField (BUF0, 0x0CC0, ECRW)
                    Store (Zero, ECRW)
                }

                If (PM0H)
                {
                    CreateDWordField (BUF0, 0x01C4, F0LN)
                    Store (Zero, F0LN)
                }

                If (LEqual (PM0H, 0x01))
                {
                    CreateBitField (BUF0, 0x0D98, F0RW)
                    Store (Zero, F0RW)
                }

                CreateDWordField (BUF0, 0x01D3, M1MN)
                CreateDWordField (BUF0, 0x01D7, M1MX)
                CreateDWordField (BUF0, 0x01DF, M1LN)
                Multiply (0x02000000, DRB5, M1MN)
                Add (Subtract (M1MX, M1MN), 0x01, M1LN)
                ShiftRight (And (\_SB.PCI0.LPCB.MTSE, 0x00038000), 0x0F, Local0)
                If (And (Local0, 0x04))
                {
                    CreateDWordField (BUF0, 0x01EE, M2MN)
                    CreateDWordField (BUF0, 0x01F2, M2MX)
                    CreateDWordField (BUF0, 0x01FA, M2LN)
                    Store (0xFED00000, M2MN)
                    Store (0xFED003FF, M2MX)
                    Store (0x0400, M2LN)
                    If (LEqual (Local0, 0x05))
                    {
                        Store (0xFED01000, M2MN)
                        Store (0xFED013FF, M2MX)
                    }

                    If (LEqual (Local0, 0x06))
                    {
                        Store (0xFED02000, M2MN)
                        Store (0xFED023FF, M2MX)
                    }

                    If (LEqual (Local0, 0x07))
                    {
                        Store (0xFED03000, M2MN)
                        Store (0xFED033FF, M2MX)
                    }
                }

                Return (BUF0)
            }

            Method (_PRT, 0, NotSerialized)
            {
                If (GPIC)
                {
                    Return (Package (0x06)
                    {
                        Package (0x04)
                        {
                            0x0002FFFF,
                            0x00,
                            0x00,
                            0x10
                        },

                        Package (0x04)
                        {
                            0x001DFFFF,
                            0x00,
                            0x00,
                            0x10
                        },

                        Package (0x04)
                        {
                            0x001DFFFF,
                            0x01,
                            0x00,
                            0x13
                        },

                        Package (0x04)
                        {
                            0x001DFFFF,
                            0x02,
                            0x00,
                            0x12
                        },

                        Package (0x04)
                        {
                            0x001FFFFF,
                            0x00,
                            0x00,
                            0x12
                        },

                        Package (0x04)
                        {
                            0x001FFFFF,
                            0x01,
                            0x00,
                            0x11
                        }
                    })
                }
                Else
                {
                    Return (Package (0x06)
                    {
                        Package (0x04)
                        {
                            0x0002FFFF,
                            0x00,
                            \_SB.PCI0.LPCB.LNKA,
                            0x00
                        },

                        Package (0x04)
                        {
                            0x001DFFFF,
                            0x00,
                            \_SB.PCI0.LPCB.LNKA,
                            0x00
                        },

                        Package (0x04)
                        {
                            0x001DFFFF,
                            0x01,
                            \_SB.PCI0.LPCB.LNKD,
                            0x00
                        },

                        Package (0x04)
                        {
                            0x001DFFFF,
                            0x02,
                            \_SB.PCI0.LPCB.LNKC,
                            0x00
                        },

                        Package (0x04)
                        {
                            0x001FFFFF,
                            0x00,
                            \_SB.PCI0.LPCB.LNKC,
                            0x00
                        },

                        Package (0x04)
                        {
                            0x001FFFFF,
                            0x01,
                            \_SB.PCI0.LPCB.LNKB,
                            0x00
                        }
                    })
                }
            }

            Device (AGPB)
            {
                Name (_ADR, 0x00010000)
                Method (_PRT, 0, NotSerialized)
                {
                    If (GPIC)
                    {
                        Return (Package (0x02)
                        {
                            Package (0x04)
                            {
                                0xFFFF,
                                0x00,
                                0x00,
                                0x10
                            },

                            Package (0x04)
                            {
                                0xFFFF,
                                0x01,
                                0x00,
                                0x11
                            }
                        })
                    }
                    Else
                    {
                        Return (Package (0x02)
                        {
                            Package (0x04)
                            {
                                0xFFFF,
                                0x00,
                                \_SB.PCI0.LPCB.LNKA,
                                0x00
                            },

                            Package (0x04)
                            {
                                0xFFFF,
                                0x01,
                                \_SB.PCI0.LPCB.LNKB,
                                0x00
                            }
                        })
                    }
                }
            }

            Device (GRFX)
            {
                Name (_ADR, 0x00020000)
                OperationRegion (IO_T, SystemIO, 0x0800, 0x04)
                Field (IO_T, ByteAcc, NoLock, Preserve)
                {
                    TRP0,   8
                }

                OperationRegion (VGAB, SystemMemory, 0x076F0FAC, 0xC010)
                Field (VGAB, AnyAcc, Lock, Preserve)
                {
                    RSIZ,   32,
                    VFUN,   16,
                    CSTE,   16,
                    NSTE,   16,
                    SSTE,   16,
                    CADL,   16,
                    PADL,   16,
                    RBUF,   391216
                }

                Method (_DOS, 1, NotSerialized)
                {
                    Store (And (Arg0, 0x03), DSEN)
                }

                Method (_DOD, 0, NotSerialized)
                {
                    Name (PSIZ, 0x00)
                    Name (PPTR, 0x00)
                    Store (0x02, VFUN)
                    Store (0x00, TRP0)
                    Or (CADL, 0x04, CADL)
                    Store (CADL, Local0)
                    Store (CADL, Local1)
                    Store (CADL, PADL)
                    While (Local1)
                    {
                        If (And (Local1, 0x01))
                        {
                            Increment (PSIZ)
                        }

                        ShiftRight (Local1, 0x01, Local1)
                    }

                    If (LOr (LEqual (PSIZ, 0x00), LGreater (PSIZ, 0x06)))
                    {
                        Store (0x00, ENUM)
                        Return (Package (0x01)
                        {
                            0x00010100
                        })
                    }
                    Else
                    {
                        Store (0x01, ENUM)
                        If (LEqual (PSIZ, 0x02))
                        {
                            Name (VID2, Package (0x02)
                            {
                                0x00010100,
                                0x00010200
                            })
                            If (And (Local0, 0x01))
                            {
                                Store (0x00010100, Index (VID2, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x02))
                            {
                                Store (0x00010200, Index (VID2, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x04))
                            {
                                Store (0x00010300, Index (VID2, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x08))
                            {
                                Store (0x00010400, Index (VID2, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x10))
                            {
                                Store (0x00010500, Index (VID2, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x20))
                            {
                                Store (0x00010600, Index (VID2, PPTR))
                            }

                            Return (VID2)
                        }

                        If (LEqual (PSIZ, 0x03))
                        {
                            Name (VID3, Package (0x03)
                            {
                                0x00010100,
                                0x00010200,
                                0x00010300
                            })
                            If (And (Local0, 0x01))
                            {
                                Store (0x00010100, Index (VID3, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x02))
                            {
                                Store (0x00010200, Index (VID3, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x04))
                            {
                                Store (0x00010300, Index (VID3, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x08))
                            {
                                Store (0x00010400, Index (VID3, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x10))
                            {
                                Store (0x00010500, Index (VID3, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x20))
                            {
                                Store (0x00010600, Index (VID3, PPTR))
                            }

                            Return (VID3)
                        }

                        If (LEqual (PSIZ, 0x04))
                        {
                            Name (VID4, Package (0x04)
                            {
                                0x00010100,
                                0x00010200,
                                0x00010300,
                                0x00010400
                            })
                            If (And (Local0, 0x01))
                            {
                                Store (0x00010100, Index (VID4, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x02))
                            {
                                Store (0x00010200, Index (VID4, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x04))
                            {
                                Store (0x00010300, Index (VID4, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x08))
                            {
                                Store (0x00010400, Index (VID4, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x10))
                            {
                                Store (0x00010500, Index (VID4, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x20))
                            {
                                Store (0x00010600, Index (VID4, PPTR))
                            }

                            Return (VID4)
                        }

                        If (LEqual (PSIZ, 0x05))
                        {
                            Name (VID5, Package (0x05)
                            {
                                0x00010100,
                                0x00010200,
                                0x00010300,
                                0x00010400,
                                0x00010500
                            })
                            If (And (Local0, 0x01))
                            {
                                Store (0x00010100, Index (VID5, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x02))
                            {
                                Store (0x00010200, Index (VID5, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x04))
                            {
                                Store (0x00010300, Index (VID5, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x08))
                            {
                                Store (0x00010400, Index (VID5, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x10))
                            {
                                Store (0x00010500, Index (VID5, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x20))
                            {
                                Store (0x00010600, Index (VID5, PPTR))
                            }

                            Return (VID5)
                        }

                        If (LEqual (PSIZ, 0x06))
                        {
                            Name (VID6, Package (0x06)
                            {
                                0x00010100,
                                0x00010200,
                                0x00010300,
                                0x00010400,
                                0x00010500,
                                0x00010600
                            })
                            If (And (Local0, 0x01))
                            {
                                Store (0x00010100, Index (VID6, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x02))
                            {
                                Store (0x00010200, Index (VID6, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x04))
                            {
                                Store (0x00010300, Index (VID6, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x08))
                            {
                                Store (0x00010400, Index (VID6, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x10))
                            {
                                Store (0x00010500, Index (VID6, PPTR))
                                Increment (PPTR)
                            }

                            If (And (Local0, 0x20))
                            {
                                Store (0x00010600, Index (VID6, PPTR))
                            }

                            Return (VID6)
                        }

                        Name (VID1, Package (0x01)
                        {
                            0x00010100
                        })
                        If (And (Local0, 0x01))
                        {
                            Store (0x00010100, Index (VID1, 0x00))
                        }

                        If (And (Local0, 0x02))
                        {
                            Store (0x00010200, Index (VID1, 0x00))
                        }

                        If (And (Local0, 0x04))
                        {
                            Store (0x00010300, Index (VID1, 0x00))
                        }

                        If (And (Local0, 0x08))
                        {
                            Store (0x00010400, Index (VID1, 0x00))
                        }

                        If (And (Local0, 0x10))
                        {
                            Store (0x00010500, Index (VID1, 0x00))
                        }

                        If (And (Local0, 0x08))
                        {
                            Store (0x00010600, Index (VID1, 0x00))
                        }

                        Return (VID1)
                    }
                }

                Method (_ROM, 2, NotSerialized)
                {
                    Store (Arg0, Local0)
                    Store (Arg1, Local1)
                    If (LGreater (Local1, 0x1000))
                    {
                        Store (0x1000, Local1)
                    }

                    If (LGreater (Add (Local0, Local1), RSIZ))
                    {
                        Store (0x00, Local0)
                    }

                    Multiply (Local0, 0x08, Local2)
                    Multiply (Local1, 0x08, Local3)
                    Name (ROM1, Buffer (RSIZ) {})
                    Name (ROM2, Buffer (Local1) {})
                    Store (RBUF, ROM1)
                    CreateField (ROM1, Local2, Local3, TMPB)
                    Store (TMPB, ROM2)
                    Return (ROM2)
                }

                Device (CRT1)
                {
                    Name (_ADR, 0x0100)
                    Method (_DCS, 0, NotSerialized)
                    {
                        Store (0x01, VFUN)
                        Store (0x00, TRP0)
                        Store (CSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x01))
                            {
                                Return (0x1F)
                            }
                        }

                        Return (0x1D)
                    }

                    Method (_DGS, 0, NotSerialized)
                    {
                        Store (NSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x01))
                            {
                                Return (0x01)
                            }
                        }

                        Return (0x00)
                    }

                    Method (_DSS, 1, NotSerialized)
                    {
                    }
                }

                Device (DTV1)
                {
                    Name (_ADR, 0x0200)
                    Method (_DCS, 0, NotSerialized)
                    {
                        Store (0x01, VFUN)
                        Store (0x00, TRP0)
                        Store (CSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x0202))
                            {
                                Return (0x1F)
                            }
                        }

                        Return (0x1D)
                    }

                    Method (_DGS, 0, NotSerialized)
                    {
                        Store (NSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x0202))
                            {
                                Return (0x01)
                            }
                        }

                        Return (0x00)
                    }

                    Method (_DSS, 1, NotSerialized)
                    {
                    }
                }

                Device (DFP1)
                {
                    Name (_ADR, 0x0300)
                    Method (_DCS, 0, NotSerialized)
                    {
                        Store (0x01, VFUN)
                        Store (0x00, TRP0)
                        Store (CSTE, Local0)
                        Or (Local0, 0x04, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x0404))
                            {
                                Return (0x1F)
                            }
                        }

                        Return (0x1D)
                    }

                    Method (_DGS, 0, NotSerialized)
                    {
                        Store (NSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x0404))
                            {
                                Return (0x01)
                            }
                        }

                        Return (0x00)
                    }

                    Method (_DSS, 1, NotSerialized)
                    {
                    }
                }

                Device (LFP1)
                {
                    Name (_ADR, 0x0400)
                    Method (_DCS, 0, NotSerialized)
                    {
                        Store (0x01, VFUN)
                        Store (0x00, TRP0)
                        Store (CSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x0808))
                            {
                                Return (0x1F)
                            }
                        }

                        Return (0x1D)
                    }

                    Method (_DGS, 0, NotSerialized)
                    {
                        Store (NSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x0808))
                            {
                                Return (0x01)
                            }
                        }

                        Return (0x00)
                    }

                    Method (_DSS, 1, NotSerialized)
                    {
                    }
                }

                Device (DTV2)
                {
                    Name (_ADR, 0x0500)
                    Method (_DCS, 0, NotSerialized)
                    {
                        Store (0x01, VFUN)
                        Store (0x00, TRP0)
                        Store (CSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x1010))
                            {
                                Return (0x1F)
                            }
                        }

                        Return (0x1D)
                    }

                    Method (_DGS, 0, NotSerialized)
                    {
                        Store (NSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x1010))
                            {
                                Return (0x01)
                            }
                        }

                        Return (0x00)
                    }

                    Method (_DSS, 1, NotSerialized)
                    {
                    }
                }

                Device (DFP2)
                {
                    Name (_ADR, 0x0600)
                    Method (_DCS, 0, NotSerialized)
                    {
                        Store (0x01, VFUN)
                        Store (0x00, TRP0)
                        Store (CSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x2020))
                            {
                                Return (0x1F)
                            }
                        }

                        Return (0x1D)
                    }

                    Method (_DGS, 0, NotSerialized)
                    {
                        Store (NSTE, Local0)
                        If (Local0)
                        {
                            If (And (Local0, 0x2020))
                            {
                                Return (0x01)
                            }
                        }

                        Return (0x00)
                    }

                    Method (_DSS, 1, NotSerialized)
                    {
                    }
                }
            }

            Device (PCIB)
            {
                Name (_ADR, 0x001E0000)
                Device (LANC)
                {
                    Name (_ADR, 0x00050000)
                    Name (_PRW, Package (0x02)
                    {
                        0x0B,
                        0x05
                    })
                }

                Device (CDB)
                {
                    Name (_ADR, 0x00030000)
                    OperationRegion (CBD0, PCI_Config, 0x00, 0xC0)
                    Field (CBD0, AnyAcc, NoLock, Preserve)
                    {
                        Offset (0x3C),
                        CD3C,   8,
                        Offset (0x44),
                        CD44,   32,
                        Offset (0xA5),
                        CDA5,   8
                    }

                    Name (_PRW, Package (0x02)
                    {
                        0x0B,
                        0x03
                    })
                    Method (_INI, 0, NotSerialized)
                    {
                        Or (CD3C, 0xFF, CD3C)
                        Store (0x00, CD44)
                    }

                    Method (_STA, 0, NotSerialized)
                    {
                        Return (0x0F)
                    }
                }

                Device (OHCI)
                {
                    Name (_ADR, 0x00030001)
                    Name (_EJD, "_SB.DCK0")
                    Name (_PRW, Package (0x02)
                    {
                        0x0B,
                        0x03
                    })
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (0x0F)
                    }
                }

                Method (_PRT, 0, NotSerialized)
                {
                    If (GPIC)
                    {
                        Return (Package (0x06)
                        {
                            Package (0x04)
                            {
                                0x0003FFFF,
                                0x00,
                                0x00,
                                0x10
                            },

                            Package (0x04)
                            {
                                0x0003FFFF,
                                0x01,
                                0x00,
                                0x12
                            },

                            Package (0x04)
                            {
                                0x0006FFFF,
                                0x00,
                                0x00,
                                0x12
                            },

                            Package (0x04)
                            {
                                0x0005FFFF,
                                0x00,
                                0x00,
                                0x13
                            },

                            Package (0x04)
                            {
                                0x0007FFFF,
                                0x00,
                                0x00,
                                0x14
                            },

                            Package (0x04)
                            {
                                0x0007FFFF,
                                0x01,
                                0x00,
                                0x15
                            }
                        })
                    }
                    Else
                    {
                        Return (Package (0x06)
                        {
                            Package (0x04)
                            {
                                0x0003FFFF,
                                0x00,
                                \_SB.PCI0.LPCB.LNKA,
                                0x00
                            },

                            Package (0x04)
                            {
                                0x0003FFFF,
                                0x01,
                                \_SB.PCI0.LPCB.LNKC,
                                0x00
                            },

                            Package (0x04)
                            {
                                0x0006FFFF,
                                0x00,
                                \_SB.PCI0.LPCB.LNKC,
                                0x00
                            },

                            Package (0x04)
                            {
                                0x0005FFFF,
                                0x00,
                                \_SB.PCI0.LPCB.LNKD,
                                0x00
                            },

                            Package (0x04)
                            {
                                0x0007FFFF,
                                0x00,
                                \_SB.PCI0.LPCB.LNKE,
                                0x00
                            },

                            Package (0x04)
                            {
                                0x0007FFFF,
                                0x01,
                                \_SB.PCI0.LPCB.LNKF,
                                0x00
                            }
                        })
                    }
                }
            }

            Device (LPCB)
            {
                Name (_ADR, 0x001F0000)
                OperationRegion (LPC0, PCI_Config, 0x40, 0xC0)
                Field (LPC0, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x20),
                    PIRA,   8,
                    PIRB,   8,
                    PIRC,   8,
                    PIRD,   8,
                    Offset (0x28),
                    PIRE,   8,
                    PIRF,   8,
                    PIRG,   8,
                    PIRH,   8,
                    Offset (0x90),
                    MTSE,   32,
                    Offset (0xA0),
                    CMAD,   3,
                    Offset (0xA1),
                    LPAD,   2
                }

                Method (IRQS, 0, Serialized)
                {
                    Name (BUF1, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {10,11}
                    })
                    Return (BUF1)
                }

                Method (IRQT, 0, Serialized)
                {
                    Name (BUF2, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {10}
                    })
                    Return (BUF2)
                }

                Method (IRQA, 0, Serialized)
                {
                    Name (BUF2, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {10}
                    })
                    Return (BUF2)
                }

                Method (IRQB, 0, Serialized)
                {
                    Name (BUF2, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {11}
                    })
                    Return (BUF2)
                }

                Device (LNKA)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x01)
                    Method (_DIS, 0, Serialized)
                    {
                        Or (PIRA, 0x80, PIRA)
                    }

                    Method (_PRS, 0, Serialized)
                    {
                        Return (IRQA ())
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLA, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLA, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        If (LNot (And (PIRA, 0x80)))
                        {
                            And (PIRA, 0x0F, Local0)
                            ShiftLeft (0x01, Local0, IRQ0)
                        }

                        Return (RTLA)
                    }

                    Method (_SRS, 1, Serialized)
                    {
                        CreateWordField (Arg0, 0x01, IRQ0)
                        FindSetRightBit (IRQ0, Local0)
                        Decrement (Local0)
                        Store (Local0, PIRA)
                    }

                    Method (_STA, 0, Serialized)
                    {
                        If (And (PIRA, 0x80))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0B)
                        }
                    }
                }

                Device (LNKB)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x02)
                    Method (_DIS, 0, Serialized)
                    {
                        Or (PIRB, 0x80, PIRB)
                    }

                    Method (_PRS, 0, Serialized)
                    {
                        Return (IRQA ())
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLB, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLB, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        If (LNot (And (PIRB, 0x80)))
                        {
                            And (PIRB, 0x0F, Local0)
                            ShiftLeft (0x01, Local0, IRQ0)
                        }

                        Return (RTLB)
                    }

                    Method (_SRS, 1, Serialized)
                    {
                        CreateWordField (Arg0, 0x01, IRQ0)
                        FindSetRightBit (IRQ0, Local0)
                        Decrement (Local0)
                        Store (Local0, PIRB)
                    }

                    Method (_STA, 0, Serialized)
                    {
                        If (And (PIRB, 0x80))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0B)
                        }
                    }
                }

                Device (LNKC)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x03)
                    Method (_DIS, 0, Serialized)
                    {
                        Or (PIRC, 0x80, PIRC)
                    }

                    Method (_PRS, 0, Serialized)
                    {
                        Return (IRQB ())
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLC, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLC, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        If (LNot (And (PIRC, 0x80)))
                        {
                            And (PIRC, 0x0F, Local0)
                            ShiftLeft (0x01, Local0, IRQ0)
                        }

                        Return (RTLC)
                    }

                    Method (_SRS, 1, Serialized)
                    {
                        CreateWordField (Arg0, 0x01, IRQ0)
                        FindSetRightBit (IRQ0, Local0)
                        Decrement (Local0)
                        Store (Local0, PIRC)
                    }

                    Method (_STA, 0, Serialized)
                    {
                        If (And (PIRC, 0x80))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0B)
                        }
                    }
                }

                Device (LNKD)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x04)
                    Method (_DIS, 0, Serialized)
                    {
                        Or (PIRD, 0x80, PIRD)
                    }

                    Method (_PRS, 0, Serialized)
                    {
                        Return (IRQB ())
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLD, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLD, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        If (LNot (And (PIRD, 0x80)))
                        {
                            And (PIRD, 0x0F, Local0)
                            ShiftLeft (0x01, Local0, IRQ0)
                        }

                        Return (RTLD)
                    }

                    Method (_SRS, 1, Serialized)
                    {
                        CreateWordField (Arg0, 0x01, IRQ0)
                        FindSetRightBit (IRQ0, Local0)
                        Decrement (Local0)
                        Store (Local0, PIRD)
                    }

                    Method (_STA, 0, Serialized)
                    {
                        If (And (PIRD, 0x80))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0B)
                        }
                    }
                }

                Device (LNKE)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x05)
                    Method (_DIS, 0, Serialized)
                    {
                        Or (PIRE, 0x80, PIRE)
                    }

                    Method (_PRS, 0, Serialized)
                    {
                        Return (IRQA ())
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLE, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLE, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        If (LNot (And (PIRE, 0x80)))
                        {
                            And (PIRE, 0x0F, Local0)
                            ShiftLeft (0x01, Local0, IRQ0)
                        }

                        Return (RTLE)
                    }

                    Method (_SRS, 1, Serialized)
                    {
                        CreateWordField (Arg0, 0x01, IRQ0)
                        FindSetRightBit (IRQ0, Local0)
                        Decrement (Local0)
                        Store (Local0, PIRE)
                    }

                    Method (_STA, 0, Serialized)
                    {
                        If (And (PIRE, 0x80))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0B)
                        }
                    }
                }

                Device (LNKF)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x06)
                    Method (_DIS, 0, Serialized)
                    {
                        Or (PIRF, 0x80, PIRF)
                    }

                    Method (_PRS, 0, Serialized)
                    {
                        Return (IRQA ())
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLF, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        If (LNot (And (PIRF, 0x80)))
                        {
                            And (PIRF, 0x0F, Local0)
                            ShiftLeft (0x01, Local0, IRQ0)
                        }

                        Return (RTLF)
                    }

                    Method (_SRS, 1, Serialized)
                    {
                        CreateWordField (Arg0, 0x01, IRQ0)
                        FindSetRightBit (IRQ0, Local0)
                        Decrement (Local0)
                        Store (Local0, PIRF)
                    }

                    Method (_STA, 0, Serialized)
                    {
                        If (And (PIRF, 0x80))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0B)
                        }
                    }
                }

                Device (LNKG)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x07)
                    Method (_DIS, 0, Serialized)
                    {
                        Or (PIRG, 0x80, PIRG)
                    }

                    Method (_PRS, 0, Serialized)
                    {
                        Return (IRQS ())
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLG, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLG, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        If (LNot (And (PIRG, 0x80)))
                        {
                            And (PIRG, 0x0F, Local0)
                            ShiftLeft (0x01, Local0, IRQ0)
                        }

                        Return (RTLG)
                    }

                    Method (_SRS, 1, Serialized)
                    {
                        CreateWordField (Arg0, 0x01, IRQ0)
                        FindSetRightBit (IRQ0, Local0)
                        Decrement (Local0)
                        Store (Local0, PIRG)
                    }

                    Method (_STA, 0, Serialized)
                    {
                        If (And (PIRG, 0x80))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0B)
                        }
                    }
                }

                Device (LNKH)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x08)
                    Method (_DIS, 0, Serialized)
                    {
                        Or (PIRH, 0x80, PIRH)
                    }

                    Method (_PRS, 0, Serialized)
                    {
                        Return (IRQS ())
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLH, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLH, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        If (LNot (And (PIRH, 0x80)))
                        {
                            And (PIRH, 0x0F, Local0)
                            ShiftLeft (0x01, Local0, IRQ0)
                        }

                        Return (RTLH)
                    }

                    Method (_SRS, 1, Serialized)
                    {
                        CreateWordField (Arg0, 0x01, IRQ0)
                        FindSetRightBit (IRQ0, Local0)
                        Decrement (Local0)
                        Store (Local0, PIRH)
                    }

                    Method (_STA, 0, Serialized)
                    {
                        If (And (PIRH, 0x80))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0B)
                        }
                    }
                }

                Device (TIMR)
                {
                    Name (_HID, EisaId ("PNP0100"))
                    Name (BUF0, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0040, 0x0040, 0x01, 0x04)
                        IO (Decode16, 0x0050, 0x0050, 0x10, 0x04)
                    })
                    Name (BUF1, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0040, 0x0040, 0x01, 0x04)
                        IO (Decode16, 0x0050, 0x0050, 0x10, 0x04)
                        IRQNoFlags () {0}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        If (And (MTSE, 0x00020000))
                        {
                            Return (BUF0)
                        }

                        Return (BUF1)
                    }
                }

                Device (IPIC)
                {
                    Name (_HID, EisaId ("PNP0000"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
                        IO (Decode16, 0x0024, 0x0024, 0x01, 0x02)
                        IO (Decode16, 0x0028, 0x0028, 0x01, 0x02)
                        IO (Decode16, 0x002C, 0x002C, 0x01, 0x02)
                        IO (Decode16, 0x0030, 0x0030, 0x01, 0x02)
                        IO (Decode16, 0x0034, 0x0034, 0x01, 0x02)
                        IO (Decode16, 0x0038, 0x0038, 0x01, 0x02)
                        IO (Decode16, 0x003C, 0x003C, 0x01, 0x02)
                        IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
                        IO (Decode16, 0x00A4, 0x00A4, 0x01, 0x02)
                        IO (Decode16, 0x00A8, 0x00A8, 0x01, 0x02)
                        IO (Decode16, 0x00AC, 0x00AC, 0x01, 0x02)
                        IO (Decode16, 0x00B0, 0x00B0, 0x01, 0x02)
                        IO (Decode16, 0x00B4, 0x00B4, 0x01, 0x02)
                        IO (Decode16, 0x00B8, 0x00B8, 0x01, 0x02)
                        IO (Decode16, 0x00BC, 0x00BC, 0x01, 0x02)
                        IO (Decode16, 0x04D0, 0x04D0, 0x01, 0x02)
                        IRQNoFlags () {2}
                    })
                }

                Device (RTC)
                {
                    Name (_HID, EisaId ("PNP0B00"))
                    Name (BUF0, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0070, 0x0070, 0x01, 0x08)
                    })
                    Name (BUF1, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0070, 0x0070, 0x01, 0x08)
                        IRQNoFlags () {8}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        If (And (MTSE, 0x00020000))
                        {
                            Return (BUF0)
                        }

                        Return (BUF1)
                    }
                }

                Device (MATH)
                {
                    Name (_HID, EisaId ("PNP0C04"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x00F0, 0x00F0, 0x01, 0x01)
                        IRQNoFlags () {13}
                    })
                }

                Device (DMAC)
                {
                    Name (_HID, EisaId ("PNP0200"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x20)
                        IO (Decode16, 0x0081, 0x0081, 0x01, 0x0F)
                        IO (Decode16, 0x0090, 0x0090, 0x01, 0x02)
                        IO (Decode16, 0x0093, 0x0093, 0x01, 0x0D)
                        IO (Decode16, 0x00C0, 0x00C0, 0x01, 0x20)
                        DMA (Compatibility, NotBusMaster, Transfer8_16) {4}
                    })
                }

                Device (MBRD)
                {
                    Name (_HID, EisaId ("PNP0C02"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x002E, 0x002E, 0x01, 0x02)
                        IO (Decode16, 0x0061, 0x0061, 0x01, 0x01)
                        IO (Decode16, 0x0063, 0x0063, 0x01, 0x01)
                        IO (Decode16, 0x0065, 0x0065, 0x01, 0x01)
                        IO (Decode16, 0x0067, 0x0067, 0x01, 0x01)
                        IO (Decode16, 0x0080, 0x0080, 0x01, 0x01)
                        IO (Decode16, 0x0092, 0x0092, 0x01, 0x01)
                        IO (Decode16, 0x0600, 0x0600, 0x01, 0x10)
                        IO (Decode16, 0x0700, 0x0700, 0x01, 0x10)
                        IO (Decode16, 0x8000, 0x8000, 0x01, 0x80)
                        IO (Decode16, 0x8080, 0x8080, 0x01, 0x40)
                        IO (Decode16, 0x0800, 0x0800, 0x01, 0x04)
                        IO (Decode16, 0x0170, 0x0170, 0x01, 0x08)
                        IO (Decode16, 0x0338, 0x0338, 0x01, 0x08)
                        IO (Decode16, 0xFE00, 0xFE00, 0x01, 0x01)
                    })
                }

                Device (FWHD)
                {
                    Name (_HID, EisaId ("INT0800"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        Memory32Fixed (ReadOnly, 0xFF800000, 0x00800000)
                    })
                }

                Device (H_EC)
                {
                    Name (_HID, EisaId ("PNP0C09"))
                    Method (_CRS, 0, NotSerialized)
                    {
                        Name (BFFR, ResourceTemplate ()
                        {
                            IO (Decode16, 0x0062, 0x0062, 0x00, 0x01)
                            IO (Decode16, 0x0066, 0x0066, 0x00, 0x01)
                        })
                        Return (BFFR)
                    }

                    Method (_REG, 2, NotSerialized)
                    {
                        If (LEqual (Arg0, 0x03))
                        {
                            If (LEqual (Arg1, 0x01))
                            {
                                Store (0x01, \ECON)
                                Store (\_SB.PCI0.LPCB.H_EC.ACEX, \ACON)
                            }
                            Else
                            {
                                Store (0x00, \ECON)
                            }
                        }
                    }

                    Name (_GPE, 0x18)
                    Event (EJT0)
                    Event (EJT1)
                    OperationRegion (ECR, EmbeddedControl, 0x00, 0xFF)
                    Field (ECR, ByteAcc, Lock, Preserve)
                    {
                        Offset (0x80),
                        B1EX,   1,
                        B2EX,   1,
                        ACEX,   1,
                        Offset (0x81),
                        SWBE,   1,
                        DCBE,   1,
                        Offset (0x82),
                        Offset (0x83),
                        LIDS,   1,
                        Offset (0x84),
                        B1ST,   8,
                        B2ST,   8,
                        Offset (0xA0),
                        B1RP,   16,
                        B1RA,   16,
                        B1PR,   16,
                        B1VO,   16,
                        B2RP,   16,
                        B2RA,   16,
                        B2PR,   16,
                        B2VO,   16,
                        B1DA,   16,
                        B1DF,   16,
                        B1DV,   16,
                        B1DL,   16,
                        B2DA,   16,
                        B2DF,   16,
                        B2DV,   16,
                        B2DL,   16,
                        CTMP,   8,
                        Offset (0xD0),
                        B1TI,   16,
                        B1SE,   16,
                        B1CR,   16,
                        B1TM,   16,
                        B2TI,   16,
                        B2SE,   16,
                        B2CR,   16,
                        B2TM,   16
                    }

                    Method (_Q50, 0, NotSerialized)
                    {
                        Notify (\_SB.PWRB, 0x80)
                    }

                    Method (_Q51, 0, NotSerialized)
                    {
                        \_SB.PHS (0xA1)
                        \_SB.PHS (0x9C)
                        Store (0x01, \ACON)
                        Store (0x01, BTS0)
                        Notify (\_SB.ADP1, 0x80)
                    }

                    Method (_Q52, 0, NotSerialized)
                    {
                        \_SB.PHS (0xA2)
                        \_SB.PHS (0x9C)
                        Store (0x00, \ACON)
                        Store (0x01, BTS0)
                        Notify (\_SB.ADP1, 0x80)
                    }

                    Method (_Q53, 0, NotSerialized)
                    {
                        Store (0x01, BTS0)
                        Notify (\_SB.BAT1, 0x81)
                    }

                    Method (_Q54, 0, NotSerialized)
                    {
                        Store (0x01, BTS0)
                        Notify (\_SB.BAT1, 0x81)
                    }

                    Method (_Q58, 0, NotSerialized)
                    {
                        \_SB.PHS (0x89)
                        Notify (\_SB.DCK0, 0x01)
                    }

                    Method (_Q59, 0, NotSerialized)
                    {
                        \_SB.PHS (0x89)
                    }

                    Method (_Q5A, 0, NotSerialized)
                    {
                        \_SB.PHS (0x8A)
                    }

                    Method (_Q5B, 0, NotSerialized)
                    {
                        Notify (\_SB.SLPB, 0x80)
                    }

                    Method (_Q5C, 0, NotSerialized)
                    {
                        \_SB.PHS (0x94)
                    }

                    Method (_Q5D, 0, NotSerialized)
                    {
                        If (LNot (LGreater (OSYS, 0x07CF)))
                        {
                            Store (0x79, P80H)
                            Store (0x06, \_SB.PCI0.GRFX.VFUN)
                            Store (0x00, \_SB.PCI0.GRFX.TRP0)
                            Notify (\_SB.PCI0.GRFX, 0x81)
                        }
                        Else
                        {
                            Store (0x7A, P80H)
                            Store (0x02, \_SB.PCI0.GRFX.VFUN)
                            Store (0x00, \_SB.PCI0.GRFX.TRP0)
                            Store (0x70, P80H)
                            If (LNot (LEqual (\_SB.PCI0.GRFX.CADL, \_SB.PCI0.GRFX.PADL)))
                            {
                                Notify (\_SB.PCI0, 0x00)
                                Sleep (0x03E8)
                            }

                            If (LEqual (0x00, DSEN))
                            {
                                If (ENUM)
                                {
                                    Store (0x7B, P80H)
                                    Store (0x07, \_SB.PCI0.GRFX.VFUN)
                                    Store (0x00, \_SB.PCI0.GRFX.TRP0)
                                    Notify (\_SB.PCI0.GRFX, 0x80)
                                }
                            }

                            If (LEqual (0x01, DSEN))
                            {
                                Store (0x06, \_SB.PCI0.GRFX.VFUN)
                                Store (0x00, \_SB.PCI0.GRFX.TRP0)
                                Notify (\_SB.PCI0.GRFX, 0x81)
                            }

                            If (LNot (LLess (DSEN, 0x02))) {}
                        }
                    }

                    Method (_Q60, 0, NotSerialized)
                    {
                        Store (0x60, P80H)
                    }

                    Method (_Q61, 0, NotSerialized)
                    {
                        If (LEqual (B1EX, 0x01))
                        {
                            Store (0x61, P80H)
                            Store (0x01, BTS0)
                            Notify (\_SB.BAT1, 0x81)
                            Notify (\_SB.BAT1, 0x80)
                        }
                    }

                    Method (_Q63, 0, NotSerialized)
                    {
                        \_SB.PHS (0x9E)
                    }

                    Method (_Q64, 0, NotSerialized)
                    {
                        \_SB.PHS (0x9F)
                    }

                    Method (_Q66, 0, NotSerialized)
                    {
                        Store (0x01, BTS0)
                        Notify (\_SB.BAT1, 0x80)
                    }

                    Method (_Q6B, 0, NotSerialized)
                    {
                        Store (0x6B, P80H)
                        Store (0x01, BTS0)
                        Notify (\_SB.BAT1, 0x81)
                    }
                }

                Device (PS2K)
                {
                    Name (_HID, EisaId ("PNP0303"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0060, 0x0060, 0x01, 0x01)
                        IO (Decode16, 0x0064, 0x0064, 0x01, 0x01)
                        IRQ (Edge, ActiveHigh, Exclusive) {1}
                    })
                }

                Device (PS2M)
                {
                    Name (_HID, EisaId ("SYN0002"))
                    Name (_CID, 0x130FD041)
                    Name (_CRS, ResourceTemplate ()
                    {
                        IRQ (Edge, ActiveHigh, Exclusive) {12}
                    })
                }

                Device (SIOD)
                {
                    Name (_HID, EisaId ("PNP0A05"))
                    Method (_INI, 0, NotSerialized)
                    {
                        If (LEqual (\_SB.DCK0._STA (), 0x00))
                        {
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                            SETD (0x03)
                            WRIT (0x30, 0x00)
                        }
                    }

                    OperationRegion (N391, SystemIO, 0x2E, 0x02)
                    Field (N391, ByteAcc, NoLock, Preserve)
                    {
                        INDX,   8,
                        DATA,   8
                    }

                    Method (SETD, 1, NotSerialized)
                    {
                        Store (0x07, INDX)
                        Store (Arg0, DATA)
                    }

                    Method (READ, 1, NotSerialized)
                    {
                        Store (Arg0, INDX)
                        Store (DATA, Local0)
                        Return (Local0)
                    }

                    Method (WRIT, 2, NotSerialized)
                    {
                        Store (Arg0, INDX)
                        Store (Arg1, DATA)
                    }

                    Device (COMA)
                    {
                        Name (_HID, EisaId ("PNP0501"))
                        Name (_UID, 0x01)
                        Name (_EJD, "_SB.DCK0")
                        Method (_STA, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                If (CMAP)
                                {
                                    SETD (0x03)
                                    If (READ (0x30))
                                    {
                                        Return (0x0F)
                                    }

                                    Return (0x0D)
                                }

                                Return (0x00)
                            }
                            Else
                            {
                                Store (0x06, CMAD)
                                Return (0x00)
                            }
                        }

                        Method (_DIS, 0, NotSerialized)
                        {
                            SETD (0x03)
                            WRIT (0x30, 0x00)
                        }

                        Method (_CRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IRQNoFlags () {}
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF0)
                            }

                            SETD (0x03)
                            If (CMAP)
                            {
                                CreateByteField (BUF0, 0x02, IOL0)
                                CreateByteField (BUF0, 0x03, IOH0)
                                CreateByteField (BUF0, 0x04, IOL1)
                                CreateByteField (BUF0, 0x05, IOH1)
                                CreateByteField (BUF0, 0x07, LEN0)
                                CreateWordField (BUF0, 0x09, IRQW)
                                Store (READ (0x60), IOH0)
                                Store (READ (0x61), IOL0)
                                Store (READ (0x60), IOH1)
                                Store (READ (0x61), IOL1)
                                Store (0x08, LEN0)
                                And (READ (0x70), 0x0F, Local0)
                                If (Local0)
                                {
                                    ShiftLeft (One, Local0, IRQW)
                                }
                                Else
                                {
                                    Store (Zero, IRQW)
                                }
                            }

                            Return (BUF0)
                        }

                        Method (_PRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                                    IRQNoFlags () {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                                    IRQNoFlags () {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                                    IRQNoFlags () {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                                    IRQNoFlags () {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                                    IRQNoFlags () {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                                    IRQNoFlags () {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                                    IRQNoFlags () {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                                    IRQNoFlags () {3}
                                }
                                EndDependentFn ()
                            })
                            Name (BUF1, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                    IRQNoFlags () {}
                                }
                                EndDependentFn ()
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF1)
                            }

                            If (CMAP)
                            {
                                Return (BUF0)
                            }
                            Else
                            {
                                Return (BUF1)
                            }
                        }

                        Method (_SRS, 1, NotSerialized)
                        {
                            CreateByteField (Arg0, 0x02, IOLO)
                            CreateByteField (Arg0, 0x03, IOHI)
                            CreateWordField (Arg0, 0x09, IRQW)
                            CreateWordField (Arg0, 0x02, IO2B)
                            SETD (0x03)
                            WRIT (0x30, 0x00)
                            WRIT (0x61, IOLO)
                            WRIT (0x60, IOHI)
                            FindSetRightBit (IRQW, Local0)
                            If (LNot (LEqual (IRQW, Zero)))
                            {
                                Decrement (Local0)
                            }

                            WRIT (0x70, Local0)
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Store (0x06, CMAD)
                            }
                            Else
                            {
                                If (LEqual (IO2B, 0x03F8))
                                {
                                    Store (0x00, CMAD)
                                }
                                Else
                                {
                                    If (LEqual (IO2B, 0x02F8))
                                    {
                                        Store (0x01, CMAD)
                                    }
                                    Else
                                    {
                                        If (LEqual (IO2B, 0x03E8))
                                        {
                                            Store (0x07, CMAD)
                                        }
                                        Else
                                        {
                                            If (LEqual (IO2B, 0x02E8))
                                            {
                                                Store (0x05, CMAD)
                                            }
                                        }
                                    }
                                }
                            }

                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x03)
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS0, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x03)
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS3, 0, NotSerialized)
                        {
                            SETD (0x03)
                            WRIT (0x30, 0x00)
                        }
                    }

                    Device (FDSK)
                    {
                        Name (_HID, EisaId ("PNP0700"))
                        Method (_STA, 0, NotSerialized)
                        {
                            If (FDCP)
                            {
                                SETD (0x00)
                                If (READ (0x30))
                                {
                                    Return (0x0F)
                                }

                                Return (0x0D)
                            }

                            Return (0x00)
                        }

                        Method (_DIS, 0, NotSerialized)
                        {
                            SETD (0x00)
                            WRIT (0x30, 0x00)
                        }

                        Method (_CRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IRQNoFlags () {}
                                DMA (Compatibility, NotBusMaster, Transfer8_16) {}
                            })
                            SETD (0x00)
                            If (FDCP)
                            {
                                CreateByteField (BUF0, 0x02, IOL0)
                                CreateByteField (BUF0, 0x03, IOH0)
                                CreateByteField (BUF0, 0x04, IOL1)
                                CreateByteField (BUF0, 0x05, IOH1)
                                CreateByteField (BUF0, 0x07, LEN0)
                                CreateByteField (BUF0, 0x0A, IOL2)
                                CreateByteField (BUF0, 0x0B, IOH2)
                                CreateByteField (BUF0, 0x0C, IOL3)
                                CreateByteField (BUF0, 0x0D, IOH3)
                                CreateByteField (BUF0, 0x0F, LEN1)
                                CreateWordField (BUF0, 0x11, IRQW)
                                CreateByteField (BUF0, 0x14, DMA0)
                                Store (And (READ (0x61), 0xF0), IOL0)
                                Store (READ (0x60), IOH0)
                                If (LAnd (IOL0, IOH0))
                                {
                                    Store (IOL0, IOL1)
                                    Store (IOH0, IOH1)
                                    Store (Or (IOL0, 0x07), IOL2)
                                    Store (IOH0, IOH2)
                                    Store (IOL2, IOL3)
                                    Store (IOH2, IOH3)
                                    Store (0x06, LEN0)
                                    Store (0x01, LEN1)
                                }

                                And (READ (0x70), 0x0F, Local0)
                                If (Local0)
                                {
                                    ShiftLeft (One, Local0, IRQW)
                                }
                                Else
                                {
                                    Store (Zero, IRQW)
                                }

                                Store (READ (0x74), Local0)
                                If (LEqual (Local0, 0x04))
                                {
                                    Store (Zero, DMA0)
                                }
                                Else
                                {
                                    ShiftLeft (One, Local0, DMA0)
                                }
                            }

                            Return (BUF0)
                        }

                        Method (_PRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
                                    IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
                                    IRQNoFlags () {6}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {2}
                                }
                                EndDependentFn ()
                            })
                            Name (BUF1, ResourceTemplate ()
                            {
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IRQNoFlags () {}
                                DMA (Compatibility, NotBusMaster, Transfer8_16) {}
                            })
                            If (FDCP)
                            {
                                Return (BUF0)
                            }
                            Else
                            {
                                Return (BUF1)
                            }
                        }

                        Method (_SRS, 1, NotSerialized)
                        {
                            CreateByteField (Arg0, 0x02, IOLO)
                            CreateByteField (Arg0, 0x03, IOHI)
                            CreateWordField (Arg0, 0x11, IRQW)
                            CreateWordField (Arg0, 0x14, DMAC)
                            SETD (0x00)
                            WRIT (0x30, 0x00)
                            WRIT (0x61, IOLO)
                            WRIT (0x60, IOHI)
                            FindSetRightBit (IRQW, Local0)
                            If (LNot (LEqual (IRQW, Zero)))
                            {
                                Decrement (Local0)
                            }

                            WRIT (0x70, Local0)
                            FindSetRightBit (DMAC, Local0)
                            If (LNot (LEqual (DMAC, Zero)))
                            {
                                Decrement (Local0)
                            }

                            WRIT (0x74, Local0)
                            WRIT (0x30, 0x01)
                        }

                        Method (_PS0, 0, NotSerialized)
                        {
                            SETD (0x00)
                            WRIT (0x30, 0x01)
                        }

                        Method (_PS3, 0, NotSerialized)
                        {
                            SETD (0x00)
                            WRIT (0x30, 0x00)
                        }
                    }

                    Device (POUT)
                    {
                        Name (_HID, EisaId ("PNP0400"))
                        Name (_UID, 0x01)
                        Name (_EJD, "_SB.DCK0")
                        Method (_STA, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x01)
                                If (LEqual (And (READ (0xF0), 0xE0), 0x00))
                                {
                                    If (LPTP)
                                    {
                                        SETD (0x01)
                                        If (READ (0x30))
                                        {
                                            Return (0x0F)
                                        }

                                        Return (0x0D)
                                    }
                                }

                                Return (0x00)
                            }
                            Else
                            {
                                Store (0x03, LPAD)
                                Return (0x00)
                            }
                        }

                        Method (_DIS, 0, NotSerialized)
                        {
                            SETD (0x01)
                            If (LEqual (And (READ (0xF0), 0xE0), 0x00))
                            {
                                WRIT (0x30, 0x00)
                            }
                        }

                        Method (_CRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IRQNoFlags () {}
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF0)
                            }

                            If (LAnd (LPTP, LEqual (And (READ (0xF0), 0xE0), 0x00)))
                            {
                                CreateByteField (BUF0, 0x02, IOL0)
                                CreateByteField (BUF0, 0x03, IOH0)
                                CreateByteField (BUF0, 0x04, IOL1)
                                CreateByteField (BUF0, 0x05, IOH1)
                                CreateByteField (BUF0, 0x07, LEN0)
                                CreateWordField (BUF0, 0x09, IRQW)
                                SETD (0x01)
                                Store (READ (0x61), IOL0)
                                Store (READ (0x60), IOH0)
                                Store (IOL0, IOL1)
                                Store (IOH0, IOH1)
                                Store (0x08, LEN0)
                                If (And (READ (0x70), 0x0F))
                                {
                                    ShiftLeft (One, And (READ (0x70), 0x0F), IRQW)
                                }
                                Else
                                {
                                    Store (Zero, IRQW)
                                }
                            }

                            Return (BUF0)
                        }

                        Method (_PRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x04)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x04)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x04)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x04)
                                    IRQNoFlags () {5}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x04)
                                    IRQNoFlags () {5}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x04)
                                    IRQNoFlags () {5}
                                }
                                EndDependentFn ()
                            })
                            Name (BUF1, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                    IRQNoFlags () {}
                                }
                                EndDependentFn ()
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF1)
                            }

                            If (LAnd (LPTP, LEqual (And (READ (0xF0), 0xE0), 0x00)))
                            {
                                Return (BUF0)
                            }
                            Else
                            {
                                Return (BUF1)
                            }
                        }

                        Method (_SRS, 1, NotSerialized)
                        {
                            CreateByteField (Arg0, 0x02, IOL0)
                            CreateByteField (Arg0, 0x03, IOH0)
                            CreateWordField (Arg0, 0x09, IRQW)
                            CreateWordField (Arg0, 0x02, IO2B)
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                            WRIT (0xF0, And (READ (0xF0), 0x0F))
                            WRIT (0x74, 0x04)
                            WRIT (0x61, IOL0)
                            WRIT (0x60, IOH0)
                            FindSetRightBit (IRQW, Local0)
                            If (LNot (LEqual (IRQW, Zero)))
                            {
                                Decrement (Local0)
                            }

                            WRIT (0x70, Local0)
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Store (0x03, LPAD)
                            }
                            Else
                            {
                                If (LEqual (IO2B, 0x0378))
                                {
                                    Store (0x00, LPAD)
                                }
                                Else
                                {
                                    If (LEqual (IO2B, 0x0278))
                                    {
                                        Store (0x01, LPAD)
                                    }
                                    Else
                                    {
                                        If (LEqual (IO2B, 0x0178))
                                        {
                                            Store (0x03, LPAD)
                                        }
                                    }
                                }
                            }

                            If (\_SB.DCK0._STA ())
                            {
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS0, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x01)
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS3, 0, NotSerialized)
                        {
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                        }
                    }

                    Device (PBID)
                    {
                        Name (_HID, EisaId ("PNP0400"))
                        Name (_UID, 0x02)
                        Name (_EJD, "_SB.DCK0")
                        Method (_STA, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x01)
                                If (LEqual (And (READ (0xF0), 0xE0), 0x20))
                                {
                                    If (LPTP)
                                    {
                                        If (READ (0x30))
                                        {
                                            Return (0x0F)
                                        }

                                        Return (0x0D)
                                    }
                                }

                                Return (0x00)
                            }
                            Else
                            {
                                Store (0x03, LPAD)
                                Return (0x00)
                            }
                        }

                        Method (_DIS, 0, NotSerialized)
                        {
                            SETD (0x01)
                            If (LEqual (And (READ (0xF0), 0xE0), 0x20))
                            {
                                WRIT (0x30, 0x00)
                            }
                        }

                        Method (_CRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IRQNoFlags () {}
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF0)
                            }

                            If (LAnd (LPTP, LEqual (And (READ (0xF0), 0xE0), 0x20)))
                            {
                                CreateByteField (BUF0, 0x02, IOL0)
                                CreateByteField (BUF0, 0x03, IOH0)
                                CreateByteField (BUF0, 0x04, IOL1)
                                CreateByteField (BUF0, 0x05, IOH1)
                                CreateByteField (BUF0, 0x07, LEN0)
                                CreateWordField (BUF0, 0x09, IRQW)
                                SETD (0x01)
                                Store (READ (0x61), IOL0)
                                Store (READ (0x60), IOH0)
                                Store (IOL0, IOL1)
                                Store (IOH0, IOH1)
                                If (LEqual (IOL0, 0x78))
                                {
                                    Store (0x08, LEN0)
                                }
                                Else
                                {
                                    Store (0x04, LEN0)
                                }

                                If (And (READ (0x70), 0x0F))
                                {
                                    ShiftLeft (One, And (READ (0x70), 0x0F), IRQW)
                                }
                                Else
                                {
                                    Store (Zero, IRQW)
                                }
                            }

                            Return (BUF0)
                        }

                        Method (_PRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                }
                                EndDependentFn ()
                            })
                            Name (BUF1, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                    IRQNoFlags () {}
                                }
                                EndDependentFn ()
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF1)
                            }

                            If (LAnd (LPTP, LEqual (And (READ (0xF0), 0xE0), 0x20)))
                            {
                                Return (BUF0)
                            }
                            Else
                            {
                                Return (BUF1)
                            }
                        }

                        Method (_SRS, 1, NotSerialized)
                        {
                            CreateByteField (Arg0, 0x02, IOL0)
                            CreateByteField (Arg0, 0x03, IOH0)
                            CreateWordField (Arg0, 0x09, IRQW)
                            CreateWordField (Arg0, 0x02, IO2B)
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                            WRIT (0xF0, Or (0x20, And (READ (0xF0), 0x0F)))
                            WRIT (0x74, 0x04)
                            WRIT (0x61, IOL0)
                            WRIT (0x60, IOH0)
                            FindSetRightBit (IRQW, Local0)
                            If (LNot (LEqual (IRQW, Zero)))
                            {
                                Decrement (Local0)
                            }

                            WRIT (0x70, Local0)
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Store (0x03, LPAD)
                            }
                            Else
                            {
                                If (LEqual (IO2B, 0x0378))
                                {
                                    Store (0x00, LPAD)
                                }
                                Else
                                {
                                    If (LEqual (IO2B, 0x0278))
                                    {
                                        Store (0x01, LPAD)
                                    }
                                    Else
                                    {
                                        If (LEqual (IO2B, 0x0178))
                                        {
                                            Store (0x03, LPAD)
                                        }
                                    }
                                }
                            }

                            If (\_SB.DCK0._STA ())
                            {
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS0, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x01)
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS3, 0, NotSerialized)
                        {
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                        }
                    }

                    Device (PEPP)
                    {
                        Name (_HID, EisaId ("PNP0400"))
                        Name (_UID, 0x03)
                        Name (_EJD, "_SB.DCK0")
                        Method (_STA, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x01)
                                If (LEqual (And (READ (0xF0), 0xE0), 0x60))
                                {
                                    If (LPTP)
                                    {
                                        If (READ (0x30))
                                        {
                                            Return (0x0F)
                                        }
                                        Else
                                        {
                                            Return (0x0D)
                                        }
                                    }
                                }

                                Return (0x00)
                            }
                            Else
                            {
                                Store (0x03, LPAD)
                                Return (0x00)
                            }
                        }

                        Method (_DIS, 0, NotSerialized)
                        {
                            SETD (0x01)
                            If (LEqual (And (READ (0xF0), 0xE0), 0x60))
                            {
                                WRIT (0x30, 0x00)
                            }
                        }

                        Method (_CRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IRQNoFlags () {}
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF0)
                            }

                            If (LAnd (LPTP, LEqual (And (READ (0xF0), 0xE0), 0x60)))
                            {
                                CreateByteField (BUF0, 0x02, IOL0)
                                CreateByteField (BUF0, 0x03, IOH0)
                                CreateByteField (BUF0, 0x04, IOL1)
                                CreateByteField (BUF0, 0x05, IOH1)
                                CreateByteField (BUF0, 0x07, LEN0)
                                CreateWordField (BUF0, 0x09, IRQW)
                                SETD (0x01)
                                Store (READ (0x61), IOL0)
                                Store (READ (0x60), IOH0)
                                Store (IOL0, IOL1)
                                Store (IOH0, IOH1)
                                Store (0x08, LEN0)
                                If (And (READ (0x70), 0x0F))
                                {
                                    ShiftLeft (One, And (READ (0x70), 0x0F), IRQW)
                                }
                                Else
                                {
                                    Store (Zero, IRQW)
                                }
                            }

                            Return (BUF0)
                        }

                        Method (_PRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                }
                                EndDependentFn ()
                            })
                            Name (BUF1, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                    IRQNoFlags () {}
                                }
                                EndDependentFn ()
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF1)
                            }

                            If (LAnd (LPTP, LEqual (And (READ (0xF0), 0xE0), 0x60)))
                            {
                                Return (BUF0)
                            }
                            Else
                            {
                                Return (BUF1)
                            }
                        }

                        Method (_SRS, 1, NotSerialized)
                        {
                            CreateByteField (Arg0, 0x02, IOL0)
                            CreateByteField (Arg0, 0x03, IOH0)
                            CreateWordField (Arg0, 0x09, IRQW)
                            CreateWordField (Arg0, 0x02, IO2B)
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                            WRIT (0xF0, Or (0x60, And (READ (0xF0), 0x0F)))
                            WRIT (0x74, 0x04)
                            WRIT (0x61, IOL0)
                            WRIT (0x60, IOH0)
                            FindSetRightBit (IRQW, Local0)
                            If (LNot (LEqual (IRQW, Zero)))
                            {
                                Decrement (Local0)
                            }

                            WRIT (0x70, Local0)
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Store (0x03, LPAD)
                            }
                            Else
                            {
                                If (LEqual (IO2B, 0x0378))
                                {
                                    Store (0x00, LPAD)
                                }
                                Else
                                {
                                    If (LEqual (IO2B, 0x0278))
                                    {
                                        Store (0x01, LPAD)
                                    }
                                    Else
                                    {
                                        If (LEqual (IO2B, 0x0178))
                                        {
                                            Store (0x03, LPAD)
                                        }
                                    }
                                }
                            }

                            If (\_SB.DCK0._STA ())
                            {
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS0, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x01)
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS3, 0, NotSerialized)
                        {
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                        }
                    }

                    Device (PECP)
                    {
                        Name (_HID, EisaId ("PNP0401"))
                        Name (_UID, 0x04)
                        Name (_EJD, "_SB.DCK0")
                        Method (_STA, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x01)
                                If (LEqual (And (READ (0xF0), 0xE0), 0xE0))
                                {
                                    If (LPTP)
                                    {
                                        If (READ (0x30))
                                        {
                                            Return (0x0F)
                                        }
                                        Else
                                        {
                                            Return (0x0D)
                                        }
                                    }
                                }

                                Return (0x00)
                            }
                            Else
                            {
                                Store (0x03, LPAD)
                                Return (0x00)
                            }
                        }

                        Method (_DIS, 0, NotSerialized)
                        {
                            SETD (0x01)
                            If (LEqual (And (READ (0xF0), 0xE0), 0xE0))
                            {
                                WRIT (0x30, 0x00)
                            }
                        }

                        Method (_CRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                IRQNoFlags () {}
                                DMA (Compatibility, NotBusMaster, Transfer8_16) {}
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF0)
                            }

                            If (LAnd (LPTP, LEqual (And (READ (0xF0), 0xE0), 0xE0)))
                            {
                                CreateByteField (BUF0, 0x02, IOL0)
                                CreateByteField (BUF0, 0x03, IOH0)
                                CreateByteField (BUF0, 0x04, IOL1)
                                CreateByteField (BUF0, 0x05, IOH1)
                                CreateByteField (BUF0, 0x07, LEN0)
                                CreateByteField (BUF0, 0x0A, IOL2)
                                CreateByteField (BUF0, 0x0B, IOH2)
                                CreateByteField (BUF0, 0x0C, IOL3)
                                CreateByteField (BUF0, 0x0D, IOH3)
                                CreateByteField (BUF0, 0x0F, LEN1)
                                CreateWordField (BUF0, 0x11, IRQW)
                                CreateByteField (BUF0, 0x14, DMA0)
                                SETD (0x01)
                                Store (READ (0x61), IOL0)
                                Store (READ (0x60), IOH0)
                                Store (IOL0, IOL1)
                                Store (IOH0, IOH1)
                                Store (IOL0, IOL2)
                                Store (Add (0x04, IOH0), IOH2)
                                Store (IOL0, IOL3)
                                Store (Add (0x04, IOH0), IOH3)
                                Store (0x08, LEN0)
                                Store (0x08, LEN1)
                                And (READ (0x70), 0x0F, Local0)
                                If (Local0)
                                {
                                    ShiftLeft (One, Local0, IRQW)
                                }
                                Else
                                {
                                    Store (Zero, IRQW)
                                }

                                Store (READ (0x74), Local0)
                                If (LEqual (Local0, 0x04))
                                {
                                    Store (Zero, DMA0)
                                }
                                Else
                                {
                                    ShiftLeft (One, Local0, DMA0)
                                }
                            }

                            Return (BUF0)
                        }

                        Method (_PRS, 0, NotSerialized)
                        {
                            Name (BUF0, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IO (Decode16, 0x0778, 0x0778, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IO (Decode16, 0x0778, 0x0778, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {3}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IO (Decode16, 0x0778, 0x0778, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {1}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {1}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {1}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IO (Decode16, 0x0778, 0x0778, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {1}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {1}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {1}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IO (Decode16, 0x0778, 0x0778, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {7}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                                    IO (Decode16, 0x0778, 0x0778, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {4}
                                }
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0178, 0x0178, 0x01, 0x08)
                                    IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                                    IRQNoFlags () {5}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {4}
                                }
                                EndDependentFn ()
                            })
                            Name (BUF1, ResourceTemplate ()
                            {
                                StartDependentFn (0x00, 0x02)
                                {
                                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                                    IRQNoFlags () {}
                                    DMA (Compatibility, NotBusMaster, Transfer8_16) {}
                                }
                                EndDependentFn ()
                            })
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Return (BUF1)
                            }

                            If (LAnd (LPTP, LEqual (And (READ (0xF0), 0xE0), 0xE0)))
                            {
                                Return (BUF0)
                            }
                            Else
                            {
                                Return (BUF1)
                            }
                        }

                        Method (_SRS, 1, NotSerialized)
                        {
                            CreateByteField (Arg0, 0x02, IOL0)
                            CreateByteField (Arg0, 0x03, IOH0)
                            CreateWordField (Arg0, 0x11, IRQW)
                            CreateByteField (Arg0, 0x14, DMA0)
                            CreateWordField (Arg0, 0x02, IO2B)
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                            WRIT (0xF0, Or (0xF0, READ (0xF0)))
                            WRIT (0x61, IOL0)
                            WRIT (0x60, IOH0)
                            FindSetRightBit (IRQW, Local0)
                            If (LNot (LEqual (IRQW, Zero)))
                            {
                                Decrement (Local0)
                            }

                            WRIT (0x70, Local0)
                            FindSetRightBit (DMA0, Local0)
                            If (LNot (LEqual (DMA0, Zero)))
                            {
                                Decrement (Local0)
                            }

                            WRIT (0x74, Local0)
                            If (LEqual (\_SB.DCK0._STA (), 0x00))
                            {
                                Store (0x03, LPAD)
                            }
                            Else
                            {
                                If (LEqual (IO2B, 0x0378))
                                {
                                    Store (0x00, LPAD)
                                }
                                Else
                                {
                                    If (LEqual (IO2B, 0x0278))
                                    {
                                        Store (0x01, LPAD)
                                    }
                                    Else
                                    {
                                        If (LEqual (IO2B, 0x0178))
                                        {
                                            Store (0x03, LPAD)
                                        }
                                    }
                                }
                            }

                            If (\_SB.DCK0._STA ())
                            {
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS0, 0, NotSerialized)
                        {
                            If (\_SB.DCK0._STA ())
                            {
                                SETD (0x01)
                                WRIT (0x30, 0x01)
                            }
                        }

                        Method (_PS3, 0, NotSerialized)
                        {
                            SETD (0x01)
                            WRIT (0x30, 0x00)
                        }
                    }
                }
            }

            Device (USB0)
            {
                Name (_ADR, 0x001D0000)
            }

            Device (USB1)
            {
                Name (_ADR, 0x001D0001)
            }

            Device (USB2)
            {
                Name (_ADR, 0x001D0002)
            }

            Name (NATA, Package (0x01)
            {
                0x001F0001
            })
            Device (IDEC)
            {
                Name (_ADR, 0x001F0001)
                OperationRegion (IDEC, PCI_Config, 0x40, 0x18)
                Field (IDEC, DWordAcc, NoLock, Preserve)
                {
                    PRIT,   16,
                    SECT,   16,
                    PSIT,   4,
                    SSIT,   4,
                    Offset (0x08),
                    SYNC,   4,
                    Offset (0x0A),
                    SDT0,   2,
                        ,   2,
                    SDT1,   2,
                    Offset (0x0B),
                    SDT2,   2,
                        ,   2,
                    SDT3,   2,
                    Offset (0x14),
                    ICR0,   4,
                    ICR1,   4,
                    ICR2,   4,
                    ICR3,   4,
                    ICR4,   4,
                    ICR5,   4
                }

                Device (PRID)
                {
                    Name (_ADR, 0x00)
                    Method (_GTM, 0, NotSerialized)
                    {
                        Name (PBUF, Buffer (0x14)
                        {
                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                            0x00, 0x00, 0x00, 0x00
                        })
                        CreateDWordField (PBUF, 0x00, PIO0)
                        CreateDWordField (PBUF, 0x04, DMA0)
                        CreateDWordField (PBUF, 0x08, PIO1)
                        CreateDWordField (PBUF, 0x0C, DMA1)
                        CreateDWordField (PBUF, 0x10, FLAG)
                        Store (GETP (PRIT), PIO0)
                        Store (GDMA (And (SYNC, 0x01), And (ICR3, 0x01), And (ICR0, 0x01), SDT0, And (ICR1, 0x01)), DMA0)
                        If (LEqual (DMA0, 0xFFFFFFFF))
                        {
                            Store (PIO0, DMA0)
                        }

                        If (And (PRIT, 0x4000))
                        {
                            If (LEqual (And (PRIT, 0x90), 0x80))
                            {
                                Store (0x0384, PIO1)
                            }
                            Else
                            {
                                Store (GETT (PSIT), PIO1)
                            }
                        }
                        Else
                        {
                            Store (0xFFFFFFFF, PIO1)
                        }

                        Store (GDMA (And (SYNC, 0x02), And (ICR3, 0x02), And (ICR0, 0x02), SDT1, And (ICR1, 0x02)), DMA1)
                        If (LEqual (DMA1, 0xFFFFFFFF))
                        {
                            Store (PIO1, DMA1)
                        }

                        Store (GETF (And (SYNC, 0x01), And (SYNC, 0x02), PRIT), FLAG)
                        Return (PBUF)
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        CreateDWordField (Arg0, 0x00, PIO0)
                        CreateDWordField (Arg0, 0x04, DMA0)
                        CreateDWordField (Arg0, 0x08, PIO1)
                        CreateDWordField (Arg0, 0x0C, DMA1)
                        CreateDWordField (Arg0, 0x10, FLAG)
                        Store (0x04, ICR2)
                        If (LEqual (SizeOf (Arg1), 0x0200))
                        {
                            And (PRIT, 0x40F0, PRIT)
                            And (SYNC, 0x0E, SYNC)
                            Store (0x00, SDT0)
                            And (ICR0, 0x0E, ICR0)
                            And (ICR1, 0x0E, ICR1)
                            And (ICR3, 0x0E, ICR3)
                            And (ICR5, 0x0E, ICR5)
                            CreateWordField (Arg1, 0x62, W490)
                            CreateWordField (Arg1, 0x6A, W530)
                            CreateWordField (Arg1, 0x7E, W630)
                            CreateWordField (Arg1, 0x80, W640)
                            CreateWordField (Arg1, 0xB0, W880)
                            CreateWordField (Arg1, 0xBA, W930)
                            Or (PRIT, 0x8004, PRIT)
                            If (LAnd (And (FLAG, 0x02), And (W490, 0x0800)))
                            {
                                Or (PRIT, 0x02, PRIT)
                            }

                            Or (PRIT, SETP (PIO0, W530, W640), PRIT)
                            If (And (FLAG, 0x01))
                            {
                                Or (SYNC, 0x01, SYNC)
                                Store (SDMA (DMA0), SDT0)
                                If (LLess (DMA0, 0x1E))
                                {
                                    Or (ICR3, 0x01, ICR3)
                                }

                                If (LLess (DMA0, 0x3C))
                                {
                                    Or (ICR0, 0x01, ICR0)
                                }

                                If (And (W930, 0x2000))
                                {
                                    Or (ICR1, 0x01, ICR1)
                                }
                            }
                        }
                    }

                    Device (P_D0)
                    {
                        Name (_ADR, 0x00)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Name (PIB0, Buffer (0x0E)
                            {
                                0x03, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xEF, 0x03,
                                0x00, 0x00, 0x00, 0x00, 0xA0, 0xEF
                            })
                            CreateByteField (PIB0, 0x01, PMD0)
                            CreateByteField (PIB0, 0x08, DMD0)
                            If (And (PRIT, 0x02))
                            {
                                If (LEqual (And (PRIT, 0x09), 0x08))
                                {
                                    Store (0x08, PMD0)
                                }
                                Else
                                {
                                    Store (0x0A, PMD0)
                                    ShiftRight (And (PRIT, 0x0300), 0x08, Local0)
                                    ShiftRight (And (PRIT, 0x3000), 0x0C, Local1)
                                    Add (Local0, Local1, Local2)
                                    If (LEqual (0x03, Local2))
                                    {
                                        Store (0x0B, PMD0)
                                    }

                                    If (LEqual (0x05, Local2))
                                    {
                                        Store (0x0C, PMD0)
                                    }
                                }
                            }
                            Else
                            {
                                Store (0x01, PMD0)
                            }

                            If (And (SYNC, 0x01))
                            {
                                Store (Or (SDT0, 0x40), DMD0)
                                If (And (ICR1, 0x01))
                                {
                                    If (And (ICR0, 0x01))
                                    {
                                        Add (DMD0, 0x02, DMD0)
                                    }

                                    If (And (ICR3, 0x01))
                                    {
                                        Store (0x45, DMD0)
                                    }
                                }
                            }
                            Else
                            {
                                Or (Subtract (And (PMD0, 0x07), 0x02), 0x20, DMD0)
                            }

                            Return (PIB0)
                        }
                    }

                    Method (_PS0, 0, NotSerialized)
                    {
                    }

                    Method (_PS3, 0, NotSerialized)
                    {
                    }
                }

                Method (GETP, 1, NotSerialized)
                {
                    If (LEqual (And (Arg0, 0x09), 0x00))
                    {
                        Return (0xFFFFFFFF)
                    }

                    If (LEqual (And (Arg0, 0x09), 0x08))
                    {
                        Return (0x0384)
                    }

                    ShiftRight (And (Arg0, 0x0300), 0x08, Local0)
                    ShiftRight (And (Arg0, 0x3000), 0x0C, Local1)
                    Return (Multiply (0x1E, Subtract (0x09, Add (Local0, Local1))))
                }

                Method (GDMA, 5, NotSerialized)
                {
                    If (Arg0)
                    {
                        If (LAnd (Arg1, Arg4))
                        {
                            Return (0x14)
                        }

                        If (LAnd (Arg2, Arg4))
                        {
                            Return (Multiply (Subtract (0x04, Arg3), 0x0F))
                        }

                        Return (Multiply (Subtract (0x04, Arg3), 0x1E))
                    }

                    Return (0xFFFFFFFF)
                }

                Method (GETT, 1, NotSerialized)
                {
                    Return (Multiply (0x1E, Subtract (0x09, Add (And (ShiftRight (Arg0, 0x02), 0x03), And (Arg0, 0x03)))))
                }

                Method (GETF, 3, NotSerialized)
                {
                    Name (TMPF, 0x00)
                    If (Arg0)
                    {
                        Or (TMPF, 0x01, TMPF)
                    }

                    If (And (Arg2, 0x02))
                    {
                        Or (TMPF, 0x02, TMPF)
                    }

                    If (Arg1)
                    {
                        Or (TMPF, 0x04, TMPF)
                    }

                    If (And (Arg2, 0x20))
                    {
                        Or (TMPF, 0x08, TMPF)
                    }

                    If (And (Arg2, 0x4000))
                    {
                        Or (TMPF, 0x10, TMPF)
                    }

                    Return (TMPF)
                }

                Method (SETP, 3, NotSerialized)
                {
                    If (LGreater (Arg0, 0xF0))
                    {
                        Return (0x08)
                    }
                    Else
                    {
                        If (And (Arg1, 0x02))
                        {
                            If (LAnd (LNot (LGreater (Arg0, 0x78)), And (Arg2, 0x02)))
                            {
                                Return (0x2301)
                            }

                            If (LAnd (LNot (LGreater (Arg0, 0xB4)), And (Arg2, 0x01)))
                            {
                                Return (0x2101)
                            }
                        }

                        Return (0x1001)
                    }
                }

                Method (SDMA, 1, NotSerialized)
                {
                    If (LNot (LGreater (Arg0, 0x14)))
                    {
                        Return (0x01)
                    }

                    If (LNot (LGreater (Arg0, 0x1E)))
                    {
                        Return (0x02)
                    }

                    If (LNot (LGreater (Arg0, 0x2D)))
                    {
                        Return (0x01)
                    }

                    If (LNot (LGreater (Arg0, 0x3C)))
                    {
                        Return (0x02)
                    }

                    If (LNot (LGreater (Arg0, 0x5A)))
                    {
                        Return (0x01)
                    }

                    Return (0x00)
                }

                Method (SETT, 3, NotSerialized)
                {
                    If (And (Arg1, 0x02))
                    {
                        If (LAnd (LNot (LGreater (Arg0, 0x78)), And (Arg2, 0x02)))
                        {
                            Return (0x0B)
                        }

                        If (LAnd (LNot (LGreater (Arg0, 0xB4)), And (Arg2, 0x01)))
                        {
                            Return (0x09)
                        }
                    }

                    Return (0x04)
                }
            }

            Device (SBUS)
            {
                Name (_ADR, 0x001F0003)
            }

            Device (AUD0)
            {
                Name (_ADR, 0x001F0005)
            }

            Device (MODM)
            {
                Name (_ADR, 0x001F0006)
                Name (_PRW, Package (0x02)
                {
                    0x05,
                    0x03
                })
            }
        }
    }
}