/*
 * Intel ACPI Component Architecture
 * AML Disassembler version 20140214-64 [Feb 27 2014]
 * Copyright (c) 2000 - 2014 Intel Corporation
 * 
 * Disassembly of /media/andrew/fs-root/home/andreas/DSDT, Wed May  7 14:54:38 2014
 *
 * Original Table Header:
 *     Signature        "DSDT"
 *     Length           0x00002648 (9800)
 *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
 *     Checksum         0x4F
 *     OEM ID           "FSC   "
 *     OEM Table ID     "D2703/B1"
 *     OEM Revision     0x00060000 (393216)
 *     Compiler ID      "MSFT"
 *     Compiler Version 0x03000001 (50331649)
 */
DefinitionBlock ("/media/andrew/fs-root/home/andreas/DSDT.aml", "DSDT", 1, "FSC   ", "D2703/B1", 0x00060000)
{
    Name (L1EN, 0x01)
    Name (C1EN, 0x01)
    Name (C2EN, 0x01)
    Name (FDEN, 0x01)
    Name (C1AD, 0x00)
    Name (C2AD, 0x00)
    Name (FDAD, 0x00)
    Name (SLPS, 0x00)
    Name (OSFL, 0x00)
    Name (PICM, 0x00)
    Method (OSCK, 0, NotSerialized)
    {
        Store (One, OSFL)
        Store (0x00, \_SB.PCI0.LPC.AAOF)
        If (STRC (\_OS, "Microsoft Windows"))
        {
            Store (Zero, OSFL)
            Store (0x01, \_SB.PCI0.LPC.AAOF)
        }

        If (STRC (\_OS, "Microsoft WindowsME: Millennium Edition"))
        {
            Store (Zero, OSFL)
            Store (0x02, \_SB.PCI0.LPC.AAOF)
        }

        If (STRC (\_OS, "Microsoft Windows NT"))
        {
            Store (One, OSFL)
            Store (0x04, \_SB.PCI0.LPC.AAOF)
        }

        If (CondRefOf (\_OSI, Local0))
        {
            If (\_OSI ("Windows 2001"))
            {
                Store (0x08, \_SB.PCI0.LPC.AAOF)
            }

            If (\_OSI ("Windows 2006"))
            {
                Store (0x40, \_SB.PCI0.LPC.AAOF)
            }
        }
    }

    Method (STRC, 2, NotSerialized)
    {
        If (LNotEqual (SizeOf (Arg0), SizeOf (Arg1)))
        {
            Return (Zero)
        }

        Add (SizeOf (Arg0), One, Local0)
        Name (STR1, Buffer (Local0) {})
        Store (Arg0, STR1)
        Name (STR2, Buffer (Local0) {})
        Store (Arg1, STR2)
        While (Local0)
        {
            Decrement (Local0)
            If (LNotEqual (DerefOf (Index (STR1, Local0)), DerefOf (Index (
                STR2, Local0))))
            {
                Return (Zero)
            }
        }

        Return (One)
    }

    Method (_PIC, 1, NotSerialized)  // _PIC: Interrupt Model
    {
        Store (Arg0, PICM)
        If (Arg0)
        {
            \_SB.PCI0.LPC.DSPI ()
        }
    }

    Name (FWSO, "FWSO")
    Name (_PSC, 0x00)  // _PSC: Power State Current
    Method (_PS0, 0, NotSerialized)  // _PS0: Power State 0
    {
        Store (_PSC, Local0)
        Store (0x00, _PSC)
        If (LEqual (Local0, 0x03))
        {
            Store (0x01, \_SB.INF)
            While (\_SB.INF)
            {
                Store (0x20, \_SB.BCMD)
                Store (Zero, \_SB.SMIC)
                If (LAnd (LEqual (\_SB.INF, 0x01), OSFL))
                {
                    Sleep (0x01F4)
                }
            }
        }
    }

    Method (_PS3, 0, NotSerialized)  // _PS3: Power State 3
    {
        Store (0x03, _PSC)
    }

    Name (_S0, Package (0x04)  // _S0_: S0 System State
    {
        0x00, 
        0x00, 
        0x00, 
        0x00
    })
    Name (_S3, Package (0x04)  // _S3_: S3 System State
    {
        0x03, 
        0x03, 
        0x00, 
        0x00
    })
    Name (_S4, Package (0x04)  // _S4_: S4 System State
    {
        0x04, 
        0x04, 
        0x00, 
        0x00
    })
    Name (_S5, Package (0x04)  // _S5_: S5 System State
    {
        0x05, 
        0x05, 
        0x00, 
        0x00
    })
    Method (\_PTS, 1, NotSerialized)  // _PTS: Prepare To Sleep
    {
        \_SB.PCI0.LPC.SIO.SLEP (Arg0)
        Store (Arg0, SLPS)
    }

    Method (\_WAK, 1, NotSerialized)  // _WAK: Wake
    {
        \_SB.PCI0.LPC.SIO.WAKE (Arg0)
        Store (Zero, SLPS)
        If (LAnd (LGreaterEqual (Arg0, 0x03), LEqual (OSFL, 0x00)))
        {
            Notify (\_SB.PCI0, 0x00)
        }

        If (LEqual (Arg0, 0x04))
        {
            Notify (\_SB.PWRB, 0x02)
            Notify (\_SB.PCI0.USB1, 0x00)
            Notify (\_SB.PCI0.USB2, 0x00)
            Notify (\_SB.PCI0.USB3, 0x00)
            Notify (\_SB.PCI0.USB4, 0x00)
            Notify (\_SB.PCI0.USB5, 0x00)
            Notify (\_SB.PCI0.USB6, 0x00)
        }

        Return (Zero)
    }

    Scope (\_PR)
    {
        Processor (CPU0, 0x00, 0x00008010, 0x06) {}
        Processor (CPU1, 0x01, 0x00008010, 0x06) {}
        Processor (CPU2, 0x02, 0x00008010, 0x06) {}
        Processor (CPU3, 0x03, 0x00008010, 0x06) {}
        Processor (CPU4, 0x04, 0x00008010, 0x06) {}
        Processor (CPU5, 0x05, 0x00008010, 0x06) {}
        Processor (CPU6, 0x06, 0x00008010, 0x06) {}
        Processor (CPU7, 0x07, 0x00008010, 0x06) {}
    }

    Scope (\_GPE)
    {
        Method (_L03, 0, NotSerialized)  // _Lxx: Level-Triggered GPE
        {
            Notify (\_SB.PWRB, 0x02)
            Notify (\_SB.PCI0.LPC.SIO.KEYB, 0x02)
            Notify (\_SB.PCI0.LPC.SIO.PS2M, 0x02)
            Notify (\_SB.PCI0.LPC.SIO.COM1, 0x02)
        }

        Method (_L04, 0, NotSerialized)  // _Lxx: Level-Triggered GPE
        {
            Notify (\_SB.PCI0.P2P, 0x02)
        }

        Method (_L0B, 0, NotSerialized)  // _Lxx: Level-Triggered GPE
        {
            Notify (\_SB.PWRB, 0x02)
            Notify (\_SB.PCI0.USB1, 0x02)
            Notify (\_SB.PCI0.USB2, 0x02)
            Notify (\_SB.PCI0.USB3, 0x02)
            Notify (\_SB.PCI0.USB4, 0x02)
            Notify (\_SB.PCI0.USB5, 0x02)
            Notify (\_SB.PCI0.USB6, 0x02)
        }

        Method (_L12, 0, NotSerialized)  // _Lxx: Level-Triggered GPE
        {
            Notify (\_SB.PCI0.PEXA, 0x02)
        }

        Method (_L1B, 0, NotSerialized)  // _Lxx: Level-Triggered GPE
        {
            Notify (\_SB.PCI0.HDA, 0x02)
        }
    }

    Scope (\_SI)
    {
        Method (_SST, 1, NotSerialized)  // _SST: System Status
        {
            If (LEqual (Arg0, 0x00))
            {
                Store (0x00, \_SB.PCI0.LPC.SIO.LED1)
            }

            If (LEqual (Arg0, 0x01))
            {
                Store (0x03, \_SB.PCI0.LPC.SIO.LED1)
            }

            If (LEqual (Arg0, 0x02))
            {
                Store (0x03, \_SB.PCI0.LPC.SIO.LED1)
            }

            If (LEqual (Arg0, 0x03))
            {
                Store (0x01, \_SB.PCI0.LPC.SIO.LED1)
            }

            If (LEqual (Arg0, 0x04))
            {
                Store (0x00, \_SB.PCI0.LPC.SIO.LED1)
            }
        }

        Method (_MSG, 1, NotSerialized)  // _MSG: Message
        {
            Noop
        }
    }

    Scope (\_SB)
    {
        OperationRegion (SMI0, SystemIO, 0x00000F40, 0x00000002)
        Field (SMI0, AnyAcc, NoLock, Preserve)
        {
            SMIC,   8
        }

        OperationRegion (SMI1, SystemMemory, 0x13EE1DE4, 0x00000120)
        Field (SMI1, AnyAcc, NoLock, Preserve)
        {
            BCMD,   8, 
            DID,    32, 
            INFO,   1024
        }

        Field (SMI1, AnyAcc, NoLock, Preserve)
        {
            AccessAs (ByteAcc, 0x00), 
            Offset (0x05), 
            INF,    8
        }

        OperationRegion (K8ST, SystemMemory, 0x13EE1F74, 0x00000048)
        Field (K8ST, AnyAcc, NoLock, Preserve)
        {
            Offset (0x40), 
            TOML,   32, 
            TOMH,   32
        }

        Device (PWRB)
        {
            Name (_HID, EisaId ("PNP0C0C"))  // _HID: Hardware ID
        }

        Device (PCI0)
        {
            Name (_HID, EisaId ("PNP0A03"))  // _HID: Hardware ID
            Name (_BBN, 0x00)  // _BBN: BIOS Bus Number
            Name (_ADR, 0x00)  // _ADR: Address
            Name (_STA, 0x0F)  // _STA: Status
            Name (_S3D, 0x02)  // _S3D: S3 Device State
            Name (_S4D, 0x03)  // _S4D: S4 Device State
            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                \OSCK ()
            }

            Name (CRES, ResourceTemplate ()
            {
                WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, PosDecode,
                    0x0000,             // Granularity
                    0x0000,             // Range Minimum
                    0x00FF,             // Range Maximum
                    0x0000,             // Translation Offset
                    0x0100,             // Length
                    ,, )
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x0000,             // Granularity
                    0x0000,             // Range Minimum
                    0x0CF7,             // Range Maximum
                    0x0000,             // Translation Offset
                    0x0CF8,             // Length
                    ,, , TypeStatic)
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x0000,             // Granularity
                    0x0D00,             // Range Minimum
                    0xFFFF,             // Range Maximum
                    0x0000,             // Translation Offset
                    0xF300,             // Length
                    ,, , TypeStatic)
                IO (Decode16,
                    0x0CF8,             // Range Minimum
                    0x0CF8,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    )
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x000A0000,         // Range Minimum
                    0x000BFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00020000,         // Length
                    ,, , AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x000C0000,         // Range Minimum
                    0x000DFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00020000,         // Length
                    ,, , AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x00000000,         // Range Minimum
                    0xFEBFFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00000000,         // Length
                    ,, _Y00, AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0xFED00000,         // Range Minimum
                    0xFEDFFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00100000,         // Length
                    ,, , AddressRangeMemory, TypeStatic)
            })
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                CreateDWordField (CRES, \_SB.PCI0._Y00._MIN, MIN1)  // _MIN: Minimum Base Address
                CreateDWordField (CRES, \_SB.PCI0._Y00._LEN, LEN1)  // _LEN: Length
                Store (\_SB.TOML, MIN1)
                Subtract (0xFEC00000, MIN1, LEN1)
                Return (CRES)
            }

            Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
            {
                If (LEqual (PICM, 0x00))
                {
                    Return (Package (0x09)
                    {
                        Package (0x04)
                        {
                            0x0012FFFF, 
                            0x00, 
                            \_SB.PCI0.LPC.LNKG, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0013FFFF, 
                            0x00, 
                            \_SB.PCI0.LPC.LNKA, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0013FFFF, 
                            0x01, 
                            \_SB.PCI0.LPC.LNKB, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0013FFFF, 
                            0x02, 
                            \_SB.PCI0.LPC.LNKC, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0013FFFF, 
                            0x03, 
                            \_SB.PCI0.LPC.LNKD, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0014FFFF, 
                            0x00, 
                            \_SB.PCI0.LPC.LNKA, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0014FFFF, 
                            0x01, 
                            \_SB.PCI0.LPC.LNKB, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0014FFFF, 
                            0x02, 
                            \_SB.PCI0.LPC.LNKC, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0014FFFF, 
                            0x03, 
                            \_SB.PCI0.LPC.LNKD, 
                            0x00
                        }
                    })
                }
                Else
                {
                    Return (Package (0x09)
                    {
                        Package (0x04)
                        {
                            0x0012FFFF, 
                            0x00, 
                            0x00, 
                            0x16
                        }, 

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

                        Package (0x04)
                        {
                            0x0013FFFF, 
                            0x01, 
                            0x00, 
                            0x11
                        }, 

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

                        Package (0x04)
                        {
                            0x0013FFFF, 
                            0x03, 
                            0x00, 
                            0x13
                        }, 

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

                        Package (0x04)
                        {
                            0x0014FFFF, 
                            0x01, 
                            0x00, 
                            0x11
                        }, 

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

                        Package (0x04)
                        {
                            0x0014FFFF, 
                            0x03, 
                            0x00, 
                            0x13
                        }
                    })
                }
            }

            Device (GRFB)
            {
                Name (_ADR, 0x00010000)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    If (LEqual (PICM, 0x00))
                    {
                        Return (Package (0x02)
                        {
                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x00, 
                                \_SB.PCI0.LPC.LNKC, 
                                0x00
                            }, 

                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x01, 
                                \_SB.PCI0.LPC.LNKD, 
                                0x00
                            }
                        })
                    }
                    Else
                    {
                        Return (Package (0x02)
                        {
                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x00, 
                                0x00, 
                                0x12
                            }, 

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

            Device (PEXA)
            {
                Name (_ADR, 0x00060000)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x12, 
                    0x04
                })
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    If (LEqual (PICM, 0x00))
                    {
                        Return (Package (0x04)
                        {
                            Package (0x04)
                            {
                                0xFFFF, 
                                0x00, 
                                \_SB.PCI0.LPC.LNKC, 
                                0x00
                            }, 

                            Package (0x04)
                            {
                                0xFFFF, 
                                0x01, 
                                \_SB.PCI0.LPC.LNKD, 
                                0x00
                            }, 

                            Package (0x04)
                            {
                                0xFFFF, 
                                0x02, 
                                \_SB.PCI0.LPC.LNKA, 
                                0x00
                            }, 

                            Package (0x04)
                            {
                                0xFFFF, 
                                0x03, 
                                \_SB.PCI0.LPC.LNKB, 
                                0x00
                            }
                        })
                    }
                    Else
                    {
                        Return (Package (0x04)
                        {
                            Package (0x04)
                            {
                                0xFFFF, 
                                0x00, 
                                0x00, 
                                0x12
                            }, 

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

                            Package (0x04)
                            {
                                0xFFFF, 
                                0x02, 
                                0x00, 
                                0x10
                            }, 

                            Package (0x04)
                            {
                                0xFFFF, 
                                0x03, 
                                0x00, 
                                0x11
                            }
                        })
                    }
                }
            }

            Device (LAN)
            {
                Name (_ADR, 0x00070000)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x12, 
                    0x04
                })
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    If (LEqual (PICM, 0x00))
                    {
                        Return (Package (0x01)
                        {
                            Package (0x04)
                            {
                                0xFFFF, 
                                0x00, 
                                \_SB.PCI0.LPC.LNKD, 
                                0x00
                            }
                        })
                    }
                    Else
                    {
                        Return (Package (0x01)
                        {
                            Package (0x04)
                            {
                                0xFFFF, 
                                0x00, 
                                0x00, 
                                0x13
                            }
                        })
                    }
                }
            }

            Device (P2P)
            {
                Name (_ADR, 0x00140004)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_S3D, 0x02)  // _S3D: S3 Device State
                Name (_S4D, 0x03)  // _S4D: S4 Device State
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x04, 
                    0x04
                })
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    If (LEqual (PICM, 0x00))
                    {
                        Return (Package (0x08)
                        {
                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x00, 
                                \_SB.PCI0.LPC.LNKF, 
                                0x00
                            }, 

                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x01, 
                                \_SB.PCI0.LPC.LNKE, 
                                0x00
                            }, 

                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x02, 
                                \_SB.PCI0.LPC.LNKH, 
                                0x00
                            }, 

                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x03, 
                                \_SB.PCI0.LPC.LNKG, 
                                0x00
                            }, 

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

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

                            Package (0x04)
                            {
                                0x0007FFFF, 
                                0x02, 
                                \_SB.PCI0.LPC.LNKG, 
                                0x00
                            }, 

                            Package (0x04)
                            {
                                0x0007FFFF, 
                                0x03, 
                                \_SB.PCI0.LPC.LNKH, 
                                0x00
                            }
                        })
                    }
                    Else
                    {
                        Return (Package (0x08)
                        {
                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x00, 
                                0x00, 
                                0x15
                            }, 

                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x01, 
                                0x00, 
                                0x14
                            }, 

                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x02, 
                                0x00, 
                                0x17
                            }, 

                            Package (0x04)
                            {
                                0x0005FFFF, 
                                0x03, 
                                0x00, 
                                0x16
                            }, 

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

                            Package (0x04)
                            {
                                0x0007FFFF, 
                                0x01, 
                                0x00, 
                                0x15
                            }, 

                            Package (0x04)
                            {
                                0x0007FFFF, 
                                0x02, 
                                0x00, 
                                0x16
                            }, 

                            Package (0x04)
                            {
                                0x0007FFFF, 
                                0x03, 
                                0x00, 
                                0x17
                            }
                        })
                    }
                }
            }

            Device (USB1)
            {
                Name (_ADR, 0x00130000)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_S3D, 0x02)  // _S3D: S3 Device State
                Name (_S4D, 0x03)  // _S4D: S4 Device State
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x0B, 
                    0x03
                })
            }

            Device (USB2)
            {
                Name (_ADR, 0x00130001)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_S3D, 0x02)  // _S3D: S3 Device State
                Name (_S4D, 0x03)  // _S4D: S4 Device State
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x0B, 
                    0x03
                })
            }

            Device (USB3)
            {
                Name (_ADR, 0x00130002)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_S3D, 0x02)  // _S3D: S3 Device State
                Name (_S4D, 0x03)  // _S4D: S4 Device State
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x0B, 
                    0x03
                })
            }

            Device (USB4)
            {
                Name (_ADR, 0x00130003)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_S3D, 0x02)  // _S3D: S3 Device State
                Name (_S4D, 0x03)  // _S4D: S4 Device State
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x0B, 
                    0x03
                })
            }

            Device (USB5)
            {
                Name (_ADR, 0x00130004)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_S3D, 0x02)  // _S3D: S3 Device State
                Name (_S4D, 0x03)  // _S4D: S4 Device State
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x0B, 
                    0x03
                })
            }

            Device (USB6)
            {
                Name (_ADR, 0x00130005)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (_S3D, 0x02)  // _S3D: S3 Device State
                Name (_S4D, 0x03)  // _S4D: S4 Device State
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x0B, 
                    0x03
                })
            }

            Device (SMBS)
            {
                Name (_ADR, 0x00140000)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
            }

            Device (HDA)
            {
                Name (_ADR, 0x00140002)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
            }

            Device (PATA)
            {
                Name (_ADR, 0x00140001)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Name (UDMT, Package (0x08)
                {
                    0x78, 
                    0x5A, 
                    0x3C, 
                    0x2D, 
                    0x1E, 
                    0x14, 
                    0x0F, 
                    0x00
                })
                Name (PIOT, Package (0x06)
                {
                    0x0258, 
                    0x0186, 
                    0x010E, 
                    0xB4, 
                    0x78, 
                    0x00
                })
                Name (PITR, Package (0x06)
                {
                    0x99, 
                    0x47, 
                    0x34, 
                    0x22, 
                    0x20, 
                    0x99
                })
                Name (MDMT, Package (0x04)
                {
                    0x01E0, 
                    0x96, 
                    0x78, 
                    0x00
                })
                Name (MDTR, Package (0x04)
                {
                    0x77, 
                    0x21, 
                    0x20, 
                    0xFF
                })
                OperationRegion (IDE, PCI_Config, 0x40, 0x20)
                Field (IDE, WordAcc, NoLock, Preserve)
                {
                    PPIT,   16, 
                    SPIT,   16, 
                    PMDT,   16, 
                    SMDT,   16, 
                    PPIC,   8, 
                    SPIC,   8, 
                    PPIM,   8, 
                    SPIM,   8, 
                    Offset (0x14), 
                    PUDC,   2, 
                    SUDC,   2, 
                    Offset (0x16), 
                    PUDM,   8, 
                    SUDM,   8
                }

                Method (GETT, 1, NotSerialized)
                {
                    Store (And (Arg0, 0x0F), Local0)
                    Store (ShiftRight (Arg0, 0x04), Local1)
                    Return (Multiply (0x1E, Add (Add (Local0, 0x01), Add (Local1, 
                        0x01))))
                }

                Method (GTM, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x00, PIT1)
                    CreateByteField (Arg0, 0x01, PIT0)
                    CreateByteField (Arg0, 0x02, MDT1)
                    CreateByteField (Arg0, 0x03, MDT0)
                    CreateByteField (Arg0, 0x04, PICX)
                    CreateByteField (Arg0, 0x05, UDCX)
                    CreateByteField (Arg0, 0x06, UDMX)
                    Name (BUF, Buffer (0x14)
                    {
                        /* 0000 */   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
                        /* 0008 */   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
                        /* 0010 */   0x00, 0x00, 0x00, 0x00
                    })
                    CreateDWordField (BUF, 0x00, PIO0)
                    CreateDWordField (BUF, 0x04, DMA0)
                    CreateDWordField (BUF, 0x08, PIO1)
                    CreateDWordField (BUF, 0x0C, DMA1)
                    CreateDWordField (BUF, 0x10, FLAG)
                    If (And (PICX, 0x01))
                    {
                        Return (BUF)
                    }

                    Store (GETT (PIT0), PIO0)
                    Store (GETT (PIT1), PIO1)
                    If (And (UDCX, 0x01))
                    {
                        Or (FLAG, 0x01, FLAG)
                        Store (DerefOf (Index (^UDMT, And (UDMX, 0x0F))), DMA0)
                    }
                    Else
                    {
                        Store (GETT (MDT0), DMA0)
                    }

                    If (And (UDCX, 0x02))
                    {
                        Or (FLAG, 0x04, FLAG)
                        Store (DerefOf (Index (^UDMT, ShiftRight (UDMX, 0x04))), DMA1)
                    }
                    Else
                    {
                        Store (GETT (MDT1), DMA1)
                    }

                    Or (FLAG, 0x1A, FLAG)
                    Return (BUF)
                }

                Method (STM, 3, NotSerialized)
                {
                    CreateDWordField (Arg0, 0x00, PIO0)
                    CreateDWordField (Arg0, 0x04, DMA0)
                    CreateDWordField (Arg0, 0x08, PIO1)
                    CreateDWordField (Arg0, 0x0C, DMA1)
                    CreateDWordField (Arg0, 0x10, FLAG)
                    Name (BUF, Buffer (0x07)
                    {
                         0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00
                    })
                    CreateByteField (BUF, 0x00, PIT1)
                    CreateByteField (BUF, 0x01, PIT0)
                    CreateByteField (BUF, 0x02, MDT1)
                    CreateByteField (BUF, 0x03, MDT0)
                    CreateByteField (BUF, 0x04, PIMX)
                    CreateByteField (BUF, 0x05, UDCX)
                    CreateByteField (BUF, 0x06, UDMX)
                    Store (Match (^PIOT, MLE, PIO0, MTR, 0x00, 0x00), Local0)
                    Divide (Local0, 0x05, Local0)
                    Store (Match (^PIOT, MLE, PIO1, MTR, 0x00, 0x00), Local1)
                    Divide (Local1, 0x05, Local1)
                    Store (Or (ShiftLeft (Local1, 0x04), Local0), PIMX)
                    Store (DerefOf (Index (^PITR, Local0)), PIT0)
                    Store (DerefOf (Index (^PITR, Local1)), PIT1)
                    If (And (FLAG, 0x01))
                    {
                        Store (Match (^UDMT, MLE, DMA0, MTR, 0x00, 0x00), Local0)
                        Divide (Local0, 0x07, Local0)
                        Or (UDMX, Local0, UDMX)
                        Or (UDCX, 0x01, UDCX)
                    }
                    Else
                    {
                        If (LNotEqual (DMA0, 0xFFFFFFFF))
                        {
                            Store (Match (^MDMT, MLE, DMA0, MTR, 0x00, 0x00), Local0)
                            Store (DerefOf (Index (^MDTR, Local0)), MDT0)
                        }
                    }

                    If (And (FLAG, 0x04))
                    {
                        Store (Match (^UDMT, MLE, DMA1, MTR, 0x00, 0x00), Local0)
                        Divide (Local0, 0x07, Local0)
                        Or (UDMX, ShiftLeft (Local0, 0x04), UDMX)
                        Or (UDCX, 0x02, UDCX)
                    }
                    Else
                    {
                        If (LNotEqual (DMA1, 0xFFFFFFFF))
                        {
                            Store (Match (^MDMT, MLE, DMA1, MTR, 0x00, 0x00), Local0)
                            Store (DerefOf (Index (^MDTR, Local0)), MDT1)
                        }
                    }

                    Return (BUF)
                }

                Method (GTF, 2, NotSerialized)
                {
                    CreateByteField (Arg1, 0x00, MDT1)
                    CreateByteField (Arg1, 0x01, MDT0)
                    CreateByteField (Arg1, 0x02, PIMX)
                    CreateByteField (Arg1, 0x03, UDCX)
                    CreateByteField (Arg1, 0x04, UDMX)
                    If (LEqual (Arg0, 0xA0))
                    {
                        Store (And (PIMX, 0x0F), Local0)
                        Store (MDT0, Local1)
                        And (UDCX, 0x01, Local2)
                        Store (And (UDMX, 0x0F), Local3)
                    }
                    Else
                    {
                        Store (ShiftRight (PIMX, 0x04), Local0)
                        Store (MDT1, Local1)
                        And (UDCX, 0x02, Local2)
                        Store (ShiftRight (UDMX, 0x04), Local3)
                    }

                    Name (BUF, Buffer (0x0E)
                    {
                        /* 0000 */   0x03, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xEF, 0x03,
                        /* 0008 */   0x00, 0x00, 0x00, 0x00, 0xFF, 0xEF
                    })
                    CreateByteField (BUF, 0x01, PMOD)
                    CreateByteField (BUF, 0x08, DMOD)
                    CreateByteField (BUF, 0x05, CMDA)
                    CreateByteField (BUF, 0x0C, CMDB)
                    Store (Arg0, CMDA)
                    Store (Arg0, CMDB)
                    Or (Local0, 0x08, PMOD)
                    If (Local2)
                    {
                        Or (Local3, 0x40, DMOD)
                    }
                    Else
                    {
                        Store (Match (^MDMT, MLE, GETT (Local1), MTR, 0x00, 0x00), Local4)
                        If (LLess (Local4, 0x03))
                        {
                            Or (0x20, Local4, DMOD)
                        }
                    }

                    Return (BUF)
                }

                Device (PRID)
                {
                    Name (_ADR, 0x00)  // _ADR: Address
                    Method (_GTM, 0, NotSerialized)  // _GTM: Get Timing Mode
                    {
                        Name (BUF, Buffer (0x07)
                        {
                             0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00
                        })
                        CreateWordField (BUF, 0x00, VPIT)
                        CreateWordField (BUF, 0x02, VMDT)
                        CreateByteField (BUF, 0x04, VPIC)
                        CreateByteField (BUF, 0x05, VUDC)
                        CreateByteField (BUF, 0x06, VUDM)
                        Store (^^PPIT, VPIT)
                        Store (^^PMDT, VMDT)
                        Store (^^PPIC, VPIC)
                        Store (^^PUDC, VUDC)
                        Store (^^PUDM, VUDM)
                        Return (GTM (BUF))
                    }

                    Method (_STM, 3, NotSerialized)  // _STM: Set Timing Mode
                    {
                        Name (BUF, Buffer (0x07)
                        {
                             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                        })
                        CreateWordField (BUF, 0x00, VPIT)
                        CreateWordField (BUF, 0x02, VMDT)
                        CreateByteField (BUF, 0x04, VPIM)
                        CreateByteField (BUF, 0x05, VUDC)
                        CreateByteField (BUF, 0x06, VUDM)
                        Store (STM (Arg0, Arg1, Arg2), BUF)
                        Store (VPIT, ^^PPIT)
                        Store (VMDT, ^^PMDT)
                        Store (VPIM, ^^PPIM)
                        Store (VUDC, ^^PUDC)
                        Store (VUDM, ^^PUDM)
                    }

                    Device (P_D0)
                    {
                        Name (_ADR, 0x00)  // _ADR: Address
                        Method (_GTF, 0, NotSerialized)  // _GTF: Get Task File
                        {
                            Name (BUF, Buffer (0x05)
                            {
                                 0x00, 0x00, 0x00, 0x00, 0x00
                            })
                            CreateWordField (BUF, 0x00, VMDT)
                            CreateByteField (BUF, 0x02, VPIM)
                            CreateByteField (BUF, 0x03, VUDC)
                            CreateByteField (BUF, 0x04, VUDM)
                            Store (^^^PMDT, VMDT)
                            Store (^^^PPIM, VPIM)
                            Store (^^^PUDC, VUDC)
                            Store (^^^PUDM, VUDM)
                            Return (GTF (0xA0, BUF))
                        }
                    }

                    Device (P_D1)
                    {
                        Name (_ADR, 0x01)  // _ADR: Address
                        Method (_GTF, 0, NotSerialized)  // _GTF: Get Task File
                        {
                            Name (BUF, Buffer (0x05)
                            {
                                 0x00, 0x00, 0x00, 0x00, 0x00
                            })
                            CreateWordField (BUF, 0x00, VMDT)
                            CreateByteField (BUF, 0x02, VPIM)
                            CreateByteField (BUF, 0x03, VUDC)
                            CreateByteField (BUF, 0x04, VUDM)
                            Store (^^^PMDT, VMDT)
                            Store (^^^PPIM, VPIM)
                            Store (^^^PUDC, VUDC)
                            Store (^^^PUDM, VUDM)
                            Return (GTF (0xB0, BUF))
                        }
                    }

                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        And (PPIC, 0x01, Local0)
                        If (LAnd (Local0, 0x01))
                        {
                            Return (0x09)
                        }
                        Else
                        {
                            Return (0x0F)
                        }
                    }
                }

                Device (SECD)
                {
                    Name (_ADR, 0x01)  // _ADR: Address
                    Name (_STA, 0x09)  // _STA: Status
                }
            }

            Device (SAT0)
            {
                Name (_ADR, 0x00120000)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                Device (PRIM)
                {
                    Name (_ADR, 0x00)  // _ADR: Address
                    Name (SPTM, Buffer (0x14)
                    {
                        /* 0000 */   0x78, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00,
                        /* 0008 */   0x78, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00,
                        /* 0010 */   0x1F, 0x00, 0x00, 0x00
                    })
                    Method (_GTM, 0, NotSerialized)  // _GTM: Get Timing Mode
                    {
                        Return (SPTM)
                    }

                    Method (_STM, 3, NotSerialized)  // _STM: Set Timing Mode
                    {
                        Store (Arg0, SPTM)
                    }

                    Device (MAST)
                    {
                        Name (_ADR, 0x00)  // _ADR: Address
                        Method (_GTF, 0, NotSerialized)  // _GTF: Get Task File
                        {
                            Store (Buffer (0x07)
                                {
                                     0x03, 0x46, 0x00, 0x00, 0x00, 0xA0, 0xEF
                                }, Local0)
                            Return (Local0)
                        }
                    }

                    Device (SLAV)
                    {
                        Name (_ADR, 0x01)  // _ADR: Address
                        Method (_GTF, 0, NotSerialized)  // _GTF: Get Task File
                        {
                            Store (Buffer (0x07)
                                {
                                     0x03, 0x46, 0x00, 0x00, 0x00, 0xB0, 0xEF
                                }, Local0)
                            Return (Local0)
                        }
                    }
                }

                Device (SECN)
                {
                    Name (_ADR, 0x01)  // _ADR: Address
                    Name (SSTM, Buffer (0x14)
                    {
                        /* 0000 */   0x78, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00,
                        /* 0008 */   0x78, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00,
                        /* 0010 */   0x1F, 0x00, 0x00, 0x00
                    })
                    Method (_GTM, 0, NotSerialized)  // _GTM: Get Timing Mode
                    {
                        Return (SSTM)
                    }

                    Method (_STM, 3, NotSerialized)  // _STM: Set Timing Mode
                    {
                        Store (Arg0, SSTM)
                    }

                    Device (MAST)
                    {
                        Name (_ADR, 0x00)  // _ADR: Address
                        Method (_GTF, 0, NotSerialized)  // _GTF: Get Task File
                        {
                            Store (Buffer (0x07)
                                {
                                     0x03, 0x46, 0x00, 0x00, 0x00, 0xA0, 0xEF
                                }, Local0)
                            Return (Local0)
                        }
                    }

                    Device (SLAV)
                    {
                        Name (_ADR, 0x01)  // _ADR: Address
                        Method (_GTF, 0, NotSerialized)  // _GTF: Get Task File
                        {
                            Store (Buffer (0x07)
                                {
                                     0x03, 0x46, 0x00, 0x00, 0x00, 0xB0, 0xEF
                                }, Local0)
                            Return (Local0)
                        }
                    }
                }
            }

            Device (LPC)
            {
                Name (_ADR, 0x00140003)  // _ADR: Address
                Name (_STA, 0x0F)  // _STA: Status
                OperationRegion (PIRQ, SystemIO, 0x0C00, 0x02)
                Field (PIRQ, ByteAcc, NoLock, Preserve)
                {
                    INDX,   8, 
                    DATA,   8
                }

                IndexField (INDX, DATA, ByteAcc, NoLock, Preserve)
                {
                    PIRA,   8, 
                    PIRB,   8, 
                    PIRC,   8, 
                    PIRD,   8, 
                    Offset (0x09), 
                    PIRE,   8, 
                    PIRF,   8, 
                    PIRG,   8, 
                    PIRH,   8
                }

                Method (DSPI, 0, NotSerialized)
                {
                    Store (Zero, PIRA)
                    Store (Zero, PIRB)
                    Store (Zero, PIRC)
                    Store (Zero, PIRD)
                    Store (Zero, PIRE)
                    Store (Zero, PIRF)
                    Store (Zero, PIRG)
                    Store (Zero, PIRH)
                }

                OperationRegion (LPCD, PCI_Config, 0x44, 0x04)
                Field (LPCD, ByteAcc, NoLock, Preserve)
                {
                        ,   6, 
                    SERX,   8, 
                        ,   12, 
                    FDCX,   2
                }

                OperationRegion (MCCG, SystemIO, 0x0CD6, 0x02)
                Field (MCCG, ByteAcc, NoLock, Preserve)
                {
                    MIDX,   8, 
                    MDTA,   8
                }

                IndexField (MIDX, MDTA, ByteAcc, NoLock, Preserve)
                {
                    Offset (0x55), 
                        ,   7, 
                    HPTE,   1
                }

                OperationRegion (CMSI, SystemIO, 0x72, 0x02)
                Field (CMSI, ByteAcc, NoLock, Preserve)
                {
                    CIDX,   8, 
                    CDTA,   8
                }

                IndexField (CIDX, CDTA, ByteAcc, NoLock, Preserve)
                {
                    Offset (0xFE), 
                    AAOF,   8
                }

                Device (LNKA)
                {
                    Name (_HID, EisaId ("PNP0C0F"))  // _HID: Hardware ID
                    Name (_UID, 0x01)  // _UID: Unique ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (PIRA)
                        {
                            Return (0x0B)
                        }
                        Else
                        {
                            Return (0x09)
                        }
                    }

                    Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                    {
                        IRQ (Level, ActiveLow, Shared, )
                            {3,4,7,9,10,11,12,14,15}
                    })
                    Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                    {
                        Store (Zero, PIRA)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared, _Y01)
                                {}
                        })
                        CreateWordField (BUFF, \_SB.PCI0.LPC.LNKA._CRS._Y01._INT, INTA)  // _INT: Interrupts
                        ShiftLeft (One, PIRA, INTA)
                        Return (BUFF)
                    }

                    Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                    {
                        CreateWordField (Arg0, 0x01, INTA)
                        FindSetRightBit (INTA, Local0)
                        If (LNotEqual (Local0, Zero))
                        {
                            Decrement (Local0)
                        }

                        Store (Local0, PIRA)
                    }
                }

                Device (LNKB)
                {
                    Name (_HID, EisaId ("PNP0C0F"))  // _HID: Hardware ID
                    Name (_UID, 0x02)  // _UID: Unique ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (PIRB)
                        {
                            Return (0x0B)
                        }
                        Else
                        {
                            Return (0x09)
                        }
                    }

                    Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                    {
                        IRQ (Level, ActiveLow, Shared, )
                            {3,4,7,9,10,11,12,14,15}
                    })
                    Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                    {
                        Store (Zero, PIRB)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared, _Y02)
                                {}
                        })
                        CreateWordField (BUFF, \_SB.PCI0.LPC.LNKB._CRS._Y02._INT, INTB)  // _INT: Interrupts
                        ShiftLeft (One, PIRB, INTB)
                        Return (BUFF)
                    }

                    Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                    {
                        CreateWordField (Arg0, 0x01, INTB)
                        FindSetRightBit (INTB, Local0)
                        If (LNotEqual (Local0, Zero))
                        {
                            Decrement (Local0)
                        }

                        Store (Local0, PIRB)
                    }
                }

                Device (LNKC)
                {
                    Name (_HID, EisaId ("PNP0C0F"))  // _HID: Hardware ID
                    Name (_UID, 0x03)  // _UID: Unique ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (PIRC)
                        {
                            Return (0x0B)
                        }
                        Else
                        {
                            Return (0x09)
                        }
                    }

                    Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                    {
                        IRQ (Level, ActiveLow, Shared, )
                            {3,4,7,9,10,11,12,14,15}
                    })
                    Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                    {
                        Store (Zero, PIRC)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared, _Y03)
                                {}
                        })
                        CreateWordField (BUFF, \_SB.PCI0.LPC.LNKC._CRS._Y03._INT, INTC)  // _INT: Interrupts
                        ShiftLeft (One, PIRC, INTC)
                        Return (BUFF)
                    }

                    Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                    {
                        CreateWordField (Arg0, 0x01, INTC)
                        FindSetRightBit (INTC, Local0)
                        If (LNotEqual (Local0, Zero))
                        {
                            Decrement (Local0)
                        }

                        Store (Local0, PIRC)
                    }
                }

                Device (LNKD)
                {
                    Name (_HID, EisaId ("PNP0C0F"))  // _HID: Hardware ID
                    Name (_UID, 0x04)  // _UID: Unique ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (PIRD)
                        {
                            Return (0x0B)
                        }
                        Else
                        {
                            Return (0x09)
                        }
                    }

                    Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                    {
                        IRQ (Level, ActiveLow, Shared, )
                            {3,4,7,9,10,11,12,14,15}
                    })
                    Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                    {
                        Store (Zero, PIRD)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared, _Y04)
                                {}
                        })
                        CreateWordField (BUFF, \_SB.PCI0.LPC.LNKD._CRS._Y04._INT, INTD)  // _INT: Interrupts
                        ShiftLeft (One, PIRD, INTD)
                        Return (BUFF)
                    }

                    Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                    {
                        CreateWordField (Arg0, 0x01, INTD)
                        FindSetRightBit (INTD, Local0)
                        If (LNotEqual (Local0, Zero))
                        {
                            Decrement (Local0)
                        }

                        Store (Local0, PIRD)
                    }
                }

                Device (LNKE)
                {
                    Name (_HID, EisaId ("PNP0C0F"))  // _HID: Hardware ID
                    Name (_UID, 0x05)  // _UID: Unique ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (PIRE)
                        {
                            Return (0x0B)
                        }
                        Else
                        {
                            Return (0x09)
                        }
                    }

                    Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                    {
                        IRQ (Level, ActiveLow, Shared, )
                            {3,4,7,9,10,11,12,14,15}
                    })
                    Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                    {
                        Store (Zero, PIRE)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared, _Y05)
                                {}
                        })
                        CreateWordField (BUFF, \_SB.PCI0.LPC.LNKE._CRS._Y05._INT, INTE)  // _INT: Interrupts
                        ShiftLeft (One, PIRE, INTE)
                        Return (BUFF)
                    }

                    Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                    {
                        CreateWordField (Arg0, 0x01, INTE)
                        FindSetRightBit (INTE, Local0)
                        If (LNotEqual (Local0, Zero))
                        {
                            Decrement (Local0)
                        }

                        Store (Local0, PIRE)
                    }
                }

                Device (LNKF)
                {
                    Name (_HID, EisaId ("PNP0C0F"))  // _HID: Hardware ID
                    Name (_UID, 0x06)  // _UID: Unique ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (PIRF)
                        {
                            Return (0x0B)
                        }
                        Else
                        {
                            Return (0x09)
                        }
                    }

                    Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                    {
                        IRQ (Level, ActiveLow, Shared, )
                            {3,4,7,9,10,11,12,14,15}
                    })
                    Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                    {
                        Store (Zero, PIRF)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared, _Y06)
                                {}
                        })
                        CreateWordField (BUFF, \_SB.PCI0.LPC.LNKF._CRS._Y06._INT, INTF)  // _INT: Interrupts
                        ShiftLeft (One, PIRF, INTF)
                        Return (BUFF)
                    }

                    Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                    {
                        CreateWordField (Arg0, 0x01, INTF)
                        FindSetRightBit (INTF, Local0)
                        If (LNotEqual (Local0, Zero))
                        {
                            Decrement (Local0)
                        }

                        Store (Local0, PIRF)
                    }
                }

                Device (LNKG)
                {
                    Name (_HID, EisaId ("PNP0C0F"))  // _HID: Hardware ID
                    Name (_UID, 0x07)  // _UID: Unique ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (PIRG)
                        {
                            Return (0x0B)
                        }
                        Else
                        {
                            Return (0x09)
                        }
                    }

                    Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                    {
                        IRQ (Level, ActiveLow, Shared, )
                            {3,4,7,9,10,11,12,14,15}
                    })
                    Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                    {
                        Store (Zero, PIRG)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared, _Y07)
                                {}
                        })
                        CreateWordField (BUFF, \_SB.PCI0.LPC.LNKG._CRS._Y07._INT, INTG)  // _INT: Interrupts
                        ShiftLeft (One, PIRG, INTG)
                        Return (BUFF)
                    }

                    Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                    {
                        CreateWordField (Arg0, 0x01, INTG)
                        FindSetRightBit (INTG, Local0)
                        If (LNotEqual (Local0, Zero))
                        {
                            Decrement (Local0)
                        }

                        Store (Local0, PIRG)
                    }
                }

                Device (LNKH)
                {
                    Name (_HID, EisaId ("PNP0C0F"))  // _HID: Hardware ID
                    Name (_UID, 0x08)  // _UID: Unique ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (PIRH)
                        {
                            Return (0x0B)
                        }
                        Else
                        {
                            Return (0x09)
                        }
                    }

                    Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                    {
                        IRQ (Level, ActiveLow, Shared, )
                            {3,4,7,9,10,11,12,14,15}
                    })
                    Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                    {
                        Store (Zero, PIRH)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared, _Y08)
                                {}
                        })
                        CreateWordField (BUFF, \_SB.PCI0.LPC.LNKH._CRS._Y08._INT, INTH)  // _INT: Interrupts
                        ShiftLeft (One, PIRH, INTH)
                        Return (BUFF)
                    }

                    Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                    {
                        CreateWordField (Arg0, 0x01, INTH)
                        FindSetRightBit (INTH, Local0)
                        If (LNotEqual (Local0, Zero))
                        {
                            Decrement (Local0)
                        }

                        Store (Local0, PIRH)
                    }
                }

                Device (MBRD)
                {
                    Name (_HID, EisaId ("PNP0C02"))  // _HID: Hardware ID
                    Name (_UID, 0x01)  // _UID: Unique ID
                    Name (_STA, 0x0F)  // _STA: Status
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0010,             // Range Minimum
                            0x0010,             // Range Maximum
                            0x01,               // Alignment
                            0x10,               // Length
                            )
                        IO (Decode16,
                            0x0022,             // Range Minimum
                            0x0022,             // Range Maximum
                            0x01,               // Alignment
                            0x0C,               // Length
                            )
                        IO (Decode16,
                            0x0030,             // Range Minimum
                            0x0030,             // Range Maximum
                            0x01,               // Alignment
                            0x10,               // Length
                            )
                        IO (Decode16,
                            0x0050,             // Range Minimum
                            0x0050,             // Range Maximum
                            0x01,               // Alignment
                            0x04,               // Length
                            )
                        IO (Decode16,
                            0x0062,             // Range Minimum
                            0x0062,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0065,             // Range Minimum
                            0x0065,             // Range Maximum
                            0x01,               // Alignment
                            0x0B,               // Length
                            )
                        IO (Decode16,
                            0x0074,             // Range Minimum
                            0x0074,             // Range Maximum
                            0x01,               // Alignment
                            0x0C,               // Length
                            )
                        IO (Decode16,
                            0x0090,             // Range Minimum
                            0x0090,             // Range Maximum
                            0x01,               // Alignment
                            0x10,               // Length
                            )
                        IO (Decode16,
                            0x00A2,             // Range Minimum
                            0x00A2,             // Range Maximum
                            0x01,               // Alignment
                            0x10,               // Length
                            )
                        IO (Decode16,
                            0x00B2,             // Range Minimum
                            0x00B2,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00B4,             // Range Minimum
                            0x00B4,             // Range Maximum
                            0x01,               // Alignment
                            0x0C,               // Length
                            )
                        IO (Decode16,
                            0x00EC,             // Range Minimum
                            0x00EC,             // Range Maximum
                            0x01,               // Alignment
                            0x04,               // Length
                            )
                        IO (Decode16,
                            0x0072,             // Range Minimum
                            0x0072,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x004E,             // Range Minimum
                            0x004E,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0600,             // Range Minimum
                            0x0600,             // Range Maximum
                            0x01,               // Alignment
                            0x80,               // Length
                            )
                        IO (Decode16,
                            0x040B,             // Range Minimum
                            0x040B,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x04D0,             // Range Minimum
                            0x04D0,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x04D6,             // Range Minimum
                            0x04D6,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x087F,             // Range Minimum
                            0x087F,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0C00,             // Range Minimum
                            0x0C00,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0C14,             // Range Minimum
                            0x0C14,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0C50,             // Range Minimum
                            0x0C50,             // Range Maximum
                            0x01,               // Alignment
                            0x03,               // Length
                            )
                        IO (Decode16,
                            0x0C6C,             // Range Minimum
                            0x0C6C,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0C6F,             // Range Minimum
                            0x0C6F,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0CD0,             // Range Minimum
                            0x0CD0,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0CD2,             // Range Minimum
                            0x0CD2,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0CD4,             // Range Minimum
                            0x0CD4,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0CD6,             // Range Minimum
                            0x0CD6,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x0CD8,             // Range Minimum
                            0x0CD8,             // Range Maximum
                            0x01,               // Alignment
                            0x08,               // Length
                            )
                        IO (Decode16,
                            0x8000,             // Range Minimum
                            0x8000,             // Range Maximum
                            0x01,               // Alignment
                            0x80,               // Length
                            )
                        IO (Decode16,
                            0x8100,             // Range Minimum
                            0x8100,             // Range Maximum
                            0x01,               // Alignment
                            0xFF,               // Length
                            )
                        IO (Decode16,
                            0xFE00,             // Range Minimum
                            0xFE00,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                        Memory32Fixed (ReadWrite,
                            0xE0000000,         // Address Base
                            0x10000000,         // Address Length
                            )
                        Memory32Fixed (ReadOnly,
                            0xFEC00000,         // Address Base
                            0x00100000,         // Address Length
                            )
                        Memory32Fixed (ReadOnly,
                            0xFEE00000,         // Address Base
                            0x00100000,         // Address Length
                            )
                    })
                }

                Device (DMAC)
                {
                    Name (_HID, EisaId ("PNP0200"))  // _HID: Hardware ID
                    Name (_STA, 0x0F)  // _STA: Status
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0000,             // Range Minimum
                            0x0000,             // Range Maximum
                            0x01,               // Alignment
                            0x10,               // Length
                            )
                        IO (Decode16,
                            0x0080,             // Range Minimum
                            0x0080,             // Range Maximum
                            0x01,               // Alignment
                            0x10,               // Length
                            )
                        IO (Decode16,
                            0x00C0,             // Range Minimum
                            0x00C0,             // Range Maximum
                            0x01,               // Alignment
                            0x20,               // Length
                            )
                        DMA (Compatibility, NotBusMaster, Transfer16, )
                            {4}
                    })
                }

                Device (PIC)
                {
                    Name (_HID, EisaId ("PNP0000"))  // _HID: Hardware ID
                    Name (_STA, 0x0F)  // _STA: Status
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0020,             // Range Minimum
                            0x0020,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00A0,             // Range Minimum
                            0x00A0,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IRQ (Edge, ActiveHigh, Exclusive, )
                            {2}
                    })
                }

                Device (RTC)
                {
                    Name (_HID, EisaId ("PNP0B00"))  // _HID: Hardware ID
                    Name (_STA, 0x0F)  // _STA: Status
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0070,             // Range Minimum
                            0x0070,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IRQ (Edge, ActiveHigh, Exclusive, )
                            {8}
                    })
                }

                Device (TIME)
                {
                    Name (_HID, EisaId ("PNP0100"))  // _HID: Hardware ID
                    Name (_STA, 0x0F)  // _STA: Status
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0040,             // Range Minimum
                            0x0040,             // Range Maximum
                            0x01,               // Alignment
                            0x04,               // Length
                            )
                        IRQ (Edge, ActiveHigh, Exclusive, )
                            {0}
                    })
                }

                Device (MATH)
                {
                    Name (_HID, EisaId ("PNP0C04"))  // _HID: Hardware ID
                    Name (_STA, 0x0F)  // _STA: Status
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x00F0,             // Range Minimum
                            0x00F0,             // Range Maximum
                            0x01,               // Alignment
                            0x0F,               // Length
                            )
                        IRQ (Edge, ActiveHigh, Exclusive, )
                            {13}
                    })
                }

                Device (SPKR)
                {
                    Name (_HID, EisaId ("PNP0800"))  // _HID: Hardware ID
                    Name (_STA, 0x0F)  // _STA: Status
                    Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                    {
                        IO (Decode16,
                            0x0061,             // Range Minimum
                            0x0061,             // Range Maximum
                            0x01,               // Alignment
                            0x01,               // Length
                            )
                    })
                }

                Device (HPET)
                {
                    Name (_HID, EisaId ("PNP0103"))  // _HID: Hardware ID
                    Method (_STA, 0, NotSerialized)  // _STA: Status
                    {
                        If (\_SB.PCI0.LPC.HPTE)
                        {
                            Store (0x0F, Local0)
                        }
                        Else
                        {
                            Store (0x09, Local0)
                        }

                        Return (Local0)
                    }

                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Name (BUFF, ResourceTemplate ()
                        {
                            Memory32Fixed (ReadOnly,
                                0xFED00000,         // Address Base
                                0x00001000,         // Address Length
                                )
                        })
                        Return (BUFF)
                    }
                }

                Device (SIO)
                {
                    Name (_HID, EisaId ("PNP0A05"))  // _HID: Hardware ID
                    Name (_STA, 0x0F)  // _STA: Status
                    OperationRegion (SMSC, SystemIO, 0x4E, 0x02)
                    Field (SMSC, ByteAcc, NoLock, Preserve)
                    {
                        INDX,   8, 
                        DATA,   8
                    }

                    IndexField (INDX, DATA, ByteAcc, NoLock, Preserve)
                    {
                        Offset (0x07), 
                        FUNC,   8, 
                        Offset (0x30), 
                        DEN,    8, 
                        Offset (0x60), 
                        DADH,   8, 
                        DADL,   8, 
                        Offset (0x70), 
                        DIR,    4, 
                        Offset (0x72), 
                        DIR2,   8, 
                        Offset (0x74), 
                        DDMA,   8, 
                        Offset (0xF0), 
                        OPT1,   8, 
                        OPT2,   8
                    }

                    OperationRegion (SSWC, SystemIO, 0x0600, 0x80)
                    Field (SSWC, AnyAcc, NoLock, Preserve)
                    {
                        PMES,   1, 
                        Offset (0x02), 
                        PMEE,   1, 
                        Offset (0x04), 
                            ,   1, 
                        RI2S,   1, 
                        RI1S,   1, 
                        KBDS,   1, 
                        MOUS,   1, 
                        Offset (0x08), 
                            ,   1, 
                        RI2E,   1, 
                        RI1E,   1, 
                        KBDE,   1, 
                        MOUE,   1, 
                        Offset (0x5D), 
                        LED1,   8, 
                        LED2,   8
                    }

                    Method (_INI, 0, NotSerialized)  // _INI: Initialize
                    {
                        SMC (Zero, RefOf (PMEE), RefOf (PMES))
                        SMC (Zero, RefOf (KBDE), RefOf (KBDS))
                        SMC (Zero, RefOf (MOUE), RefOf (MOUS))
                        SMC (Zero, RefOf (RI1E), RefOf (RI1S))
                        SMC (Zero, RefOf (RI2E), RefOf (RI2S))
                        Store (0x55, INDX)
                        Store (0x00, FUNC)
                        Store (DEN, FDEN)
                        Store (0x03, FUNC)
                        Store (DEN, L1EN)
                        Store (0x04, FUNC)
                        Store (DEN, C1EN)
                        Store (0x05, FUNC)
                        Store (DEN, C2EN)
                        Store (0xAA, INDX)
                    }

                    Method (WAKE, 1, NotSerialized)
                    {
                        SMC (Zero, RefOf (KBDE), RefOf (KBDS))
                        SMC (Zero, RefOf (MOUE), RefOf (MOUS))
                        SMC (Zero, RefOf (RI1E), RefOf (RI1S))
                        SMC (Zero, RefOf (RI2E), RefOf (RI2S))
                        SMC (Zero, RefOf (PMEE), RefOf (PMES))
                    }

                    Method (SLEP, 1, NotSerialized)
                    {
                        If (LEqual (Arg0, 0x01))
                        {
                            SMC (One, RefOf (RI1E), RefOf (RI1S))
                            SMC (One, RefOf (RI2E), RefOf (RI2S))
                            SMC (One, RefOf (KBDE), RefOf (KBDS))
                            SMC (One, RefOf (MOUE), RefOf (MOUS))
                            SMC (One, RefOf (PMEE), RefOf (PMES))
                        }
                    }

                    Method (SMC, 3, NotSerialized)
                    {
                        If (Arg0)
                        {
                            Store (One, Arg2)
                            Store (One, Arg1)
                        }
                        Else
                        {
                            Store (Zero, Arg1)
                            Store (One, Arg2)
                        }
                    }

                    Device (KEYB)
                    {
                        Name (_HID, EisaId ("PNP0303"))  // _HID: Hardware ID
                        Name (_STA, 0x0F)  // _STA: Status
                        Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                        {
                            IO (Decode16,
                                0x0060,             // Range Minimum
                                0x0060,             // Range Maximum
                                0x01,               // Alignment
                                0x01,               // Length
                                )
                            IO (Decode16,
                                0x0064,             // Range Minimum
                                0x0064,             // Range Maximum
                                0x01,               // Alignment
                                0x01,               // Length
                                )
                            IRQ (Edge, ActiveHigh, Exclusive, )
                                {1}
                        })
                    }

                    Device (PS2M)
                    {
                        Name (_HID, EisaId ("PNP0F13"))  // _HID: Hardware ID
                        Method (_STA, 0, NotSerialized)  // _STA: Status
                        {
                            Store (0x55, INDX)
                            Store (0x07, FUNC)
                            If (DIR2)
                            {
                                Store (0x0F, Local0)
                            }
                            Else
                            {
                                Store (0x08, Local0)
                            }

                            Store (0xAA, INDX)
                            Return (Local0)
                        }

                        Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
                        {
                            IRQ (Edge, ActiveHigh, Exclusive, )
                                {12}
                        })
                    }

                    Device (FDC)
                    {
                        Name (_HID, EisaId ("PNP0700"))  // _HID: Hardware ID
                        Method (_STA, 0, NotSerialized)  // _STA: Status
                        {
                            Store (0x55, INDX)
                            Store (0x00, FUNC)
                            If (LEqual (FDEN, 0x01))
                            {
                                If (DEN)
                                {
                                    Store (0x0F, Local0)
                                }
                                Else
                                {
                                    Store (0x0D, Local0)
                                }
                            }
                            Else
                            {
                                Store (0x08, Local0)
                            }

                            Store (0xAA, INDX)
                            Return (Local0)
                        }

                        Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                        {
                            Store (0x55, INDX)
                            Store (0x00, FUNC)
                            Store (Zero, DEN)
                            And (FDCX, Not (FDAD), FDCX)
                            Store (Zero, FDAD)
                            Store (0xAA, INDX)
                        }

                        Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                        {
                            Name (BUFF, ResourceTemplate ()
                            {
                                IO (Decode16,
                                    0x03F0,             // Range Minimum
                                    0x03F0,             // Range Maximum
                                    0x01,               // Alignment
                                    0x06,               // Length
                                    )
                                IO (Decode16,
                                    0x03F7,             // Range Minimum
                                    0x03F7,             // Range Maximum
                                    0x01,               // Alignment
                                    0x01,               // Length
                                    )
                                DMA (Compatibility, NotBusMaster, Transfer16, )
                                    {2}
                                IRQNoFlags ()
                                    {6}
                            })
                            Return (BUFF)
                        }

                        Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                        {
                            IO (Decode16,
                                0x03F0,             // Range Minimum
                                0x03F0,             // Range Maximum
                                0x01,               // Alignment
                                0x06,               // Length
                                )
                            IO (Decode16,
                                0x03F7,             // Range Minimum
                                0x03F7,             // Range Maximum
                                0x01,               // Alignment
                                0x01,               // Length
                                )
                            DMA (Compatibility, NotBusMaster, Transfer16, )
                                {2}
                            IRQNoFlags ()
                                {6}
                        })
                        Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                        {
                            Store (0x55, INDX)
                            Store (0x00, FUNC)
                            Store (One, DEN)
                            Or (0x01, FDAD)
                            Or (FDCX, FDAD, FDCX)
                            Store (0xAA, INDX)
                        }
                    }

                    Device (COM1)
                    {
                        Name (_HID, EisaId ("PNP0501"))  // _HID: Hardware ID
                        Name (_UID, 0x01)  // _UID: Unique ID
                        Method (_STA, 0, NotSerialized)  // _STA: Status
                        {
                            Store (0x55, INDX)
                            Store (0x05, FUNC)
                            If (LEqual (C2EN, 0x01))
                            {
                                If (DEN)
                                {
                                    Store (0x0F, Local0)
                                }
                                Else
                                {
                                    Store (0x0D, Local0)
                                }
                            }
                            Else
                            {
                                Store (0x08, Local0)
                            }

                            Store (0xAA, INDX)
                            Return (Local0)
                        }

                        Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
                        {
                            Store (0x55, INDX)
                            Store (0x05, FUNC)
                            Store (Zero, DEN)
                            Or (OPT1, 0x20, OPT1)
                            And (SERX, Not (C2AD), SERX)
                            Store (Zero, C2AD)
                            Store (0xAA, INDX)
                        }

                        Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                        {
                            Store (0x55, INDX)
                            Store (0x05, FUNC)
                            Name (BUFF, ResourceTemplate ()
                            {
                                IO (Decode16,
                                    0x0000,             // Range Minimum
                                    0x0000,             // Range Maximum
                                    0x08,               // Alignment
                                    0x08,               // Length
                                    _Y09)
                                IRQNoFlags (_Y0A)
                                    {0}
                            })
                            CreateByteField (BUFF, \_SB.PCI0.LPC.SIO.COM1._CRS._Y09._MIN, AD1L)  // _MIN: Minimum Base Address
                            CreateByteField (BUFF, 0x03, AD1H)
                            CreateByteField (BUFF, \_SB.PCI0.LPC.SIO.COM1._CRS._Y09._MAX, AD2L)  // _MAX: Maximum Base Address
                            CreateByteField (BUFF, 0x05, AD2H)
                            Store (DADL, AD1L)
                            Store (DADH, AD1H)
                            Store (DADL, AD2L)
                            Store (DADH, AD2H)
                            CreateWordField (BUFF, \_SB.PCI0.LPC.SIO.COM1._CRS._Y0A._INT, IRQS)  // _INT: Interrupts
                            Store (One, Local0)
                            ShiftLeft (Local0, DIR, IRQS)
                            Store (0xAA, INDX)
                            Return (BUFF)
                        }

                        Name (_PRS, ResourceTemplate ()  // _PRS: Possible Resource Settings
                        {
                            StartDependentFn (0x00, 0x00)
                            {
                                IO (Decode16,
                                    0x02F8,             // Range Minimum
                                    0x02F8,             // Range Maximum
                                    0x08,               // Alignment
                                    0x08,               // Length
                                    )
                                IRQNoFlags ()
                                    {3}
                            }
                            StartDependentFn (0x01, 0x01)
                            {
                                IO (Decode16,
                                    0x02E8,             // Range Minimum
                                    0x02E8,             // Range Maximum
                                    0x08,               // Alignment
                                    0x08,               // Length
                                    )
                                IRQNoFlags ()
                                    {3}
                            }
                            StartDependentFn (0x02, 0x02)
                            {
                                IO (Decode16,
                                    0x03F8,             // Range Minimum
                                    0x03F8,             // Range Maximum
                                    0x08,               // Alignment
                                    0x08,               // Length
                                    )
                                IRQNoFlags ()
                                    {4}
                            }
                            StartDependentFn (0x02, 0x02)
                            {
                                IO (Decode16,
                                    0x03E8,             // Range Minimum
                                    0x03E8,             // Range Maximum
                                    0x08,               // Alignment
                                    0x08,               // Length
                                    )
                                IRQNoFlags ()
                                    {4}
                            }
                            EndDependentFn ()
                        })
                        Name (CM2L, Package (0x04)
                        {
                            0x03F8, 
                            0x02F8, 
                            0x02E8, 
                            0x03E8
                        })
                        Name (CM2C, Package (0x04)
                        {
                            0x01, 
                            0x02, 
                            0x20, 
                            0x80
                        })
                        Method (_SRS, 1, NotSerialized)  // _SRS: Set Resource Settings
                        {
                            Store (0x55, INDX)
                            Store (0x05, FUNC)
                            CreateByteField (Arg0, 0x02, IOSL)
                            CreateByteField (Arg0, 0x03, IOSH)
                            CreateWordField (Arg0, 0x02, IOSA)
                            CreateWordField (Arg0, 0x09, IRQS)
                            Store (IOSL, DADL)
                            Store (IOSH, DADH)
                            Store (DerefOf (Index (CM2C, Match (CM2L, MEQ, IOSA, MTR, 0x00, 
                                0x00))), C2AD)
                            Or (SERX, C2AD, SERX)
                            FindSetRightBit (IRQS, Local0)
                            If (Local0)
                            {
                                Decrement (Local0)
                            }

                            Store (Local0, DIR)
                            Store (One, DEN)
                            And (OPT1, LNot (0x20), OPT1)
                            Store (0xAA, INDX)
                        }
                    }
                }
            }
        }
    }
}

