Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jul 2006 12:43:09 +0200 (CEST)
From:      uwe farinol <uwefarinol@yahoo.it>
To:        freebsd-acpi@freebsd.org
Subject:   partial support on asus p5vdc mx 
Message-ID:  <20060708104309.32820.qmail@web27905.mail.ukl.yahoo.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
hi

I run freebsd SMP on the mobo in subject, with a
Pentium D 805 CPU.
Everything is fine, but I get very few MIBs for acpi.
Notably, I don't get support for the thermal sensor.

While I saw it targets laptop mobos, I tried loading
acpi_asus too, without any difference.

ACPI is run as kernel module.

If I dump my acpi bytecode and try to recompile it, as
suggested in
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/acpi-debug.html,
I get 11 errors (I attach the code below).

My bios is up to the last version, and includes a
trigger "ACPI 2.0 support", which has no impact on
freebsd acpi when turned on/off.

I attach
the dump of dmesg
the dump of my acpi sysctls (sysctl -a | grep acpi)
and my asl from acpidump:
[root@uwef /home/uwe]# acpidump -d -t -o pooracpi.dsdt
> pooracpi.asl
acpidump: RSDT entry 3 (sig OEMB) is corrupt


How can I debug further my problem?

thank you
uwe farinol

Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 
[-- Attachment #2 --]
      acpisem    24     2K       -       24  64
     acpitask     0     0K       -        1  32
       acpica  2610   138K       -    37735  16,32,64,128,256,512,1024
      acpidev    76     3K       -       76  32
debug.acpi.acpi_ca_version: 0x20041119
debug.acpi.do_powerstate: 1
debug.acpi.semaphore_debug: 0
hw.acpi.supported_sleep_state: S1 S3 S4 S5
hw.acpi.power_button_state: S5
hw.acpi.sleep_button_state: S1
hw.acpi.lid_switch_state: NONE
hw.acpi.standby_state: S1
hw.acpi.suspend_state: S3
hw.acpi.sleep_delay: 1
hw.acpi.s4bios: 0
hw.acpi.verbose: 0
hw.acpi.disable_on_reboot: 0
hw.acpi.reset_video: 1
hw.acpi.cpu.cx_supported: C1/0
hw.acpi.cpu.cx_lowest: C1
hw.acpi.cpu.cx_usage: 100.00%
machdep.acpi_timer_freq: 3579545
machdep.acpi_root: 1026208
dev.acpi.0.%desc: A M I OEMXSDT
dev.acpi.0.%driver: acpi
dev.acpi.0.%parent: nexus0
dev.acpi_sysresource.0.%desc: System Resource
dev.acpi_sysresource.0.%driver: acpi_sysresource
dev.acpi_sysresource.0.%location: handle=\_SB_.PCI0.SBRG.RMSC
dev.acpi_sysresource.0.%pnpinfo: _HID=PNP0C02 _UID=16
dev.acpi_sysresource.0.%parent: acpi0
dev.acpi_sysresource.1.%desc: System Resource
dev.acpi_sysresource.1.%driver: acpi_sysresource
dev.acpi_sysresource.1.%location: handle=\_SB_.PCI0.SBRG.OMSC
dev.acpi_sysresource.1.%pnpinfo: _HID=PNP0C02 _UID=0
dev.acpi_sysresource.1.%parent: acpi0
dev.acpi_sysresource.2.%desc: System Resource
dev.acpi_sysresource.2.%driver: acpi_sysresource
dev.acpi_sysresource.2.%location: handle=\_SB_.PCI0.SBRG.SIOR
dev.acpi_sysresource.2.%pnpinfo: _HID=PNP0C02 _UID=46
dev.acpi_sysresource.2.%parent: acpi0
dev.acpi_sysresource.3.%desc: System Resource
dev.acpi_sysresource.3.%driver: acpi_sysresource
dev.acpi_sysresource.3.%location: handle=\_SB_.PCI0.PCIE
dev.acpi_sysresource.3.%pnpinfo: _HID=PNP0C02 _UID=17
dev.acpi_sysresource.3.%parent: acpi0
dev.acpi_sysresource.4.%desc: System Resource
dev.acpi_sysresource.4.%driver: acpi_sysresource
dev.acpi_sysresource.4.%location: handle=\_SB_.RMEM
dev.acpi_sysresource.4.%pnpinfo: _HID=PNP0C01 _UID=1
dev.acpi_sysresource.4.%parent: acpi0
dev.acpi_timer.0.%desc: 24-bit timer at 3.579545MHz
dev.acpi_timer.0.%driver: acpi_timer
dev.acpi_timer.0.%location: unknown
dev.acpi_timer.0.%pnpinfo: unknown
dev.acpi_timer.0.%parent: acpi0
dev.pci_link.0.%parent: acpi0
dev.pci_link.1.%parent: acpi0
dev.pci_link.2.%parent: acpi0
dev.pci_link.3.%parent: acpi0
dev.pci_link.4.%parent: acpi0
dev.pci_link.5.%parent: acpi0
dev.pci_link.6.%parent: acpi0
dev.pci_link.7.%parent: acpi0
dev.cpu.0.%parent: acpi0
dev.cpu.1.%parent: acpi0
dev.acpi_throttle.0.%desc: ACPI CPU Throttling
dev.acpi_throttle.0.%driver: acpi_throttle
dev.acpi_throttle.0.%parent: cpu0
dev.acpi_throttle.0.freq_settings: 10000/-1 9375/-1 8750/-1 8125/-1 7500/-1 6875/-1 6250/-1 5625/-1 5000/-1 4375/-1 3750/-1 3125/-1 2500/-1 1875/-1 1250/-1 625/-1
dev.pcib.0.%parent: acpi0
dev.acpi_button.0.%desc: Sleep Button
dev.acpi_button.0.%driver: acpi_button
dev.acpi_button.0.%location: handle=\_SB_.SLPB
dev.acpi_button.0.%pnpinfo: _HID=PNP0C0E _UID=0
dev.acpi_button.0.%parent: acpi0
dev.acpi_button.0.wake: 1
dev.acpi_button.1.%desc: Power Button
dev.acpi_button.1.%driver: acpi_button
dev.acpi_button.1.%location: handle=\_SB_.PWRB
dev.acpi_button.1.%pnpinfo: _HID=PNP0C0C _UID=170
dev.acpi_button.1.%parent: acpi0
dev.atpic.0.%parent: acpi0
dev.atdma.0.%parent: acpi0
dev.attimer.0.%parent: acpi0
dev.attimer.1.%parent: acpi0
dev.npxisa.0.%parent: acpi0
dev.sio.0.%parent: acpi0
dev.fdc.0.%parent: acpi0
dev.atkbdc.0.%parent: acpi0
dev.psmcpnp.0.%parent: acpi0


[-- Attachment #3 --]
Copyright (c) 1992-2006 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 6.1-STABLE #3: Fri Jul  7 22:40:21 CEST 2006
    root@root:/not/default
ACPI APIC Table: <A M I  OEMAPIC >
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) D  CPU 2.66GHz (2660.03-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf47  Stepping = 7
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FX
SR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x651d<SSE3,RSVD2,MON,DS_CPL,TM2,CNTX-ID,CX16,<b14>>
  AMD Features=0x20000000<LM>
  AMD Features2=0x1<LAHF>
  Cores per package: 2
real memory  = 519766016 (495 MB)
avail memory = 503316480 (480 MB)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ioapic0 <Version 0.3> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <A M I OEMXSDT> on motherboard
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
cpu1: <ACPI CPU> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pci1: <display, VGA> at device 0.0 (no driver attached)
atapci0: <VIA 8251 SATA150 controller> port 0xec00-0xec07,0xe880-0xe883,0xe800-0xe807,0xe480-0xe483,0xe400-0xe40f mem
 0xfbfffc00-0xfbffffff irq 21 at device 15.0 on pci0
ata2: <ATA channel 0> on atapci0
ata3: <ATA channel 1> on atapci0
atapci1: <VIA 8251 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xfc00-0xfc0f at device 15.1 on pci0
ata0: <ATA channel 0> on atapci1
ata1: <ATA channel 1> on atapci1
uhci0: <VIA 83C572 USB controller> port 0xe080-0xe09f irq 20 at device 16.0 on pci0
uhci0: [GIANT-LOCKED]
usb0: <VIA 83C572 USB controller> on uhci0
usb0: USB revision 1.0
uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1: <VIA 83C572 USB controller> port 0xe000-0xe01f irq 22 at device 16.1 on pci0
uhci1: [GIANT-LOCKED]
usb1: <VIA 83C572 USB controller> on uhci1
usb1: USB revision 1.0
uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2: <VIA 83C572 USB controller> port 0xdc00-0xdc1f irq 21 at device 16.2 on pci0
uhci2: [GIANT-LOCKED]
usb2: <VIA 83C572 USB controller> on uhci2
usb2: USB revision 1.0
uhub2: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3: <VIA 83C572 USB controller> port 0xd880-0xd89f irq 23 at device 16.3 on pci0
uhci3: [GIANT-LOCKED]
usb3: <VIA 83C572 USB controller> on uhci3
usb3: USB revision 1.0
uhub3: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0: <VIA VT6202 USB 2.0 controller> mem 0xfbfff800-0xfbfff8ff irq 22 at device 16.4 on pci0
ehci0: [GIANT-LOCKED]
usb4: EHCI version 1.0
usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3
usb4: <VIA VT6202 USB 2.0 controller> on ehci0
usb4: USB revision 2.0
uhub4: VIA EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub4: 8 ports with 8 removable, self powered
isab0: <PCI-ISA bridge> at device 17.0 on pci0
isa0: <ISA bus> on isab0
vr0: <VIA VT6102 Rhine II 10/100BaseTX> port 0xd400-0xd4ff mem 0xfbfff400-0xfbfff4ff irq 23 at device 18.0 on pci0
miibus0: <MII bus> on vr0
rlphy0: <RTL8201L 10/100 media interface> on miibus0
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vr0: Ethernet address: 00:e0:12:34:56:78
pcib2: <ACPI PCI-PCI bridge> at device 19.0 on pci0
pci2: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> at device 0.0 on pci2
pci3: <ACPI PCI bus> on pcib3
pcib4: <ACPI PCI-PCI bridge> at device 0.1 on pci2
pci4: <ACPI PCI bus> on pcib4
pcib5: <ACPI PCI-PCI bridge> at device 19.1 on pci0
pci5: <ACPI PCI bus> on pcib5
rl0: <RealTek 8139 10/100BaseTX> port 0xc800-0xc8ff mem 0xfbeffc00-0xfbeffcff irq 17 at device 8.0 on pci5
miibus1: <MII bus> on rl0
rlphy1: <RealTek internal media interface> on miibus1
rlphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
rl0: Ethernet address: 00:30:84:77:49:78
acpi_button0: <Sleep Button> on acpi0
acpi_button1: <Power Button> on acpi0
sio0: configured irq 4 not in bitmap of probed irqs 0
sio0: port may not be enabled
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
fdc0: <floppy drive controller (FDE)> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FAST]
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model MouseMan+, device ID 0
pmtimer0 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounters tick every 1.000 msec
ad4: 76319MB <SAMSUNG HD080HJ ZH100-41> at ata2-master SATA150
SMP: AP CPU #1 Launched!
Trying to mount root from ufs:/dev/ad4s1a


[-- Attachment #4 --]
/*
  RSD PTR: OEM=ACPIAM, ACPI_Rev=2.0x (2)
	XSDT=0x1efb0100, length=36, cksum=194
 */
/*
  XSDT: Length=68, Revision=1, Checksum=114,
	OEMID=A M I, OEM Table ID=OEMXSDT, OEM Revision=0x4000614,
	Creator ID=MSFT, Creator Revision=0x97
	Entries={ 0x1efb0290, 0x1efb0390, 0x1efb03f0, 0x1efbe040 }
 */
/*
  FACP: Length=244, Revision=3, Checksum=110,
	OEMID=A M I, OEM Table ID=OEMFACP, OEM Revision=0x4000614,
	Creator ID=MSFT, Creator Revision=0x97
 	FACS=0x1efbe000, DSDT=0x1efb0430
	INT_MODEL=APIC
	Preferred_PM_Profile=Desktop (1)
	SCI_INT=9
	SMI_CMD=0x82f, ACPI_ENABLE=0xe1, ACPI_DISABLE=0x1e, S4BIOS_REQ=0x0
	PSTATE_CNT=0xe2
	PM1a_EVT_BLK=0x800-0x803
	PM1a_CNT_BLK=0x804-0x805
	PM_TMR_BLK=0x808-0x80b
	GPE0_BLK=0x820-0x823
	CST_CNT=0xe3
	P_LVL2_LAT=101 us, P_LVL3_LAT=1001 us
	FLUSH_SIZE=1024, FLUSH_STRIDE=16
	DUTY_OFFSET=0, DUTY_WIDTH=4
	DAY_ALRM=125, MON_ALRM=126, CENTURY=50
	IAPC_BOOT_ARCH={LEGACY_DEV,8042}
	Flags={WBINVD,PROC_C1,SLP_BUTTON,RTC_S4}
	X_FACS=0x1efbe000, X_DSDT=0x1efb0430
	X_PM1a_EVT_BLK=0x800:0[32] (IO)
	X_PM1a_CNT_BLK=0x804:0[16] (IO)
	X_PM_TMR_BLK=0x808:0[32] (IO)
	X_GPE0_BLK=0x820:0[32] (IO)
 */
/*
  FACS:	Length=64, HwSig=0x00000000, Firm_Wake_Vec=0x00000000
	Global_Lock=
	Flags=
	Version=1
 */
/*
  DSDT: Length=19506, Revision=1, Checksum=46,
	OEMID=A0403, OEM Table ID=A0403503, OEM Revision=0x503,
	Creator ID=INTL, Creator Revision=0x2002026
 */
/*
  APIC: Length=92, Revision=1, Checksum=69,
	OEMID=A M I, OEM Table ID=OEMAPIC, OEM Revision=0x4000614,
	Creator ID=MSFT, Creator Revision=0x97
	Local APIC ADDR=0xfee00000
	Flags={PC-AT}

	Type=Local APIC
	ACPI CPU=1
	Flags={ENABLED}
	APIC ID=0

	Type=Local APIC
	ACPI CPU=2
	Flags={ENABLED}
	APIC ID=1

	Type=IO APIC
	APIC ID=2
	INT BASE=0
	ADDR=0x00000000fec00000

	Type=INT Override
	BUS=0
	IRQ=0
	INTR=2
	Flags={Polarity=conforming, Trigger=conforming}

	Type=INT Override
	BUS=0
	IRQ=9
	INTR=9
	Flags={Polarity=active-lo, Trigger=level}
 */
/*
  MCFG: Length=60, Revision=1, Checksum=129,
	OEMID=A M I, OEM Table ID=OEMMCFG, OEM Revision=0x4000614,
	Creator ID=MSFT, Creator Revision=0x97

	Base Address= 0x00000000e0000000
	Segment Group= 0x0000
	Start Bus= 2
	End Bus= 255
 */
/*
 * Intel ACPI Component Architecture
 * AML Disassembler version 20041119
 *
 * Disassembly of /tmp/acpidump.5C9OVF, Sat Jul  8 12:42:29 2006
 */
DefinitionBlock ("DSDT.aml", "DSDT", 1, "A0403", "A0403503", 1283)
{
    Name (SPIO, 0x2E)
    Name (IOPB, 0x0C00)
    Name (IOPL, 0x10)
    Name (IOEB, 0x0D00)
    Name (IOEL, 0x10)
    Name (IOGB, 0x0A20)
    Name (IOGL, 0x10)
    Name (IODB, 0x0A30)
    Name (IODL, 0x10)
    Name (IO1B, 0x0A20)
    Name (IO1L, 0x08)
    Name (IO3B, 0x0D00)
    Name (IO3L, 0x80)
    Name (CPUC, 0x02)
    Name (APIC, 0x01)
    Name (PMBS, 0x0800)
    Name (PMLN, 0x80)
    Name (PM28, 0x0828)
    Name (GPBS, 0x00)
    Name (GPLN, 0x00)
    Name (SMBS, 0x0400)
    Name (SMBL, 0x20)
    Name (SUSW, 0x04)
    Name (PCIB, 0xE0000000)
    Name (PCIL, 0x10000000)
    OperationRegion (BIOS, SystemMemory, 0x1EFBE064, 0xFF)
    Field (BIOS, ByteAcc, NoLock, Preserve)
    {
        SS1,    1, 
        SS2,    1, 
        SS3,    1, 
        SS4,    1, 
        Offset (0x01), 
        IOST,   16, 
        TOPM,   32, 
        ROMS,   32, 
        MG1B,   32, 
        MG1L,   32, 
        MG2B,   32, 
        MG2L,   32, 
        Offset (0x1C), 
        ASSB,   8, 
        AOTB,   8, 
        AAXB,   32, 
        DMAX,   8, 
        HPTA,   32
    }

    Method (RRIO, 4, NotSerialized)
    {
        Store ("RRIO", Debug)
    }

    Method (RDMA, 3, NotSerialized)
    {
        Store ("rDMA", Debug)
    }

    Name (PICM, 0x00)
    Method (_PIC, 1, NotSerialized)
    {
        If (Arg0)
        {
            Store (0xAA, DBG8)
        }
        Else
        {
            Store (0xAC, DBG8)
        }

        Store (Arg0, PICM)
    }

    Name (OSVR, Ones)
    Method (OSFL, 0, NotSerialized)
    {
        If (LNot (LEqual (OSVR, Ones)))
        {
            Return (OSVR)
        }

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

        Store (0x01, OSVR)
        If (MCTH (\_OS, "Microsoft Windows NT"))
        {
            Store (0x00, OSVR)
        }
        Else
        {
            If (MCTH (\_OS, "Microsoft WindowsME: Millennium Edition"))
            {
                Store (0x02, OSVR)
            }

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

        Return (OSVR)
    }

    Method (MCTH, 2, NotSerialized)
    {
        If (LLess (SizeOf (Arg0), SizeOf (Arg1)))
        {
            Return (Zero)
        }

        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)
    }

    Name (PRWP, Package (0x02)
    {
        Zero, 
        Zero
    })
    Method (GPRW, 2, NotSerialized)
    {
        Store (Arg0, Index (PRWP, 0x00))
        Store (ShiftLeft (SS1, 0x01), Local0)
        Or (Local0, ShiftLeft (SS2, 0x02), Local0)
        Or (Local0, ShiftLeft (SS3, 0x03), Local0)
        Or (Local0, ShiftLeft (SS4, 0x04), Local0)
        If (And (ShiftLeft (0x01, Arg1), Local0))
        {
            Store (Arg1, Index (PRWP, 0x01))
        }
        Else
        {
            ShiftRight (Local0, 0x01, Local0)
            If (LOr (LEqual (OSFL (), 0x01), LEqual (OSFL (), 0x02)))
            {
                FindSetLeftBit (Local0, Index (PRWP, 0x01))
            }
            Else
            {
                FindSetRightBit (Local0, Index (PRWP, 0x01))
            }
        }

        Return (PRWP)
    }

    Name (WAKP, Package (0x02)
    {
        Zero, 
        Zero
    })
    OperationRegion (DEB0, SystemIO, 0x80, 0x01)
    Field (DEB0, ByteAcc, NoLock, Preserve)
    {
        DBG8,   8
    }

    OperationRegion (DEB1, SystemIO, 0x90, 0x02)
    Field (DEB1, WordAcc, NoLock, Preserve)
    {
        DBG9,   16
    }

    Scope (\_PR)
    {
        Processor (CPU1, 0x01, 0x00000810, 0x06) {}
        Processor (CPU2, 0x02, 0x00000000, 0x00) {}
    }

    Scope (\_SB)
    {
        Name (PR00, Package (0x0F)
        {
            Package (0x04)
            {
                0x0001FFFF, 
                0x00, 
                LNKA, 
                0x00
            }, 

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

            Package (0x04)
            {
                0x0011FFFF, 
                0x02, 
                LNKC, 
                0x00
            }, 

            Package (0x04)
            {
                0x0010FFFF, 
                0x00, 
                LNKA, 
                0x00
            }, 

            Package (0x04)
            {
                0x0010FFFF, 
                0x01, 
                LNKB, 
                0x00
            }, 

            Package (0x04)
            {
                0x0010FFFF, 
                0x02, 
                LNKC, 
                0x00
            }, 

            Package (0x04)
            {
                0x0010FFFF, 
                0x03, 
                LNKD, 
                0x00
            }, 

            Package (0x04)
            {
                0x0012FFFF, 
                0x00, 
                LNKA, 
                0x00
            }, 

            Package (0x04)
            {
                0x0012FFFF, 
                0x01, 
                LNKB, 
                0x00
            }, 

            Package (0x04)
            {
                0x0012FFFF, 
                0x02, 
                LNKC, 
                0x00
            }, 

            Package (0x04)
            {
                0x0012FFFF, 
                0x03, 
                LNKD, 
                0x00
            }, 

            Package (0x04)
            {
                0x000FFFFF, 
                0x00, 
                LNKB, 
                0x00
            }, 

            Package (0x04)
            {
                0x000FFFFF, 
                0x01, 
                LNKB, 
                0x00
            }, 

            Package (0x04)
            {
                0x000FFFFF, 
                0x02, 
                LNKB, 
                0x00
            }, 

            Package (0x04)
            {
                0x000FFFFF, 
                0x03, 
                LNKB, 
                0x00
            }
        })
        Name (AR00, Package (0x0F)
        {
            Package (0x04)
            {
                0x0001FFFF, 
                0x00, 
                0x00, 
                0x10
            }, 

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

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

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

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

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

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

            Package (0x04)
            {
                0x0012FFFF, 
                0x00, 
                0x00, 
                0x17
            }, 

            Package (0x04)
            {
                0x0012FFFF, 
                0x01, 
                0x00, 
                0x17
            }, 

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

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

            Package (0x04)
            {
                0x000FFFFF, 
                0x00, 
                0x00, 
                0x15
            }, 

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

            Package (0x04)
            {
                0x000FFFFF, 
                0x02, 
                0x00, 
                0x15
            }, 

            Package (0x04)
            {
                0x000FFFFF, 
                0x03, 
                0x00, 
                0x15
            }
        })
        Name (PR01, Package (0x01)
        {
            Package (0x04)
            {
                0xFFFF, 
                0x00, 
                LNKA, 
                0x00
            }
        })
        Name (AR01, Package (0x01)
        {
            Package (0x04)
            {
                0xFFFF, 
                0x00, 
                0x00, 
                0x10
            }
        })
        Name (PR07, Package (0x08)
        {
            Package (0x04)
            {
                0xFFFF, 
                0x00, 
                LNKD, 
                0x00
            }, 

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

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

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

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

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

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

            Package (0x04)
            {
                0x0001FFFF, 
                0x03, 
                LNKB, 
                0x00
            }
        })
        Name (AR07, Package (0x08)
        {
            Package (0x04)
            {
                0xFFFF, 
                0x00, 
                0x00, 
                0x14
            }, 

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

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

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

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

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

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

            Package (0x04)
            {
                0x0001FFFF, 
                0x03, 
                0x00, 
                0x11
            }
        })
        Name (PR08, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                0x00, 
                LNKA, 
                0x00
            }, 

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

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

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                LNKD, 
                0x00
            }
        })
        Name (AR08, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                0x00, 
                0x00, 
                0x10
            }, 

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

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

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

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

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

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                LNKD, 
                0x00
            }
        })
        Name (AR09, Package (0x04)
        {
            Package (0x04)
            {
                0xFFFF, 
                0x00, 
                0x00, 
                0x10
            }, 

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

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

            Package (0x04)
            {
                0xFFFF, 
                0x03, 
                0x00, 
                0x13
            }
        })
        Name (PR05, Package (0x09)
        {
            Package (0x04)
            {
                0x0008FFFF, 
                0x00, 
                LNKB, 
                0x00
            }, 

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

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

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

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

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

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

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

            Package (0x04)
            {
                0x0009FFFF, 
                0x03, 
                LNKB, 
                0x00
            }
        })
        Name (AR05, Package (0x09)
        {
            Package (0x04)
            {
                0x0008FFFF, 
                0x00, 
                0x00, 
                0x11
            }, 

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

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

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

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

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

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

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

            Package (0x04)
            {
                0x0009FFFF, 
                0x03, 
                0x00, 
                0x11
            }
        })
        Name (PRSA, ResourceTemplate ()
        {
            IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11,12,14,15}
        })
        Alias (PRSA, PRSB)
        Alias (PRSA, PRSC)
        Alias (PRSA, PRSD)
        Alias (PRSA, PRSE)
        Alias (PRSA, PRSF)
        Alias (PRSA, PRSG)
        Alias (PRSA, PRSH)
        Device (PCI0)
        {
            Name (_HID, EisaId ("PNP0A03"))
            Name (_ADR, 0x00)
            Method (^BN00, 0, NotSerialized)
            {
                Return (0x00)
            }

            Method (_BBN, 0, NotSerialized)
            {
                Return (BN00 ())
            }

            Name (_UID, 0x00)
            Method (_PRT, 0, NotSerialized)
            {
                If (PICM)
                {
                    Return (AR00)
                }

                Return (PR00)
            }

            Method (_S3D, 0, NotSerialized)
            {
                If (LOr (LEqual (OSFL (), 0x01), LEqual (OSFL (), 0x02)))
                {
                    Return (0x02)
                }
                Else
                {
                    Return (0x03)
                }
            }

            Method (NPTS, 1, NotSerialized)
            {
            }

            Method (NWAK, 1, NotSerialized)
            {
            }

            Device (NBF1)
            {
                Name (_ADR, 0x01)
            }

            Device (NBF2)
            {
                Name (_ADR, 0x02)
            }

            Device (NBF3)
            {
                Name (_ADR, 0x03)
            }

            Device (NBF4)
            {
                Name (_ADR, 0x04)
            }

            Device (NBF5)
            {
                Name (_ADR, 0x07)
            }

            Device (P0P1)
            {
                Name (_ADR, 0x00010000)
                Method (_PRT, 0, NotSerialized)
                {
                    If (PICM)
                    {
                        Return (AR01)
                    }

                    Return (PR01)
                }
            }

            Device (SBRG)
            {
                Name (_ADR, 0x00110000)
                Method (SPTS, 1, NotSerialized)
                {
                    If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL (), 0x02)))
                    {
                        Sleep (0x0BB8)
                    }

                    If (LEqual (Arg0, 0x01))
                    {
                        While (WAKS)
                        {
                            Stall (0x50)
                            Store (One, WAKS)
                        }
                    }
                    Else
                    {
                        Store (Zero, SUST)
                    }

                    Store (\_SB.PCI0.MC97.MC9P, PTB0)
                    Store (0x00, \_SB.PCI0.MC97.MC9P)
                    Store (0x01, \_SB.SLPS)
                    While (SLES)
                    {
                        Stall (0x50)
                        Store (0x01, SLES)
                    }

                    Store (0x01, SLEE)
                }

                Method (SWAK, 1, NotSerialized)
                {
                    If (RTCX) {}
                    Else
                    {
                        Notify (\_SB.PWRB, 0x02)
                    }

                    Store (Zero, RTCX)
                    Store (One, PWBT)
                    Store (PTB0, \_SB.PCI0.MC97.MC9P)
                    Store (Zero, SLEE)
                    Store (Zero, \_SB.PCI0.USB1.U184)
                    Store (Zero, \_SB.PCI0.USB2.U284)
                    Store (Zero, \_SB.PCI0.USB3.U384)
                    Store (Zero, \_SB.PCI0.USB4.U484)
                    Store (Zero, \_SB.PCI0.EHCI.U584)
                    Store (0x00, \_SB.SLPS)
                }

                OperationRegion (PMS0, SystemIO, PMBS, 0x04)
                Field (PMS0, ByteAcc, NoLock, Preserve)
                {
                        ,   10, 
                    RTCS,   1, 
                    Offset (0x03), 
                    PWBT,   1, 
                    Offset (0x04)
                }

                OperationRegion (IOTP, SystemIO, PM28, 0x04)
                Field (IOTP, ByteAcc, NoLock, Preserve)
                {
                        ,   7, 
                    WAKS,   1, 
                        ,   2, 
                    SLES,   1, 
                        ,   4, 
                    PS1S,   1, 
                        ,   10, 
                    SLEE,   1, 
                        ,   4, 
                    PS1E,   1
                }

                OperationRegion (\_SB.PCI0.SBRG.PWCR, PCI_Config, 0x94, 0x01)
                Field (\_SB.PCI0.SBRG.PWCR, ByteAcc, NoLock, Preserve)
                {
                        ,   4, 
                    SUST,   1, 
                    Offset (0x01)
                }

                OperationRegion (\_SB.PCI0.SBRG.BSR0, PCI_Config, 0x6F, 0x01)
                Field (\_SB.PCI0.SBRG.BSR0, ByteAcc, NoLock, Preserve)
                {
                        ,   7, 
                    RTCX,   1
                }

                Name (PTBF, Buffer (0x03)
                {
                    0x00, 0x00, 0x00
                })
                CreateByteField (PTBF, 0x00, PTB0)
                CreateByteField (PTBF, 0x01, PTB1)
                CreateByteField (PTBF, 0x02, PTB2)
                Scope (\_SB)
                {
                    Name (SLPS, 0x00)
                    Device (SLPB)
                    {
                        Name (_HID, EisaId ("PNP0C0E"))
                        Method (_STA, 0, NotSerialized)
                        {
                            If (LNot (LEqual (SUSW, 0xFF)))
                            {
                                Return (0x0F)
                            }

                            Return (0x00)
                        }

                        Method (SBEV, 0, NotSerialized)
                        {
                            If (SLPS)
                            {
                                Notify (SLPB, 0x02)
                            }
                            Else
                            {
                                Notify (SLPB, 0x80)
                            }
                        }

                        Method (\_GPE._L04, 0, NotSerialized)
                        {
                            \_SB.SLPB.SBEV ()
                        }

                        Method (_PRW, 0, NotSerialized)
                        {
                            Return (Package (0x02)
                            {
                                0x04, 
                                0x04
                            })
                        }
                    }
                }

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

                Device (DMAD)
                {
                    Name (_HID, EisaId ("PNP0200"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        DMA (Compatibility, BusMaster, Transfer8) {4}
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x10)
                        IO (Decode16, 0x0081, 0x0081, 0x00, 0x03)
                        IO (Decode16, 0x0087, 0x0087, 0x00, 0x01)
                        IO (Decode16, 0x0089, 0x0089, 0x00, 0x03)
                        IO (Decode16, 0x008F, 0x008F, 0x00, 0x01)
                        IO (Decode16, 0x00C0, 0x00C0, 0x00, 0x20)
                    })
                }

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

                Device (RTC0)
                {
                    Name (_HID, EisaId ("PNP0B00"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0070, 0x0070, 0x00, 0x02)
                        IRQNoFlags () {8}
                    })
                }

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

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

                Device (UAR1)
                {
                    Name (_UID, 0x01)
                    Method (_HID, 0, NotSerialized)
                    {
                        Return (UHID (0x00))
                    }

                    Method (_STA, 0, NotSerialized)
                    {
                        Return (DSTA (0x00))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DCNT (0x00, 0x00)
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (DCRS (0x00, 0x01))
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        DSRS (Arg0, 0x00)
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        Return (CMPR)
                    }

                    Method (_PRW, 0, NotSerialized)
                    {
                        Return (GPRW (0x08, 0x04))
                    }

                    Name (CMPR, ResourceTemplate ()
                    {
                        StartDependentFn (0x00, 0x00)
                        {
                            IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                            IRQNoFlags () {4}
                            DMA (Compatibility, NotBusMaster, Transfer8) {}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        EndDependentFn ()
                    })
                }

                Device (FDC)
                {
                    Name (_HID, EisaId ("PNP0700"))
                    Method (_FDE, 0, NotSerialized)
                    {
                        Name (FDEP, Package (0x05)
                        {
                            0x00, 
                            0x00, 
                            0x02, 
                            0x02, 
                            0x02
                        })
                        If (_STA ())
                        {
                            Store (0x01, Index (FDEP, 0x00))
                        }

                        Return (FDEP)
                    }

                    Method (_STA, 0, NotSerialized)
                    {
                        Return (DSTA (0x03))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DCNT (0x03, 0x00)
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        DCRS (0x03, 0x01)
                        Store (IRQM, IRQE)
                        Store (DMAM, DMAE)
                        Store (IO11, IO21)
                        Store (IO12, IO22)
                        Store (0x06, LEN2)
                        Add (IO21, 0x07, IO31)
                        Store (IO31, IO32)
                        Store (0x01, LEN3)
                        Return (CRS2)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        DSRS (Arg0, 0x03)
                        CreateWordField (Arg0, 0x11, IRQE)
                        CreateByteField (Arg0, 0x14, DMAE)
                        ENFG (CGLD (0x03))
                        If (IRQE)
                        {
                            FindSetRightBit (IRQE, Local0)
                            Subtract (Local0, 0x01, INTR)
                        }
                        Else
                        {
                            Store (0x00, INTR)
                        }

                        If (DMAE)
                        {
                            FindSetRightBit (DMAE, Local0)
                            Subtract (Local0, 0x01, DMCH)
                        }
                        Else
                        {
                            Store (0x04, DMCH)
                        }

                        EXFG ()
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        StartDependentFn (0x00, 0x00)
                        {
                            IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
                            IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
                            IRQNoFlags () {6}
                            DMA (Compatibility, NotBusMaster, Transfer8) {2}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
                            IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x0370, 0x0370, 0x01, 0x06)
                            IO (Decode16, 0x0377, 0x0377, 0x01, 0x01)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        EndDependentFn ()
                    })
                }

                Device (LPTE)
                {
                    Method (_HID, 0, NotSerialized)
                    {
                        If (LPTM (0x02))
                        {
                            Return (0x0104D041)
                        }
                        Else
                        {
                            Return (0x0004D041)
                        }
                    }

                    Method (_STA, 0, NotSerialized)
                    {
                        Return (DSTA (0x02))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DCNT (0x02, 0x00)
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        DCRS (0x02, 0x01)
                        If (LPTM (0x02))
                        {
                            Store (IRQM, IRQE)
                            Store (DMAM, DMAE)
                            Store (IO11, IO21)
                            Store (IO12, IO22)
                            Store (LEN1, LEN2)
                            Add (IO21, 0x0400, IO31)
                            Store (IO31, IO32)
                            Store (LEN2, LEN3)
                            Return (CRS2)
                        }
                        Else
                        {
                            Return (CRS1)
                        }
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        DSRS (Arg0, 0x02)
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        If (LPTM (0x02))
                        {
                            Return (EPPR)
                        }
                        Else
                        {
                            Return (LPPR)
                        }
                    }

                    Name (LPPR, ResourceTemplate ()
                    {
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x03BC, 0x03BC, 0x01, 0x04)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {}
                        }
                        EndDependentFn ()
                    })
                    Name (EPPR, ResourceTemplate ()
                    {
                        StartDependentFn (0x00, 0x00)
                        {
                            IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                            IO (Decode16, 0x0778, 0x0778, 0x01, 0x08)
                            IRQNoFlags () {7}
                            DMA (Compatibility, NotBusMaster, Transfer8) {3}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x0378, 0x0378, 0x01, 0x08)
                            IO (Decode16, 0x0778, 0x0778, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x0278, 0x0278, 0x01, 0x08)
                            IO (Decode16, 0x0678, 0x0678, 0x01, 0x08)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x03BC, 0x03BC, 0x01, 0x04)
                            IO (Decode16, 0x07BC, 0x07BC, 0x01, 0x04)
                            IRQNoFlags () {3,4,5,6,7,10,11,12}
                            DMA (Compatibility, NotBusMaster, Transfer8) {0,1,2,3}
                        }
                        EndDependentFn ()
                    })
                }

                Device (GAME)
                {
                    Name (_HID, EisaId ("PNPB02F"))
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (DSTA (0x08))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DCNT (0x08, 0x00)
                    }

                    Name (GMCR, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x08, 0x08)
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        CreateWordField (GMCR, 0x02, IOGL)
                        CreateWordField (GMCR, 0x04, IOGH)
                        ENFG (CGLD (0x08))
                        ShiftLeft (IOAH, 0x08, IOGL)
                        Or (IOAL, IOGL, IOGL)
                        Store (IOGL, IOGH)
                        EXFG ()
                        Return (GMCR)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        CreateWordField (Arg0, 0x02, IO11)
                        ENFG (CGLD (0x08))
                        And (IO11, 0xFF, IOAL)
                        ShiftRight (IO11, 0x08, IOAH)
                        DCNT (0x08, 0x01)
                        EXFG ()
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        StartDependentFn (0x00, 0x00)
                        {
                            IO (Decode16, 0x0201, 0x0201, 0x01, 0x08)
                        }
                        EndDependentFn ()
                    })
                }

                Device (MIDI)
                {
                    Name (_HID, EisaId ("PNPB006"))
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (DSTA (0x05))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DCNT (0x05, 0x00)
                    }

                    Name (MDCR, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x02)
                        IRQNoFlags () {5}
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        CreateWordField (MDCR, 0x02, IOML)
                        CreateWordField (MDCR, 0x04, IOMH)
                        CreateWordField (MDCR, 0x09, IRQM)
                        ENFG (CGLD (0x05))
                        ShiftLeft (IOAH, 0x08, IOML)
                        Or (IOAL, IOML, IOML)
                        Store (IOML, IOMH)
                        If (INTR)
                        {
                            ShiftLeft (0x01, INTR, IRQM)
                        }
                        Else
                        {
                            Store (0x00, IRQM)
                        }

                        EXFG ()
                        Return (MDCR)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        CreateWordField (Arg0, 0x02, IO11)
                        CreateWordField (Arg0, 0x09, IRQM)
                        ENFG (CGLD (0x05))
                        And (IO11, 0xFF, IOAL)
                        ShiftRight (IO11, 0x08, IOAH)
                        If (IRQM)
                        {
                            FindSetRightBit (IRQM, Local0)
                            Subtract (Local0, 0x01, INTR)
                        }
                        Else
                        {
                            Store (0x00, INTR)
                        }

                        DCNT (0x05, 0x01)
                        EXFG ()
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x0300, 0x0300, 0x01, 0x02)
                        }
                        StartDependentFnNoPri ()
                        {
                            IO (Decode16, 0x0330, 0x0330, 0x01, 0x02)
                        }
                        EndDependentFn ()
                        IRQNoFlags () {5,7,9,10,11}
                    })
                }

                Device (RMSC)
                {
                    Name (_HID, EisaId ("PNP0C02"))
                    Name (_UID, 0x10)
                    Name (CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0010, 0x0010, 0x00, 0x10)
                        IO (Decode16, 0x0022, 0x0022, 0x00, 0x1E)
                        IO (Decode16, 0x0044, 0x0044, 0x00, 0x1C)
                        IO (Decode16, 0x0062, 0x0062, 0x00, 0x02)
                        IO (Decode16, 0x0065, 0x0065, 0x00, 0x0B)
                        IO (Decode16, 0x0072, 0x0072, 0x00, 0x0E)
                        IO (Decode16, 0x0080, 0x0080, 0x00, 0x01)
                        IO (Decode16, 0x0084, 0x0084, 0x00, 0x03)
                        IO (Decode16, 0x0088, 0x0088, 0x00, 0x01)
                        IO (Decode16, 0x008C, 0x008C, 0x00, 0x03)
                        IO (Decode16, 0x0090, 0x0090, 0x00, 0x10)
                        IO (Decode16, 0x00A2, 0x00A2, 0x00, 0x1E)
                        IO (Decode16, 0x00E0, 0x00E0, 0x00, 0x10)
                        IO (Decode16, 0x03E0, 0x03E0, 0x00, 0x08)
                        Memory32Fixed (ReadWrite, 0xFFB00000, 0x00100000)
                        IO (Decode16, 0x04D0, 0x04D0, 0x00, 0x02)
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x00)
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x00)
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x00)
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        CreateWordField (CRS, 0x86, GP00)
                        CreateWordField (CRS, 0x88, GP01)
                        CreateByteField (CRS, 0x8B, GP0L)
                        Store (PMBS, GP00)
                        Store (PMBS, GP01)
                        Store (PMLN, GP0L)
                        If (SMBS)
                        {
                            CreateWordField (CRS, 0x8E, GP10)
                            CreateWordField (CRS, 0x90, GP11)
                            CreateByteField (CRS, 0x93, GP1L)
                            Store (SMBS, GP10)
                            Store (SMBS, GP11)
                            Store (SMBL, GP1L)
                        }

                        If (GPBS)
                        {
                            CreateWordField (CRS, 0x96, GP20)
                            CreateWordField (CRS, 0x98, GP21)
                            CreateByteField (CRS, 0x9B, GP2L)
                            Store (GPBS, GP20)
                            Store (GPBS, GP21)
                            Store (GPLN, GP2L)
                        }

                        If (LOr (LEqual (OSFL (), 0x01), LEqual (OSFL (), 0x02))) {}
                        Else
                        {
                            CreateDWordField (CRS, 0x78, ML03)
                            CreateDWordField (CRS, 0x74, MB03)
                            Store (0xFFB00000, MB03)
                            Store (0x00500000, ML03)
                        }

                        Return (CRS)
                    }
                }

                Scope (\_SB.PCI0.SBRG)
                {
                    Device (ASOC)
                    {
                        Name (_HID, "ATK0110")
                        Name (_UID, 0x01010110)
                        Method (_STA, 0, NotSerialized)
                        {
                            Return (0x0F)
                        }
                    }
                }

                Device (PS2K)
                {
                    Name (_HID, EisaId ("PNP0303"))
                    Name (_CID, 0x0B03D041)
                    Method (_STA, 0, NotSerialized)
                    {
                        ShiftLeft (0x01, 0x0A, Local0)
                        If (And (IOST, Local0))
                        {
                            Return (0x0F)
                        }

                        Return (0x00)
                    }

                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
                        IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
                        IRQNoFlags () {1}
                    })
                    Method (_PRW, 0, NotSerialized)
                    {
                        Return (GPRW (0x02, 0x04))
                    }
                }

                Device (PS2M)
                {
                    Name (_HID, EisaId ("PNP0F03"))
                    Name (_CID, 0x130FD041)
                    Method (_STA, 0, NotSerialized)
                    {
                        ShiftLeft (0x01, 0x0C, Local0)
                        If (And (IOST, Local0))
                        {
                            Return (0x0F)
                        }

                        Return (0x00)
                    }

                    Name (CRS1, ResourceTemplate ()
                    {
                        IRQNoFlags () {12}
                    })
                    Name (CRS2, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
                        IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
                        IRQNoFlags () {12}
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        ShiftLeft (0x01, 0x0A, Local0)
                        If (And (IOST, Local0))
                        {
                            Return (CRS1)
                        }
                        Else
                        {
                            Return (CRS2)
                        }
                    }

                    Method (_PRW, 0, NotSerialized)
                    {
                        Return (GPRW (0x09, 0x04))
                    }
                }

                Scope (\)
                {
                    OperationRegion (\RAMW, SystemMemory, Subtract (TOPM, 0x00010000), 0x00010000)
                    Field (\RAMW, ByteAcc, NoLock, Preserve)
                    {
                        PAR0,   32, 
                        PAR1,   32
                    }

                    OperationRegion (IOB2, SystemIO, 0x082F, 0x02)
                    Field (IOB2, ByteAcc, NoLock, Preserve)
                    {
                        SMIC,   8, 
                        SMIS,   8
                    }

                    Method (ISMI, 1, Serialized)
                    {
                        Store (Arg0, SMIC)
                    }

                    Method (GNVS, 1, Serialized)
                    {
                        Store (Arg0, PAR0)
                        ISMI (0x70)
                        Return (PAR1)
                    }

                    Method (SNVS, 2, Serialized)
                    {
                        Store (Arg0, PAR0)
                        Store (Arg1, PAR1)
                        ISMI (0x71)
                    }
                }

                Device (\_SB.PCI0.PCIE)
                {
                    Name (_HID, EisaId ("PNP0C02"))
                    Name (_UID, 0x11)
                    Name (CRS, ResourceTemplate ()
                    {
                        Memory32Fixed (ReadOnly, 0xE0000000, 0x10000000)
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        CreateDWordField (CRS, 0x04, BAS1)
                        CreateDWordField (CRS, 0x08, LEN1)
                        Store (\PCIB, BAS1)
                        Store (\PCIL, LEN1)
                        Return (CRS)
                    }
                }

                Device (OMSC)
                {
                    Name (_HID, EisaId ("PNP0C02"))
                    Name (_UID, 0x00)
                    Name (CRS, ResourceTemplate ()
                    {
                        Memory32Fixed (ReadOnly, 0x00000000, 0x00000000)
                        Memory32Fixed (ReadOnly, 0x00000000, 0x00000000)
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        If (APIC)
                        {
                            CreateDWordField (CRS, 0x08, ML01)
                            CreateDWordField (CRS, 0x04, MB01)
                            CreateDWordField (CRS, 0x14, ML02)
                            CreateDWordField (CRS, 0x10, MB02)
                            Store (0xFEC00000, MB01)
                            Store (0x1000, ML01)
                            Store (0xFEE00000, MB02)
                            Store (0x1000, ML02)
                        }

                        Return (CRS)
                    }
                }

                Device (\_SB.RMEM)
                {
                    Name (_HID, EisaId ("PNP0C01"))
                    Name (_UID, 0x01)
                    Name (CRS, ResourceTemplate ()
                    {
                        Memory32Fixed (ReadWrite, 0x00000000, 0x000A0000)
                        Memory32Fixed (ReadOnly, 0x00000000, 0x00000000)
                        Memory32Fixed (ReadOnly, 0x000E0000, 0x00020000)
                        Memory32Fixed (ReadWrite, 0x00100000, 0x00000000)
                        Memory32Fixed (ReadOnly, 0x00000000, 0x00000000)
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        CreateDWordField (CRS, 0x10, BAS1)
                        CreateDWordField (CRS, 0x14, LEN1)
                        CreateDWordField (CRS, 0x1C, BAS2)
                        CreateDWordField (CRS, 0x20, LEN2)
                        CreateDWordField (CRS, 0x2C, LEN3)
                        CreateDWordField (CRS, 0x34, BAS4)
                        CreateDWordField (CRS, 0x38, LEN4)
                        If (OSFL ()) {}
                        Else
                        {
                            If (MG1B)
                            {
                                If (LGreater (MG1B, 0x000C0000))
                                {
                                    Store (0x000C0000, BAS1)
                                    Subtract (MG1B, BAS1, LEN1)
                                }
                            }
                            Else
                            {
                                Store (0x000C0000, BAS1)
                                Store (0x00020000, LEN1)
                            }

                            If (Add (MG1B, MG1L, Local0))
                            {
                                Store (Local0, BAS2)
                                Subtract (0x00100000, BAS2, LEN2)
                            }
                        }

                        Subtract (MG2B, 0x00100000, LEN3)
                        Add (MG2B, MG2L, BAS4)
                        Subtract (0x00, BAS4, LEN4)
                        Return (CRS)
                    }
                }

                Device (SIOR)
                {
                    Name (_HID, EisaId ("PNP0C02"))
                    Method (_UID, 0, NotSerialized)
                    {
                        Return (SPIO)
                    }

                    Name (CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x00)
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x00)
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x00)
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x00)
                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x00)
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        If (LAnd (LNot (LEqual (SPIO, 0x03F0)), LGreater (SPIO, 0xF0)))
                        {
                            CreateWordField (CRS, 0x02, GP10)
                            CreateWordField (CRS, 0x04, GP11)
                            CreateByteField (CRS, 0x07, GPL1)
                            Store (SPIO, GP10)
                            Store (SPIO, GP11)
                            Store (0x02, GPL1)
                        }

                        If (IOPB)
                        {
                            CreateWordField (CRS, 0x0A, GP20)
                            CreateWordField (CRS, 0x0C, GP21)
                            CreateByteField (CRS, 0x0F, GPL2)
                            Store (IOPB, GP20)
                            Store (IOPB, GP21)
                            Store (IOPL, GPL2)
                        }

                        If (IOEB)
                        {
                            CreateWordField (CRS, 0x12, GP30)
                            CreateWordField (CRS, 0x14, GP31)
                            CreateByteField (CRS, 0x17, GPL3)
                            Store (IOEB, GP30)
                            Store (IOEB, GP31)
                            Store (IOEL, GPL3)
                        }

                        If (IOGB)
                        {
                            CreateWordField (CRS, 0x1A, GP40)
                            CreateWordField (CRS, 0x1C, GP41)
                            CreateByteField (CRS, 0x1F, GPL4)
                            Store (IOGB, GP40)
                            Store (IOGB, GP41)
                            Store (IOGL, GPL4)
                        }

                        If (IODB)
                        {
                            CreateWordField (CRS, 0x22, GP50)
                            CreateWordField (CRS, 0x24, GP51)
                            CreateByteField (CRS, 0x27, GPL5)
                            Store (IODB, GP50)
                            Store (IODB, GP51)
                            Store (IODL, GPL5)
                        }

                        Return (CRS)
                    }
                }

                Name (DCAT, Package (0x16)
                {
                    0x01, 
                    0x02, 
                    0x03, 
                    0x00, 
                    0xFF, 
                    0x08, 
                    0xFF, 
                    0xFF, 
                    0x09, 
                    0xFF, 
                    0x05, 
                    0x04, 
                    0xFF, 
                    0xFF, 
                    0xFF, 
                    0xFF, 
                    0x0A, 
                    0xFF, 
                    0xFF, 
                    0xFF, 
                    0xFF, 
                    0xFF
                })
                Name (IKEY, Package (0x02)
                {
                    Package (0x04)
                    {
                        0x87, 
                        0x01, 
                        0x55, 
                        0x55
                    }, 

                    Package (0x04)
                    {
                        0x87, 
                        0x01, 
                        0x55, 
                        0xAA
                    }
                })
                Name (KBFG, 0x01)
                Name (MSFG, 0x01)
                Name (UR1F, 0x01)
                Method (ENFG, 1, NotSerialized)
                {
                    Store (0x00, Local1)
                    If (LEqual (SPIO, 0x2E))
                    {
                        Store (0x00, Local1)
                    }

                    If (LEqual (SPIO, 0x4E))
                    {
                        Store (0x01, Local1)
                    }

                    Store (0x00, Local0)
                    While (LNot (LEqual (Local0, 0x04)))
                    {
                        Store (DerefOf (Index (DerefOf (Index (IKEY, Local1)), Local0)), INDX)
                        Increment (Local0)
                    }

                    Store (Arg0, LDN)
                }

                Method (ENTR, 0, NotSerialized)
                {
                    Store (0x87, INDX)
                    Store (0x01, INDX)
                    Store (0x55, INDX)
                    If (LEqual (SPIO, 0x2E))
                    {
                        Store (0x55, INDX)
                    }
                    Else
                    {
                        Store (0xAA, INDX)
                    }
                }

                Method (EXFG, 0, NotSerialized)
                {
                    Store (0x02, INDX)
                    Store (0x02, DATA)
                }

                Method (LPTM, 1, NotSerialized)
                {
                    ENFG (CGLD (Arg0))
                    And (OPT0, 0x02, Local0)
                    EXFG ()
                    Return (Local0)
                }

                Method (UHID, 1, NotSerialized)
                {
                    ENFG (CGLD (Arg0))
                    And (OPT0, 0x70, Local0)
                    EXFG ()
                    If (Local0)
                    {
                        Return (0x1005D041)
                    }

                    Return (0x0105D041)
                }

                Method (ORF0, 1, NotSerialized)
                {
                    ENTR ()
                    Or (OPT0, Arg0, OPT0)
                    EXFG ()
                }

                Method (ORF1, 1, NotSerialized)
                {
                    ENTR ()
                    Or (OPT1, Arg0, OPT1)
                    EXFG ()
                }

                Method (ORF2, 1, NotSerialized)
                {
                    ENTR ()
                    Or (OPT2, Arg0, OPT2)
                    EXFG ()
                }

                Method (ANF0, 1, NotSerialized)
                {
                    ENTR ()
                    And (OPT0, Arg0, OPT0)
                    EXFG ()
                }

                Method (ANF2, 1, NotSerialized)
                {
                    ENTR ()
                    And (OPT2, Arg0, OPT2)
                    EXFG ()
                }

                Method (ANF4, 1, NotSerialized)
                {
                    ENTR ()
                    And (OPT4, Arg0, OPT4)
                    EXFG ()
                }

                Method (STF0, 1, NotSerialized)
                {
                    ENTR ()
                    Store (Arg0, OPT0)
                    EXFG ()
                }

                Method (STF1, 1, NotSerialized)
                {
                    ENTR ()
                    Store (Arg0, OPT1)
                    EXFG ()
                }

                Method (SIOS, 1, NotSerialized)
                {
                    Store ("SIOS", Debug)
                    Store (0x00, GP10)
                    If (LLess (Arg0, 0x05))
                    {
                        ENFG (0x04)
                        Store (0x01, ACTR)
                        EXFG ()
                        ANF4 (0xFC)
                        If (KBFG)
                        {
                            ORF1 (0x08)
                            ORF0 (0x08)
                        }
                        Else
                        {
                            ANF0 (0xF7)
                        }

                        If (MSFG)
                        {
                            ORF1 (0x10)
                            ORF0 (0x10)
                        }
                        Else
                        {
                            ANF0 (0xEF)
                            ENFG (0x06)
                            Store (0x00, ACTR)
                            EXFG ()
                        }

                        ENFG (0x04)
                        ANF2 (0xF0)
                        ENFG (0x07)
                        And (OPF9, 0xFE, OPF9)
                        And (OPC0, 0xFE, OPC0)
                        And (OPC3, 0xFE, OPC3)
                        And (OP29, 0xEF, OP29)
                        EXFG ()
                    }
                    Else
                    {
                        ENFG (0x07)
                        And (OPC0, 0x00, OPC0)
                        Or (OPC0, 0x01, OPC0)
                        And (OPC3, 0x00, OPC3)
                        Or (OPC3, 0x01, OPC3)
                        Or (OPF9, 0x01, OPF9)
                        And (OP29, 0xEF, OP29)
                        EXFG ()
                    }
                }

                Method (SIOW, 1, NotSerialized)
                {
                    Store (0x01, GP10)
                    Store (0x01, GP40)
                    Store ("SIOW", Debug)
                    ENFG (0x04)
                    Store (0x00, ACTR)
                    EXFG ()
                    STF0 (0x00)
                    STF1 (0xFF)
                    ENFG (0x07)
                    Or (OP29, 0x10, OP29)
                    Or (OPC0, 0x01, OPC0)
                    Or (OPC3, 0x01, OPC3)
                    EXFG ()
                    ENFG (0x05)
                    Or (ACTR, 0x01, ACTR)
                    EXFG ()
                    ENFG (0x06)
                    Or (ACTR, 0x01, ACTR)
                    EXFG ()
                }

                Method (SIOH, 0, NotSerialized)
                {
                    Store ("SIOH", Debug)
                }

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

                IndexField (INDX, DATA, ByteAcc, NoLock, Preserve)
                {
                    Offset (0x07), 
                    LDN,    8, 
                    Offset (0x29), 
                    OP29,   8, 
                    Offset (0x30), 
                    ACTR,   8, 
                    Offset (0x60), 
                    IOAH,   8, 
                    IOAL,   8, 
                    IOH2,   8, 
                    IOL2,   8, 
                    Offset (0x70), 
                    INTR,   8, 
                    Offset (0x74), 
                    DMCH,   8, 
                    Offset (0xC0), 
                    OPC0,   8, 
                    OPC1,   8, 
                    OPC2,   8, 
                    OPC3,   8, 
                    Offset (0xF0), 
                    OPT0,   8, 
                    OPT1,   8, 
                    OPT2,   8, 
                    OPT3,   8, 
                    OPT4,   8, 
                    Offset (0xF8), 
                    OPF8,   8, 
                    OPF9,   8, 
                    OPFA,   8, 
                    OPFB,   8
                }

                Method (CGLD, 1, NotSerialized)
                {
                    Return (DerefOf (Index (DCAT, Arg0)))
                }

                Method (DSTA, 1, NotSerialized)
                {
                    ENFG (CGLD (Arg0))
                    Store (ACTR, Local0)
                    EXFG ()
                    If (LEqual (Local0, 0xFF))
                    {
                        Return (0x00)
                    }

                    And (Local0, 0x01, Local0)
                    Or (IOST, ShiftLeft (Local0, Arg0), IOST)
                    If (Local0)
                    {
                        Return (0x0F)
                    }
                    Else
                    {
                        If (And (ShiftLeft (0x01, Arg0), IOST))
                        {
                            Return (0x0D)
                        }
                        Else
                        {
                            Return (0x00)
                        }
                    }
                }

                Method (DCNT, 2, NotSerialized)
                {
                    ENFG (CGLD (Arg0))
                    ShiftLeft (IOAH, 0x08, Local1)
                    Or (IOAL, Local1, Local1)
                    RRIO (Arg0, Arg1, Local1, 0x08)
                    If (LAnd (LLess (DMCH, 0x04), LNot (LEqual (And (DMCH, 0x03, Local1), 0x00))))
                    {
                        RDMA (Arg0, Arg1, Increment (Local1))
                    }

                    Store (Arg1, ACTR)
                    EXFG ()
                }

                Name (CRS1, ResourceTemplate ()
                {
                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                    IRQNoFlags () {}
                    DMA (Compatibility, NotBusMaster, Transfer8) {}
                })
                CreateWordField (CRS1, 0x09, IRQM)
                CreateByteField (CRS1, 0x0C, DMAM)
                CreateWordField (CRS1, 0x02, IO11)
                CreateWordField (CRS1, 0x04, IO12)
                CreateByteField (CRS1, 0x07, LEN1)
                Name (CRS2, ResourceTemplate ()
                {
                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                    IO (Decode16, 0x0000, 0x0000, 0x01, 0x00)
                    IRQNoFlags () {6}
                    DMA (Compatibility, NotBusMaster, Transfer8) {2}
                })
                CreateWordField (CRS2, 0x11, IRQE)
                CreateByteField (CRS2, 0x14, DMAE)
                CreateWordField (CRS2, 0x02, IO21)
                CreateWordField (CRS2, 0x04, IO22)
                CreateByteField (CRS2, 0x07, LEN2)
                CreateWordField (CRS2, 0x0A, IO31)
                CreateWordField (CRS2, 0x0C, IO32)
                CreateByteField (CRS2, 0x0F, LEN3)
                Method (DCRS, 2, NotSerialized)
                {
                    ENFG (CGLD (Arg0))
                    ShiftLeft (IOAH, 0x08, IO11)
                    Or (IOAL, IO11, IO11)
                    Store (IO11, IO12)
                    Subtract (FindSetRightBit (IO11), 0x01, Local0)
                    ShiftLeft (0x01, Local0, LEN1)
                    If (INTR)
                    {
                        ShiftLeft (0x01, INTR, IRQM)
                    }
                    Else
                    {
                        Store (0x00, IRQM)
                    }

                    If (LOr (LGreater (DMCH, 0x03), LEqual (Arg1, 0x00)))
                    {
                        Store (0x00, DMAM)
                    }
                    Else
                    {
                        And (DMCH, 0x03, Local1)
                        ShiftLeft (0x01, Local1, DMAM)
                    }

                    EXFG ()
                    Return (CRS1)
                }

                Method (DSRS, 2, NotSerialized)
                {
                    CreateWordField (Arg0, 0x09, IRQM)
                    CreateByteField (Arg0, 0x0C, DMAM)
                    CreateWordField (Arg0, 0x02, IO11)
                    ENFG (CGLD (Arg1))
                    And (IO11, 0xFF, IOAL)
                    ShiftRight (IO11, 0x08, IOAH)
                    If (IRQM)
                    {
                        FindSetRightBit (IRQM, Local0)
                        Subtract (Local0, 0x01, INTR)
                    }
                    Else
                    {
                        Store (0x00, INTR)
                    }

                    If (DMAM)
                    {
                        FindSetRightBit (DMAM, Local0)
                        Subtract (Local0, 0x01, DMCH)
                    }
                    Else
                    {
                        Store (0x04, DMCH)
                    }

                    EXFG ()
                    DCNT (Arg1, 0x01)
                }

                OperationRegion (GPIO, SystemIO, IO1B, 0x04)
                Field (GPIO, ByteAcc, NoLock, Preserve)
                {
                    GP10,   1, 
                    GP11,   1, 
                    GP12,   1, 
                    GP13,   1, 
                    GO14,   1, 
                    GO15,   1, 
                    GO16,   1, 
                    GO17,   1, 
                    GP20,   1, 
                    GP21,   1, 
                    GP22,   1, 
                    GP23,   1, 
                    GO24,   1, 
                    GO25,   1, 
                    GO26,   1, 
                    GO27,   1, 
                    GP30,   1, 
                    GP31,   1, 
                    GP32,   1, 
                    GP33,   1, 
                    GO34,   1, 
                    GO35,   1, 
                    GO36,   1, 
                    GO37,   1, 
                    GP40,   1, 
                    GP41,   1, 
                    GP42,   1, 
                    GP43,   1, 
                    GO44,   1, 
                    GO45,   1, 
                    GO46,   1, 
                    GO47,   1
                }
            }

            Device (AC97)
            {
                Name (_ADR, 0x00110005)
            }

            Device (MC97)
            {
                Name (_ADR, 0x00110006)
                OperationRegion (ACLK, PCI_Config, 0x41, 0x01)
                Field (ACLK, ByteAcc, NoLock, Preserve)
                {
                        ,   6, 
                    MC9P,   2
                }
            }

            Device (SBLK)
            {
                Name (_ADR, 0x00110007)
            }

            Device (EHCI)
            {
                Name (_ADR, 0x00100004)
                OperationRegion (WAU5, PCI_Config, 0x84, 0x01)
                Field (WAU5, ByteAcc, NoLock, Preserve)
                {
                    U584,   8
                }

                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x0E, 0x04))
                }
            }

            Device (ILAN)
            {
                Name (_ADR, 0x00120000)
                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x03, 0x04))
                }
            }

            Device (SATA)
            {
                Name (_ADR, 0x000F0000)
                Name (_STA, 0x0F)
                Name (REGF, 0x01)
                Method (_REG, 2, NotSerialized)
                {
                    If (LEqual (Arg0, 0x02))
                    {
                        Store (Arg1, REGF)
                    }
                }

                Name (TIM0, Package (0x04)
                {
                    Package (0x05)
                    {
                        0x78, 
                        0xB4, 
                        0xF0, 
                        0x017F, 
                        0x0258
                    }, 

                    Package (0x05)
                    {
                        0x20, 
                        0x22, 
                        0x33, 
                        0x47, 
                        0x5D
                    }, 

                    Package (0x07)
                    {
                        0x78, 
                        0x50, 
                        0x3C, 
                        0x2D, 
                        0x1E, 
                        0x14, 
                        0x0F
                    }, 

                    Package (0x0F)
                    {
                        0x06, 
                        0x05, 
                        0x04, 
                        0x04, 
                        0x03, 
                        0x03, 
                        0x02, 
                        0x02, 
                        0x01, 
                        0x01, 
                        0x01, 
                        0x01, 
                        0x01, 
                        0x01, 
                        0x00
                    }
                })
                Name (TMD0, Buffer (0x14) {})
                CreateDWordField (TMD0, 0x00, PIO0)
                CreateDWordField (TMD0, 0x04, DMA0)
                CreateDWordField (TMD0, 0x08, PIO1)
                CreateDWordField (TMD0, 0x0C, DMA1)
                CreateDWordField (TMD0, 0x10, CHNF)
                Name (PMPT, 0x20)
                Name (PMUE, 0x07)
                Name (PMUT, 0x00)
                Name (PSPT, 0x20)
                Name (PSUE, 0x07)
                Name (PSUT, 0x00)
                Name (SMPT, 0x20)
                Name (SMUE, 0x07)
                Name (SMUT, 0x00)
                Name (SSPT, 0x20)
                Name (SSUE, 0x07)
                Name (SSUT, 0x00)
                Device (CHN0)
                {
                    Name (_ADR, 0x00)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (0x0F)
                    }

                    Method (_GTM, 0, NotSerialized)
                    {
                        Return (GTM (PMPT, PMUE, PMUT, PSPT, PSUE, PSUT))
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, 0x00)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Return (0x00)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, 0x01)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Return (0x00)
                        }
                    }
                }

                Device (CHN1)
                {
                    Name (_ADR, 0x01)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (0x0F)
                    }

                    Method (_GTM, 0, NotSerialized)
                    {
                        Return (GTM (SMPT, SMUE, SMUT, SSPT, SSUE, SSUT))
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, 0x00)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Return (0x00)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, 0x01)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Return (0x00)
                        }
                    }
                }

                Device (CHN2)
                {
                    Name (_ADR, 0x00)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (0x0F)
                    }

                    Method (_GTM, 0, NotSerialized)
                    {
                        Return (GTM (PMPT, PMUE, PMUT, PSPT, PSUE, PSUT))
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, 0x00)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Return (0x00)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, 0x01)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Return (0x00)
                        }
                    }
                }

                Device (CHN3)
                {
                    Name (_ADR, 0x01)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (0x0F)
                    }

                    Method (_GTM, 0, NotSerialized)
                    {
                        Return (GTM (SMPT, SMUE, SMUT, SSPT, SSUE, SSUT))
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                    }

                    Device (DRV0)
                    {
                        Name (_ADR, 0x00)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Return (0x00)
                        }
                    }

                    Device (DRV1)
                    {
                        Name (_ADR, 0x01)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Return (0x00)
                        }
                    }
                }

                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, 0x03)), Arg2)), Local5)
                        Store (DerefOf (Index (DerefOf (Index (TIM0, 0x02)), Local5)), DMA0)
                        Or (CHNF, 0x01, CHNF)
                    }

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

                    Return (TMD0)
                }
            }

            Device (PATA)
            {
                Name (_ADR, 0x000F0001)
                Name (REGF, 0x01)
                Method (_STA, 0, NotSerialized)
                {
                    If (LNot (LEqual (\_SB.PCI0.PATA.VID, 0x1106)))
                    {
                        Return (0x00)
                    }
                    Else
                    {
                        PMEX ()
                        If (LEqual (\_SB.PCI0.PATA.CMDR, 0x00))
                        {
                            Return (0x0D)
                        }
                        Else
                        {
                            Return (0x0F)
                        }
                    }
                }

                Method (_REG, 2, NotSerialized)
                {
                    If (LEqual (Arg0, 0x02))
                    {
                        Store (Arg1, REGF)
                    }
                }

                Name (TIM0, Package (0x07)
                {
                    Package (0x05)
                    {
                        0x78, 
                        0xB4, 
                        0xF0, 
                        0x017F, 
                        0x0258
                    }, 

                    Package (0x05)
                    {
                        0x20, 
                        0x22, 
                        0x33, 
                        0x47, 
                        0x5D
                    }, 

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

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

                    Package (0x07)
                    {
                        0x78, 
                        0x50, 
                        0x3C, 
                        0x2D, 
                        0x1E, 
                        0x14, 
                        0x0F
                    }, 

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

                    Package (0x07)
                    {
                        0x0E, 
                        0x08, 
                        0x06, 
                        0x04, 
                        0x02, 
                        0x01, 
                        0x00
                    }
                })
                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 (PAPR, PCI_Config, 0x00, 0xC2)
                Field (PAPR, ByteAcc, NoLock, Preserve)
                {
                    VID,    16, 
                    Offset (0x04), 
                    CMDR,   3, 
                    Offset (0x09), 
                    ENAT,   4, 
                    Offset (0x3C), 
                    IDEI,   8, 
                    Offset (0x40), 
                    ESCH,   1, 
                    EPCH,   1, 
                    Offset (0x48), 
                    SSPT,   8, 
                    SMPT,   8, 
                    PSPT,   8, 
                    PMPT,   8, 
                    Offset (0x50), 
                    SSUT,   4, 
                    SSCT,   1, 
                    SSUE,   3, 
                    SMUT,   4, 
                    SMCT,   1, 
                    SMUE,   3, 
                    PSUT,   4, 
                    PSCT,   1, 
                    PSUE,   3, 
                    PMUT,   4, 
                    PMCT,   1, 
                    PMUE,   3
                }

                Name (GMPT, 0x00)
                Name (GMUE, 0x00)
                Name (GMUT, 0x00)
                Name (GSPT, 0x00)
                Name (GSUE, 0x00)
                Name (GSUT, 0x00)
                Device (CHN0)
                {
                    Name (_ADR, 0x00)
                    Method (_STA, 0, NotSerialized)
                    {
                        If (LNot (LEqual (\_SB.PCI0.PATA.EPCH, 0x01)))
                        {
                            Return (0x00)
                        }
                        Else
                        {
                            Return (0x0F)
                        }
                    }

                    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 (_STA, 0, NotSerialized)
                    {
                        If (LNot (LEqual (\_SB.PCI0.PATA.ESCH, 0x01)))
                        {
                            Return (0x00)
                        }
                        Else
                        {
                            Return (0x0F)
                        }
                    }

                    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 (PMEX, 0, Serialized)
                {
                    If (REGF)
                    {
                        If (LEqual (PMPT, 0xA8))
                        {
                            Store (0x5D, PMPT)
                        }

                        If (LEqual (PMPT, 0x65))
                        {
                            Store (0x33, PMPT)
                        }

                        If (LEqual (PMPT, 0x31))
                        {
                            Store (0x22, PMPT)
                        }

                        If (LEqual (PSPT, 0xA8))
                        {
                            Store (0x5D, PSPT)
                        }

                        If (LEqual (PSPT, 0x65))
                        {
                            Store (0x33, PSPT)
                        }

                        If (LEqual (PSPT, 0x31))
                        {
                            Store (0x22, PSPT)
                        }

                        If (LEqual (SMPT, 0xA8))
                        {
                            Store (0x5D, SMPT)
                        }

                        If (LEqual (SMPT, 0x65))
                        {
                            Store (0x33, SMPT)
                        }

                        If (LEqual (SMPT, 0x31))
                        {
                            Store (0x22, SMPT)
                        }

                        If (LEqual (SSPT, 0xA8))
                        {
                            Store (0x5D, SSPT)
                        }

                        If (LEqual (SSPT, 0x65))
                        {
                            Store (0x33, SSPT)
                        }

                        If (LEqual (SSPT, 0x31))
                        {
                            Store (0x22, 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, 0x05)), 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, 0x03)), Local0)), UMOD)
                    }

                    Store (Match (DerefOf (Index (TIM0, 0x01)), MEQ, Arg3, MTR, 0x00, 0x00), Local0)
                    Or (0x08, DerefOf (Index (DerefOf (Index (TIM0, 0x02)), 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, 0x05)), Arg2)), Local5)
                        Store (DerefOf (Index (DerefOf (Index (TIM0, 0x04)), Local5)), DMA0)
                        Or (CHNF, 0x01, CHNF)
                    }

                    If (Arg4)
                    {
                        Store (DerefOf (Index (DerefOf (Index (TIM0, 0x05)), 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 (0x07, GMUT)
                    Store (0x07, GSUT)
                    If (And (CHNF, 0x01))
                    {
                        Store (Match (DerefOf (Index (TIM0, 0x04)), MLE, DMA0, MTR, 0x00, 0x00), Local0)
                        Store (DerefOf (Index (DerefOf (Index (TIM0, 0x06)), Local0)), GMUT)
                        Or (GMUE, 0x07, 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, 0x06)), Local0)), GSUT)
                        Or (GSUE, 0x07, 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)
                    Return (Ones)
                }
            }

            Device (P0P7)
            {
                Name (_ADR, 0x00130000)
                Method (_PRT, 0, NotSerialized)
                {
                    If (PICM)
                    {
                        Return (AR07)
                    }

                    Return (PR07)
                }

                Device (P7P8)
                {
                    Name (_ADR, 0x00)
                    Method (_PRW, 0, NotSerialized)
                    {
                        Return (GPRW (0x05, 0x04))
                    }

                    Method (_PRT, 0, NotSerialized)
                    {
                        If (PICM)
                        {
                            Return (AR08)
                        }

                        Return (PR08)
                    }
                }

                Device (P7P9)
                {
                    Name (_ADR, 0x01)
                    Method (_PRW, 0, NotSerialized)
                    {
                        Return (GPRW (0x05, 0x04))
                    }

                    Method (_PRT, 0, NotSerialized)
                    {
                        If (PICM)
                        {
                            Return (AR09)
                        }

                        Return (PR09)
                    }
                }

                Device (AZAL)
                {
                    Name (_ADR, 0x00010000)
                }
            }

            Device (P2PB)
            {
                Name (_ADR, 0x00130001)
                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x05, 0x04))
                }

                Method (_PRT, 0, NotSerialized)
                {
                    If (PICM)
                    {
                        Return (AR05)
                    }

                    Return (PR05)
                }

                Device (PCI1)
                {
                    Name (_ADR, 0x0008FFFF)
                    Method (_PRW, 0, NotSerialized)
                    {
                        Return (GPRW (0x05, 0x04))
                    }
                }

                Device (PCI2)
                {
                    Name (_ADR, 0x0009FFFF)
                    Method (_PRW, 0, NotSerialized)
                    {
                        Return (GPRW (0x05, 0x04))
                    }
                }
            }

            Device (USB1)
            {
                Name (_ADR, 0x00100000)
                OperationRegion (WAU1, PCI_Config, 0x84, 0x01)
                Field (WAU1, ByteAcc, NoLock, Preserve)
                {
                    U184,   8
                }

                OperationRegion (U1D3, PCI_Config, 0x49, 0x01)
                Field (U1D3, ByteAcc, NoLock, Preserve)
                {
                    UR49,   3
                }

                OperationRegion (UBP1, PCI_Config, 0x85, 0x01)
                Field (UBP1, ByteAcc, NoLock, Preserve)
                {
                    U1PE,   1
                }

                Method (_S3D, 0, NotSerialized)
                {
                    If (LOr (LEqual (OSFL (), 0x01), LEqual (OSFL (), 0x02)))
                    {
                        Return (0x02)
                    }
                    Else
                    {
                        Return (0x03)
                    }
                }

                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x0E, 0x04))
                }
            }

            Device (USB2)
            {
                Name (_ADR, 0x00100001)
                OperationRegion (WAU2, PCI_Config, 0x84, 0x01)
                Field (WAU2, ByteAcc, NoLock, Preserve)
                {
                    U284,   8
                }

                OperationRegion (UBP2, PCI_Config, 0x85, 0x01)
                Field (UBP2, ByteAcc, NoLock, Preserve)
                {
                    U2PE,   1
                }

                Method (_S3D, 0, NotSerialized)
                {
                    If (LOr (LEqual (OSFL (), 0x01), LEqual (OSFL (), 0x02)))
                    {
                        Return (0x02)
                    }
                    Else
                    {
                        Return (0x03)
                    }
                }

                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x0E, 0x04))
                }
            }

            Device (USB3)
            {
                Name (_ADR, 0x00100002)
                OperationRegion (WAU3, PCI_Config, 0x84, 0x01)
                Field (WAU3, ByteAcc, NoLock, Preserve)
                {
                    U384,   8
                }

                OperationRegion (UBP3, PCI_Config, 0x85, 0x01)
                Field (UBP3, ByteAcc, NoLock, Preserve)
                {
                    U3PE,   1
                }

                Method (_S3D, 0, NotSerialized)
                {
                    If (LOr (LEqual (OSFL (), 0x01), LEqual (OSFL (), 0x02)))
                    {
                        Return (0x02)
                    }
                    Else
                    {
                        Return (0x03)
                    }
                }

                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x0E, 0x04))
                }
            }

            Device (USB4)
            {
                Name (_ADR, 0x00100003)
                OperationRegion (WAU4, PCI_Config, 0x84, 0x01)
                Field (WAU4, ByteAcc, NoLock, Preserve)
                {
                    U484,   8
                }

                OperationRegion (UBP4, PCI_Config, 0x85, 0x01)
                Field (UBP4, ByteAcc, NoLock, Preserve)
                {
                    U4PE,   1
                }

                Method (_S3D, 0, NotSerialized)
                {
                    If (LOr (LEqual (OSFL (), 0x01), LEqual (OSFL (), 0x02)))
                    {
                        Return (0x02)
                    }
                    Else
                    {
                        Return (0x03)
                    }
                }

                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x0E, 0x04))
                }
            }
        }

        Scope (\_GPE)
        {
            Method (_L0E, 0, NotSerialized)
            {
                Notify (\_SB.PCI0.EHCI, 0x02)
                Notify (\_SB.PCI0.USB1, 0x02)
                Notify (\_SB.PCI0.USB2, 0x02)
                Notify (\_SB.PCI0.USB3, 0x02)
                Notify (\_SB.PCI0.USB4, 0x02)
                Notify (\_SB.PWRB, 0x02)
            }

            Method (_L03, 0, NotSerialized)
            {
                Notify (\_SB.PCI0.ILAN, 0x02)
                Notify (\_SB.PWRB, 0x02)
            }

            Method (_L05, 0, NotSerialized)
            {
                Notify (\_SB.PCI0.P0P7.P7P8, 0x02)
                Notify (\_SB.PCI0.P0P7.P7P9, 0x02)
                Notify (\_SB.PCI0.P2PB, 0x02)
                Notify (\_SB.PCI0.P2PB.PCI1, 0x02)
                Notify (\_SB.PCI0.P2PB.PCI2, 0x02)
                Notify (\_SB.PWRB, 0x02)
            }
        }

        Device (PWRB)
        {
            Name (_HID, EisaId ("PNP0C0C"))
            Name (_UID, 0xAA)
            Name (_STA, 0x0B)
        }
    }

    Scope (\_SB)
    {
        OperationRegion (\_SB.PCI0.SBRG.PIX0, PCI_Config, 0x55, 0x04)
        OperationRegion (\_SB.PCI0.SBRG.PIX1, PCI_Config, 0x50, 0x02)
        OperationRegion (\_SB.PCI0.SBRG.PIX2, PCI_Config, 0x44, 0x02)
        OperationRegion (\_SB.PCI0.SBRG.PIX3, PCI_Config, 0x67, 0x03)
        OperationRegion (\_SB.PCI0.SBRG.PIX4, PCI_Config, 0x6C, 0x04)
        Field (\_SB.PCI0.SBRG.PIX0, ByteAcc, NoLock, Preserve)
        {
                ,   4, 
            PIRA,   4, 
            PIRB,   4, 
            PIRC,   4, 
                ,   4, 
            PIRD,   4, 
                ,   4
        }

        Field (\_SB.PCI0.SBRG.PIX1, ByteAcc, NoLock, Preserve)
        {
                ,   1, 
            EP3C,   1, 
            EN3C,   1, 
                ,   6, 
            KBFG,   1
        }

        Field (\_SB.PCI0.SBRG.PIX2, ByteAcc, NoLock, Preserve)
        {
            PIRE,   4, 
            PIRF,   4, 
            PIRG,   4, 
            PIRH,   4
        }

        Field (\_SB.PCI0.SBRG.PIX3, ByteAcc, NoLock, Preserve)
        {
            ENIR,   1, 
            IRSD,   1, 
            Offset (0x02), 
            IRBA,   8
        }

        Field (\_SB.PCI0.SBRG.PIX4, ByteAcc, NoLock, Preserve)
        {
            PS0E,   1, 
            PS1E,   1, 
            ROME,   1, 
            APCE,   1, 
            LPMS,   2, 
            MSEN,   1, 
            IXEN,   1, 
            LPMD,   2, 
            MDEN,   1, 
            GMEN,   1, 
            LPLP,   2, 
            LPEN,   1, 
            FDEN,   1, 
            LPCA,   3, 
            CAEN,   1, 
            LPCB,   3, 
            CBEN,   1, 
            LPSB,   2, 
            SBEN,   1, 
            FDSE,   1, 
            Offset (0x04)
        }

        Name (IRQA, 0x00)
        Name (IRQB, 0x00)
        Name (IRQC, 0x00)
        Name (IRQD, 0x00)
        Name (IRQE, 0x00)
        Name (IRQF, 0x00)
        Name (IRQG, 0x00)
        Name (IRQH, 0x00)
        Name (ICRS, ResourceTemplate ()
        {
            IRQ (Level, ActiveLow, Shared) {15}
        })
        Device (LNKA)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x01)
            Method (_STA, 0, NotSerialized)
            {
                Store (PIRA, IRQA)
                If (PIRA)
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (0x09)
                }
            }

            Method (_PRS, 0, NotSerialized)
            {
                Return (PRSA)
            }

            Method (_DIS, 0, NotSerialized)
            {
                Store (0x00, PIRA)
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (ICRS, 0x01, IRA0)
                Store (One, Local1)
                ShiftLeft (Local1, IRQA, IRA0)
                Return (ICRS)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRA)
                FindSetRightBit (IRA, Local0)
                Decrement (Local0)
                Store (Local0, PIRA)
                Store (PIRA, IRQA)
            }
        }

        Device (LNKB)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x02)
            Method (_STA, 0, NotSerialized)
            {
                Store (PIRB, IRQB)
                If (PIRB)
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (0x09)
                }
            }

            Method (_PRS, 0, NotSerialized)
            {
                Return (PRSB)
            }

            Method (_DIS, 0, NotSerialized)
            {
                Store (0x00, PIRB)
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (ICRS, 0x01, IRA0)
                Store (One, Local1)
                ShiftLeft (Local1, IRQB, IRA0)
                Return (ICRS)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRA)
                FindSetRightBit (IRA, Local0)
                Decrement (Local0)
                Store (Local0, PIRB)
                Store (PIRB, IRQB)
            }
        }

        Device (LNKC)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x03)
            Method (_STA, 0, NotSerialized)
            {
                Store (PIRC, IRQC)
                If (PIRC)
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (0x09)
                }
            }

            Method (_PRS, 0, NotSerialized)
            {
                Return (PRSC)
            }

            Method (_DIS, 0, NotSerialized)
            {
                Store (0x00, PIRC)
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (ICRS, 0x01, IRA0)
                Store (One, Local1)
                ShiftLeft (Local1, IRQC, IRA0)
                Return (ICRS)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRA)
                FindSetRightBit (IRA, Local0)
                Decrement (Local0)
                Store (Local0, PIRC)
                Store (PIRC, IRQC)
            }
        }

        Device (LNKD)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x04)
            Method (_STA, 0, NotSerialized)
            {
                Store (PIRD, IRQD)
                If (PIRD)
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (0x09)
                }
            }

            Method (_PRS, 0, NotSerialized)
            {
                Return (PRSD)
            }

            Method (_DIS, 0, NotSerialized)
            {
                Store (0x00, PIRD)
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (ICRS, 0x01, IRA0)
                Store (One, Local1)
                ShiftLeft (Local1, IRQD, IRA0)
                Return (ICRS)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRA)
                FindSetRightBit (IRA, Local0)
                Decrement (Local0)
                Store (Local0, PIRD)
                Store (PIRD, IRQD)
            }
        }

        Device (LNKE)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x01)
            Method (_STA, 0, NotSerialized)
            {
                Store (PIRE, IRQE)
                If (PIRE)
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (0x09)
                }
            }

            Method (_PRS, 0, NotSerialized)
            {
                Return (PRSE)
            }

            Method (_DIS, 0, NotSerialized)
            {
                Store (0x00, PIRE)
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (ICRS, 0x01, IRA0)
                Store (One, Local1)
                ShiftLeft (Local1, IRQE, IRA0)
                Return (ICRS)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRA)
                FindSetRightBit (IRA, Local0)
                Decrement (Local0)
                Store (Local0, PIRE)
                Store (PIRE, IRQE)
            }
        }

        Device (LNKF)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x02)
            Method (_STA, 0, NotSerialized)
            {
                Store (PIRF, IRQF)
                If (PIRF)
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (0x09)
                }
            }

            Method (_PRS, 0, NotSerialized)
            {
                Return (PRSF)
            }

            Method (_DIS, 0, NotSerialized)
            {
                Store (0x00, PIRF)
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (ICRS, 0x01, IRA0)
                Store (One, Local1)
                ShiftLeft (Local1, IRQF, IRA0)
                Return (ICRS)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRA)
                FindSetRightBit (IRA, Local0)
                Decrement (Local0)
                Store (Local0, PIRF)
                Store (PIRF, IRQF)
            }
        }

        Device (LNKG)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x03)
            Method (_STA, 0, NotSerialized)
            {
                Store (PIRG, IRQG)
                If (PIRG)
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (0x09)
                }
            }

            Method (_PRS, 0, NotSerialized)
            {
                Return (PRSG)
            }

            Method (_DIS, 0, NotSerialized)
            {
                Store (0x00, PIRG)
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (ICRS, 0x01, IRA0)
                Store (One, Local1)
                ShiftLeft (Local1, IRQG, IRA0)
                Return (ICRS)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRA)
                FindSetRightBit (IRA, Local0)
                Decrement (Local0)
                Store (Local0, PIRG)
                Store (PIRG, IRQG)
            }
        }

        Device (LNKH)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x04)
            Method (_STA, 0, NotSerialized)
            {
                Store (PIRH, IRQH)
                If (PIRH)
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (0x09)
                }
            }

            Method (_PRS, 0, NotSerialized)
            {
                Return (PRSH)
            }

            Method (_DIS, 0, NotSerialized)
            {
                Store (0x00, PIRH)
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (ICRS, 0x01, IRA0)
                Store (One, Local1)
                ShiftLeft (Local1, IRQH, IRA0)
                Return (ICRS)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRA)
                FindSetRightBit (IRA, Local0)
                Decrement (Local0)
                Store (Local0, PIRH)
                Store (PIRH, IRQH)
            }
        }
    }

    Scope (\_SB)
    {
        Name (XCPD, 0x00)
        Name (XNPT, 0x01)
        Name (XCAP, 0x02)
        Name (XDCP, 0x04)
        Name (XDCT, 0x08)
        Name (XDST, 0x0A)
        Name (XLCP, 0x0C)
        Name (XLCT, 0x10)
        Name (XLST, 0x12)
        Name (XSCP, 0x14)
        Name (XSCT, 0x18)
        Name (XSST, 0x1A)
        Name (XRCT, 0x1C)
        Mutex (MUTE, 0x00)
        Method (RBPE, 1, NotSerialized)
        {
            Acquire (MUTE, 0x03E8)
            Add (Arg0, \PCIB, Local0)
            OperationRegion (PCFG, SystemMemory, Local0, 0x01)
            Field (PCFG, ByteAcc, NoLock, Preserve)
            {
                XCFG,   8
            }

            Release (MUTE)
            Return (XCFG)
        }

        Method (RWPE, 1, NotSerialized)
        {
            Acquire (MUTE, 0x03E8)
            And (Arg0, 0xFFFFFFFE, Arg0)
            Add (Arg0, \PCIB, Local0)
            OperationRegion (PCFG, SystemMemory, Local0, 0x02)
            Field (PCFG, WordAcc, NoLock, Preserve)
            {
                XCFG,   16
            }

            Release (MUTE)
            Return (XCFG)
        }

        Method (RDPE, 1, NotSerialized)
        {
            Acquire (MUTE, 0x03E8)
            And (Arg0, 0xFFFFFFFC, Arg0)
            Add (Arg0, \PCIB, Local0)
            OperationRegion (PCFG, SystemMemory, Local0, 0x04)
            Field (PCFG, DWordAcc, NoLock, Preserve)
            {
                XCFG,   32
            }

            Release (MUTE)
            Return (XCFG)
        }

        Method (WBPE, 2, NotSerialized)
        {
            Acquire (MUTE, 0x0FFF)
            Add (Arg0, \PCIB, Local0)
            OperationRegion (PCFG, SystemMemory, Local0, 0x01)
            Field (PCFG, ByteAcc, NoLock, Preserve)
            {
                XCFG,   8
            }

            Store (Arg1, XCFG)
            Release (MUTE)
        }

        Method (WWPE, 2, NotSerialized)
        {
            Acquire (MUTE, 0x03E8)
            And (Arg0, 0xFFFFFFFE, Arg0)
            Add (Arg0, \PCIB, Local0)
            OperationRegion (PCFG, SystemMemory, Local0, 0x02)
            Field (PCFG, WordAcc, NoLock, Preserve)
            {
                XCFG,   16
            }

            Store (Arg1, XCFG)
            Release (MUTE)
        }

        Method (WDPE, 2, NotSerialized)
        {
            Acquire (MUTE, 0x03E8)
            And (Arg0, 0xFFFFFFFC, Arg0)
            Add (Arg0, \PCIB, Local0)
            OperationRegion (PCFG, SystemMemory, Local0, 0x04)
            Field (PCFG, DWordAcc, NoLock, Preserve)
            {
                XCFG,   32
            }

            Store (Arg1, XCFG)
            Release (MUTE)
        }

        Method (RWDP, 3, NotSerialized)
        {
            Acquire (MUTE, 0x03E8)
            And (Arg0, 0xFFFFFFFC, Arg0)
            Add (Arg0, \PCIB, Local0)
            OperationRegion (PCFG, SystemMemory, Local0, 0x04)
            Field (PCFG, DWordAcc, NoLock, Preserve)
            {
                XCFG,   32
            }

            And (XCFG, Arg2, Local1)
            Or (Local1, Arg1, XCFG)
            Release (MUTE)
        }

        Method (RPME, 1, NotSerialized)
        {
            Add (Arg0, 0x84, Local0)
            Store (\_SB.RDPE (Local0), Local1)
            If (LEqual (Local1, 0xFFFFFFFF))
            {
                Return (0x00)
            }
            Else
            {
                If (LAnd (Local1, 0x00010000))
                {
                    \_SB.WDPE (Local0, And (Local1, 0x00010000))
                    Return (0x01)
                }

                Return (0x00)
            }
        }
    }

    Scope (\_SB.PCI0.SBRG.SIOR)
    {
        Method (HWV0, 0, NotSerialized)
        {
            Return (Multiply (VIV0, 0x10))
        }

        Method (HWV1, 0, NotSerialized)
        {
            Return (Multiply (VIV1, 0x10))
        }

        Method (HWV2, 0, NotSerialized)
        {
            Return (Multiply (VIV2, 0x10))
        }

        Method (HWV3, 0, NotSerialized)
        {
            Return (Multiply (VIV3, 0x10))
        }

        Method (HWV4, 0, NotSerialized)
        {
            Return (Multiply (VIV4, 0x10))
        }

        Method (HWV5, 0, NotSerialized)
        {
            Return (Multiply (VIV5, 0x10))
        }

        Method (HWV6, 0, NotSerialized)
        {
            Return (Multiply (VIV6, 0x10))
        }

        Method (HWV7, 0, NotSerialized)
        {
            Return (Multiply (VIV7, 0x10))
        }

        Method (HWT1, 0, NotSerialized)
        {
            Store (TPI1, Local0)
            If (LGreater (Local0, 0x80))
            {
                Subtract (0x0100, Local0, Local0)
            }

            Return (Multiply (Local0, 0x0A))
        }

        Method (HWT2, 0, NotSerialized)
        {
            Store (TPI2, Local0)
            If (LGreater (Local0, 0x80))
            {
                Subtract (0x0100, Local0, Local0)
            }

            Return (Multiply (Local0, 0x0A))
        }

        Method (HWT3, 0, NotSerialized)
        {
            Store (TPI3, Local0)
            If (LGreater (Local0, 0x80))
            {
                Subtract (0x0100, Local0, Local0)
            }

            Return (Multiply (Local0, 0x0A))
        }

        Method (HWF1, 0, NotSerialized)
        {
            Store (FTC1, Local0)
            Store (0x01, Local2)
            While (LAnd (LOr (LNot (LGreater (Local0, FHMT)), LNot (LLess (Local0, FLMT))), LEqual (Local2, 0x01)))
            {
                If (LNot (LGreater (Local0, FHMT)))
                {
                    Store (FTD1, Local1)
                    If (LGreater (Local1, 0x00))
                    {
                        Decrement (Local1)
                        Store (Local1, FTD1)
                    }
                    Else
                    {
                        Store (0x00, Local2)
                    }
                }
                Else
                {
                    Store (FTD1, Local1)
                    If (LLess (Local1, 0x07))
                    {
                        Increment (Local1)
                        Store (Local1, FTD1)
                    }
                    Else
                    {
                        Store (0x00, Local2)
                    }
                }

                Sleep (0x012C)
                Store (FTC1, Local0)
            }

            If (LOr (LEqual (Local0, 0x00), LEqual (Local0, 0xFF)))
            {
                Return (0x00)
            }
            Else
            {
                Divide (FTFR, Multiply (Local0, DerefOf (Index (DTB1, FTD1))), , Local1)
                Return (Local1)
            }
        }

        Method (HWF2, 0, NotSerialized)
        {
            Store (FTC2, Local0)
            Store (0x01, Local2)
            While (LAnd (LOr (LNot (LGreater (Local0, FHMT)), LNot (LLess (Local0, FLMT))), LEqual (Local2, 0x01)))
            {
                If (LNot (LGreater (Local0, FHMT)))
                {
                    Store (FTD2, Local1)
                    If (LGreater (Local1, 0x00))
                    {
                        Decrement (Local1)
                        Store (Local1, FTD2)
                    }
                    Else
                    {
                        Store (0x00, Local2)
                    }
                }
                Else
                {
                    Store (FTD2, Local1)
                    If (LLess (Local1, 0x07))
                    {
                        Increment (Local1)
                        Store (Local1, FTD2)
                    }
                    Else
                    {
                        Store (0x00, Local2)
                    }
                }

                Sleep (0x012C)
                Store (FTC2, Local0)
            }

            If (LOr (LEqual (Local0, 0x00), LEqual (Local0, 0xFF)))
            {
                Return (0x00)
            }
            Else
            {
                Divide (FTFR, Multiply (Local0, DerefOf (Index (DTB1, FTD2))), , Local1)
                Return (Local1)
            }
        }

        Method (HWF3, 0, NotSerialized)
        {
            Store (FTC3, Local0)
            If (LNot (LGreater (Local0, FHMT)))
            {
                Store (FTD3, Local1)
                If (LGreater (Local1, 0x00))
                {
                    Decrement (Local1)
                    Store (Local1, FTD3)
                    Sleep (0x012C)
                    Store (FTC3, Local0)
                }
            }
            Else
            {
                If (LNot (LLess (Local0, FLMT)))
                {
                    Store (FTD3, Local1)
                    If (LLess (Local1, 0x01))
                    {
                        Increment (Local1)
                        Store (Local1, FTD3)
                        Sleep (0x012C)
                        Store (FTC3, Local0)
                    }
                }
            }

            If (LOr (LEqual (Local0, 0x00), LEqual (Local0, 0xFF)))
            {
                Return (0x00)
            }
            Else
            {
                Divide (FTFR, Multiply (Local0, DerefOf (Index (DTB2, FTD3))), , Local1)
                Return (Local1)
            }
        }

        Name (FTFR, 0x00149970)
        Name (FHMT, 0x78)
        Name (FLMT, 0xFE)
        Name (DTB1, Package (0x08)
        {
            0x01, 
            0x02, 
            0x04, 
            0x08, 
            0x10, 
            0x20, 
            0x40, 
            0x80
        })
        Name (DTB2, Package (0x02)
        {
            0x02, 
            0x08
        })
        OperationRegion (ECRE, SystemIO, IOEB, 0x20)
        Field (ECRE, ByteAcc, NoLock, Preserve)
        {
            Offset (0x05), 
            HIDX,   8, 
            HDAT,   8
        }

        IndexField (HIDX, HDAT, ByteAcc, NoLock, Preserve)
        {
            Offset (0x0B), 
            FTD1,   3, 
            FTD2,   3, 
            FTD3,   1, 
            Offset (0x0C), 
            ETDE,   8, 
            FTC1,   8, 
            FTC2,   8, 
            FTC3,   8, 
            Offset (0x18), 
            EFN1,   8, 
            EFN2,   8, 
            EFN3,   8, 
            Offset (0x20), 
            VIV0,   8, 
            VIV1,   8, 
            VIV2,   8, 
            VIV3,   8, 
            VIV4,   8, 
            VIV5,   8, 
            VIV6,   8, 
            VIV7,   8, 
            Offset (0x29), 
            TPI1,   8, 
            TPI2,   8, 
            TPI3,   8
        }
    }

    Scope (\)
    {
        Field (\RAMW, ByteAcc, NoLock, Preserve)
        {
            Offset (0x20), 
            CPUQ,   8, 
            CPVL,   16, 
            CPVH,   16, 
            CPVC,   1
        }
    }

    Scope (\_SB.PCI0.SBRG.ASOC)
    {
        Name (CORV, Package (0x05)
        {
            0x06020000, 
            "Vcore Voltage", 
            0x0352, 
            0x0640, 
            0x01
        })
        Name (V3VV, Package (0x05)
        {
            0x06020001, 
            " +3.3 Voltage", 
            0x0B9A, 
            0x0E2E, 
            0x01
        })
        Name (V5VV, Package (0x05)
        {
            0x06020002, 
            " +5 Voltage", 
            0x1194, 
            0x157C, 
            0x01
        })
        Name (VV12, Package (0x05)
        {
            0x06020003, 
            " +12 Voltage", 
            0x27D8, 
            0x35E8, 
            0x01
        })
        Name (VPAR, Package (0x04)
        {
            Package (0x03)
            {
                0x00, 
                0x01, 
                0x00
            }, 

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

            Package (0x03)
            {
                0x22, 
                0x32, 
                0x00
            }, 

            Package (0x03)
            {
                0x1E, 
                0x0A, 
                0x00
            }
        })
        Name (VBUF, Package (0x05)
        {
            0x04, 
            CORV, 
            V3VV, 
            V5VV, 
            VV12
        })
        Method (VGET, 1, NotSerialized)
        {
            If (LEqual (Arg0, 0x00))
            {
                Return (^^SIOR.HWV0 ())
            }

            If (LEqual (Arg0, 0x01))
            {
                Return (^^SIOR.HWV1 ())
            }

            If (LEqual (Arg0, 0x02))
            {
                Return (^^SIOR.HWV2 ())
            }

            If (LEqual (Arg0, 0x03))
            {
                Return (^^SIOR.HWV4 ())
            }
        }

        Name (CPUT, Package (0x05)
        {
            0x06030000, 
            "CPU Temperature", 
            0x0258, 
            0x03B6, 
            0x00010001
        })
        Name (MBTP, Package (0x05)
        {
            0x06030001, 
            "MB Temperature", 
            0x01C2, 
            0x03B6, 
            0x00010001
        })
        Name (TBUF, Package (0x03)
        {
            0x02, 
            CPUT, 
            MBTP
        })
        Method (TGET, 1, NotSerialized)
        {
            If (LEqual (Arg0, 0x00))
            {
                Return (^^SIOR.HWT1 ())
            }

            If (LEqual (Arg0, 0x01))
            {
                Return (^^SIOR.HWT2 ())
            }
        }

        Name (CPUF, Package (0x05)
        {
            0x06040000, 
            "CPU FAN Speed", 
            0x0320, 
            0x1C20, 
            0x00010001
        })
        Name (CHAF, Package (0x05)
        {
            0x06040001, 
            "CHASSIS FAN Speed", 
            0x0320, 
            0x1C20, 
            0x00010001
        })
        Name (FBUF, Package (0x03)
        {
            0x02, 
            CPUF, 
            CHAF
        })
        Method (FGET, 1, NotSerialized)
        {
            If (LEqual (Arg0, 0x00))
            {
                Return (^^SIOR.HWF1 ())
            }

            If (LEqual (Arg0, 0x01))
            {
                Return (^^SIOR.HWF2 ())
            }
        }

        Name (QBUF, Package (0x01)
        {
            0x00
        })
        Method (VSIF, 0, NotSerialized)
        {
            Return (VBUF)
        }

        Method (RVLT, 1, NotSerialized)
        {
            And (Arg0, 0xFFFF, Local0)
            Store (VGET (Local0), Local1)
            Store (DerefOf (Index (DerefOf (Index (VPAR, Local0)), 0x00)), Local2)
            Store (DerefOf (Index (DerefOf (Index (VPAR, Local0)), 0x01)), Local3)
            Store (DerefOf (Index (DerefOf (Index (VPAR, Local0)), 0x02)), Local4)
            Multiply (Local1, Add (Local2, Local3), Local5)
            Divide (Local5, Local3, , Local5)
            Add (Local5, Local4, Local5)
            Return (Local5)
        }

        Method (SVLT, 1, NotSerialized)
        {
            And (DerefOf (Index (Arg0, 0x00)), 0xFFFF, Local0)
            Store (DerefOf (Index (VBUF, 0x00)), Local1)
            If (LNot (LLess (Local0, Local1)))
            {
                Return (0x00)
            }

            Increment (Local0)
            Store (DerefOf (Index (Arg0, 0x01)), Index (DerefOf (Index (VBUF, Local0)), 0x01))
            Store (DerefOf (Index (Arg0, 0x02)), Index (DerefOf (Index (VBUF, Local0)), 0x02))
            Store (DerefOf (Index (Arg0, 0x03)), Index (DerefOf (Index (VBUF, Local0)), 0x03))
            Store (DerefOf (Index (Arg0, 0x04)), Index (DerefOf (Index (VBUF, Local0)), 0x04))
            Return (0x01)
        }

        Method (TSIF, 0, NotSerialized)
        {
            Return (TBUF)
        }

        Method (RTMP, 1, NotSerialized)
        {
            And (Arg0, 0xFFFF, Local0)
            Store (TGET (Local0), Local1)
            Return (Local1)
        }

        Method (STMP, 1, NotSerialized)
        {
            Store (And (DerefOf (Index (Arg0, 0x00)), 0xFFFF), Local0)
            Store (DerefOf (Index (TBUF, 0x00)), Local1)
            If (LNot (LLess (Local0, Local1)))
            {
                Return (0x00)
            }

            Increment (Local0)
            Store (DerefOf (Index (Arg0, 0x01)), Index (DerefOf (Index (TBUF, Local0)), 0x01))
            Store (DerefOf (Index (Arg0, 0x02)), Index (DerefOf (Index (TBUF, Local0)), 0x02))
            Store (DerefOf (Index (Arg0, 0x03)), Index (DerefOf (Index (TBUF, Local0)), 0x03))
            Store (DerefOf (Index (Arg0, 0x04)), Index (DerefOf (Index (TBUF, Local0)), 0x04))
            Return (0x01)
        }

        Method (FSIF, 0, NotSerialized)
        {
            Return (FBUF)
        }

        Method (RFAN, 1, NotSerialized)
        {
            And (Arg0, 0xFFFF, Local0)
            Store (FGET (Local0), Local1)
            Return (Local1)
        }

        Method (SFAN, 1, NotSerialized)
        {
            And (DerefOf (Index (Arg0, 0x00)), 0xFFFF, Local0)
            Store (DerefOf (Index (FBUF, 0x00)), Local1)
            If (LNot (LLess (Local0, Local1)))
            {
                Return (0x00)
            }

            Increment (Local0)
            Store (DerefOf (Index (Arg0, 0x01)), Index (DerefOf (Index (FBUF, Local0)), 0x01))
            Store (DerefOf (Index (Arg0, 0x02)), Index (DerefOf (Index (FBUF, Local0)), 0x02))
            Store (DerefOf (Index (Arg0, 0x03)), Index (DerefOf (Index (FBUF, Local0)), 0x03))
            Store (DerefOf (Index (Arg0, 0x04)), Index (DerefOf (Index (FBUF, Local0)), 0x04))
            Return (0x01)
        }

        Method (QFIF, 0, NotSerialized)
        {
            If (LEqual (CPUQ, 0x00))
            {
                And (DerefOf (Index (QCFN, 0x05)), 0xFFFDFFFF, Local0)
                Store (Local0, Index (QCFN, 0x05))
            }
            Else
            {
                Or (DerefOf (Index (QCFN, 0x05)), 0x00020000, Local0)
                Store (Local0, Index (QCFN, 0x05))
            }

            Return (QBUF)
        }

        Method (GCQV, 1, NotSerialized)
        {
            If (LEqual (Arg0, 0x00))
            {
                Return (CPVL)
            }

            If (LEqual (Arg0, 0x01))
            {
                Return (CPVH)
            }

            If (LEqual (Arg0, 0x02))
            {
                Return (CPVC)
            }

            Return (0x00)
        }

        Method (QFST, 1, NotSerialized)
        {
            If (LEqual (Arg0, DerefOf (Index (QCFN, 0x00))))
            {
                Return (CQST)
            }

            Return (0x00)
        }
    }

    Name (HBAS, 0x00)
    Name (HLBA, 0x00)
    Name (HDEV, 0x00)
    OperationRegion (REFP, SystemIO, 0x61, 0x01)
    Field (REFP, ByteAcc, NoLock, Preserve)
    {
        P061,   8
    }

    Method (FZHD, 0, NotSerialized)
    {
        Store (0x80, Local0)
        Store (DMAX, Local1)
        While (LNot (LGreater (Local0, Local1)))
        {
            And (Local0, 0x7F, Local3)
            Store (0x01, Local2)
            ShiftLeft (Local2, Local3, Local2)
            If (LNot (And (\_SB.PCI0.HFZF, Local2)))
            {
                If (FZOD (Local0))
                {
                    Or (\_SB.PCI0.HFZF, Local2, \_SB.PCI0.HFZF)
                }
            }

            Increment (Local0)
        }
    }

    Method (FZOD, 1, NotSerialized)
    {
        GHET (Arg0)
        If (LEqual (HBAS, 0x00))
        {
            Return (0x01)
        }

        If (LEqual (HDEV, 0x00))
        {
            Return (0x01)
        }

        Store (HDEV, Local1)
        And (Local1, 0x10, Local1)
        If (LEqual (Local1, 0x00))
        {
            Return (0x01)
        }

        SDRV ()
        Add (HBAS, 0x07, Local1)
        OperationRegion (HRGS, SystemIO, Local1, 0x01)
        Field (HRGS, ByteAcc, NoLock, Preserve)
        {
            SREG,   8
        }

        Store (SREG, Local1)
        And (Local1, 0x80, Local1)
        If (Local1)
        {
            Return (0x00)
        }

        Add (HBAS, 0x07, Local1)
        OperationRegion (HRGC, SystemIO, Local1, 0x01)
        Field (HRGC, ByteAcc, NoLock, Preserve)
        {
            CREG,   8
        }

        Store (0xF5, CREG)
        If (WFCF ())
        {
            Add (HBAS, 0x07, Local0)
            Store (SREG, Local1)
            Return (LNot (And (Local1, 0x01)))
        }
        Else
        {
            Return (0x00)
        }
    }

    OperationRegion (DBGA, SystemIO, 0x80, 0x04)
    Field (DBGA, DWordAcc, NoLock, Preserve)
    {
        DB32,   32
    }

    Method (GHET, 1, NotSerialized)
    {
        And (Arg0, 0x7F, Local0)
        ShiftLeft (Local0, 0x05, Local0)
        Add (Local0, HPTA, Local0)
        OperationRegion (HDPT, SystemMemory, Local0, 0x20)
        Field (HDPT, ByteAcc, NoLock, Preserve)
        {
            HP00,   16, 
            Offset (0x04), 
            HP04,   8, 
            Offset (0x12), 
            HP0C,   8
        }

        Store (HP00, HBAS)
        Store (HP04, HLBA)
        Store (HP0C, HDEV)
    }

    Method (SDRV, 0, NotSerialized)
    {
        Add (HBAS, 0x06, Local0)
        OperationRegion (HRGH, SystemIO, Local0, 0x01)
        Field (HRGH, ByteAcc, NoLock, Preserve)
        {
            HREG,   8
        }

        Store (HLBA, HREG)
    }

    Method (WFCF, 0, NotSerialized)
    {
        SDRV ()
        Add (HBAS, 0x01, Local0)
        OperationRegion (HRGE, SystemIO, Local0, 0x01)
        Field (HRGE, ByteAcc, NoLock, Preserve)
        {
            EREG,   8
        }

        Store (0x00, EREG)
        Add (HBAS, 0x07, Local1)
        OperationRegion (HRGC, SystemIO, Local1, 0x01)
        Field (HRGC, ByteAcc, NoLock, Preserve)
        {
            CREG,   8
        }

        Store (0x28, Local0)
        While (Local0)
        {
            And (CREG, 0x01, Local2)
            If (Local2)
            {
                Return (0x00)
            }

            WFZF (Local1)
            And (CREG, 0x80, Local2)
            If (LEqual (Local2, 0x00))
            {
                Return (0x01)
            }

            Decrement (Local0)
        }

        Return (0x00)
    }

    Method (WFZF, 1, NotSerialized)
    {
        OperationRegion (HRGC, SystemIO, Arg0, 0x01)
        Field (HRGC, ByteAcc, NoLock, Preserve)
        {
            CREG,   8
        }

        Store (0xFFFF, Local1)
        Store (CREG, Local2)
        And (Local2, 0x80, Local2)
        If (LEqual (Local2, 0x00))
        {
            Return (While (Local1)
            {
                Stall (0x0F)
                Decrement (Local1)
                If (LEqual (Local1, 0x00))
                {
                    Return (Store (CREG, Local2))
                }

                And (Local2, 0x80, Local2)
                If (LEqual (Local2, 0x00))
                {
                    Return (Decrement (Local1))
                }
            })
        }
    }

    Scope (\_SB.PCI0)
    {
        Name (HFZF, 0x00)
        Method (HWAK, 1, NotSerialized)
        {
            If (LEqual (Arg0, 0x03))
            {
                Store (0x00, HFZF)
            }
        }
    }

    Scope (\_SB)
    {
        Scope (PCI0)
        {
            Name (CRS, ResourceTemplate ()
            {
                WordBusNumber (ResourceProducer, MinFixed, MaxFixed, 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)
                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,
                    0x00000000,
                    0x00000000,
                    0x00000000,
                    0x00000000)
            })
            CreateDWordField (CRS, 0x5C, MIN5)
            CreateDWordField (CRS, 0x60, MAX5)
            CreateDWordField (CRS, 0x68, LEN5)
            CreateDWordField (CRS, 0x76, MIN6)
            CreateDWordField (CRS, 0x7A, MAX6)
            CreateDWordField (CRS, 0x82, LEN6)
            Method (_CRS, 0, NotSerialized)
            {
                Store (MG1L, Local0)
                If (Local0)
                {
                    Store (MG1B, MIN5)
                    Store (MG1L, LEN5)
                    Add (MIN5, Decrement (Local0), MAX5)
                }

                Store (MG2B, MIN6)
                Store (MG2L, LEN6)
                Store (MG2L, Local0)
                Add (MIN6, Decrement (Local0), MAX6)
                Return (CRS)
            }
        }
    }

    Name (WOTB, 0x00)
    Name (WSSB, 0x00)
    Name (WAXB, 0x00)
    Method (_PTS, 1, NotSerialized)
    {
        Store (Arg0, DBG8)
        PTS (Arg0)
        Store (0x00, Index (WAKP, 0x00))
        Store (0x00, Index (WAKP, 0x01))
        If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL (), 0x02)))
        {
            Sleep (0x0BB8)
        }

        Store (ASSB, WSSB)
        Store (AOTB, WOTB)
        Store (AAXB, WAXB)
        Store (Arg0, ASSB)
        Store (OSFL (), AOTB)
        Store (Zero, AAXB)
    }

    Method (_WAK, 1, NotSerialized)
    {
        ShiftLeft (Arg0, 0x04, DBG8)
        Store (0x00, PLED)
        WAK (Arg0)
        If (ASSB)
        {
            Store (WSSB, ASSB)
            Store (WOTB, AOTB)
            Store (WAXB, AAXB)
        }

        If (DerefOf (Index (WAKP, 0x00)))
        {
            Store (0x00, Index (WAKP, 0x01))
        }
        Else
        {
            Store (Arg0, Index (WAKP, 0x01))
        }

        Return (WAKP)
    }

    OperationRegion (\_SB.PCI0.SBRG.PWCQ, PCI_Config, 0x94, 0x01)
    Field (\_SB.PCI0.SBRG.PWCQ, ByteAcc, NoLock, Preserve)
    {
        PLED,   2, 
            ,   2, 
        SUSU,   1, 
        Offset (0x01)
    }

    Name (\_S0, Package (0x04)
    {
        0x00, 
        0x00, 
        0x00, 
        0x00
    })
    If (SS1)
    {
        Name (\_S1, Package (0x04)
        {
            0x04, 
            0x00, 
            0x00, 
            0x00
        })
    }

    If (SS3)
    {
        Name (\_S3, Package (0x04)
        {
            0x01, 
            0x00, 
            0x00, 
            0x00
        })
    }

    If (SS4)
    {
        Name (\_S4, Package (0x04)
        {
            0x02, 
            0x00, 
            0x00, 
            0x00
        })
    }

    Name (\_S5, Package (0x04)
    {
        0x02, 
        0x00, 
        0x00, 
        0x00
    })
    Method (PTS, 1, NotSerialized)
    {
        If (Arg0)
        {
            \_SB.PCI0.NPTS (Arg0)
            \_SB.PCI0.SBRG.SPTS (Arg0)
        }
    }

    Method (WAK, 1, NotSerialized)
    {
        \_SB.PCI0.NWAK (Arg0)
        \_SB.PCI0.SBRG.SWAK (Arg0)
        \_SB.PCI0.HWAK (Arg0)
    }
}


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