Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Sep 2003 13:07:10 +0200
From:      des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=)
To:        current@freebsd.org
Subject:   ACPI problems on MSI K7D
Message-ID:  <xzpllt3v6ht.fsf@dwp.des.no>

next in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Dual AthlonMP 2200+ on MSI K7D Master-L (AMD 760 MPX chipset) panics
during boot when ACPI is enabled:

[...]
 cpu0(BSP): apic id:  0, version: 0x00040010, at 0xfee00000
 cpu1(AP):  apic id:  1, version: 0x00040010, at 0xfee00000
 io0(APIC): apic id:  2, version: 0x00170011, at 0xfec00000
bios32: Found BIOS32 Service Directory header at 0xc00fac90
bios32: Entry =3D 0xfb100 (c00fb100)  Rev =3D 0  Len =3D 1
pcibios: PCI BIOS entry at 0xf0000+0xb130
pnpbios: Found PnP BIOS data at 0xc00fbb30
pnpbios: Entry =3D f0000:bb60  Rev =3D 1.0
Other BIOS signatures found:
null: <null device, zero device>
mem: <memory & I/O>
Pentium Pro MTRR support enabled
random: <entropy source>
SMP: CPU0 bsp_apic_configure():
     lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <AMD2P  AWRDACPI> on motherboard
pci_open(1):    mode 1 addr port (0x0cf8) is 0x80ff003c
pci_open(2):    mode 2 enable port (0x0cf8) is 0xff
panic: AcpiOsDerivePciId unable to initialize pci bus
cpuid =3D 0; lapic.id =3D 00000000
Debugger("panic")
Stopped at      Debugger+0x4e:  xchgl   %ebc,in_Debugger.0
db>=20

This was copied by hand as I don't have a serial console hooked up to
the box.

I tested a 5.0 DP#3 installation CD I had lying around, and it seems
to handle ACPI just fine, though it hangs while or immediately after
mounting root.

I've attached a dmesg from a "normal" boot (hint.acpi.0.disabled=3D"1")
and the disassembled DSDT.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no


--=-=-=
Content-Disposition: attachment; filename=dmesg.txt

Copyright (c) 1992-2003 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD 5.1-CURRENT #9: Mon Sep  1 19:06:40 CEST 2003
    des@meali.registrar.no:/usr/src/sys/i386/compile/meali
Preloaded elf kernel "/boot/kernel/kernel" at 0xc0408000.
Preloaded elf module "/boot/kernel/snd_ich.ko" at 0xc04081cc.
Preloaded elf module "/boot/kernel/snd_pcm.ko" at 0xc0408278.
Preloaded elf module "/boot/kernel/usb.ko" at 0xc0408324.
Preloaded elf module "/boot/kernel/ums.ko" at 0xc04083cc.
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) MP 2200+ (1800.07-MHz 686-class CPU)
  Origin = "AuthenticAMD"  Id = 0x681  Stepping = 1
  Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
  AMD Features=0xc0480000<MP,AMIE,DSP,3DNow!>
real memory  = 1073676288 (1023 MB)
avail memory = 1038675968 (990 MB)
Programming 24 pins in IOAPIC #0
IOAPIC #0 intpin 2 -> irq 0
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): apic id:  0, version: 0x00040010, at 0xfee00000
 cpu1 (AP):  apic id:  1, version: 0x00040010, at 0xfee00000
 io0 (APIC): apic id:  2, version: 0x00170011, at 0xfec00000
Pentium Pro MTRR support enabled
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcibios: BIOS version 2.10
Using $PIR table, 11 entries at 0xc00fdec0
pcib0: <Host to PCI bridge> at pcibus 0 on motherboard
pci0: <PCI bus> on pcib0
IOAPIC #0 intpin 17 -> irq 2
agp0: <AMD 762 host to AGP bridge> port 0xec00-0xec03 mem 0xfc000000-0xfc000fff,0xe8000000-0xefffffff at device 0.0 on pci0
pcib1: <PCIBIOS PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
pci1: <display, VGA> at device 5.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <AMD 768 UDMA100 controller> port 0xe000-0xe00f at device 7.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
pci0: <bridge, PCI-unknown> at device 7.3 (no driver attached)
pcm0: <AMD-768> port 0xe800-0xe83f,0xe400-0xe4ff irq 2 at device 7.5 on pci0
pcm0: <Avance Logic ALC200 AC97 Codec>
pcib2: <PCIBIOS PCI-PCI bridge> at device 16.0 on pci0
pci2: <PCI bus> on pcib2
IOAPIC #0 intpin 19 -> irq 11
ohci0: <OHCI (generic) USB controller> mem 0xfb020000-0xfb020fff irq 11 at device 0.0 on pci2
usb0: OHCI version 1.0, legacy support
usb0: <OHCI (generic) USB controller> on ohci0
usb0: USB revision 1.0
uhub0: AMD OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 4 ports with 4 removable, self powered
ums0: Logitech USB-PS/2 Optical Mouse, rev 2.00/11.10, addr 2, iclass 3/1
ums0: 3 buttons and Z dir.
pci2: <network, ethernet> at device 9.0 (no driver attached)
orm0: <Option ROMs> at iomem 0xd0000-0xd17ff,0xc0000-0xccfff on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x64,0x60 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> at port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
unknown: <PNP0303> can't assign resources (port)
unknown: <PNP0501> can't assign resources (port)
unknown: <PNP0700> can't assign resources (port)
unknown: <PNP0400> can't assign resources (port)
unknown: <PNP0501> can't assign resources (port)
APIC_IO: Testing 8254 interrupt delivery
APIC_IO: routing 8254 via IOAPIC #0 intpin 2

Timecounters tick every 10.000 msec
GEOM: create disk ad0 dp=0xc6296470
ad0: 39205MB <Maxtor 2F040J0> [79656/16/63] at ata0-master UDMA100
acd0: CDRW <HL-DT-ST GCE-8520B> at ata1-master UDMA33
SMP: AP CPU #1 Launched!
Mounting root from ufs:/dev/ad0s1a
fxp0: <Intel 82551 Pro/100 Ethernet> port 0xd000-0xd03f mem 0xfb000000-0xfb01ffff,0xfb021000-0xfb021fff irq 2 at device 9.0 on pci2
fxp0: Ethernet address 00:0c:76:27:c9:43
miibus0: <MII bus> on fxp0
inphy0: <i82555 10/100 media interface> on miibus0
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ipfw2 initialized, divert disabled, rule-based forwarding enabled, default to deny, logging disabled

--=-=-=
Content-Disposition: attachment; filename=dsdt.txt

/*
 * Intel ACPI Component Architecture
 * AML Disassembler version 20030619
 *
 * Disassembly of /tmp/acpidump.uJ77zc, Fri Sep  5 13:00:08 2003
 */
DefinitionBlock ("DSDT.aml", "DSDT", 1, "AMD2P ", "AWRDACPI", 4096)
{
    Scope (\_PR)
    {
        Processor (\_PR.CPU0, 0x00, 0x00000000, 0x00) {}
    }

    Scope (\_PR)
    {
        Processor (\_PR.CPU1, 0x01, 0x00000000, 0x00) {}
    }

    Name (\_S0, Package (0x04)
    {
        0x00, 
        0x00, 
        0x00, 
        0x00
    })
    Name (\_S1, Package (0x04)
    {
        0x01, 
        0x01, 
        0x01, 
        0x01
    })
    Name (\SS3, Package (0x04)
    {
        0x05, 
        0x05, 
        0x05, 
        0x05
    })
    Name (\_S4, Package (0x04)
    {
        0x06, 
        0x06, 
        0x06, 
        0x06
    })
    Name (\_S5, Package (0x04)
    {
        0x07, 
        0x07, 
        0x07, 
        0x07
    })
    OperationRegion (\DEBG, SystemIO, 0x80, 0x01)
    Field (\DEBG, ByteAcc, NoLock, Preserve)
    {
        DBG1,   8
    }

    OperationRegion (EXTM, SystemMemory, 0x000FF830, 0x10)
    Field (EXTM, WordAcc, NoLock, Preserve)
    {
        ROM1,   16, 
        RMS1,   16, 
        ROM2,   16, 
        RMS2,   16, 
        ROM3,   16, 
        RMS3,   16, 
        AMEM,   32
    }

    OperationRegion (ELCR, SystemIO, 0x04D0, 0x02)
    Field (ELCR, ByteAcc, NoLock, Preserve)
    {
        ELC1,   8, 
        ELC2,   8
    }

    OperationRegion (\PM10, SystemIO, 0x06, 0x01)
    Field (\PM10, ByteAcc, NoLock, Preserve)
    {
        PMS0,   8
    }

    OperationRegion (\PM11, SystemIO, 0x61, 0x01)
    Field (\PM11, ByteAcc, NoLock, Preserve)
    {
        PMS1,   8
    }

    OperationRegion (\PM12, SystemIO, 0x0620, 0x01)
    Field (\PM12, ByteAcc, NoLock, Preserve)
    {
        PMS2,   8
    }

    OperationRegion (\PM13, SystemIO, 0x0621, 0x01)
    Field (\PM13, ByteAcc, NoLock, Preserve)
    {
        PMS3,   8
    }

    OperationRegion (\PSC, SystemIO, 0x0627, 0x01)
    Field (\PSC, ByteAcc, NoLock, Preserve)
    {
        PSCC,   8
    }

    OperationRegion (\STUS, SystemIO, 0x0628, 0x01)
    Field (\STUS, ByteAcc, NoLock, Preserve)
    {
        G_ST,   8
    }

    OperationRegion (\STUB, SystemIO, 0x0629, 0x01)
    Field (\STUB, ByteAcc, NoLock, Preserve)
    {
        G_SB,   8
    }

    OperationRegion (\SMIC, SystemIO, 0x062F, 0x01)
    Field (\SMIC, ByteAcc, NoLock, Preserve)
    {
        SCP,    8
    }

    OperationRegion (\GP1, SystemIO, 0x06C0, 0x20)
    Field (\GP1, ByteAcc, NoLock, Preserve)
    {
        GP00,   8, 
        GP01,   8, 
        GP02,   8, 
        GP03,   8, 
        GP04,   8, 
        GP05,   8, 
        GP06,   8, 
        GP07,   8, 
        GP08,   8, 
        GP09,   8, 
        GP10,   8, 
        GP11,   8, 
        GP12,   8, 
        GP13,   8, 
        GP14,   8, 
        GP15,   8, 
        GP16,   8, 
        GP17,   8, 
        GP18,   8, 
        GP19,   8, 
        GP20,   8, 
        GP21,   8, 
        GP22,   8, 
        GP23,   8, 
        GP24,   8, 
        GP25,   8, 
        GP26,   8, 
        GP27,   8, 
        GP28,   8, 
        GP29,   8, 
        GP30,   8, 
        GP31,   8
    }

    Name (OSFL, 0x01)
    Method (STRC, 2, NotSerialized)
    {
        If (LNot (LEqual (SizeOf (Arg0), SizeOf (Arg1))))
        {
            Return (0x00)
        }

        Add (SizeOf (Arg0), 0x01, Local0)
        Name (BUF0, Buffer (Local0) {})
        Name (BUF1, Buffer (Local0) {})
        Store (Arg0, BUF0)
        Store (Arg1, BUF1)
        While (Local0)
        {
            Decrement (Local0)
            If (LNot (LEqual (DerefOf (Index (BUF0, Local0)), DerefOf (Index (BUF1, Local0)))))
            {
                Return (Zero)
            }
        }

        Return (One)
    }

    OperationRegion (RTCM, SystemIO, 0x70, 0x02)
    Field (RTCM, ByteAcc, NoLock, Preserve)
    {
        CMIN,   8, 
        CMDA,   8
    }

    IndexField (CMIN, CMDA, ByteAcc, NoLock, Preserve)
    {
        Offset (0x0F), 
        SHUT,   8
    }

    OperationRegion (INFO, SystemMemory, 0x000FF840, 0x01)
    Field (INFO, ByteAcc, NoLock, Preserve)
    {
        KBDI,   1, 
        RTCW,   1, 
        PS2F,   1, 
        IRFL,   2, 
        DISE,   1, 
        SSHU,   1
    }

    OperationRegion (BEEP, SystemIO, 0x61, 0x01)
    Field (BEEP, ByteAcc, NoLock, Preserve)
    {
        S1B,    8
    }

    OperationRegion (CONT, SystemIO, 0x40, 0x04)
    Field (CONT, ByteAcc, NoLock, Preserve)
    {
        CNT0,   8, 
        CNT1,   8, 
        CNT2,   8, 
        CTRL,   8
    }

    Method (SPKR, 1, NotSerialized)
    {
        Store (S1B, Local0)
        Store (0xB6, CTRL)
        Store (0x55, CNT2)
        Store (0x03, CNT2)
        Store (Arg0, Local2)
        While (LGreater (Local2, 0x00))
        {
            Or (S1B, 0x03, S1B)
            Store (0x5FFF, Local3)
            While (LGreater (Local3, 0x00))
            {
                Decrement (Local3)
            }

            And (S1B, 0xFC, S1B)
            Store (0x0EFF, Local3)
            While (LGreater (Local3, 0x00))
            {
                Decrement (Local3)
            }

            Decrement (Local2)
        }

        Store (Local0, S1B)
    }

    Scope (\)
    {
        Name (PICF, 0x00)
        Method (_PIC, 1, NotSerialized)
        {
            Store (Arg0, PICF)
        }
    }

    Method (CLRS, 0, NotSerialized)
    {
        Store (PMS0, Local1)
        Store (Local1, PMS0)
        Store (PMS1, Local1)
        Store (Local1, PMS1)
        Store (PMS2, Local1)
        Store (Local1, PMS2)
        Store (PMS3, Local1)
        Store (Local1, PMS3)
        Store (G_ST, Local1)
        Store (Local1, G_ST)
        Store (G_SB, Local1)
        Store (Local1, G_SB)
    }

    Method (\_PTS, 1, NotSerialized)
    {
        CLRS ()
        Or (Arg0, 0xF0, Local0)
        Store (Local0, DBG1)
        If (LNot (LEqual (Arg0, 0x05))) {}
        If (LEqual (Arg0, 0x01))
        {
            Store (Arg0, Local0)
            SALD (Local0)
        }

        If (LEqual (Arg0, 0x03))
        {
            Store (Arg0, Local0)
            SALD (Local0)
        }

        If (LEqual (Arg0, 0x04)) {}
        If (LEqual (Arg0, 0x05))
        {
            Store (G_ST, Local1)
            Store (Local1, G_ST)
            Store (G_SB, Local1)
            Store (Local1, G_SB)
        }
    }

    Method (\_WAK, 1, NotSerialized)
    {
        CLRS ()
        Store (0xFF, DBG1)
        Store (G_ST, Local1)
        Store (Local1, G_ST)
        Store (G_SB, Local1)
        Store (Local1, G_SB)
        SALD (0x00)
        Notify (\_SB.PWRB, 0x02)
    }

    Scope (\_SB)
    {
        Device (PWRB)
        {
            Name (_HID, EisaId ("PNP0C0C"))
            Method (_STA, 0, NotSerialized)
            {
                Return (0x0B)
            }
        }

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

        Device (MEM)
        {
            Name (_HID, EisaId ("PNP0C01"))
            Method (_CRS, 0, NotSerialized)
            {
                Name (BUF0, ResourceTemplate ()
                {
                    Memory32Fixed (ReadWrite, 0x000F0000, 0x00004000)
                    Memory32Fixed (ReadWrite, 0x000F4000, 0x00004000)
                    Memory32Fixed (ReadWrite, 0x000F8000, 0x00004000)
                    Memory32Fixed (ReadWrite, 0x000FC000, 0x00004000)
                    Memory32Fixed (ReadWrite, 0x00000000, 0x00010000)
                    Memory32Fixed (ReadWrite, 0xFFFF0000, 0x00010000)
                    Memory32Fixed (ReadWrite, 0x00000000, 0x000A0000)
                    Memory32Fixed (ReadWrite, 0x00100000, 0x00000000)
                    Memory32Fixed (ReadWrite, 0xFEC00000, 0x00001000)
                    Memory32Fixed (ReadWrite, 0xFEE00000, 0x00001000)
                })
                CreateDWordField (BUF0, 0x34, ACMM)
                CreateDWordField (BUF0, 0x04, RMA1)
                CreateDWordField (BUF0, 0x08, RSS1)
                CreateDWordField (BUF0, 0x10, RMA2)
                CreateDWordField (BUF0, 0x14, RSS2)
                CreateDWordField (BUF0, 0x1C, RMA3)
                CreateDWordField (BUF0, 0x20, RSS3)
                CreateDWordField (BUF0, 0x28, RMA4)
                CreateDWordField (BUF0, 0x2C, RSS4)
                CreateDWordField (BUF0, 0x5C, EXTM)
                Subtract (AMEM, 0x00100000, EXTM)
                If (LNot (LEqual (ROM1, Zero)))
                {
                    Store (RMA1, RMA2)
                    ShiftLeft (ROM1, 0x08, Local0)
                    Store (Local0, RMA1)
                    ShiftLeft (RMS1, 0x08, Local0)
                    Store (Local0, RSS1)
                    Store (0x8000, RSS2)
                }

                If (LNot (LEqual (ROM2, Zero)))
                {
                    Store (RMA2, RMA3)
                    ShiftLeft (ROM2, 0x08, Local0)
                    Store (Local0, RMA2)
                    ShiftLeft (RMS2, 0x08, Local0)
                    Store (Local0, RSS2)
                    Store (0xC000, RSS3)
                }

                If (LNot (LEqual (ROM3, Zero)))
                {
                    Store (RMA3, RMA4)
                    ShiftLeft (ROM3, 0x08, Local0)
                    Store (Local0, RMA3)
                    ShiftLeft (RMS3, 0x08, Local0)
                    Store (Local0, RSS3)
                    Store (0x00010000, RSS4)
                }

                Store (AMEM, ACMM)
                Return (BUF0)
            }
        }

        Device (PCI0)
        {
            Name (_HID, EisaId ("PNP0A03"))
            Name (_ADR, 0x00)
            Name (_UID, 0x01)
            Name (_BBN, 0x00)
            Name (SS3D, 0x02)
            Method (_STA, 0, NotSerialized)
            {
                Return (0x0F)
            }

            Name (_PRW, Package (0x02)
            {
                0x08, 
                0x05
            })
            Method (_CRS, 0, NotSerialized)
            {
                Name (BUF0, ResourceTemplate ()
                {
                    WordBusNumber (ResourceConsumer, MinNotFixed, MaxNotFixed, PosDecode,
                        0x0000,
                        0x0000,
                        0x00FF,
                        0x0000,
                        0x0100)
                    IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
                    WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                        0x0000,
                        0x0000,
                        0x0CF7,
                        0x0000,
                        0x0CF8)
                    WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                        0x0000,
                        0x0D00,
                        0xFFFF,
                        0x0000,
                        0xF300)
                    IO (Decode16, 0x0600, 0x0600, 0x01, 0xE0)
                    IO (Decode16, 0x06E0, 0x06E0, 0x01, 0x20)
                    DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                        0x00000000,
                        0x000A0000,
                        0x000BFFFF,
                        0x00000000,
                        0x00020000)
                    DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                        0x00000000,
                        0x000C0000,
                        0x000DFFFF,
                        0x00000000,
                        0x00020000)
                    DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                        0x00000000,
                        0x00100000,
                        0xFEBFFFFF,
                        0x00000000,
                        0xFFF00000)
                })
                CreateDWordField (BUF0, 0x86, TCMM)
                CreateDWordField (BUF0, 0x92, TOMM)
                Add (AMEM, 0x00010000, TCMM)
                Subtract (0xFEC00000, TCMM, TOMM)
                Return (BUF0)
            }

            Name (PICM, Package (0x10)
            {
                Package (0x04)
                {
                    0x0008FFFF, 
                    0x00, 
                    \_SB.PCI0.LNKA, 
                    0x00
                }, 

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

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

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

                Package (0x04)
                {
                    0x0009FFFF, 
                    0x00, 
                    \_SB.PCI0.LNKB, 
                    0x00
                }, 

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

                Package (0x04)
                {
                    0x0009FFFF, 
                    0x02, 
                    \_SB.PCI0.LNKD, 
                    0x00
                }, 

                Package (0x04)
                {
                    0x0009FFFF, 
                    0x03, 
                    \_SB.PCI0.LNKA, 
                    0x00
                }, 

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

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

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

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

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

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

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

                Package (0x04)
                {
                    0x0007FFFF, 
                    0x03, 
                    \_SB.PCI0.LNKD, 
                    0x00
                }
            })
            Name (APIC, Package (0x10)
            {
                Package (0x04)
                {
                    0x0008FFFF, 
                    0x00, 
                    0x00, 
                    0x10
                }, 

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

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

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

                Package (0x04)
                {
                    0x0009FFFF, 
                    0x00, 
                    0x00, 
                    0x11
                }, 

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

                Package (0x04)
                {
                    0x0009FFFF, 
                    0x02, 
                    0x00, 
                    0x13
                }, 

                Package (0x04)
                {
                    0x0009FFFF, 
                    0x03, 
                    0x00, 
                    0x10
                }, 

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

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

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

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

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

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

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

                Package (0x04)
                {
                    0x0007FFFF, 
                    0x03, 
                    0x00, 
                    0x13
                }
            })
            Method (_PRT, 0, NotSerialized)
            {
                If (LNot (PICF))
                {
                    Return (PICM)
                }
                Else
                {
                    Return (APIC)
                }
            }

            Device (SBC0)
            {
                Name (_ADR, 0x00070000)
            }

            Device (SBC3)
            {
                Name (_ADR, 0x00070003)
                OperationRegion (PIRQ, PCI_Config, 0x56, 0x02)
                Scope (\)
                {
                    Field (\_SB.PCI0.SBC3.PIRQ, ByteAcc, NoLock, Preserve)
                    {
                        PIRA,   8, 
                        PIRC,   8
                    }
                }
            }

            Scope (\)
            {
                Method (DISD, 1, NotSerialized)
                {
                }

                Method (CKIO, 2, NotSerialized)
                {
                }

                Method (SLDM, 2, NotSerialized)
                {
                }
            }

            Device (OP2P)
            {
                Name (_ADR, 0x00100000)
                Method (_STA, 0, NotSerialized)
                {
                    Return (0x0F)
                }

                Name (_PRW, Package (0x02)
                {
                    0x09, 
                    0x05
                })
                Device (IDE0)
                {
                    Name (_ADR, 0x00070001)
                    Name (REGF, 0x01)
                    Method (_REG, 2, NotSerialized)
                    {
                        If (LEqual (Arg0, 0x02))
                        {
                            Store (Arg1, REGF)
                        }
                    }

                    Name (TIM0, Package (0x0C)
                    {
                        Package (0x05)
                        {
                            0x78, 
                            0xB4, 
                            0xF0, 
                            0x017F, 
                            0x0384
                        }, 

                        Package (0x05)
                        {
                            0x20, 
                            0x22, 
                            0x42, 
                            0x65, 
                            0xA8
                        }, 

                        Package (0x08)
                        {
                            0x02, 
                            0x01, 
                            0x00, 
                            0x00, 
                            0x00, 
                            0x00, 
                            0x00, 
                            0x00
                        }, 

                        Package (0x08)
                        {
                            0x04, 
                            0x03, 
                            0x02, 
                            0x02, 
                            0x01, 
                            0x01, 
                            0x00, 
                            0x00
                        }, 

                        Package (0x06)
                        {
                            0x70, 
                            0x49, 
                            0x36, 
                            0x27, 
                            0x19, 
                            0x14
                        }, 

                        Package (0x05)
                        {
                            0x02, 
                            0x01, 
                            0x00, 
                            0x00, 
                            0x00
                        }, 

                        Package (0x05)
                        {
                            0x06, 
                            0x04, 
                            0x02, 
                            0x01, 
                            0x00
                        }, 

                        Package (0x05)
                        {
                            0x00, 
                            0x00, 
                            0x00, 
                            0x01, 
                            0x01
                        }, 

                        Package (0x04)
                        {
                            0x04, 
                            0x03, 
                            0x02, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x02, 
                            0x01, 
                            0x00, 
                            0x00
                        }, 

                        Package (0x08)
                        {
                            0x05, 
                            0x04, 
                            0x03, 
                            0x02, 
                            0x02, 
                            0x01, 
                            0x01, 
                            0x00
                        }, 

                        Package (0x06)
                        {
                            0x02, 
                            0x01, 
                            0x00, 
                            0x04, 
                            0x05, 
                            0x06
                        }
                    })
                    Name (TMD0, Buffer (0x14) {})
                    CreateDWordField (TMD0, 0x00, PIO0)
                    CreateDWordField (TMD0, 0x04, DMA0)
                    CreateDWordField (TMD0, 0x08, PIO1)
                    CreateDWordField (TMD0, 0x0C, DMA1)
                    CreateDWordField (TMD0, 0x10, CHNF)
                    OperationRegion (CFG2, PCI_Config, 0x40, 0x20)
                    Field (CFG2, DWordAcc, NoLock, Preserve)
                    {
                        Offset (0x08), 
                        SSPT,   8, 
                        SMPT,   8, 
                        PSPT,   8, 
                        PMPT,   8, 
                        Offset (0x10), 
                        SSUT,   3, 
                            ,   3, 
                        SSUE,   2, 
                        SMUT,   3, 
                            ,   3, 
                        SMUE,   2, 
                        PSUT,   3, 
                            ,   3, 
                        PSUE,   2, 
                        PMUT,   3, 
                            ,   3, 
                        PMUE,   2
                    }

                    Name (GMPT, 0x00)
                    Name (GMUE, 0x00)
                    Name (GMUT, 0x00)
                    Name (GSPT, 0x00)
                    Name (GSUE, 0x00)
                    Name (GSUT, 0x00)
                    Name (GBCS, 0x00)
                    Device (CHN0)
                    {
                        Name (_ADR, 0x00)
                        Method (_GTM, 0, NotSerialized)
                        {
                            Return (GTM (PMPT, PMUE, PMUT, PSPT, PSUE, PSUT))
                        }

                        Method (_STM, 3, NotSerialized)
                        {
                            Store (Arg0, TMD0)
                            Store (PMPT, GMPT)
                            Store (PMUE, GMUE)
                            Store (PMUT, GMUT)
                            Store (PSPT, GSPT)
                            Store (PSUE, GSUE)
                            Store (PSUT, GSUT)
                            STM ()
                            Store (GMPT, PMPT)
                            Store (GMUE, PMUE)
                            Store (GMUT, PMUT)
                            Store (GSPT, PSPT)
                            Store (GSUE, PSUE)
                            Store (GSUT, PSUT)
                        }

                        Device (DRV0)
                        {
                            Name (_ADR, 0x00)
                            Method (_GTF, 0, NotSerialized)
                            {
                                Return (GTF (0x00, PMUE, PMUT, PMPT))
                            }
                        }

                        Device (DRV1)
                        {
                            Name (_ADR, 0x01)
                            Method (_GTF, 0, NotSerialized)
                            {
                                Return (GTF (0x01, PSUE, PSUT, PSPT))
                            }
                        }
                    }

                    Device (CHN1)
                    {
                        Name (_ADR, 0x01)
                        Method (_GTM, 0, NotSerialized)
                        {
                            Return (GTM (SMPT, SMUE, SMUT, SSPT, SSUE, SSUT))
                        }

                        Method (_STM, 3, NotSerialized)
                        {
                            Store (Arg0, TMD0)
                            Store (SMPT, GMPT)
                            Store (SMUE, GMUE)
                            Store (SMUT, GMUT)
                            Store (SSPT, GSPT)
                            Store (SSUE, GSUE)
                            Store (SSUT, GSUT)
                            STM ()
                            Store (GMPT, SMPT)
                            Store (GMUE, SMUE)
                            Store (GMUT, SMUT)
                            Store (GSPT, SSPT)
                            Store (GSUE, SSUE)
                            Store (GSUT, SSUT)
                        }

                        Device (DRV0)
                        {
                            Name (_ADR, 0x00)
                            Method (_GTF, 0, NotSerialized)
                            {
                                Return (GTF (0x02, SMUE, SMUT, SMPT))
                            }
                        }

                        Device (DRV1)
                        {
                            Name (_ADR, 0x01)
                            Method (_GTF, 0, NotSerialized)
                            {
                                Return (GTF (0x03, SSUE, SSUT, SSPT))
                            }
                        }
                    }

                    Method (GTF, 4, Serialized)
                    {
                        Store (Buffer (0x07)
                            {
                                0x03, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xEF
                            }, Local1)
                        Store (Buffer (0x07)
                            {
                                0x03, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xEF
                            }, Local2)
                        CreateByteField (Local1, 0x01, MODE)
                        CreateByteField (Local2, 0x01, UMOD)
                        CreateByteField (Local1, 0x05, PCHA)
                        CreateByteField (Local2, 0x05, UCHA)
                        And (Arg0, 0x03, Local3)
                        If (LEqual (And (Local3, 0x01), 0x01))
                        {
                            Store (0xB0, PCHA)
                            Store (0xB0, UCHA)
                        }

                        If (Arg1)
                        {
                            Store (DerefOf (Index (DerefOf (Index (TIM0, 0x0A)), Arg2)), UMOD)
                            Or (UMOD, 0x40, UMOD)
                        }
                        Else
                        {
                            Store (Match (DerefOf (Index (TIM0, 0x01)), MEQ, Arg3, MTR, 0x00, 0x00), Local0)
                            Or (0x20, DerefOf (Index (DerefOf (Index (TIM0, 0x09)), Local0)), UMOD)
                        }

                        Store (Match (DerefOf (Index (TIM0, 0x01)), MEQ, Arg3, MTR, 0x00, 0x00), Local0)
                        Or (0x08, DerefOf (Index (DerefOf (Index (TIM0, 0x08)), Local0)), MODE)
                        Concatenate (Local1, Local2, Local6)
                        Return (Local6)
                    }

                    Method (GTM, 6, Serialized)
                    {
                        Store (Ones, PIO0)
                        Store (Ones, PIO1)
                        Store (Ones, DMA0)
                        Store (Ones, DMA1)
                        Store (0x10, CHNF)
                        If (REGF) {}
                        Else
                        {
                            Return (TMD0)
                        }

                        Store (Match (DerefOf (Index (TIM0, 0x01)), MEQ, Arg0, MTR, 0x00, 0x00), Local6)
                        Store (DerefOf (Index (DerefOf (Index (TIM0, 0x00)), Local6)), Local7)
                        Store (Local7, DMA0)
                        Store (Local7, PIO0)
                        Store (Match (DerefOf (Index (TIM0, 0x01)), MEQ, Arg3, MTR, 0x00, 0x00), Local6)
                        Store (DerefOf (Index (DerefOf (Index (TIM0, 0x00)), Local6)), Local7)
                        Store (Local7, DMA1)
                        Store (Local7, PIO1)
                        If (Arg1)
                        {
                            Store (DerefOf (Index (DerefOf (Index (TIM0, 0x0A)), Arg2)), Local5)
                            Store (DerefOf (Index (DerefOf (Index (TIM0, 0x04)), Local5)), DMA0)
                            Or (CHNF, 0x01, CHNF)
                        }

                        If (Arg4)
                        {
                            Store (DerefOf (Index (DerefOf (Index (TIM0, 0x0A)), Arg5)), Local5)
                            Store (DerefOf (Index (DerefOf (Index (TIM0, 0x04)), Local5)), DMA1)
                            Or (CHNF, 0x04, CHNF)
                        }

                        Return (TMD0)
                    }

                    Method (STM, 0, Serialized)
                    {
                        If (REGF) {}
                        Else
                        {
                            Return (TMD0)
                        }

                        Store (0x00, GMUE)
                        Store (0x00, GSUE)
                        Store (0x03, GMUT)
                        Store (0x03, GSUT)
                        If (And (CHNF, 0x01))
                        {
                            Store (Match (DerefOf (Index (TIM0, 0x04)), MLE, DMA0, MTR, 0x00, 0x00), Local0)
                            Store (DerefOf (Index (DerefOf (Index (TIM0, 0x0B)), Local0)), GMUT)
                            Or (GMUE, 0x03, GMUE)
                        }
                        Else
                        {
                            If (Or (LEqual (PIO0, Ones), LEqual (PIO0, 0x00)))
                            {
                                If (And (LLess (DMA0, Ones), LGreater (DMA0, 0x00)))
                                {
                                    Store (DMA0, PIO0)
                                }
                            }
                        }

                        If (And (CHNF, 0x04))
                        {
                            Store (Match (DerefOf (Index (TIM0, 0x04)), MLE, DMA1, MTR, 0x00, 0x00), Local0)
                            Store (DerefOf (Index (DerefOf (Index (TIM0, 0x0B)), Local0)), GSUT)
                            Or (GSUE, 0x03, GSUE)
                        }
                        Else
                        {
                            If (Or (LEqual (PIO1, Ones), LEqual (PIO1, 0x00)))
                            {
                                If (And (LLess (DMA1, Ones), LGreater (DMA1, 0x00)))
                                {
                                    Store (DMA1, PIO1)
                                }
                            }
                        }

                        And (Match (DerefOf (Index (TIM0, 0x00)), MGE, PIO0, MTR, 0x00, 0x00), 0x03, Local0)
                        Store (DerefOf (Index (DerefOf (Index (TIM0, 0x01)), Local0)), Local1)
                        Store (Local1, GMPT)
                        And (Match (DerefOf (Index (TIM0, 0x00)), MGE, PIO1, MTR, 0x00, 0x00), 0x03, Local0)
                        Store (DerefOf (Index (DerefOf (Index (TIM0, 0x01)), Local0)), Local1)
                        Store (Local1, GSPT)
                    }
                }

                Device (USB0)
                {
                    Name (_ADR, 0x00)
                    Name (_PRW, Package (0x02)
                    {
                        0x0F, 
                        0x03
                    })
                    Name (SS3D, 0x03)
                }

                Name (PICM, Package (0x14)
                {
                    Package (0x04)
                    {
                        0xFFFF, 
                        0x00, 
                        \_SB.PCI0.LNKD, 
                        0x00
                    }, 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Package (0x04)
                    {
                        0x0006FFFF, 
                        0x03, 
                        \_SB.PCI0.LNKB, 
                        0x00
                    }, 

                    Package (0x04)
                    {
                        0x0009FFFF, 
                        0x00, 
                        \_SB.PCI0.LNKB, 
                        0x00
                    }, 

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

                    Package (0x04)
                    {
                        0x0009FFFF, 
                        0x02, 
                        \_SB.PCI0.LNKD, 
                        0x00
                    }, 

                    Package (0x04)
                    {
                        0x0009FFFF, 
                        0x03, 
                        \_SB.PCI0.LNKA, 
                        0x00
                    }
                })
                Name (APIC, Package (0x14)
                {
                    Package (0x04)
                    {
                        0xFFFF, 
                        0x00, 
                        0x00, 
                        0x10
                    }, 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Package (0x04)
                    {
                        0x0009FFFF, 
                        0x00, 
                        0x00, 
                        0x11
                    }, 

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

                    Package (0x04)
                    {
                        0x0009FFFF, 
                        0x02, 
                        0x00, 
                        0x13
                    }, 

                    Package (0x04)
                    {
                        0x0009FFFF, 
                        0x03, 
                        0x00, 
                        0x10
                    }
                })
                Method (_PRT, 0, NotSerialized)
                {
                    If (LNot (PICF))
                    {
                        Return (PICM)
                    }
                    Else
                    {
                        Return (APIC)
                    }
                }
            }

            Device (AGPP)
            {
                Name (_ADR, 0x00010000)
                Method (_STA, 0, NotSerialized)
                {
                    Return (0x0F)
                }

                Device (AGP)
                {
                    Name (_ADR, 0x00050000)
                    Name (SS3D, 0x02)
                }

                Name (PICM, Package (0x04)
                {
                    Package (0x04)
                    {
                        0x0005FFFF, 
                        0x00, 
                        \_SB.PCI0.LNKB, 
                        0x00
                    }, 

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

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

                    Package (0x04)
                    {
                        0x0005FFFF, 
                        0x03, 
                        \_SB.PCI0.LNKA, 
                        0x00
                    }
                })
                Name (APIC, Package (0x04)
                {
                    Package (0x04)
                    {
                        0x0005FFFF, 
                        0x00, 
                        0x00, 
                        0x11
                    }, 

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

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

                    Package (0x04)
                    {
                        0x0005FFFF, 
                        0x03, 
                        0x00, 
                        0x10
                    }
                })
                Method (_PRT, 0, NotSerialized)
                {
                    If (LNot (PICF))
                    {
                        Return (PICM)
                    }
                    Else
                    {
                        Return (APIC)
                    }
                }
            }

            Device (LNKA)
            {
                Name (_HID, EisaId ("PNP0C0F"))
                Name (_UID, 0x01)
                Method (_STA, 0, NotSerialized)
                {
                    And (PIRA, 0x0F, Local0)
                    If (LEqual (Local0, 0x00))
                    {
                        Return (0x09)
                    }
                    Else
                    {
                        Return (0x0B)
                    }
                }

                Method (_PRS, 0, NotSerialized)
                {
                    Name (BUFB, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11,12,14,15}
                    })
                    Return (BUFB)
                }

                Method (_DIS, 0, NotSerialized)
                {
                    And (PIRA, 0xF0, PIRA)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUFB, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {}
                    })
                    CreateByteField (BUFB, 0x01, IRB1)
                    CreateByteField (BUFB, 0x02, IRB2)
                    Store (0x00, Local3)
                    Store (0x00, Local4)
                    And (PIRA, 0x0F, Local1)
                    If (LNot (LEqual (Local1, 0x00)))
                    {
                        If (LGreater (Local1, 0x07))
                        {
                            Subtract (Local1, 0x08, Local2)
                            ShiftLeft (One, Local2, Local4)
                        }
                        Else
                        {
                            If (LGreater (Local1, 0x00))
                            {
                                ShiftLeft (One, Local1, Local3)
                            }
                        }

                        Store (Local3, IRB1)
                        Store (Local4, IRB2)
                    }

                    Return (BUFB)
                }

                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x01, IRB1)
                    CreateByteField (Arg0, 0x02, IRB2)
                    ShiftLeft (IRB2, 0x08, Local0)
                    Or (Local0, IRB1, Local0)
                    Store (0x00, Local1)
                    ShiftRight (Local0, 0x01, Local0)
                    While (LGreater (Local0, 0x00))
                    {
                        Increment (Local1)
                        ShiftRight (Local0, 0x01, Local0)
                    }

                    And (PIRA, 0xF0, PIRA)
                    Or (PIRA, Local1, PIRA)
                }
            }

            Device (LNKB)
            {
                Name (_HID, EisaId ("PNP0C0F"))
                Name (_UID, 0x02)
                Method (_STA, 0, NotSerialized)
                {
                    And (PIRA, 0xF0, Local0)
                    If (LEqual (Local0, 0x00))
                    {
                        Return (0x09)
                    }
                    Else
                    {
                        Return (0x0B)
                    }
                }

                Method (_PRS, 0, NotSerialized)
                {
                    Name (BUFB, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11,12,14,15}
                    })
                    Return (BUFB)
                }

                Method (_DIS, 0, NotSerialized)
                {
                    And (PIRA, 0x0F, PIRA)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUFB, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {}
                    })
                    CreateByteField (BUFB, 0x01, IRB1)
                    CreateByteField (BUFB, 0x02, IRB2)
                    Store (0x00, Local3)
                    Store (0x00, Local4)
                    And (PIRA, 0xF0, Local1)
                    ShiftRight (Local1, 0x04, Local1)
                    If (LNot (LEqual (Local1, 0x00)))
                    {
                        If (LGreater (Local1, 0x07))
                        {
                            Subtract (Local1, 0x08, Local2)
                            ShiftLeft (One, Local2, Local4)
                        }
                        Else
                        {
                            If (LGreater (Local1, 0x00))
                            {
                                ShiftLeft (One, Local1, Local3)
                            }
                        }

                        Store (Local3, IRB1)
                        Store (Local4, IRB2)
                    }

                    Return (BUFB)
                }

                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x01, IRB1)
                    CreateByteField (Arg0, 0x02, IRB2)
                    ShiftLeft (IRB2, 0x08, Local0)
                    Or (Local0, IRB1, Local0)
                    Store (0x00, Local1)
                    ShiftRight (Local0, 0x01, Local0)
                    While (LGreater (Local0, 0x00))
                    {
                        Increment (Local1)
                        ShiftRight (Local0, 0x01, Local0)
                    }

                    And (PIRA, 0x0F, PIRA)
                    ShiftLeft (Local1, 0x04, Local1)
                    Or (PIRA, Local1, PIRA)
                }
            }

            Device (LNKC)
            {
                Name (_HID, EisaId ("PNP0C0F"))
                Name (_UID, 0x03)
                Method (_STA, 0, NotSerialized)
                {
                    And (PIRC, 0x0F, Local0)
                    If (LEqual (Local0, 0x00))
                    {
                        Return (0x09)
                    }
                    Else
                    {
                        Return (0x0B)
                    }
                }

                Method (_PRS, 0, NotSerialized)
                {
                    Name (BUFB, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11,12,14,15}
                    })
                    Return (BUFB)
                }

                Method (_DIS, 0, NotSerialized)
                {
                    And (PIRC, 0xF0, PIRC)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUFB, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {}
                    })
                    CreateByteField (BUFB, 0x01, IRB1)
                    CreateByteField (BUFB, 0x02, IRB2)
                    Store (0x00, Local3)
                    Store (0x00, Local4)
                    And (PIRC, 0x0F, Local1)
                    If (LNot (LEqual (Local1, 0x00)))
                    {
                        If (LGreater (Local1, 0x07))
                        {
                            Subtract (Local1, 0x08, Local2)
                            ShiftLeft (One, Local2, Local4)
                        }
                        Else
                        {
                            If (LGreater (Local1, 0x00))
                            {
                                ShiftLeft (One, Local1, Local3)
                            }
                        }

                        Store (Local3, IRB1)
                        Store (Local4, IRB2)
                    }

                    Return (BUFB)
                }

                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x01, IRB1)
                    CreateByteField (Arg0, 0x02, IRB2)
                    ShiftLeft (IRB2, 0x08, Local0)
                    Or (Local0, IRB1, Local0)
                    Store (0x00, Local1)
                    ShiftRight (Local0, 0x01, Local0)
                    While (LGreater (Local0, 0x00))
                    {
                        Increment (Local1)
                        ShiftRight (Local0, 0x01, Local0)
                    }

                    And (PIRC, 0xF0, PIRC)
                    Or (PIRC, Local1, PIRC)
                }
            }

            Device (LNKD)
            {
                Name (_HID, EisaId ("PNP0C0F"))
                Name (_UID, 0x04)
                Method (_STA, 0, NotSerialized)
                {
                    And (PIRC, 0xF0, Local0)
                    If (LEqual (Local0, 0x00))
                    {
                        Return (0x09)
                    }
                    Else
                    {
                        Return (0x0B)
                    }
                }

                Method (_PRS, 0, NotSerialized)
                {
                    Name (BUFB, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11,12,14,15}
                    })
                    Return (BUFB)
                }

                Method (_DIS, 0, NotSerialized)
                {
                    And (PIRC, 0x0F, PIRC)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUFB, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {}
                    })
                    CreateByteField (BUFB, 0x01, IRB1)
                    CreateByteField (BUFB, 0x02, IRB2)
                    Store (0x00, Local3)
                    Store (0x00, Local4)
                    And (PIRC, 0xF0, Local1)
                    ShiftRight (Local1, 0x04, Local1)
                    If (LNot (LEqual (Local1, 0x00)))
                    {
                        If (LGreater (Local1, 0x07))
                        {
                            Subtract (Local1, 0x08, Local2)
                            ShiftLeft (One, Local2, Local4)
                        }
                        Else
                        {
                            If (LGreater (Local1, 0x00))
                            {
                                ShiftLeft (One, Local1, Local3)
                            }
                        }

                        Store (Local3, IRB1)
                        Store (Local4, IRB2)
                    }

                    Return (BUFB)
                }

                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x01, IRB1)
                    CreateByteField (Arg0, 0x02, IRB2)
                    ShiftLeft (IRB2, 0x08, Local0)
                    Or (Local0, IRB1, Local0)
                    Store (0x00, Local1)
                    ShiftRight (Local0, 0x01, Local0)
                    While (LGreater (Local0, 0x00))
                    {
                        Increment (Local1)
                        ShiftRight (Local0, 0x01, Local0)
                    }

                    And (PIRC, 0x0F, PIRC)
                    ShiftLeft (Local1, 0x04, Local1)
                    Or (PIRC, Local1, PIRC)
                }
            }

            OperationRegion (\SCPP, SystemIO, 0x062F, 0x01)
            Field (\SCPP, ByteAcc, NoLock, Preserve)
            {
                SMIP,   8
            }

            Method (\_SB.PCI0._INI, 0, NotSerialized)
            {
                If (STRC (\_OS, "Microsoft Windows"))
                {
                    Store (0x56, SMIP)
                }
                Else
                {
                    If (STRC (\_OS, "Microsoft Windows NT"))
                    {
                        Store (0x58, SMIP)
                        Store (0x00, OSFL)
                    }
                    Else
                    {
                        Store (0x57, SMIP)
                        Store (0x02, OSFL)
                    }
                }
            }

            Method (OSTP, 0, NotSerialized)
            {
                If (LEqual (OSFL, 0x01))
                {
                    Store (0x56, SMIP)
                }

                If (LEqual (OSFL, 0x02))
                {
                    Store (0x57, SMIP)
                }

                If (LEqual (OSFL, 0x00))
                {
                    Store (0x58, SMIP)
                }
            }

            Device (SYSR)
            {
                Name (_HID, EisaId ("PNP0C02"))
                Name (_UID, 0x01)
                Name (_CRS, ResourceTemplate ()
                {
                    IO (Decode16, 0x0010, 0x0010, 0x01, 0x10)
                    IO (Decode16, 0x0022, 0x0022, 0x01, 0x1E)
                    IO (Decode16, 0x0044, 0x0044, 0x01, 0x1C)
                    IO (Decode16, 0x0062, 0x0062, 0x01, 0x02)
                    IO (Decode16, 0x0065, 0x0065, 0x01, 0x0B)
                    IO (Decode16, 0x0074, 0x0074, 0x01, 0x0C)
                    IO (Decode16, 0x0091, 0x0091, 0x01, 0x03)
                    IO (Decode16, 0x00A2, 0x00A2, 0x01, 0x1E)
                    IO (Decode16, 0x00E0, 0x00E0, 0x01, 0x10)
                    IO (Decode16, 0x0B78, 0x0B78, 0x04, 0x04)
                    IO (Decode16, 0x0F78, 0x0F78, 0x04, 0x04)
                    IO (Decode16, 0x0A78, 0x0A78, 0x04, 0x04)
                    IO (Decode16, 0x0E78, 0x0E78, 0x04, 0x04)
                    IO (Decode16, 0x0BBC, 0x0BBC, 0x04, 0x04)
                    IO (Decode16, 0x0FBC, 0x0FBC, 0x04, 0x04)
                    IO (Decode16, 0x04D0, 0x04D0, 0x01, 0x02)
                })
            }

            Device (PIC)
            {
                Name (_HID, EisaId ("PNP0000"))
                Name (_CRS, ResourceTemplate ()
                {
                    IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
                    IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
                    IRQNoFlags () {2}
                })
            }

            Device (DMA1)
            {
                Name (_HID, EisaId ("PNP0200"))
                Name (_CRS, ResourceTemplate ()
                {
                    DMA (Compatibility, BusMaster, Transfer8) {4}
                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x10)
                    IO (Decode16, 0x0080, 0x0080, 0x01, 0x11)
                    IO (Decode16, 0x0094, 0x0094, 0x01, 0x0C)
                    IO (Decode16, 0x00C0, 0x00C0, 0x01, 0x20)
                })
            }

            Device (TMR)
            {
                Name (_HID, EisaId ("PNP0100"))
                Name (_CRS, ResourceTemplate ()
                {
                    IO (Decode16, 0x0040, 0x0040, 0x01, 0x04)
                    IRQNoFlags () {0}
                })
            }

            Device (RTC)
            {
                Name (_HID, EisaId ("PNP0B00"))
                Name (_CRS, ResourceTemplate ()
                {
                    IO (Decode16, 0x0070, 0x0070, 0x04, 0x04)
                    IRQNoFlags () {8}
                })
            }

            Device (SPKR)
            {
                Name (_HID, EisaId ("PNP0800"))
                Name (_CRS, ResourceTemplate ()
                {
                    IO (Decode16, 0x0061, 0x0061, 0x01, 0x01)
                })
            }

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

            Scope (\)
            {
                OperationRegion (WIN1, SystemIO, 0x2E, 0x02)
                Field (WIN1, ByteAcc, NoLock, Preserve)
                {
                    INDP,   8, 
                    DATA,   8
                }

                IndexField (INDP, DATA, ByteAcc, NoLock, Preserve)
                {
                    Offset (0x02), 
                    CFG,    8, 
                    Offset (0x07), 
                    LDN,    8, 
                    Offset (0x20), 
                    IDHI,   8, 
                    IDLO,   8, 
                    POWC,   8, 
                    Offset (0x30), 
                    ACTR,   8, 
                    Offset (0x60), 
                    IOAH,   8, 
                    IOAL,   8, 
                    IO2H,   8, 
                    IO2L,   8, 
                    Offset (0x70), 
                    INTR,   8, 
                    Offset (0x72), 
                    INT1,   8, 
                    Offset (0x74), 
                    DMCH,   8, 
                    Offset (0xC0), 
                    GP40,   8, 
                    Offset (0xE0), 
                    CRE0,   8, 
                    CRE1,   8, 
                    CRE2,   8, 
                    CRE3,   8, 
                    CRE4,   8, 
                    Offset (0xF0), 
                    OPT1,   8, 
                    OPT2,   8, 
                    OPT3,   8, 
                    OPT4,   8, 
                    OPT5,   8, 
                    OPT6,   8, 
                    OPT7,   8
                }

                Method (ENFG, 0, NotSerialized)
                {
                    Store (0x87, INDP)
                    Store (0x87, INDP)
                }

                Method (EXFG, 0, NotSerialized)
                {
                    Store (0xAA, INDP)
                }
            }

            OperationRegion (COM1, SystemIO, 0x03F8, 0x08)
            Field (COM1, ByteAcc, NoLock, Preserve)
            {
                P3F8,   8, 
                P3F9,   8, 
                P3FA,   8, 
                P3FB,   8, 
                P3FC,   8, 
                P3FD,   8, 
                P3FE,   8, 
                P3FF,   8
            }

            OperationRegion (COM2, SystemIO, 0x02F8, 0x08)
            Field (COM2, ByteAcc, NoLock, Preserve)
            {
                P2F8,   8, 
                P2F9,   8, 
                P2FA,   8, 
                P2FB,   8, 
                P2FC,   8, 
                P2FD,   8, 
                P2FE,   8, 
                P2FF,   8
            }

            OperationRegion (COM3, SystemIO, 0x03E8, 0x08)
            Field (COM3, ByteAcc, NoLock, Preserve)
            {
                P3E8,   8, 
                P3E9,   8, 
                P3EA,   8, 
                P3EB,   8, 
                P3EC,   8, 
                P3ED,   8, 
                P3EE,   8, 
                P3EF,   8
            }

            OperationRegion (COM4, SystemIO, 0x02E8, 0x08)
            Field (COM4, ByteAcc, NoLock, Preserve)
            {
                P2E8,   8, 
                P2E9,   8, 
                P2EA,   8, 
                P2EB,   8, 
                P2EC,   8, 
                P2ED,   8, 
                P2EE,   8, 
                P2EF,   8
            }

            Method (ICOM, 1, NotSerialized)
            {
                Store (Arg0, Local0)
                If (LEqual (Local0, 0x03F8))
                {
                    Store (P3FD, Local0)
                    Store (P3FD, Local0)
                    Store (0xC3, P3FA)
                    While (LNot (LEqual (P3FA, 0xC1)))
                    {
                        Store (P3FE, Local0)
                    }
                }
                Else
                {
                    If (LEqual (Local0, 0x02F8))
                    {
                        Store (P2FD, Local0)
                        Store (P2FD, Local0)
                        Store (0xC3, P2FA)
                        While (LNot (LEqual (P2FA, 0xC1)))
                        {
                            Store (P2FE, Local0)
                        }
                    }
                    Else
                    {
                        If (LEqual (Local0, 0x03E8))
                        {
                            Store (P3ED, Local0)
                            Store (P3ED, Local0)
                            Store (0xC3, P3EA)
                            While (LNot (LEqual (P3EA, 0xC1)))
                            {
                                Store (P3EE, Local0)
                            }
                        }
                        Else
                        {
                            If (LEqual (Local0, 0x02E8))
                            {
                                Store (P2ED, Local0)
                                Store (P2ED, Local0)
                                Store (0xC3, P2EA)
                                While (LNot (LEqual (P2EA, 0xC1)))
                                {
                                    Store (P2EE, Local0)
                                }
                            }
                        }
                    }
                }
            }

            Device (FDC0)
            {
                Name (_HID, EisaId ("PNP0700"))
                Method (_STA, 0, NotSerialized)
                {
                    ENFG ()
                    Store (Zero, LDN)
                    If (ACTR)
                    {
                        EXFG ()
                        Return (0x0F)
                    }
                    Else
                    {
                        If (LOr (IOAH, IOAL))
                        {
                            EXFG ()
                            Return (0x0D)
                        }
                        Else
                        {
                            EXFG ()
                            Return (0x00)
                        }
                    }
                }

                Method (_DIS, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x00, LDN)
                    Store (Zero, ACTR)
                    SLDM (DMCH, 0x04)
                    EXFG ()
                    DISD (0x03)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF0, ResourceTemplate ()
                    {
                        IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
                        IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
                        IRQNoFlags () {6}
                        DMA (Compatibility, NotBusMaster, Transfer8) {2}
                    })
                    CreateByteField (BUF0, 0x02, IOLO)
                    CreateByteField (BUF0, 0x03, IOHI)
                    CreateByteField (BUF0, 0x04, IORL)
                    CreateByteField (BUF0, 0x05, IORH)
                    ENFG ()
                    EXFG ()
                    Return (BUF0)
                }

                Name (_PRS, ResourceTemplate ()
                {
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
                        IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
                        IRQNoFlags () {6}
                        DMA (Compatibility, NotBusMaster, Transfer8) {2}
                    }
                    EndDependentFn ()
                })
                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x02, IOLO)
                    CreateByteField (Arg0, 0x03, IOHI)
                    CreateWordField (Arg0, 0x02, IOAD)
                    CreateWordField (Arg0, 0x19, IRQL)
                    CreateByteField (Arg0, 0x1C, DMAV)
                    ENFG ()
                    Store (Zero, LDN)
                    Store (One, ACTR)
                    SLDM (DMCH, DMCH)
                    EXFG ()
                    CKIO (IOAD, 0x03)
                }
            }

            Device (UAR1)
            {
                Name (_HID, EisaId ("PNP0501"))
                Name (_UID, 0x01)
                Method (_STA, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x02, LDN)
                    If (ACTR)
                    {
                        EXFG ()
                        Return (0x0F)
                    }
                    Else
                    {
                        If (LOr (IOAH, IOAL))
                        {
                            EXFG ()
                            Return (0x0D)
                        }
                        Else
                        {
                            EXFG ()
                            Return (0x00)
                        }
                    }

                    EXFG ()
                }

                Method (_DIS, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x02, LDN)
                    Store (Zero, ACTR)
                    EXFG ()
                    DISD (0x00)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF1, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x08)
                        IRQNoFlags () {}
                    })
                    CreateByteField (BUF1, 0x02, IOLO)
                    CreateByteField (BUF1, 0x03, IOHI)
                    CreateByteField (BUF1, 0x04, IORL)
                    CreateByteField (BUF1, 0x05, IORH)
                    CreateWordField (BUF1, 0x09, IRQW)
                    ENFG ()
                    Store (0x02, LDN)
                    Store (IOAL, IOLO)
                    Store (IOAL, IORL)
                    Store (IOAH, IOHI)
                    Store (IOAH, IORH)
                    Store (One, Local0)
                    ShiftLeft (Local0, INTR, IRQW)
                    EXFG ()
                    Return (BUF1)
                }

                Name (_PRS, ResourceTemplate ()
                {
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    EndDependentFn ()
                })
                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x02, IOLO)
                    CreateByteField (Arg0, 0x03, IOHI)
                    CreateWordField (Arg0, 0x02, IOAD)
                    CreateWordField (Arg0, 0x09, IRQW)
                    ENFG ()
                    Store (0x02, LDN)
                    Store (One, ACTR)
                    Store (IOLO, IOAL)
                    Store (IOHI, IOAH)
                    FindSetRightBit (IRQW, Local0)
                    Subtract (Local0, 0x01, INTR)
                    EXFG ()
                    CKIO (IOAD, 0x00)
                }
            }

            Device (UAR2)
            {
                Name (_HID, EisaId ("PNP0501"))
                Name (_UID, 0x02)
                Method (_STA, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x03, LDN)
                    And (OPT2, 0x30, Local0)
                    If (LNot (LEqual (Local0, 0x10)))
                    {
                        If (ACTR)
                        {
                            EXFG ()
                            Return (0x0F)
                        }
                        Else
                        {
                            If (LOr (IOAH, IOAL))
                            {
                                EXFG ()
                                Return (0x0D)
                            }
                            Else
                            {
                                EXFG ()
                                Return (0x00)
                            }
                        }
                    }
                    Else
                    {
                        EXFG ()
                        Return (0x00)
                    }
                }

                Method (_DIS, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x03, LDN)
                    And (OPT2, 0x38, Local0)
                    If (LEqual (Local0, 0x00))
                    {
                        Store (Zero, ACTR)
                    }

                    EXFG ()
                    DISD (0x01)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF2, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x08)
                        IRQNoFlags () {4}
                    })
                    CreateByteField (BUF2, 0x02, IOLO)
                    CreateByteField (BUF2, 0x03, IOHI)
                    CreateByteField (BUF2, 0x04, IORL)
                    CreateByteField (BUF2, 0x05, IORH)
                    CreateWordField (BUF2, 0x09, IRQW)
                    ENFG ()
                    Store (0x03, LDN)
                    Store (IOAL, IOLO)
                    Store (IOAL, IORL)
                    Store (IOAH, IOHI)
                    Store (IOAH, IORH)
                    Store (One, Local0)
                    ShiftLeft (Local0, INTR, IRQW)
                    EXFG ()
                    Return (BUF2)
                }

                Name (_PRS, ResourceTemplate ()
                {
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    EndDependentFn ()
                })
                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x02, IOLO)
                    CreateByteField (Arg0, 0x03, IOHI)
                    CreateWordField (Arg0, 0x02, IOAD)
                    CreateWordField (Arg0, 0x09, IRQW)
                    ENFG ()
                    Store (0x03, LDN)
                    Store (One, ACTR)
                    Store (IOLO, IOAL)
                    Store (IOHI, IOAH)
                    FindSetRightBit (IRQW, Local0)
                    Subtract (Local0, 0x01, INTR)
                    EXFG ()
                    CKIO (IOAD, 0x01)
                }
            }

            Device (IRDA)
            {
                Name (_HID, EisaId ("PNP0510"))
                Method (_STA, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x03, LDN)
                    And (OPT2, 0x30, Local0)
                    If (LEqual (Local0, 0x10))
                    {
                        If (ACTR)
                        {
                            EXFG ()
                            Return (0x0F)
                        }
                        Else
                        {
                            If (LOr (IOAH, IOAL))
                            {
                                EXFG ()
                                Return (0x0D)
                            }
                            Else
                            {
                                EXFG ()
                                Return (0x00)
                            }
                        }
                    }
                    Else
                    {
                        EXFG ()
                        Return (0x00)
                    }
                }

                Method (_DIS, 0, NotSerialized)
                {
                    If (LEqual (DISE, 0x01))
                    {
                        ENFG ()
                        Store (0x03, LDN)
                        And (OPT2, 0x38, Local0)
                        If (LNot (LEqual (Local0, 0x00)))
                        {
                            Store (Zero, ACTR)
                        }

                        EXFG ()
                        DISD (0x01)
                    }

                    Store (Local0, Local0)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF4, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x08)
                        IRQNoFlags () {}
                    })
                    CreateByteField (BUF4, 0x02, IOLO)
                    CreateByteField (BUF4, 0x03, IOHI)
                    CreateByteField (BUF4, 0x04, IORL)
                    CreateByteField (BUF4, 0x05, IORH)
                    CreateWordField (BUF4, 0x09, IRQW)
                    ENFG ()
                    Store (0x03, LDN)
                    Store (IOAL, IOLO)
                    Store (IOAL, IORL)
                    Store (IOAH, IOHI)
                    Store (IOAH, IORH)
                    ShiftLeft (0x01, INTR, IRQW)
                    EXFG ()
                    Return (BUF4)
                }

                Name (_PRS, ResourceTemplate ()
                {
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    EndDependentFn ()
                })
                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x02, IOLO)
                    CreateByteField (Arg0, 0x03, IOHI)
                    CreateWordField (Arg0, 0x02, IOAD)
                    CreateWordField (Arg0, 0x09, IRQW)
                    ENFG ()
                    Store (0x03, LDN)
                    Store (One, ACTR)
                    Store (IOLO, IOAL)
                    Store (IOHI, IOAH)
                    FindSetRightBit (IRQW, Local0)
                    Subtract (Local0, 0x01, INTR)
                    EXFG ()
                    CKIO (IOAD, 0x01)
                }
            }

            Device (LPT1)
            {
                Name (_HID, EisaId ("PNP0400"))
                Method (_STA, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x01, LDN)
                    And (OPT1, 0x02, Local0)
                    If (LNot (LEqual (Local0, 0x02)))
                    {
                        If (ACTR)
                        {
                            EXFG ()
                            Return (0x0F)
                        }
                        Else
                        {
                            If (LOr (IOAH, IOAL))
                            {
                                EXFG ()
                                Return (0x0D)
                            }
                            Else
                            {
                                EXFG ()
                                Return (0x00)
                            }
                        }
                    }
                    Else
                    {
                        EXFG ()
                        Return (0x00)
                    }
                }

                Method (_DIS, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x01, LDN)
                    Store (Zero, ACTR)
                    EXFG ()
                    DISD (0x02)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF5, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x08)
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x04)
                        IRQNoFlags () {}
                    })
                    CreateByteField (BUF5, 0x02, IOLO)
                    CreateByteField (BUF5, 0x03, IOHI)
                    CreateByteField (BUF5, 0x04, IORL)
                    CreateByteField (BUF5, 0x05, IORH)
                    CreateByteField (BUF5, 0x07, IOLE)
                    CreateByteField (BUF5, 0x0A, IO21)
                    CreateByteField (BUF5, 0x0B, IO22)
                    CreateByteField (BUF5, 0x0C, IO23)
                    CreateByteField (BUF5, 0x0D, IO24)
                    CreateWordField (BUF5, 0x11, IRQW)
                    ENFG ()
                    Store (0x01, LDN)
                    Store (IOAL, IOLO)
                    Store (IOLO, IORL)
                    Store (IOAH, IOHI)
                    Store (IOHI, IORH)
                    Store (IOAL, IO21)
                    Store (IOAL, IO23)
                    Add (IOAH, 0x04, IO22)
                    Add (IOAH, 0x04, IO24)
                    If (LEqual (IOLO, 0xBC))
                    {
                        Store (0x04, IOLE)
                    }
                    Else
                    {
                        Store (0x08, IOLE)
                    }

                    Store (One, Local0)
                    Store (INTR, Local5)
                    ShiftLeft (Local0, Local5, IRQW)
                    Store (One, ACTR)
                    EXFG ()
                    Return (BUF5)
                }

                Name (_PRS, ResourceTemplate ()
                {
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                        IO (Decode16, 0x0778, 0x0778, 0x01, 0x04)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                        IO (Decode16, 0x0678, 0x0678, 0x01, 0x04)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03BC, 0x03BC, 0x01, 0x04)
                        IO (Decode16, 0x07BC, 0x07BC, 0x01, 0x04)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    EndDependentFn ()
                })
                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x02, IOLO)
                    CreateByteField (Arg0, 0x03, IOHI)
                    CreateWordField (Arg0, 0x02, IOAD)
                    CreateByteField (Arg0, 0x04, IORL)
                    CreateByteField (Arg0, 0x05, IORH)
                    CreateWordField (Arg0, 0x11, IRQW)
                    ENFG ()
                    Store (0x01, LDN)
                    Store (One, ACTR)
                    Store (IOLO, IOAL)
                    Store (IOHI, IOAH)
                    FindSetLeftBit (IRQW, Local0)
                    Subtract (Local0, 0x01, Local0)
                    Store (Local0, INTR)
                    EXFG ()
                    CKIO (IOAD, 0x02)
                }
            }

            Device (ECP1)
            {
                Name (_HID, EisaId ("PNP0401"))
                Method (_STA, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x01, LDN)
                    And (OPT1, 0x02, Local0)
                    If (LEqual (Local0, 0x02))
                    {
                        If (ACTR)
                        {
                            EXFG ()
                            Return (0x0F)
                        }
                        Else
                        {
                            If (LOr (IOAH, IOAL))
                            {
                                EXFG ()
                                Return (0x0D)
                            }
                            Else
                            {
                                EXFG ()
                                Return (0x00)
                            }
                        }
                    }
                    Else
                    {
                        EXFG ()
                        Return (0x00)
                    }
                }

                Method (_DIS, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x01, LDN)
                    Store (Zero, ACTR)
                    SLDM (DMCH, 0x04)
                    EXFG ()
                    DISD (0x02)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF6, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x08)
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x04)
                        IRQNoFlags () {}
                        DMA (Compatibility, NotBusMaster, Transfer8) {}
                    })
                    CreateByteField (BUF6, 0x02, IOLO)
                    CreateByteField (BUF6, 0x03, IOHI)
                    CreateByteField (BUF6, 0x04, IORL)
                    CreateByteField (BUF6, 0x05, IORH)
                    CreateByteField (BUF6, 0x0A, IOEL)
                    CreateByteField (BUF6, 0x0B, IOEH)
                    CreateByteField (BUF6, 0x0C, IOML)
                    CreateByteField (BUF6, 0x0D, IOMH)
                    CreateByteField (BUF6, 0x07, IOLE)
                    CreateWordField (BUF6, 0x11, IRQW)
                    CreateByteField (BUF6, 0x14, DMAC)
                    ENFG ()
                    Store (0x01, LDN)
                    Store (One, ACTR)
                    Store (IOAL, Local2)
                    Store (Local2, IOLO)
                    Store (IOAH, Local3)
                    Store (Local3, IOHI)
                    Or (Local3, 0x04, Local3)
                    Store (Local3, IOEH)
                    Store (Local3, IOMH)
                    Store (IOLO, IORL)
                    Store (IOLO, IOEL)
                    Store (IOLO, IOML)
                    Store (IOHI, IORH)
                    If (LEqual (IOLO, 0xBC))
                    {
                        Store (0x04, IOLE)
                    }
                    Else
                    {
                        Store (0x08, IOLE)
                    }

                    Store (One, Local0)
                    Store (INTR, Local5)
                    ShiftLeft (Local0, Local5, IRQW)
                    Store (One, Local0)
                    Store (DMCH, Local5)
                    ShiftLeft (Local0, Local5, DMAC)
                    EXFG ()
                    Return (BUF6)
                }

                Name (_PRS, ResourceTemplate ()
                {
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                        IO (Decode16, 0x0778, 0x0778, 0x01, 0x04)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                        DMA (Compatibility, NotBusMaster, Transfer8) {0,1,3}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                        IO (Decode16, 0x0678, 0x0678, 0x01, 0x04)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                        DMA (Compatibility, NotBusMaster, Transfer8) {0,1,3}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x03BC, 0x03BC, 0x01, 0x04)
                        IO (Decode16, 0x07BC, 0x07BC, 0x01, 0x04)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                        DMA (Compatibility, NotBusMaster, Transfer8) {0,1,3}
                    }
                    EndDependentFn ()
                })
                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x02, IOLO)
                    CreateByteField (Arg0, 0x03, IOHI)
                    CreateWordField (Arg0, 0x02, IOAD)
                    CreateWordField (Arg0, 0x11, IRQW)
                    CreateByteField (Arg0, 0x14, DMAC)
                    ENFG ()
                    Store (0x01, LDN)
                    Store (One, ACTR)
                    Store (IOLO, IOAL)
                    Store (IOHI, IOAH)
                    FindSetLeftBit (IRQW, Local0)
                    Subtract (Local0, 0x01, Local0)
                    Store (Local0, INTR)
                    FindSetLeftBit (DMAC, Local1)
                    Store (DMCH, Local0)
                    Subtract (Local1, 0x01, DMCH)
                    SLDM (Local0, DMCH)
                    EXFG ()
                    CKIO (IOAD, 0x02)
                }
            }

            OperationRegion (KBCT, SystemIO, 0x60, 0x05)
            Field (KBCT, ByteAcc, NoLock, Preserve)
            {
                P060,   8, 
                Offset (0x04), 
                P064,   8
            }

            Device (PS2M)
            {
                Name (_HID, EisaId ("PNP0F13"))
                Method (_STA, 0, NotSerialized)
                {
                    If (LEqual (PS2F, 0x00))
                    {
                        Return (0x0F)
                    }
                    Else
                    {
                        Return (0x00)
                    }
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF1, ResourceTemplate ()
                    {
                        IRQNoFlags () {12}
                    })
                    Name (BUF2, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0060, 0x0060, 0x01, 0x01)
                        IO (Decode16, 0x0064, 0x0064, 0x01, 0x01)
                        IRQNoFlags () {12}
                    })
                    If (LEqual (KBDI, 0x01))
                    {
                        If (LEqual (OSFL, 0x02))
                        {
                            Return (BUF1)
                        }

                        If (LEqual (OSFL, 0x01))
                        {
                            Return (BUF1)
                        }
                        Else
                        {
                            Return (BUF2)
                        }
                    }
                    Else
                    {
                        Return (BUF1)
                    }
                }
            }

            Device (PS2K)
            {
                Name (_HID, EisaId ("PNP0303"))
                Method (_STA, 0, NotSerialized)
                {
                    If (LEqual (KBDI, 0x01))
                    {
                        Return (0x00)
                    }
                    Else
                    {
                        Return (0x0F)
                    }
                }

                Name (_CRS, ResourceTemplate ()
                {
                    IO (Decode16, 0x0060, 0x0060, 0x01, 0x01)
                    IO (Decode16, 0x0064, 0x0064, 0x01, 0x01)
                    IRQNoFlags () {1}
                })
            }

            Device (PSMR)
            {
                Name (_HID, EisaId ("PNP0C02"))
                Name (_UID, 0x03)
                Method (_STA, 0, NotSerialized)
                {
                    If (LEqual (KBDI, 0x00))
                    {
                        Return (0x00)
                    }

                    If (LEqual (PS2F, 0x00))
                    {
                        If (LEqual (OSFL, 0x02))
                        {
                            Return (0x0F)
                        }

                        If (LEqual (OSFL, 0x01))
                        {
                            Return (0x0F)
                        }

                        Return (0x00)
                    }

                    Return (0x0F)
                }

                Name (_CRS, ResourceTemplate ()
                {
                    IO (Decode16, 0x0060, 0x0060, 0x01, 0x01)
                    IO (Decode16, 0x0064, 0x0064, 0x01, 0x01)
                })
            }

            Device (GAME)
            {
                Name (_HID, EisaId ("PNPB02F"))
                Method (_STA, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x07, LDN)
                    If (LOr (IOAH, IOAL))
                    {
                        EXFG ()
                        Return (0x0F)
                    }
                    Else
                    {
                        And (ACTR, 0x02, Local0)
                        If (LEqual (Local0, 0x02))
                        {
                            EXFG ()
                            Return (0x0D)
                        }
                        Else
                        {
                            EXFG ()
                            Return (0x00)
                        }
                    }
                }

                Method (_DIS, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x07, LDN)
                    Store (Zero, IOAH)
                    Store (Zero, IOAL)
                    EXFG ()
                    DISD (0x04)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF1, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x07)
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x01)
                    })
                    CreateByteField (BUF1, 0x02, IOLO)
                    CreateByteField (BUF1, 0x03, IOHI)
                    CreateByteField (BUF1, 0x04, IORL)
                    CreateByteField (BUF1, 0x05, IORH)
                    CreateByteField (BUF1, 0x0A, IO21)
                    CreateByteField (BUF1, 0x0B, IO22)
                    CreateByteField (BUF1, 0x0C, IO23)
                    CreateByteField (BUF1, 0x0D, IO24)
                    ENFG ()
                    Store (0x07, LDN)
                    Store (IOAL, IOLO)
                    Store (IOAL, IORL)
                    Store (IOAH, IOHI)
                    Store (IOAH, IORH)
                    Subtract (IOAL, 0x01, IO21)
                    Subtract (IOAL, 0x01, IO23)
                    Store (IOAH, IO22)
                    Store (IOAH, IO24)
                    EXFG ()
                    Return (BUF1)
                }

                Name (_PRS, ResourceTemplate ()
                {
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0201, 0x0201, 0x01, 0x07)
                        IO (Decode16, 0x0200, 0x0200, 0x01, 0x01)
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0209, 0x0209, 0x01, 0x07)
                        IO (Decode16, 0x0208, 0x0208, 0x01, 0x01)
                    }
                    EndDependentFn ()
                })
                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x02, IOLO)
                    CreateByteField (Arg0, 0x03, IOHI)
                    CreateWordField (Arg0, 0x02, IOAD)
                    ENFG ()
                    Store (0x07, LDN)
                    Or (ACTR, 0x02, ACTR)
                    Store (IOLO, IOAL)
                    Store (IOHI, IOAH)
                    EXFG ()
                    CKIO (IOAD, 0x04)
                }
            }

            Device (MIDI)
            {
                Name (_HID, EisaId ("PNPB006"))
                OperationRegion (MID1, SystemIO, 0x0290, 0x02)
                Field (MID1, ByteAcc, NoLock, Preserve)
                {
                    MD1,    8, 
                    ST1,    8
                }

                OperationRegion (MID2, SystemIO, 0x0300, 0x02)
                Field (MID2, ByteAcc, NoLock, Preserve)
                {
                    MD2,    8, 
                    ST2,    8
                }

                OperationRegion (MID3, SystemIO, 0x0330, 0x02)
                Field (MID3, ByteAcc, NoLock, Preserve)
                {
                    MD3,    8, 
                    ST3,    8
                }

                Method (_STA, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x07, LDN)
                    If (LOr (IO2H, IO2L))
                    {
                        EXFG ()
                        Return (0x0F)
                    }
                    Else
                    {
                        And (ACTR, 0x04, Local0)
                        If (LEqual (Local0, 0x04))
                        {
                            EXFG ()
                            Return (0x0D)
                        }
                        Else
                        {
                            EXFG ()
                            Return (0x00)
                        }
                    }
                }

                Method (_DIS, 0, NotSerialized)
                {
                    ENFG ()
                    Store (0x07, LDN)
                    Store (Zero, IO2H)
                    Store (Zero, IO2L)
                    Store (Zero, INTR)
                    EXFG ()
                    DISD (0x05)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF1, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x02)
                        IRQNoFlags () {}
                    })
                    CreateByteField (BUF1, 0x02, IOLO)
                    CreateByteField (BUF1, 0x03, IOHI)
                    CreateByteField (BUF1, 0x04, IORL)
                    CreateByteField (BUF1, 0x05, IORH)
                    CreateWordField (BUF1, 0x09, IRQW)
                    ENFG ()
                    Store (0x07, LDN)
                    Store (IO2L, IOLO)
                    Store (IO2L, IORL)
                    Store (IO2H, IOHI)
                    Store (IO2H, IORH)
                    Store (One, Local0)
                    ShiftLeft (Local0, INTR, IRQW)
                    EXFG ()
                    Return (BUF1)
                }

                Name (_PRS, ResourceTemplate ()
                {
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0330, 0x0330, 0x01, 0x02)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0300, 0x0300, 0x01, 0x02)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    StartDependentFnNoPri ()
                    {
                        IO (Decode16, 0x0290, 0x0290, 0x01, 0x02)
                        IRQNoFlags () {3,4,5,7,9,10,11,12}
                    }
                    EndDependentFn ()
                })
                Method (_SRS, 1, NotSerialized)
                {
                    CreateByteField (Arg0, 0x02, IOLO)
                    CreateByteField (Arg0, 0x03, IOHI)
                    CreateWordField (Arg0, 0x02, IOAD)
                    CreateWordField (Arg0, 0x09, IRQW)
                    ENFG ()
                    Store (0x07, LDN)
                    Or (ACTR, 0x04, ACTR)
                    Store (IOLO, IO2L)
                    Store (IOHI, IO2H)
                    FindSetLeftBit (IRQW, Local0)
                    Subtract (Local0, 0x01, Local0)
                    Store (Local0, INTR)
                    EXFG ()
                    CKIO (IOAD, 0x05)
                    If (LEqual (IOAD, 0x0290))
                    {
                        And (ST1, 0x40, Local0)
                        While (LEqual (Local0, 0x40))
                        {
                            Store (MD1, Local0)
                            And (ST1, 0x40, Local0)
                        }
                    }
                    Else
                    {
                        If (LEqual (IOAD, 0x0300))
                        {
                            And (ST2, 0x40, Local0)
                            While (LEqual (Local0, 0x40))
                            {
                                Store (MD2, Local0)
                                And (ST2, 0x40, Local0)
                            }
                        }
                        Else
                        {
                            And (ST3, 0x40, Local0)
                            While (LEqual (Local0, 0x40))
                            {
                                Store (MD3, Local0)
                                And (ST3, 0x40, Local0)
                            }
                        }
                    }
                }
            }

            Scope (\)
            {
                OperationRegion (WIN2, SystemIO, 0x70, 0x02)
                Field (WIN2, ByteAcc, NoLock, Preserve)
                {
                    IND2,   8, 
                    DAT2,   8
                }

                Method (RCMS, 0, NotSerialized)
                {
                    Store (0x60, Local0)
                    Store (0x3A, IND2)
                    Store (DAT2, Local1)
                    And (Local1, Local0, Local1)
                    FindSetRightBit (Local0, Local2)
                    Decrement (Local2)
                    ShiftRight (Local1, Local2, Local1)
                    Return (Local1)
                }

                Method (PLS, 0, NotSerialized)
                {
                    Store (RCMS (), Local0)
                    If (LEqual (Local0, 0x00))
                    {
                        Store (0x40, Local0)
                    }
                    Else
                    {
                        If (LEqual (Local0, 0x01))
                        {
                            Store (0x40, Local0)
                        }
                        Else
                        {
                            Store (0x80, Local0)
                        }
                    }

                    Return (Local0)
                }

                Method (SALD, 1, NotSerialized)
                {
                    If (LEqual (Arg0, 0x00))
                    {
                        Store (0x00, Local0)
                    }

                    If (LEqual (Arg0, 0x01))
                    {
                        Store (PLS (), Local0)
                    }

                    If (LEqual (Arg0, 0x03))
                    {
                        Store (PLS (), Local0)
                    }

                    If (LEqual (Arg0, 0x04)) {}
                    If (LEqual (Arg0, 0x05)) {}
                    SLED (Local0)
                }
            }

            Scope (\)
            {
                Method (PLED, 1, NotSerialized)
                {
                    ENFG ()
                    Store (0x08, LDN)
                    And (OPT6, 0x3F, Local0)
                    Or (Local0, Arg0, OPT6)
                    EXFG ()
                }
            }

            Scope (\)
            {
                Method (SLED, 1, NotSerialized)
                {
                    ENFG ()
                    Store (0x09, LDN)
                    And (OPT4, 0x3F, Local0)
                    Or (Local0, Arg0, OPT4)
                    EXFG ()
                }
            }
        }
    }

    Scope (\_GPE)
    {
        Method (_L08, 0, NotSerialized)
        {
            Notify (\_SB.PCI0, 0x02)
        }

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

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

        Method (_L0F, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.OP2P.USB0, 0x02)
        }
    }
}


--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpllt3v6ht.fsf>