Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Oct 2006 11:29:48 +0200
From:      "felix.schalck" <felix.schalck@gmail.com>
To:        Bruno Ducrot <ducrot@poupinou.org>
Cc:        freebsd-mobile@freebsd.org
Subject:   Re: Battery on Clevo M120 W
Message-ID:  <45222D8C.3000809@gmail.com>
In-Reply-To: <20061003091020.GH4945@poupinou.org>
References:  <4513C3A7.4090607@gmail.com> <20061003091020.GH4945@poupinou.org>

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

[-- Attachment #1 --]
Bruno Ducrot wrote:
> On Fri, Sep 22, 2006 at 01:06:15PM +0200, felix.schalck wrote:
>   
>> Hello,
>>
>> I don't know wether it is the right place to post this; i first tried 
>> freebsd-acpi, but didn't get any response: maybe I did something wrong...
>> Well: I'm was running FreeBSD 5.4 on my laptop without any main problem 
>> related to acpi. But since I upgraded to 6 - Stable, I miss the battery 
>> life status, which is very annoying... Since it worked on 5.4, it might 
>> not be an ASL problem (anyway: it tried acpidump & ald *.dump and only 
>> got 2 minor errors). Does someone experience a similar problem ?
>> Related to the battery: the handbook provided by the vendor describes 
>> the battery as a smart batt, although demsg shows battery0: <ACPI 
>> Control Method Battery>. Is it possible to force the load of sm_batt ?
>>     
>
> This require some hacking you maybe don't want to hear about.
> A first step is a carreful inspection of the ACPI tables and
> modification of them.
>
>   
>> Secondly: i'm getting a wrong acpi-line status every time I'm rebooting. 
>> After unplugging the ac adapter, and reconnecting it, everything seems 
>> to work fine. Perhaps the adapter is not ready when it's first beeing 
>> tested ? Is there any way to force a new status-init a bit later ?
>>
>> Any help or comments woudl be greatly appreciated. I find it to stupid 
>> to leave FreeBSD because of a batt problem; so I ready to read-and-do 
>> everything's neccessary to get it working again. If required, I can post 
>> system log or acpi messages.
>>
>>     
>
> Is there an acpidump available somewhere on the web?  Something like
> that:
> acpidump -d -t > Clevo_M120.asl
>
>   
Thanks for help Bruno. You french ? because I am :)
- OK for the wired sm_batt hack.
- Sure, I can post a dump: checkout attachement file or lookat here 
<http://kwerkus.free.fr/clevo_m120w.asl>;

Felix

[-- Attachment #2 --]
/*
  RSD PTR: OEM=PTLTD, ACPI_Rev=1.0x (0)
	RSDT=0x3dee5643, cksum=117
 */
/*
  RSDT: Length=60, Revision=1, Checksum=44,
	OEMID=PTLTD, OEM Table ID=ð , OEM Revision=0x6040000,
	Creator ID= LTP, Creator Revision=0x0
	Entries={ 0x3dee9ec4, 0x3dee9fd8, 0x3dee9f70, 0x3dee5a70, 0x3dee5898, 0x3dee567f }
 */
/*
  FACP: Length=116, Revision=1, Checksum=3,
	OEMID=INTEL, OEM Table ID=MONTARA, OEM Revision=0x6040000,
	Creator ID=PTL, Creator Revision=0x50
 	FACS=0x3defafc0, DSDT=0x3dee5f07
	INT_MODEL=PIC
	Preferred_PM_Profile=Unspecified (0)
	SCI_INT=9
	SMI_CMD=0xb2, ACPI_ENABLE=0xf0, ACPI_DISABLE=0xf1, S4BIOS_REQ=0xf2
	PSTATE_CNT=0x80
	PM1a_EVT_BLK=0x1000-0x1003
	PM1a_CNT_BLK=0x1004-0x1005
	PM2_CNT_BLK=0x1020-0x1020
	PM_TMR_BLK=0x1008-0x100b
	GPE0_BLK=0x1028-0x102f
	CST_CNT=0x85
	P_LVL2_LAT=1 us, P_LVL3_LAT=85 us
	FLUSH_SIZE=0, FLUSH_STRIDE=0
	DUTY_OFFSET=1, DUTY_WIDTH=3
	DAY_ALRM=13, MON_ALRM=0, CENTURY=50
	IAPC_BOOT_ARCH=
	Flags={WBINVD,PROC_C1,SLP_BUTTON,DCK_CAP}
 */
/*
  FACS:	Length=64, HwSig=0x00001207, Firm_Wake_Vec=0x00000000
	Global_Lock=
	Flags=
	Version=0
 */
/*
  DSDT: Length=16317, Revision=1, Checksum=6,
	OEMID=INTEL, OEM Table ID=MONTARAG, OEM Revision=0x6040000,
	Creator ID=MSFT, Creator Revision=0x100000e
 */
/*
  BOOT: Length=40, Revision=1, Checksum=165,
	OEMID=PTLTD, OEM Table ID=$SBFTBL$, OEM Revision=0x6040000,
	Creator ID= LTP, Creator Revision=0x1
 */
/*
  APIC: Length=104, Revision=1, Checksum=241,
	OEMID=INTEL, OEM Table ID=MONTARA, OEM Revision=0x6040000,
	Creator ID=LOHR, Creator Revision=0x64
	Local APIC ADDR=0xfee00000
	Flags={PC-AT}

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

	Type=Local APIC
	ACPI CPU=1
	Flags={DISABLED}
	APIC ID=1

	Type=IO APIC
	APIC ID=1
	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-hi, Trigger=level}

	Type=Local NMI
	ACPI CPU=0
	LINT Pin=1
	Flags={Polarity=active-hi, Trigger=edge}

	Type=Local NMI
	ACPI CPU=1
	LINT Pin=1
	Flags={Polarity=active-hi, Trigger=edge}
 */
/*
  SSDT: Length=511, Revision=1, Checksum=249,
	OEMID=PmRef, OEM Table ID=Cpu0Ist, OEM Revision=0x3000,
	Creator ID=INTL, Creator Revision=0x20030224
 */
/*
  SSDT: Length=472, Revision=1, Checksum=247,
	OEMID=PmRef, OEM Table ID=Cpu0Cst, OEM Revision=0x3001,
	Creator ID=INTL, Creator Revision=0x20030224
 */
/*
  SSDT: Length=537, Revision=1, Checksum=204,
	OEMID=PmRef, OEM Table ID=CpuPm, OEM Revision=0x3000,
	Creator ID=INTL, Creator Revision=0x20030224
 */
/*
 * Intel ACPI Component Architecture
 * AML Disassembler version 20041119
 *
 * Disassembly of /tmp/acpidump.Lrj7HU, Tue Oct  3 11:18:46 2006
 */
DefinitionBlock ("DSDT.aml", "DSDT", 1, "INTEL ", "MONTARAG", 100925440)
{
    OperationRegion (PRT0, SystemIO, 0x80, 0x01)
    Field (PRT0, ByteAcc, Lock, Preserve)
    {
        P80H,   8
    }

    OperationRegion (PRT1, SystemIO, 0x11B9, 0x01)
    Field (PRT1, ByteAcc, Lock, Preserve)
    {
        TLED,   8
    }

    OperationRegion (S_IO, SystemIO, 0x0600, 0x10)
    Field (S_IO, ByteAcc, NoLock, Preserve)
    {
        Offset (0x0A), 
        ISPE,   1
    }

    OperationRegion (IO_T, SystemIO, 0x0800, 0x10)
    Field (IO_T, ByteAcc, NoLock, Preserve)
    {
        Offset (0x02), 
        Offset (0x04), 
        Offset (0x06), 
        Offset (0x08), 
        TRP0,   8, 
        Offset (0x0A), 
        Offset (0x0B), 
        Offset (0x0C), 
        Offset (0x0D), 
        Offset (0x0E), 
        Offset (0x0F), 
        Offset (0x10)
    }

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

    OperationRegion (MNVS, SystemMemory, 0x3DEEAF09, 0x40)
    Field (MNVS, AnyAcc, Lock, Preserve)
    {
        OSYS,   16, 
        SMIF,   8, 
        PRM0,   8, 
        PRM1,   8, 
        SCIF,   8, 
        PRM2,   8, 
        PRM3,   8, 
        LCKF,   8, 
        PRM4,   8, 
        PRM5,   8, 
        DBGS,   8, 
        DCKS,   4, 
        CDCK,   4, 
        LIDS,   8, 
        PWRS,   8, 
        SIDE,   8, 
        Offset (0x14), 
        CMAP,   8, 
        CMBP,   8, 
        LPTP,   8, 
        FDCP,   8, 
        BTEN,   8, 
        ACTT,   8, 
        PSVT,   8, 
        TC1V,   8, 
        TC2V,   8, 
        TSPV,   8, 
        CRTT,   8, 
        Offset (0x20), 
        BVAL,   32, 
        P80D,   32, 
        CPUL,   8, 
        CPUH,   8, 
        APIC,   8, 
        GV3E,   8, 
        HTTE,   8, 
        WTHT,   8, 
        Offset (0x30), 
        IGDS,   8, 
        LCDA,   16, 
        TLST,   8, 
        CADL,   16, 
        PADL,   16, 
        CSTE,   16, 
        NSTE,   16, 
        SSTE,   16, 
        BLCS,   8, 
        BRTL,   8
    }

    Mutex (MUTX, 0x00)
    Name (_S0, Package (0x03)
    {
        0x00, 
        0x00, 
        0x00
    })
    Name (_S3, Package (0x03)
    {
        0x05, 
        0x05, 
        0x00
    })
    Name (_S4, Package (0x03)
    {
        0x06, 
        0x06, 
        0x00
    })
    Name (_S5, Package (0x03)
    {
        0x07, 
        0x07, 
        0x00
    })
    Scope (\_PR)
    {
        Processor (CPU0, 0x00, 0x00001010, 0x06) {}
        Processor (CPU1, 0x01, 0x00001010, 0x06) {}
    }

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

    Method (_PTS, 1, NotSerialized)
    {
        Store (0x00, P80D)
        P8XH (0x00, Arg0)
        If (DBGS)
        {
            Store (0x00, CPEN)
        }

        If (LEqual (Arg0, 0x04))
        {
            Store (0x35, SMIF)
            Store (0x00, TRP0)
        }

        If (LEqual (Arg0, 0x05))
        {
            Store (0x35, SMIF)
            Store (0x00, TRP0)
        }
    }

    Method (_WAK, 1, NotSerialized)
    {
        If (DBGS)
        {
            Store (0x01, CPEN)
        }

        If (LEqual (Arg0, 0x03))
        {
            If (GV3E)
            {
                PNOT ()
            }
            Else
            {
                PNO1 ()
            }

            Store (0x36, SMIF)
            Store (0x00, TRP0)
        }

        If (LEqual (Arg0, 0x04))
        {
            If (GV3E)
            {
                PNOT ()
            }
            Else
            {
                PNO1 ()
                Notify (\_SB.PCI0.USB1, 0x02)
                Notify (\_SB.PCI0.USB2, 0x02)
                Notify (\_SB.PCI0.USB7, 0x02)
            }
        }

        Return (Package (0x02)
        {
            0x00, 
            0x00
        })
    }

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

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

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

        Method (_L08, 0, NotSerialized)
        {
        }

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

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

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

        Method (_L1D, 0, NotSerialized)
        {
            If (LEqual (\_SB.PCI0.LPCB.H_EC.WFNO, 0x01))
            {
                Notify (\_SB.LID0, 0x02)
            }

            If (LEqual (\_SB.PCI0.LPCB.H_EC.WFNO, 0x03))
            {
                Notify (\_SB.PCI0, 0x02)
            }

            If (LEqual (\_SB.PCI0.LPCB.H_EC.WFNO, 0x04))
            {
                Notify (\_SB.SLPB, 0x02)
            }
        }
    }

    Method (BRTW, 1, Serialized)
    {
        Store (Divide (Multiply (0xFF, Arg0), 0x64, ), Local0)
        If (LEqual (BLCS, 0x01))
        {
            Subtract (0xFF, Local0, Local1)
            If (\_SB.PCI0.SBUS.SWRB (0x58, 0xAA, Local1))
            {
                P8XH (0x02, Local0)
                Store (Arg0, BRTL)
            }
        }
        Else
        {
            Store (Local0, PRM0)
            Store (0x12, SMIF)
            Store (0x00, TRP0)
            If (LEqual (SMIF, 0x00))
            {
                P8XH (0x02, Local0)
                Store (Arg0, BRTL)
            }
        }
    }

    Method (BTTM, 1, Serialized)
    {
        If (PWRS)
        {
            If (LNot (LLess (Arg0, BVAL)))
            {
                Store (Arg0, BVAL)
                Notify (\_SB.BAT0, 0x80)
            }
        }
        Else
        {
            If (LNot (LGreater (Arg0, BVAL)))
            {
                Store (Arg0, BVAL)
                Notify (\_SB.BAT0, 0x80)
            }
        }
    }

    Method (HKDS, 1, Serialized)
    {
        If (LEqual (0x00, DSEN))
        {
            Store (Arg0, SMIF)
            Store (0x00, TRP0)
            If (LEqual (SMIF, 0x00))
            {
                If (LNot (LEqual (CADL, PADL)))
                {
                    Store (CADL, PADL)
                    If (LEqual (OSYS, 0x07D1))
                    {
                        Notify (\_SB.PCI0, 0x00)
                    }
                    Else
                    {
                        Notify (\_SB.PCI0.GFX0, 0x00)
                    }

                    Sleep (0x02EE)
                }

                Notify (\_SB.PCI0.GFX0, 0x80)
            }
        }

        If (LEqual (0x01, DSEN))
        {
            Store (Increment (Arg0), SMIF)
            Store (0x00, TRP0)
            If (LEqual (SMIF, 0x00))
            {
                Notify (\_SB.PCI0.GFX0, 0x81)
            }
        }
    }

    Method (LSDS, 1, Serialized)
    {
        If (Arg0)
        {
            HKDS (0x0C)
        }
        Else
        {
            HKDS (0x0E)
        }
    }

    Method (P8XH, 2, Serialized)
    {
        If (LEqual (Arg0, 0x00))
        {
            Store (Or (And (P80D, 0xFFFFFF00), Arg1), P80D)
        }

        If (LEqual (Arg0, 0x01))
        {
            Store (Or (And (P80D, 0xFFFF00FF), ShiftLeft (Arg1, 0x08)), P80D)
        }

        If (LEqual (Arg0, 0x02))
        {
            Store (Or (And (P80D, 0xFF00FFFF), ShiftLeft (Arg1, 0x10)), P80D)
        }

        If (LEqual (Arg0, 0x03))
        {
            Store (Or (And (P80D, 0x00FFFFFF), ShiftLeft (Arg1, 0x18)), P80D)
        }

        Store (P80D, P80H)
    }

    Method (PNOT, 0, Serialized)
    {
        If (HTTE)
        {
            Notify (\_SB.BAT0, 0x80)
        }
        Else
        {
            If (LEqual (OSYS, 0x07D0))
            {
                If (\_SB.PCI0.LPCB.H_EC.PSTE)
                {
                    Store (0x38, SMIF)
                    Store (0x00, TRP0)
                    Store (0x56, P80H)
                    Notify (\_SB.BAT0, 0x80)
                    Notify (\_PR.CPU0, 0x80)
                    Sleep (0x64)
                    Notify (\_PR.CPU0, 0x81)
                }
                Else
                {
                    If (\_SB.PCI0.LPCB.H_EC.BAT4)
                    {
                        Store (0x37, SMIF)
                        Store (0x00, TRP0)
                        Store (0x55, P80H)
                        Notify (\_SB.BAT0, 0x80)
                        Notify (\_PR.CPU0, 0x80)
                        Sleep (0x64)
                        Notify (\_PR.CPU0, 0x81)
                    }
                }
            }
            Else
            {
            }

            Notify (\_SB.BAT0, 0x80)
            Notify (\_PR.CPU0, 0x80)
            Sleep (0x64)
            Notify (\_PR.CPU0, 0x81)
        }
    }

    Method (PNO1, 0, Serialized)
    {
        If (HTTE)
        {
            Notify (\_SB.BAT0, 0x80)
        }
        Else
        {
            If (\_SB.PCI0.LPCB.H_EC.BAT4)
            {
                Store (0xEE, P80H)
                Store (0x37, SMIF)
                Store (0x00, TRP0)
                Notify (\_SB.BAT0, 0x80)
                Notify (\_PR.CPU0, 0x80)
            }

            If (\_SB.PCI0.LPCB.H_EC.PSTE)
            {
                Store (0xAA, P80H)
                Store (0x38, SMIF)
                Store (0x00, TRP0)
                Notify (\_SB.BAT0, 0x80)
                Notify (\_PR.CPU0, 0x80)
                Sleep (0x64)
                Notify (\_PR.CPU0, 0x81)
            }
            Else
            {
            }

            Notify (\_SB.BAT0, 0x80)
            Notify (\_PR.CPU0, 0x80)
            Sleep (0x64)
            Notify (\_PR.CPU0, 0x81)
        }
    }

    Name (DCRT, 0x0E92)
    Name (DPSV, 0x0E60)
    Scope (\_TZ)
    {
        ThermalZone (THRM)
        {
            Method (_CRT, 0, NotSerialized)
            {
                Return (DCRT)
            }

            Method (_SCP, 1, Serialized)
            {
                Store (Arg0, CTYP)
            }

            Method (_TMP, 0, Serialized)
            {
                If (ECON)
                {
                    Store (\_SB.PCI0.LPCB.H_EC.TMP, Local0)
                    Store (Subtract (Divide (Local0, 0x0A, ), 0x0111), Local0)
                    If (LAnd (LAnd (LEqual (OSYS, 0x07D1), GPIC), LAnd (HTTE, PSVT)))
                    {
                        If (LNot (LEqual (And (PDC1, 0x0A), 0x0A)))
                        {
                            If (LGreater (Local0, PSVT))
                            {
                                If (LEqual (WTHT, 0x00))
                                {
                                    Store (0x01, WTHT)
                                    Store (0x34, SMIF)
                                    Store (0x00, TRP0)
                                }
                            }
                            Else
                            {
                                If (LEqual (WTHT, 0x01))
                                {
                                    Store (0x00, WTHT)
                                    Store (0x33, SMIF)
                                    Store (0x00, TRP0)
                                }
                            }
                        }
                    }

                    Return (Add (0x0AAC, Multiply (Local0, 0x0A)))
                }
                Else
                {
                    Return (Add (0x0AAC, Multiply (0x37, 0x0A)))
                }
            }

            Method (_PSL, 0, Serialized)
            {
                If (HTTE)
                {
                    Return (Package (0x02)
                    {
                        \_PR.CPU0, 
                        \_PR.CPU1
                    })
                }

                Return (Package (0x01)
                {
                    \_PR.CPU0
                })
            }

            Method (_PSV, 0, NotSerialized)
            {
                Return (DPSV)
            }

            Method (_TC1, 0, Serialized)
            {
                Return (TC1V)
            }

            Method (_TC2, 0, Serialized)
            {
                Return (TC2V)
            }

            Method (XTSP, 0, Serialized)
            {
                Return (TSPV)
            }
        }
    }

    Scope (\_SB)
    {
        Device (ADP1)
        {
            Name (_HID, "ACPI0003")
            Method (_PSR, 0, NotSerialized)
            {
                Return (PWRS)
            }

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

        Device (BAT0)
        {
            Name (_HID, EisaId ("PNP0C0A"))
            Name (PBIF, Package (0x0D)
            {
                0x01, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                0x01, 
                0xFFFFFFFF, 
                0xA0, 
                0x64, 
                0x40, 
                0x40, 
                " ", 
                " ", 
                " ", 
                " "
            })
            Name (BUF0, Package (0x0D)
            {
                0x01, 
                0x07D0, 
                0x07D0, 
                0x01, 
                0x2B5C, 
                0xA0, 
                0x64, 
                0x40, 
                0x40, 
                "        ", 
                "        ", 
                "LION", 
                "        "
            })
            Name (PBST, Package (0x04)
            {
                0x00, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                0xFFFFFFFF
            })
            Name (TMP0, Package (0x04)
            {
                0x00, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                0xFFFFFFFF
            })
            Method (_STA, 0, NotSerialized)
            {
                If (ECON)
                {
                    If (\_SB.PCI0.LPCB.H_EC.BAT0)
                    {
                        Return (0x1F)
                    }
                    Else
                    {
                        Return (0x0F)
                    }
                }
                Else
                {
                    Return (0x0F)
                }
            }

            Method (_BIF, 0, NotSerialized)
            {
                If (ECON)
                {
                    Store (\_SB.PCI0.LPCB.H_EC.BDC0, Index (BUF0, 0x01))
                    Store (\_SB.PCI0.LPCB.H_EC.BFC0, Index (BUF0, 0x02))
                    Store (\_SB.PCI0.LPCB.H_EC.BMO0, Index (BUF0, 0x09))
                    Store (\_SB.PCI0.LPCB.H_EC.BIF0, Index (BUF0, 0x0C))
                    Store (\_SB.PCI0.LPCB.H_EC.BSN0, Local1)
                    Name (TBUF, Buffer (0x07)
                    {
                        0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00
                    })
                    Store (TBUF, Index (BUF0, 0x0A))
                    Store (0x00, Local3)
                    Store (0x2710, Local4)
                    While (Local1)
                    {
                        Divide (Local1, Local4, Local1, Local2)
                        Add (Local2, 0x30, Local2)
                        Store (Local2, Index (TBUF, Local3))
                        Add (Local3, 0x01, Local3)
                        Divide (Local4, 0x0A, Local2, Local4)
                    }

                    Store (TBUF, Index (BUF0, 0x0A))
                    Return (BUF0)
                }
                Else
                {
                    Return (PBIF)
                }
            }

            Method (_BST, 0, NotSerialized)
            {
                If (ECON)
                {
                    And (\_SB.PCI0.LPCB.H_EC.BST0, 0x03, Local0)
                    Store (Local0, Index (TMP0, 0x00))
                    Store (\_SB.PCI0.LPCB.H_EC.BRC0, Index (TMP0, 0x02))
                    Return (TMP0)
                }
                Else
                {
                    Return (PBST)
                }
            }

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

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

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

        Device (SLPB)
        {
            Name (_HID, EisaId ("PNP0C0E"))
            Name (_PRW, Package (0x02)
            {
                0x1D, 
                0x03
            })
        }

        Device (PCI0)
        {
            Method (_INI, 0, NotSerialized)
            {
                If (CondRefOf (_OSI, Local0))
                {
                    Store (0x07D1, OSYS)
                    If (HTTE)
                    {
                        Store (0x32, SMIF)
                        Store (0x00, TRP0)
                    }
                }
                Else
                {
                    If (LEqual (SizeOf (_OS), 0x14))
                    {
                        Store (0x07D0, OSYS)
                    }
                    Else
                    {
                        If (LEqual (SizeOf (_OS), 0x27))
                        {
                            Store (0x07CF, OSYS)
                        }
                        Else
                        {
                            Store (0x07CE, OSYS)
                        }
                    }
                }

                If (LNot (LGreater (OSYS, 0x07CF)))
                {
                    Store (0x01, ECON)
                    If (LNot (LEqual (\_SB.PCI0.LPCB.H_EC.LSTE, LIDS)))
                    {
                        Store (\_SB.PCI0.LPCB.H_EC.LSTE, LIDS)
                        If (IGDS)
                        {
                            LSDS (LIDS)
                        }
                        Else
                        {
                            Store (0x2A, SMIF)
                            Store (0x00, TRP0)
                        }

                        Notify (\_SB.LID0, 0x80)
                    }

                    If (LNot (LEqual (\_SB.PCI0.LPCB.H_EC.PSTE, PWRS)))
                    {
                        Store (\_SB.PCI0.LPCB.H_EC.PSTE, PWRS)
                        Store (0x2B, SMIF)
                        Store (0x00, TRP0)
                        Notify (\_SB.BAT0, 0x80)
                    }
                }
            }

            Method (_S1D, 0, NotSerialized)
            {
                If (LEqual (OSYS, 0x07CF))
                {
                    Return (0x02)
                }

                Return (0x01)
            }

            Method (_S3D, 0, NotSerialized)
            {
                Return (0x02)
            }

            Method (_S4D, 0, NotSerialized)
            {
                Return (0x02)
            }

            Name (_HID, EisaId ("PNP0A03"))
            Name (_ADR, 0x00)
            Name (_BBN, 0x00)
            OperationRegion (HBUS, PCI_Config, 0x40, 0xC0)
            Field (HBUS, DWordAcc, NoLock, Preserve)
            {
                Offset (0x18), 
                    ,   7, 
                HENA,   1, 
                    ,   4, 
                PM0H,   2, 
                Offset (0x1A), 
                PM1L,   2, 
                    ,   2, 
                PM1H,   2, 
                Offset (0x1B), 
                PM2L,   2, 
                    ,   2, 
                PM2H,   2, 
                Offset (0x1C), 
                PM3L,   2, 
                    ,   2, 
                PM3H,   2, 
                Offset (0x1D), 
                PM4L,   2, 
                    ,   2, 
                PM4H,   2, 
                Offset (0x1E), 
                PM5L,   2, 
                    ,   2, 
                PM5H,   2, 
                Offset (0x1F), 
                PM6L,   2, 
                    ,   2, 
                PM6H,   2, 
                Offset (0x20)
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Return (BUF0)
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

            Device (MBUS)
            {
                Name (_ADR, 0x01)
                OperationRegion (MBUS, PCI_Config, 0x40, 0xC0)
                Field (MBUS, DWordAcc, NoLock, Preserve)
                {
                    DRB0,   8, 
                    DRB1,   8, 
                    DRB2,   8, 
                    DRB3,   8
                }
            }

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

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

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

            Device (GFX0)
            {
                Name (_ADR, 0x00020000)
                OperationRegion (VNVS, SystemMemory, 0x3DEEAF49, 0x00010004)
                Field (VNVS, AnyAcc, Lock, Preserve)
                {
                    RSIZ,   32, 
                    RBUF,   524288
                }

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

                Method (_DOD, 0, NotSerialized)
                {
                    If (LEqual (LCDA, 0x0110))
                    {
                        Return (Package (0x02)
                        {
                            0x00010100, 
                            0x00010110
                        })
                    }

                    Return (Package (0x02)
                    {
                        0x00010100, 
                        0x00010400
                    })
                }

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

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

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

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

                        Return (0x1D)
                    }

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

                        Return (0x00)
                    }

                    Method (_DSS, 1, NotSerialized)
                    {
                        If (LEqual (And (Arg0, 0xC0000000), 0xC0000000))
                        {
                            Store (NSTE, CSTE)
                        }
                    }
                }

                Device (LCD)
                {
                    Method (_ADR, 0, NotSerialized)
                    {
                        Return (LCDA)
                    }

                    Method (_DCS, 0, NotSerialized)
                    {
                        Store (0x01, SMIF)
                        Store (0x00, TRP0)
                        If (And (CSTE, 0x0808))
                        {
                            Return (0x1F)
                        }

                        Return (0x1D)
                    }

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

                        Return (0x00)
                    }

                    Method (_DSS, 1, NotSerialized)
                    {
                        If (LEqual (And (Arg0, 0xC0000000), 0xC0000000))
                        {
                            Store (NSTE, CSTE)
                        }
                    }

                    Method (_BCL, 0, NotSerialized)
                    {
                        Return (Package (0x0D)
                        {
                            0x64, 
                            0x50, 
                            0x00, 
                            0x0A, 
                            0x14, 
                            0x1E, 
                            0x28, 
                            0x32, 
                            0x3C, 
                            0x46, 
                            0x50, 
                            0x5A, 
                            0x64
                        })
                    }

                    Method (_BCM, 1, NotSerialized)
                    {
                        BRTW (Arg0)
                    }
                }
            }

            Device (PCIB)
            {
                Name (_ADR, 0x001E0000)
                Device (SLT0)
                {
                    Name (_ADR, 0x00)
                    Name (_PRW, Package (0x02)
                    {
                        0x0B, 
                        0x04
                    })
                }

                Device (SLT1)
                {
                    Name (_ADR, 0x00010000)
                    Name (_PRW, Package (0x02)
                    {
                        0x0B, 
                        0x04
                    })
                }

                Device (SLT2)
                {
                    Name (_ADR, 0x00020000)
                    Name (_PRW, Package (0x02)
                    {
                        0x0B, 
                        0x04
                    })
                }

                Device (LAN)
                {
                    Name (_ADR, 0x00060000)
                    Name (_PRW, Package (0x02)
                    {
                        0x0B, 
                        0x05
                    })
                }

                Method (_PRT, 0, NotSerialized)
                {
                    If (GPIC)
                    {
                        Return (Package (0x04)
                        {
                            Package (0x04)
                            {
                                0x0006FFFF, 
                                0x00, 
                                0x00, 
                                0x12
                            }, 

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

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

                            Package (0x04)
                            {
                                0x0008FFFF, 
                                0x01, 
                                0x00, 
                                0x11
                            }
                        })
                    }
                    Else
                    {
                        Return (Package (0x04)
                        {
                            Package (0x04)
                            {
                                0x0006FFFF, 
                                0x00, 
                                0x00, 
                                0x05
                            }, 

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

                            Package (0x04)
                            {
                                0x0008FFFF, 
                                0x00, 
                                0x00, 
                                0x05
                            }, 

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

            Device (LPCB)
            {
                Name (_ADR, 0x001F0000)
                OperationRegion (LPC0, PCI_Config, 0x40, 0xC0)
                Field (LPC0, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x20), 
                    PIRA,   8, 
                    PIRB,   8, 
                    PIRC,   8, 
                    PIRD,   8, 
                    Offset (0x28), 
                    PIRE,   8, 
                    PIRF,   8, 
                    PIRG,   8, 
                    PIRH,   8, 
                    Offset (0x90), 
                    HPTE,   32, 
                    Offset (0xA0), 
                    LDE0,   8, 
                    LDE1,   8
                }

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

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {1,3,4,5,6,7,10,12,14,15}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLA, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLA, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        ShiftLeft (0x01, And (PIRA, 0x0F), IRQ0)
                        Return (RTLA)
                    }

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

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

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

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {1,3,4,5,6,7,11,12,14,15}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLB, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLB, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        ShiftLeft (0x01, And (PIRB, 0x0F), IRQ0)
                        Return (RTLB)
                    }

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

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

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

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {1,3,4,5,6,7,10,12,14,15}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLC, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLC, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        ShiftLeft (0x01, And (PIRC, 0x0F), IRQ0)
                        Return (RTLC)
                    }

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

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

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

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {1,3,4,5,6,7,11,12,14,15}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLD, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLD, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        ShiftLeft (0x01, And (PIRD, 0x0F), IRQ0)
                        Return (RTLD)
                    }

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

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

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

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {1,3,4,5,6,7,10,12,14,15}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLE, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLE, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        ShiftLeft (0x01, And (PIRE, 0x0F), IRQ0)
                        Return (RTLE)
                    }

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

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

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

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {1,3,4,5,6,7,11,12,14,15}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLF, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLF, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        ShiftLeft (0x01, And (PIRF, 0x0F), IRQ0)
                        Return (RTLF)
                    }

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

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

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

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {1,3,4,5,6,7,10,12,14,15}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLG, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLG, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        ShiftLeft (0x01, And (PIRG, 0x0F), IRQ0)
                        Return (RTLG)
                    }

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

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

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

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {1,3,4,5,6,7,11,12,14,15}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        Name (RTLH, ResourceTemplate ()
                        {
                            IRQ (Level, ActiveLow, Shared) {}
                        })
                        CreateWordField (RTLH, 0x01, IRQ0)
                        Store (Zero, IRQ0)
                        ShiftLeft (0x01, And (PIRH, 0x0F), IRQ0)
                        Return (RTLH)
                    }

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

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

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

                        Return (BUF1)
                    }
                }

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

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

                        Return (BUF1)
                    }
                }

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

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

                Device (MBD0)
                {
                    Name (_HID, EisaId ("PNP0C02"))
                    Name (_UID, 0x01)
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x002E, 0x002E, 0x01, 0x02)
                        IO (Decode16, 0x0061, 0x0061, 0x01, 0x01)
                        IO (Decode16, 0x0063, 0x0063, 0x01, 0x01)
                        IO (Decode16, 0x0065, 0x0065, 0x01, 0x01)
                        IO (Decode16, 0x0067, 0x0067, 0x01, 0x01)
                        IO (Decode16, 0x0080, 0x0080, 0x01, 0x01)
                        IO (Decode16, 0x0092, 0x0092, 0x01, 0x01)
                        IO (Decode16, 0x00B2, 0x00B2, 0x01, 0x02)
                        IO (Decode16, 0x0600, 0x0600, 0x01, 0x10)
                        IO (Decode16, 0x0700, 0x0700, 0x01, 0x10)
                        IO (Decode16, 0x0800, 0x0800, 0x01, 0x10)
                        IO (Decode16, 0x1000, 0x1000, 0x01, 0x80)
                        IO (Decode16, 0x1180, 0x1180, 0x01, 0x40)
                        IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x08)
                        Memory32Fixed (ReadWrite, 0xFEC10000, 0x00010000)
                    })
                }

                Device (MBD1)
                {
                    Name (_HID, EisaId ("PNP0C02"))
                    Name (_UID, 0x02)
                    Name (_CRS, ResourceTemplate ()
                    {
                        Memory32Fixed (ReadWrite, 0xFEC00000, 0x00001000)
                        Memory32Fixed (ReadWrite, 0xFEE00000, 0x00001000)
                    })
                    Method (_STA, 0, NotSerialized)
                    {
                        If (LNot (LGreater (OSYS, 0x07CF)))
                        {
                            If (LOr (APIC, HTTE))
                            {
                                Return (0x0B)
                            }
                        }

                        Return (0x00)
                    }
                }

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

                Device (HPET)
                {
                    Name (_HID, EisaId ("PNP0103"))
                    Name (BUF0, ResourceTemplate ()
                    {
                        IRQNoFlags () {0}
                        IRQNoFlags () {8}
                        Memory32Fixed (ReadOnly, 0xFED00000, 0x00000400)
                    })
                    Method (_STA, 0, NotSerialized)
                    {
                        ShiftRight (And (HPTE, 0x00038000), 0x0F, Local0)
                        If (LEqual (OSYS, 0x07D1))
                        {
                            If (And (Local0, 0x04))
                            {
                                Return (0x0F)
                            }
                        }
                        Else
                        {
                            If (And (Local0, 0x04))
                            {
                                Return (0x0B)
                            }
                        }

                        Return (0x00)
                    }

                    Method (_CRS, 0, Serialized)
                    {
                        ShiftRight (And (HPTE, 0x00038000), 0x0F, Local0)
                        If (And (Local0, 0x04))
                        {
                            CreateDWordField (BUF0, 0x0A, HPT0)
                            If (LEqual (Local0, 0x05))
                            {
                                Store (0xFED01000, HPT0)
                            }

                            If (LEqual (Local0, 0x06))
                            {
                                Store (0xFED02000, HPT0)
                            }

                            If (LEqual (Local0, 0x07))
                            {
                                Store (0xFED03000, HPT0)
                            }
                        }

                        Return (BUF0)
                    }
                }

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

                    OperationRegion (RAM, EmbeddedControl, 0x00, 0xFF)
                    Field (RAM, AnyAcc, Lock, Preserve)
                    {
                        NMSG,   8, 
                        SLED,   4, 
                        Offset (0x02), 
                        MODE,   1, 
                        FAN0,   1, 
                        TME0,   1, 
                        TME1,   1, 
                        FAN1,   1, 
                            ,   2, 
                        Offset (0x03), 
                        LSTE,   1, 
                        LSW0,   1, 
                        LWKE,   1, 
                        WAKF,   1, 
                            ,   2, 
                        PWKE,   1, 
                        MWKE,   1, 
                        AC0,    16, 
                        PSV,    16, 
                        CRT,    16, 
                        TMP,    16, 
                        AC1,    16, 
                        SLPT,   8, 
                        SWEJ,   1, 
                        SWCH,   1, 
                        Offset (0x10), 
                        PSTE,   1, 
                        AFLT,   1, 
                        BAT0,   1, 
                        BAT1,   1, 
                            ,   3, 
                        PWOF,   1, 
                        WFNO,   8, 
                        BPU0,   32, 
                        BDC0,   32, 
                        BFC0,   32, 
                        BTC0,   32, 
                        BDV0,   32, 
                        BST0,   32, 
                        BPR0,   32, 
                        BRC0,   32, 
                        BPV0,   32, 
                        BTP0,   16, 
                        BRS0,   16, 
                        BCW0,   32, 
                        BCL0,   32, 
                        BCG0,   32, 
                        BG20,   32, 
                        BMO0,   64, 
                        BIF0,   64, 
                        BSN0,   32, 
                        BTY0,   64, 
                        BCC0,   16, 
                        REV0,   16, 
                            ,   3, 
                        BAT4,   1, 
                        Offset (0x6E), 
                        REV3,   32, 
                        BPU1,   32, 
                        BDC1,   32, 
                        BFC1,   32, 
                        BTC1,   32, 
                        BDV1,   32, 
                        BST1,   32, 
                        BPR1,   32, 
                        BRC1,   32, 
                        BPV1,   32, 
                        BTP1,   16, 
                        BRS1,   16, 
                        BCW1,   32, 
                        BCL1,   32, 
                        BCG1,   32, 
                        BG21,   32, 
                        BMO1,   64, 
                        BIF1,   64, 
                        BSN1,   32, 
                        BTY1,   64, 
                        BCC1,   16, 
                        BTAS,   1, 
                        BTPS,   1, 
                        SCAN,   8, 
                        PRON,   8, 
                        PROF,   8, 
                        ATTA,   8, 
                        DETA,   8
                    }

                    Device (BT)
                    {
                        Name (_HID, "ICOBCCC")
                        Method (_STA, 0, NotSerialized)
                        {
                            If (BTEN)
                            {
                                Return (0x0F)
                            }

                            Return (0x00)
                        }

                        Method (DUSB, 0, NotSerialized)
                        {
                            Store (0x00, \_SB.PCI0.LPCB.H_EC.DETA)
                        }

                        Method (AUSB, 0, NotSerialized)
                        {
                            Store (0x00, \_SB.PCI0.LPCB.H_EC.ATTA)
                        }

                        Method (BTPO, 0, NotSerialized)
                        {
                            Store (0x00, \_SB.PCI0.LPCB.H_EC.PRON)
                        }

                        Method (BTPF, 0, NotSerialized)
                        {
                            Store (0x00, \_SB.PCI0.LPCB.H_EC.PROF)
                        }

                        Method (BTST, 0, NotSerialized)
                        {
                            Return (Or (ShiftLeft (BTPS, 0x07), ShiftLeft (BTAS, 0x06)))
                        }
                    }

                    Method (_REG, 2, NotSerialized)
                    {
                        If (LAnd (LEqual (Arg0, 0x03), LEqual (Arg1, 0x01)))
                        {
                            Store (0x01, ECON)
                            If (LNot (LEqual (PSTE, PWRS)))
                            {
                                Store (PSTE, PWRS)
                                Store (0x2B, SMIF)
                                Store (0x00, TRP0)
                                Notify (\_SB.BAT0, 0x80)
                            }
                        }
                    }

                    Name (_GPE, 0x1C)
                    Method (_Q0A, 0, NotSerialized)
                    {
                        Notify (\_SB.BAT0, 0x80)
                    }

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

                    Method (_Q10, 0, NotSerialized)
                    {
                        Store (0x01, TLST)
                        HKDS (0x0A)
                    }

                    Method (_Q16, 0, NotSerialized)
                    {
                        If (LNot (LEqual (PSTE, PWRS)))
                        {
                            Store (PSTE, PWRS)
                            Store (0x2B, SMIF)
                            Store (0x00, TRP0)
                        }

                        If (GV3E)
                        {
                            PNOT ()
                        }
                        Else
                        {
                            PNO1 ()
                        }
                    }

                    Method (_Q17, 0, NotSerialized)
                    {
                        Notify (\_SB.BAT0, 0x81)
                    }

                    Method (_Q19, 0, NotSerialized)
                    {
                    }

                    Method (_Q1B, 0, NotSerialized)
                    {
                        Store (LSTE, LIDS)
                        Store (LIDS, P80H)
                        If (LIDS)
                        {
                            Store (0x11, P80H)
                            Store (0x00, TLED)
                        }
                        Else
                        {
                            Store (0x22, P80H)
                            Store (0x08, TLED)
                        }

                        Notify (\_SB.LID0, 0x80)
                    }

                    Method (_Q1C, 0, NotSerialized)
                    {
                        Notify (\_TZ.THRM, 0x80)
                    }

                    Method (_Q1D, 0, NotSerialized)
                    {
                    }

                    Method (_Q21, 0, NotSerialized)
                    {
                        Notify (\_SB.BAT0, 0x80)
                    }

                    Method (_Q23, 0, NotSerialized)
                    {
                        Store (0x23, P80H)
                    }

                    Method (_Q50, 0, NotSerialized)
                    {
                        P8XH (0x00, 0x50)
                        Notify (\_SB.PCI0.LPCB.H_EC.BT, 0x02)
                    }

                    Method (_Q51, 0, NotSerialized)
                    {
                        P8XH (0x00, 0x51)
                        Store (LSTE, LIDS)
                        If (IGDS)
                        {
                            LSDS (LIDS)
                        }
                        Else
                        {
                            Store (0x2A, SMIF)
                            Store (0x00, TRP0)
                        }

                        Notify (\_SB.LID0, 0x80)
                    }

                    Method (_Q60, 0, NotSerialized)
                    {
                        Notify (\_SB.PCI0.LPCB.H_EC.BT, 0x90)
                    }

                    Method (_Q61, 0, NotSerialized)
                    {
                        Notify (\_SB.PCI0.LPCB.H_EC.BT, 0x90)
                    }
                }

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

                IndexField (INDX, DATA, AnyAcc, NoLock, Preserve)
                {
                    AccessAs (ByteAcc, 0x00), 
                    Offset (0x07), 
                    LDN,    8, 
                    Offset (0x20), 
                    CFG,    8, 
                    Offset (0x26), 
                        ,   2, 
                    CR26,   1, 
                    Offset (0x27), 
                    Offset (0x30), 
                    ACTR,   1, 
                    Offset (0x60), 
                    IOAH,   8, 
                    IOAL,   8, 
                    Offset (0x70), 
                    INTR,   8, 
                    Offset (0x74), 
                    DMCH,   8, 
                    Offset (0xF0), 
                    OPT1,   8, 
                    OPT2,   8, 
                    OPT3,   8
                }

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

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

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

                Device (FIR)
                {
                    Name (_HID, EisaId ("NSC6001"))
                    Name (RSRC, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0000, 0x0000, 0x01, 0x08)
                        IRQNoFlags () {}
                        DMA (Compatibility, NotBusMaster, Transfer8) {}
                    })
                    Method (_STA, 0, NotSerialized)
                    {
                        If (CR26)
                        {
                            Return (0x00)
                        }

                        If (ACTR)
                        {
                            If (LEqual (CMBP, 0x06))
                            {
                                Store (0x0F, Local0)
                            }
                            Else
                            {
                                Store (0x0D, Local0)
                            }
                        }
                        Else
                        {
                            Store (0x0D, Local0)
                        }

                        Return (Local0)
                    }

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

                    Method (_CRS, 0, NotSerialized)
                    {
                        And (_STA (), 0x02, Local0)
                        If (LEqual (Local0, Zero))
                        {
                            Return (RSRC)
                        }

                        SETD (0x02)
                        CreateWordField (RSRC, 0x02, IO1L)
                        CreateWordField (RSRC, 0x04, IO1H)
                        CreateWordField (RSRC, 0x09, IRQX)
                        CreateWordField (RSRC, 0x0C, DMAX)
                        ShiftLeft (READ (0x60), 0x08, Local0)
                        Or (Local0, READ (0x61), Local0)
                        Store (Local0, IO1L)
                        Store (Local0, IO1H)
                        Store (0x01, Local1)
                        ShiftLeft (Local1, READ (0x70), IRQX)
                        Store (0x01, Local1)
                        ShiftLeft (Local1, READ (0x74), DMAX)
                        Return (RSRC)
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        Name (BUF0, ResourceTemplate ()
                        {
                            StartDependentFn (0x00, 0x02)
                            {
                                IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                                IRQNoFlags () {3}
                                DMA (Compatibility, NotBusMaster, Transfer8) {0}
                            }
                            StartDependentFn (0x00, 0x02)
                            {
                                IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                                IRQNoFlags () {3}
                                DMA (Compatibility, NotBusMaster, Transfer8) {0}
                            }
                            StartDependentFn (0x00, 0x02)
                            {
                                IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                                IRQNoFlags () {4}
                                DMA (Compatibility, NotBusMaster, Transfer8) {0}
                            }
                            StartDependentFn (0x00, 0x02)
                            {
                                IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                                IRQNoFlags () {4}
                                DMA (Compatibility, NotBusMaster, Transfer8) {0}
                            }
                            StartDependentFn (0x00, 0x02)
                            {
                                IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
                                IRQNoFlags () {3}
                                DMA (Compatibility, NotBusMaster, Transfer8) {3}
                            }
                            StartDependentFn (0x00, 0x02)
                            {
                                IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
                                IRQNoFlags () {3}
                                DMA (Compatibility, NotBusMaster, Transfer8) {3}
                            }
                            StartDependentFn (0x00, 0x02)
                            {
                                IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08)
                                IRQNoFlags () {4}
                                DMA (Compatibility, NotBusMaster, Transfer8) {3}
                            }
                            StartDependentFn (0x00, 0x02)
                            {
                                IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08)
                                IRQNoFlags () {4}
                                DMA (Compatibility, NotBusMaster, Transfer8) {3}
                            }
                            EndDependentFn ()
                        })
                        Return (BUF0)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        Store (Arg0, RSRC)
                        CreateWordField (RSRC, 0x02, IO1X)
                        CreateWordField (RSRC, 0x09, IRQX)
                        CreateWordField (RSRC, 0x0C, DMAX)
                        SETD (0x02)
                        ShiftRight (IO1X, 0x08, Local0)
                        WRIT (0x60, Local0)
                        And (IO1X, 0xFF, Local0)
                        WRIT (0x61, Local0)
                        FindSetRightBit (IRQX, Local0)
                        If (Local0)
                        {
                            Decrement (Local0)
                        }

                        WRIT (0x70, Local0)
                        FindSetRightBit (DMAX, Local0)
                        If (Local0)
                        {
                            Decrement (Local0)
                        }

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

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

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

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

                Device (PS2M)
                {
                    Name (_HID, EisaId ("PNP0F13"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IRQ (Edge, ActiveHigh, Exclusive) {12}
                    })
                }
            }

            Device (USB0)
            {
                Name (_ADR, 0x001D0000)
                OperationRegion (U0CS, PCI_Config, 0xC4, 0x04)
                Field (U0CS, DWordAcc, NoLock, Preserve)
                {
                    U0EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x03, 
                    0x04
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U0EN)
                    }
                    Else
                    {
                        Store (0x00, U0EN)
                    }
                }

                Method (_S1D, 0, NotSerialized)
                {
                    If (LEqual (OSYS, 0x07CF))
                    {
                        Return (0x02)
                    }

                    Return (0x01)
                }

                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x02)
                }

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x02)
                }
            }

            Device (USB1)
            {
                Name (_ADR, 0x001D0001)
                OperationRegion (U1CS, PCI_Config, 0xC4, 0x04)
                Field (U1CS, DWordAcc, NoLock, Preserve)
                {
                    U1EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x04, 
                    0x04
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U1EN)
                    }
                    Else
                    {
                        Store (0x00, U1EN)
                    }
                }

                Method (_S1D, 0, NotSerialized)
                {
                    If (LEqual (OSYS, 0x07CF))
                    {
                        Return (0x02)
                    }

                    Return (0x01)
                }

                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x02)
                }

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x02)
                }
            }

            Device (USB2)
            {
                Name (_ADR, 0x001D0002)
                OperationRegion (U2CS, PCI_Config, 0xC4, 0x04)
                Field (U2CS, DWordAcc, NoLock, Preserve)
                {
                    U2EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x0C, 
                    0x04
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U2EN)
                    }
                    Else
                    {
                        Store (0x00, U2EN)
                    }
                }

                Method (_S1D, 0, NotSerialized)
                {
                    If (LEqual (OSYS, 0x07CF))
                    {
                        Return (0x02)
                    }

                    Return (0x01)
                }

                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x02)
                }

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x02)
                }
            }

            Device (USB7)
            {
                Name (_ADR, 0x001D0007)
                Name (_PRW, Package (0x02)
                {
                    0x0D, 
                    0x04
                })
            }

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

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

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

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

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

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

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

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

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

                        If (LEqual (SizeOf (Arg2), 0x0200))
                        {
                            And (PRIT, 0x3F0F, PRIT)
                            Store (0x00, PSIT)
                            And (SYNC, 0x0D, SYNC)
                            Store (0x00, SDT1)
                            And (ICR0, 0x0D, ICR0)
                            And (ICR1, 0x0D, ICR1)
                            And (ICR3, 0x0D, ICR3)
                            And (ICR5, 0x0D, ICR5)
                            CreateWordField (Arg2, 0x62, W491)
                            CreateWordField (Arg2, 0x6A, W531)
                            CreateWordField (Arg2, 0x7E, W631)
                            CreateWordField (Arg2, 0x80, W641)
                            CreateWordField (Arg2, 0xB0, W881)
                            CreateWordField (Arg2, 0xBA, W931)
                            Or (PRIT, 0x8040, PRIT)
                            If (LAnd (And (FLAG, 0x08), And (W491, 0x0800)))
                            {
                                Or (PRIT, 0x20, PRIT)
                            }

                            If (And (FLAG, 0x10))
                            {
                                Or (PRIT, 0x4000, PRIT)
                                If (LGreater (PIO1, 0xF0))
                                {
                                    Or (PRIT, 0x80, PRIT)
                                }
                                Else
                                {
                                    Or (PRIT, 0x10, PRIT)
                                    Store (SETT (PIO1, W531, W641), PSIT)
                                }
                            }

                            If (And (FLAG, 0x04))
                            {
                                Or (SYNC, 0x02, SYNC)
                                Store (SDMA (DMA1), SDT1)
                                If (LLess (DMA1, 0x1E))
                                {
                                    Or (ICR3, 0x02, ICR3)
                                }

                                If (LLess (DMA1, 0x3C))
                                {
                                    Or (ICR0, 0x02, ICR0)
                                }

                                If (And (W931, 0x2000))
                                {
                                    Or (ICR1, 0x02, ICR1)
                                }
                            }
                        }
                    }

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

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

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

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

                            Return (PIB0)
                        }
                    }

                    Device (P_D1)
                    {
                        Name (_ADR, 0x01)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Name (PIB1, Buffer (0x0E)
                            {
                                0x03, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xEF, 0x03, 
                                0x00, 0x00, 0x00, 0x00, 0xB0, 0xEF
                            })
                            CreateByteField (PIB1, 0x01, PMD1)
                            CreateByteField (PIB1, 0x08, DMD1)
                            If (And (PRIT, 0x20))
                            {
                                If (LEqual (And (PRIT, 0x90), 0x80))
                                {
                                    Store (0x08, PMD1)
                                }
                                Else
                                {
                                    Add (And (PSIT, 0x03), ShiftRight (And (PSIT, 0x0C), 0x02), Local0)
                                    If (LEqual (0x05, Local0))
                                    {
                                        Store (0x0C, PMD1)
                                    }
                                    Else
                                    {
                                        If (LEqual (0x03, Local0))
                                        {
                                            Store (0x0B, PMD1)
                                        }
                                        Else
                                        {
                                            Store (0x0A, PMD1)
                                        }
                                    }
                                }
                            }
                            Else
                            {
                                Store (0x01, PMD1)
                            }

                            If (And (SYNC, 0x02))
                            {
                                Store (Or (SDT1, 0x40), DMD1)
                                If (And (ICR1, 0x02))
                                {
                                    If (And (ICR0, 0x02))
                                    {
                                        Add (DMD1, 0x02, DMD1)
                                    }

                                    If (And (ICR3, 0x02))
                                    {
                                        Store (0x45, DMD1)
                                    }
                                }
                            }
                            Else
                            {
                                Or (Subtract (And (PMD1, 0x07), 0x02), 0x20, DMD1)
                            }

                            Return (PIB1)
                        }
                    }

                    Method (_PS0, 0, NotSerialized)
                    {
                    }

                    Method (_PS3, 0, NotSerialized)
                    {
                    }
                }

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

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

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

                        Store (GETF (And (SYNC, 0x04), And (SYNC, 0x08), SECT), FLAG)
                        Return (SBUF)
                    }

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

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

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

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

                        If (LEqual (SizeOf (Arg2), 0x0200))
                        {
                            And (SECT, 0x3F0F, SECT)
                            Store (0x00, SSIT)
                            And (SYNC, 0x07, SYNC)
                            Store (0x00, SDT3)
                            And (ICR0, 0x07, ICR0)
                            And (ICR1, 0x07, ICR1)
                            And (ICR3, 0x07, ICR3)
                            And (ICR5, 0x07, ICR5)
                            CreateWordField (Arg2, 0x62, W491)
                            CreateWordField (Arg2, 0x6A, W531)
                            CreateWordField (Arg2, 0x7E, W631)
                            CreateWordField (Arg2, 0x80, W641)
                            CreateWordField (Arg2, 0xB0, W881)
                            CreateWordField (Arg2, 0xBA, W931)
                            Or (SECT, 0x8040, SECT)
                            If (LAnd (And (FLAG, 0x08), And (W491, 0x0800)))
                            {
                                Or (SECT, 0x20, SECT)
                            }

                            If (And (FLAG, 0x10))
                            {
                                Or (SECT, 0x4000, SECT)
                                If (LGreater (PIO1, 0xF0))
                                {
                                    Or (SECT, 0x80, SECT)
                                }
                                Else
                                {
                                    Or (SECT, 0x10, SECT)
                                    Store (SETT (PIO1, W531, W641), SSIT)
                                }
                            }

                            If (And (FLAG, 0x04))
                            {
                                Or (SYNC, 0x08, SYNC)
                                Store (SDMA (DMA1), SDT3)
                                If (LLess (DMA1, 0x1E))
                                {
                                    Or (ICR3, 0x08, ICR3)
                                }

                                If (LLess (DMA1, 0x3C))
                                {
                                    Or (ICR0, 0x08, ICR0)
                                }

                                If (And (W931, 0x2000))
                                {
                                    Or (ICR1, 0x08, ICR1)
                                }
                            }
                        }
                    }

                    Device (S_D0)
                    {
                        Name (_ADR, 0x00)
                        Method (_STA, 0, NotSerialized)
                        {
                            If (LAnd (ICR4, 0x04))
                            {
                                Return (0x00)
                            }

                            Return (0x0F)
                        }

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

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

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

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

                            Return (SIB0)
                        }
                    }

                    Device (S_D1)
                    {
                        Name (_ADR, 0x01)
                        Method (_GTF, 0, NotSerialized)
                        {
                            Name (SIB1, Buffer (0x0E)
                            {
                                0x03, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xEF, 0x03, 
                                0x00, 0x00, 0x00, 0x00, 0xB0, 0xEF
                            })
                            CreateByteField (SIB1, 0x01, PMD1)
                            CreateByteField (SIB1, 0x08, DMD1)
                            If (And (SECT, 0x20))
                            {
                                If (LEqual (And (SECT, 0x90), 0x80))
                                {
                                    Store (0x08, PMD1)
                                }
                                Else
                                {
                                    Add (And (SSIT, 0x03), ShiftRight (And (SSIT, 0x0C), 0x02), Local0)
                                    If (LEqual (0x05, Local0))
                                    {
                                        Store (0x0C, PMD1)
                                    }
                                    Else
                                    {
                                        If (LEqual (0x03, Local0))
                                        {
                                            Store (0x0B, PMD1)
                                        }
                                        Else
                                        {
                                            Store (0x0A, PMD1)
                                        }
                                    }
                                }
                            }
                            Else
                            {
                                Store (0x01, PMD1)
                            }

                            If (And (SYNC, 0x08))
                            {
                                Store (Or (SDT3, 0x40), DMD1)
                                If (And (ICR1, 0x08))
                                {
                                    If (And (ICR0, 0x08))
                                    {
                                        Add (DMD1, 0x02, DMD1)
                                    }

                                    If (And (ICR3, 0x08))
                                    {
                                        Store (0x45, DMD1)
                                    }
                                }
                            }
                            Else
                            {
                                Or (Subtract (And (PMD1, 0x07), 0x02), 0x20, DMD1)
                            }

                            Return (SIB1)
                        }
                    }

                    Method (_PS0, 0, NotSerialized)
                    {
                        Store (0x00, ISPE)
                        Sleep (0xC8)
                        And (ICR4, 0x03, ICR4)
                    }

                    Method (_PS3, 0, NotSerialized)
                    {
                        Or (And (ICR4, 0x03), 0x04, ICR4)
                        Sleep (0xC8)
                        Store (0x01, ISPE)
                    }
                }

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

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

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

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

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

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

                    Return (0xFFFFFFFF)
                }

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

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

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

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

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

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

                    Return (TMPF)
                }

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

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

                        Return (0x1001)
                    }
                }

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

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

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

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

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

                    Return (0x00)
                }

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

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

                    Return (0x04)
                }
            }

            Device (SBUS)
            {
                Name (_ADR, 0x001F0003)
                OperationRegion (SMBP, PCI_Config, 0x40, 0xC0)
                Field (SMBP, DWordAcc, NoLock, Preserve)
                {
                        ,   2, 
                    I2CE,   1
                }

                OperationRegion (SMBI, SystemIO, 0x1880, 0x10)
                Field (SMBI, ByteAcc, NoLock, Preserve)
                {
                    HSTS,   8, 
                    Offset (0x02), 
                    HCON,   8, 
                    HCOM,   8, 
                    TXSA,   8, 
                    DAT0,   8, 
                    DAT1,   8, 
                    HBDR,   8, 
                    PECR,   8, 
                    RXSA,   8, 
                    SDAT,   16
                }

                Method (SSXB, 2, Serialized)
                {
                    If (STRT ())
                    {
                        Return (0x00)
                    }

                    Store (0xBF, HSTS)
                    Store (Arg0, TXSA)
                    Store (Arg1, HCOM)
                    Store (0x48, HCON)
                    If (COMP ())
                    {
                        Or (HSTS, 0xFF, HSTS)
                        Return (0x01)
                    }

                    Return (0x00)
                }

                Method (SRXB, 1, Serialized)
                {
                    If (STRT ())
                    {
                        Return (0xFFFF)
                    }

                    Store (0xBF, HSTS)
                    Store (Or (Arg0, 0x01), TXSA)
                    Store (0x44, HCON)
                    If (COMP ())
                    {
                        Or (HSTS, 0xFF, HSTS)
                        Return (DAT0)
                    }

                    Return (0xFFFF)
                }

                Method (SWRB, 3, Serialized)
                {
                    If (STRT ())
                    {
                        Return (0x00)
                    }

                    Store (0xBF, HSTS)
                    Store (Arg0, TXSA)
                    Store (Arg1, HCOM)
                    Store (Arg2, DAT0)
                    Store (0x48, HCON)
                    If (COMP ())
                    {
                        Or (HSTS, 0xFF, HSTS)
                        Return (0x01)
                    }

                    Return (0x00)
                }

                Method (SRDB, 2, Serialized)
                {
                    If (STRT ())
                    {
                        Return (0xFFFF)
                    }

                    Store (0xBF, HSTS)
                    Store (Or (Arg0, 0x01), TXSA)
                    Store (Arg1, HCOM)
                    Store (0x48, HCON)
                    If (COMP ())
                    {
                        Or (HSTS, 0xFF, HSTS)
                        Return (DAT0)
                    }

                    Return (0xFFFF)
                }

                Method (SBLW, 3, Serialized)
                {
                    If (STRT ())
                    {
                        Return (0x00)
                    }

                    Store (0xBF, HSTS)
                    Store (Arg0, TXSA)
                    Store (Arg1, HCOM)
                    Store (SizeOf (Arg2), DAT0)
                    Store (0x00, Local1)
                    Store (DerefOf (Index (Arg2, 0x00)), HBDR)
                    Store (0x54, HCON)
                    While (LGreater (SizeOf (Arg2), Local1))
                    {
                        Store (0x0A, Local0)
                        While (LAnd (LNot (And (HSTS, 0x80)), Local0))
                        {
                            Sleep (0x64)
                            Decrement (Local0)
                        }

                        If (LNot (Local0))
                        {
                            KILL ()
                            Return (0x00)
                        }

                        Store (0x80, HSTS)
                        Increment (Local1)
                        If (LGreater (SizeOf (Arg2), Local1))
                        {
                            Store (DerefOf (Index (Arg2, Local1)), HBDR)
                        }
                    }

                    If (COMP ())
                    {
                        Or (HSTS, 0xFF, HSTS)
                        Return (0x01)
                    }

                    Return (0x00)
                }

                Method (SBLR, 2, Serialized)
                {
                    Name (TBUF, Buffer (0x0100) {})
                    If (STRT ())
                    {
                        Return (0x00)
                    }

                    Store (0xBF, HSTS)
                    Store (Or (Arg0, 0x01), TXSA)
                    Store (Arg1, HCOM)
                    Store (0x54, HCON)
                    Store (0x0A, Local0)
                    While (LAnd (LNot (And (HSTS, 0x80)), Local0))
                    {
                        Sleep (0x64)
                        Decrement (Local0)
                    }

                    If (LNot (Local0))
                    {
                        KILL ()
                        Return (0x00)
                    }

                    Store (DAT0, Index (TBUF, 0x00))
                    Store (0x80, HSTS)
                    Store (0x01, Local1)
                    While (LLess (Local1, DerefOf (Index (TBUF, 0x00))))
                    {
                        Store (0x0A, Local0)
                        While (LAnd (LNot (And (HSTS, 0x80)), Local0))
                        {
                            Sleep (0x64)
                            Decrement (Local0)
                        }

                        If (LNot (Local0))
                        {
                            KILL ()
                            Return (0x00)
                        }

                        Store (HBDR, Index (TBUF, Local1))
                        Store (0x80, HSTS)
                        Increment (Local1)
                    }

                    If (COMP ())
                    {
                        Or (HSTS, 0xFF, HSTS)
                        Return (TBUF)
                    }

                    Return (0x00)
                }

                Method (STRT, 0, Serialized)
                {
                    Store (0x64, Local0)
                    While (Local0)
                    {
                        If (And (HSTS, 0x40))
                        {
                            Decrement (Local0)
                            Sleep (0x0A)
                            If (LEqual (Local0, 0x00))
                            {
                                Return (0x01)
                            }
                        }
                        Else
                        {
                            Store (0x00, Local0)
                        }
                    }

                    Store (0x64, Local0)
                    While (Local0)
                    {
                        If (And (HSTS, 0x01))
                        {
                            Decrement (Local0)
                            Sleep (0x0A)
                            If (LEqual (Local0, 0x00))
                            {
                                KILL ()
                            }
                        }
                        Else
                        {
                            Return (0x00)
                        }
                    }

                    Return (0x01)
                }

                Method (COMP, 0, Serialized)
                {
                    Store (0x64, Local0)
                    While (Local0)
                    {
                        If (And (HSTS, 0x02))
                        {
                            Return (0x01)
                        }
                        Else
                        {
                            Decrement (Local0)
                            Sleep (0x0A)
                            If (LEqual (Local0, 0x00))
                            {
                                KILL ()
                            }
                        }
                    }

                    Return (0x00)
                }

                Method (KILL, 0, Serialized)
                {
                    Or (HCON, 0x02, HCON)
                    Or (HSTS, 0xFF, HSTS)
                }
            }

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

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

    Scope (\_PR.CPU0)
    {
        Method (_PPC, 0, NotSerialized)
        {
            If (\ECON)
            {
                If (\_SB.PCI0.LPCB.H_EC.PSTE)
                {
                    Return (0x00)
                }
                Else
                {
                    If (\_SB.PCI0.LPCB.H_EC.BAT0)
                    {
                        Store (SizeOf (SPSS), Local0)
                        ShiftRight (Local0, 0x01, Local1)
                        Return (Local1)
                    }
                }
            }

            Return (0x00)
        }

        Method (_PCT, 0, NotSerialized)
        {
            If (And (CFGD, 0x4000))
            {
                Return (Package (0x02)
                {
                    ResourceTemplate ()
                    {
                        Register (SystemIO, 0x08, 0x00, 0x0000000000000800)
                    }, 

                    ResourceTemplate ()
                    {
                        Register (SystemIO, 0x08, 0x00, 0x0000000000000802)
                    }
                })
            }

            If (LAnd (And (CFGD, 0x02), And (PDC0, 0x01)))
            {
                Return (Package (0x02)
                {
                    ResourceTemplate ()
                    {
                        Register (FFixedHW, 0x00, 0x00, 0x0000000000000000)
                    }, 

                    ResourceTemplate ()
                    {
                        Register (FFixedHW, 0x00, 0x00, 0x0000000000000000)
                    }
                })
            }

            Return (Package (0x02)
            {
                ResourceTemplate ()
                {
                    Register (SystemIO, 0x10, 0x00, 0x00000000000000B2)
                }, 

                ResourceTemplate ()
                {
                    Register (SystemIO, 0x08, 0x00, 0x00000000000000B3)
                }
            })
        }

        Method (_PSS, 0, NotSerialized)
        {
            If (LAnd (LNot (And (CFGD, 0x4000)), LAnd (And (CFGD, 0x02), And (PDC0, 0x01))))
            {
                Return (NPSS)
            }

            Return (SPSS)
        }

        Name (SPSS, Package (0x02)
        {
            Package (0x06)
            {
                0x00000640, 
                0x00000000, 
                0x00000064, 
                0x0000006E, 
                0x00000083, 
                0x00000000
            }, 

            Package (0x06)
            {
                0x00000258, 
                0x00000000, 
                0x00000064, 
                0x0000006E, 
                0x00000183, 
                0x00000001
            }
        })
        Name (NPSS, Package (0x02)
        {
            Package (0x06)
            {
                0x00000640, 
                0x00000000, 
                0x0000000A, 
                0x0000000A, 
                0x00001028, 
                0x00001028
            }, 

            Package (0x06)
            {
                0x00000258, 
                0x00000000, 
                0x0000000A, 
                0x0000000A, 
                0x00000612, 
                0x00000612
            }
        })
    }

    Scope (\_PR.CPU0)
    {
        Method (_CST, 0, NotSerialized)
        {
            If (And (CFGD, 0x4000))
            {
                Return (Package (0x02)
                {
                    0x01, 
                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (FFixedHW, 0x01, 0x01, 0x0000000000000809)
                        }, 

                        0x01, 
                        0x01, 
                        0x03E8
                    }
                })
            }

            If (And (CFGD, 0x80))
            {
                Return (Package (0x05)
                {
                    0x04, 
                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (FFixedHW, 0x00, 0x00, 0x0000000000000000)
                        }, 

                        0x01, 
                        0x01, 
                        0x03E8
                    }, 

                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (SystemIO, 0x08, 0x00, 0x0000000000001014)
                        }, 

                        0x02, 
                        0x01, 
                        0x01F4
                    }, 

                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (SystemIO, 0x08, 0x00, 0x0000000000001015)
                        }, 

                        0x03, 
                        0x55, 
                        0xFA
                    }, 

                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (SystemIO, 0x08, 0x00, 0x0000000000001016)
                        }, 

                        0x03, 
                        0xB9, 
                        0x64
                    }
                })
            }

            If (And (CFGD, 0x40))
            {
                Return (Package (0x04)
                {
                    0x03, 
                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (FFixedHW, 0x00, 0x00, 0x0000000000000000)
                        }, 

                        0x01, 
                        0x01, 
                        0x03E8
                    }, 

                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (SystemIO, 0x08, 0x00, 0x0000000000001014)
                        }, 

                        0x02, 
                        0x01, 
                        0x01F4
                    }, 

                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (SystemIO, 0x08, 0x00, 0x0000000000001015)
                        }, 

                        0x03, 
                        0x55, 
                        0xFA
                    }
                })
            }

            If (And (CFGD, 0x20))
            {
                Return (Package (0x03)
                {
                    0x02, 
                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (FFixedHW, 0x00, 0x00, 0x0000000000000000)
                        }, 

                        0x01, 
                        0x01, 
                        0x03E8
                    }, 

                    Package (0x04)
                    {
                        ResourceTemplate ()
                        {
                            Register (SystemIO, 0x08, 0x00, 0x0000000000001014)
                        }, 

                        0x02, 
                        0x01, 
                        0x01F4
                    }
                })
            }

            Return (Package (0x02)
            {
                0x01, 
                Package (0x04)
                {
                    ResourceTemplate ()
                    {
                        Register (FFixedHW, 0x00, 0x00, 0x0000000000000000)
                    }, 

                    0x01, 
                    0x01, 
                    0x03E8
                }
            })
        }
    }

    Scope (\)
    {
        Name (SSDT, Package (0x0C)
        {
            "CPU0IST ", 
            0x3DEE5A70, 
            0x000001FF, 
            "CPU1IST ", 
            0x00000000, 
            0xF000FF53, 
            "CPU0CST ", 
            0x3DEE5898, 
            0x000001D8, 
            "CPU1CST ", 
            0x00000000, 
            0xF000FF53
        })
        Name (CFGD, 0x06D681F2)
        Name (\PDC0, 0x80000000)
        Name (\PDC1, 0x80000000)
    }

    Scope (\_PR.CPU0)
    {
        Name (HI0, 0x00)
        Name (HC0, 0x00)
        Method (_PDC, 1, NotSerialized)
        {
            CreateDWordField (Arg0, 0x08, CAP0)
            Store (CAP0, PDC0)
            If (LAnd (And (CFGD, 0x4000), LEqual (And (PDC0, 0x0A), 0x0A)))
            {
                If (And (CFGD, 0x03))
                {
                    OperationRegion (IST0, SystemMemory, DerefOf (Index (SSDT, 0x01)), DerefOf (Index (SSDT, 0x02)))
                    Load (IST0, HI0)
                }

                If (And (CFGD, 0x10))
                {
                    OperationRegion (CST0, SystemMemory, DerefOf (Index (SSDT, 0x07)), DerefOf (Index (SSDT, 0x08)))
                    Load (CST0, HC0)
                }
            }
        }
    }

    Scope (\_PR.CPU1)
    {
        Name (HI1, 0x00)
        Name (HC1, 0x00)
        Method (_PDC, 1, NotSerialized)
        {
            CreateDWordField (Arg0, 0x08, CAP1)
            Store (CAP1, PDC1)
            If (LAnd (And (CFGD, 0x4000), LEqual (And (PDC1, 0x0A), 0x0A)))
            {
                If (And (CFGD, 0x03))
                {
                    OperationRegion (IST1, SystemMemory, DerefOf (Index (SSDT, 0x04)), DerefOf (Index (SSDT, 0x05)))
                    Load (IST1, HI1)
                }

                If (And (CFGD, 0x10))
                {
                    OperationRegion (CST1, SystemMemory, DerefOf (Index (SSDT, 0x0A)), DerefOf (Index (SSDT, 0x0B)))
                    Load (CST1, HC1)
                }
            }

            If (LEqual (And (PDC1, 0x0A), 0x0A))
            {
                If (LEqual (WTHT, 0x01))
                {
                    Store (0x00, WTHT)
                    Store (0x33, SMIF)
                    Store (0x00, TRP0)
                }
            }
        }
    }
}


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