Toshiba Portege 4010 g_vfs_done error = 6 on resume

From: Russell Jackson <raj_at_cserv62.csub.edu>
Date: Fri, 16 Dec 2005 12:22:09 +0000
My Toshiba Portege 4010 continues to be unable to resume after a
suspend on a freshly compiled CURRENT.

On suspend I get an interrupt storm on irq11 (USB controller), but it
does successfully go into suspend.

On resume, the video comes back up and the console is responsive;
however, any attempt to access the disk results in g_vfs_done() = 6
errors for either READ or WRITE along with the occasional
'initiate_write_filepage: already started'.

A sync results in an immediate kernel panic: 'vinvalbuf: dirty bufs'.

I've included both my dmesg output and an AML dump in the case that
this is related to ACPI.

/var/run/dmesg.boot:

Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights
reserved. FreeBSD 7.0-CURRENT #5: Thu Dec 15 18:14:40 UTC 2005
    raj_at_vala:/usr/src/sys/i386/compile/VALA
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Mobile Intel(R) Pentium(R) III CPU - M   933MHz (929.57-MHz
686-class CPU) Origin = "GenuineIntel"  Id = 0x6b4  Stepping = 4
  Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
real memory  = 251002880 (239 MB)
avail memory = 236101632 (225 MB)
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <TOSHIB 750> on motherboard
acpi0: Power Button (fixed)
Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xee08-0xee0b on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_perf0: <ACPI CPU Frequency Control> on cpu0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
acpi_video0: <ACPI video extension> mem
0xfc000000-0xfdffffff,0xfbc00000-0xfbffffff,0xf8000000-0xf9ffffff,0xf7ff8000-0xf7ffffff
irq 11 at device 0.0 on pci1 ohci0: <AcerLabs M5237 (Aladdin-V) USB
controller> mem 0xf7eff000-0xf7efffff irq 11 at device 2.0 on pci0
controller> ohci0: [GIANT-LOCKED]
usb0: OHCI version 1.0, legacy support
usb0: SMM does not respond, resetting
usb0: <AcerLabs M5237 (Aladdin-V) USB controller> on ohci0
usb0: USB revision 1.0
uhub0: AcerLabs OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
atapci0: <AcerLabs M5229 UDMA66 controller> port
0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xeff0-0xefff at device 4.0 on pci0
atapci0: using PIO transfers above 137GB as workaround for 48bit DMA
access bug, expect reduced performance ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0 pcm0: <Acer Labs M5451> at device 6.0
on pci0 pcm0: <Asahi Kasei AK4543 AC97 Codec>
pcm0: [GIANT-LOCKED]
isab0: <PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
pci0: <bridge> at device 8.0 (no driver attached)
fxp0: <Intel 82550 Pro/100 Ethernet> port 0xeec0-0xeeff mem
0xf7efe000-0xf7efefff,0xf7ec0000-0xf7edffff irq 11 at device 10.0 on
pci0 miibus0: <MII bus> on fxp0 inphy0: <i82555 10/100 media interface>
on miibus0 inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:08:0d:aa:26:08
fwohci0: <Texas Instruments TSB43AB22/A> at device 12.0 on pci0
fwohci0: OHCI version 1.10 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 00:00:39:00:00:1a:26:b1
fwohci0: Phy 1394a available S400, 2 ports.
fwohci0: Link S400, max_rec 2048 bytes.
firewire0: <IEEE1394(FireWire) bus> on fwohci0
sbp0: <SBP-2/SCSI over FireWire> on firewire0
fwohci0: Initiate bus reset
fwohci0: node_id=0xc000ffc0, gen=1, CYCLEMASTER mode
firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
firewire0: bus manager 0 (me)
cbb0: <TI1410 PCI-CardBus Bridge> at device 16.0 on pci0
cardbus0: <CardBus bus> on cbb0
pccard0: <16-bit PCCard bus> on cbb0
cbb1: <ToPIC100 PCI-CardBus Bridge> at device 17.0 on pci0
cardbus1: <CardBus bus> on cbb1
pccard1: <16-bit PCCard bus> on cbb1
cbb2: <ToPIC100 PCI-CardBus Bridge> at device 17.1 on pci0
cardbus2: <CardBus bus> on cbb2
pccard2: <16-bit PCCard bus> on cbb2
pci0: <base peripheral> at device 18.0 (no driver attached)
acpi_lid0: <Control Method Lid Switch> on acpi0
battery0: <ACPI Control Method Battery> on acpi0
battery1: <ACPI Control Method Battery> on acpi0
acpi_acad0: <AC Adapter> on acpi0
acpi_toshiba0: <Toshiba HCI Extras> on acpi0
acpi_tz0: <Thermal Zone> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse, device ID 3
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on
acpi0 sio0: type 16550A
pmtimer0 on isa0
orm0: <ISA Option ROMs> at iomem 0xc0000-0xcbfff,0xe0000-0xeffff pnpid
ORM0000 on isa0 sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on
isa0 sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
uhub1: Mitsumi Electric Hub in Apple Extended USB Keyboard, class 9/0,
rev 1.10/1.22, addr 2 uhub1: 3 ports with 2 removable, bus powered
ukbd0: Mitsumi Electric Apple Extended USB Keyboard, rev 1.10/1.22,
addr 3, iclass 3/1 kbd1 at ukbd0
uhid0: Mitsumi Electric Apple Extended USB Keyboard, rev 1.10/1.22,
addr 3, iclass 3/1 ums0: vendor 0x045e product 0x0009, rev 1.00/1.05,
addr 4, iclass 3/1 ums0: 3 buttons and Z dir.
Timecounter "TSC" frequency 929567735 Hz quality 800
Timecounters tick every 1.000 msec
ata2: <SanDisk 4-1 PC Card Adapter> at port 0x100-0x10f irq 11 function
0 config 1 on pccard1 wi0: <TOSHIBA Wireless LAN Card> at port
0x180-0x1bf irq 11 function 0 config 1 on pccard0 wi0: using Lucent
Embedded WaveLAN/IEEE wi0: Lucent Firmware: Station (8.10.1)
wi0: Ethernet address: 00:02:2d:6c:f7:ca
ad0: 28615MB <FUJITSU MHR2030AT 53BB> at ata0-master UDMA66
acd0: CDRW <UJDA720 DVD/CDRW/1.01> at ata1-master UDMA33
ad4: 119MB <Memory Card Adapter 20020812> at ata2-master PIO2
Trying to mount root from ufs:/dev/ad0s3a
WARNING: / was not properly dismounted
WARNING: /var was not properly dismounted
WARNING: /tmp was not properly dismounted
WARNING: /usr was not properly dismounted
WARNING: /home was not properly dismounted
fxp0: link state changed to UP

AML dump:

/*
 * Intel ACPI Component Architecture
 * AML Disassembler version 20041119
 *
 * Disassembly of dump, Sun May 29 19:22:09 2005
 */
DefinitionBlock ("DSDT.aml", "DSDT", 1, "TOSHIB", "4010    ", 537003538)
{
    Name (\_S0, Package (0x04)
    {
        0x00, 
        0x00, 
        0x00, 
        0x00
    })
    Name (\_S3, Package (0x04)
    {
        0x07, 
        0x00, 
        0x00, 
        0x00
    })
    Name (\_S4, Package (0x04)
    {
        0x07, 
        0x00, 
        0x00, 
        0x00
    })
    Name (\_S5, Package (0x04)
    {
        0x07, 
        0x00, 
        0x00, 
        0x00
    })
    Scope (\_PR)
    {
        Processor (CPU0, 0x01, 0x0000EE10, 0x06)
        {
            Name (_PCT, Package (0x02)
            {
                ResourceTemplate ()
                {
                    Register (SystemIO, 0x08, 0x00, 0x00000000000000B1)
                }, 

                ResourceTemplate ()
                {
                    Register (SystemIO, 0x10, 0x00, 0x000000000000EF40)
                }
            })
            Method (_PSS, 0, NotSerialized)
            {
                If (\_SB.MEM.PSS1)
                {
                    Name (PSSD, Package (0x02)
                    {
                        Package (0x00) {}, 
                        Package (0x00) {}
                    })
                    Name (PSD0, Package (0x06)
                    {
                        0x03E8, 
                        0x55F0, 
                        0xFA, 
                        0xFA, 
                        0x90, 
                        0x00
                    })
                    Name (PSD1, Package (0x06)
                    {
                        0x02BC, 
                        0x2648, 
                        0xFA, 
                        0xFA, 
                        0x91, 
                        0x01
                    })
                    Store (\_SB.MEM.PSS0, Index (PSD0, 0x00))
                    Store (\_SB.MEM.PSS1, Index (PSD1, 0x00))
                    Store (PSD0, Index (PSSD, 0x00))
                    Store (PSD1, Index (PSSD, 0x01))
                    Return (PSSD)
                }
                Else
                {
                    Name (PSSC, Package (0x01)
                    {
                        Package (0x00) {}
                    })
                    Name (PSC0, Package (0x06)
                    {
                        0x03E8, 
                        0x55F0, 
                        0xFA, 
                        0xFA, 
                        0x90, 
                        0x00
                    })
                    Store (\_SB.MEM.PSS0, Index (PSC0, 0x00))
                    Store (PSC0, Index (PSSC, 0x00))
                    Return (PSSC)
                }
            }

            Method (_PPC, 0, NotSerialized)
            {
                SMBR (0xFC00, 0x3D, 0x00, 0x00, 0xB2)
                And (\_SB.MEM.OECX, 0x03, Local0)
                If (LEqual (Local0, 0x00))
                {
                    If (\_SB.MEM.HPSU)
                    {
                        If (\_SB.MEM.ACST)
                        {
                            Return (\_SB.MEM.PULA)
                        }
                        Else
                        {
                            Return (\_SB.MEM.PULD)
                        }
                    }
                    Else
                    {
                        Return (0x00)
                    }
                }
                Else
                {
                    If (LEqual (Local0, 0x01))
                    {
                        Return (0x00)
                    }
                    Else
                    {
                        Return (0x01)
                    }
                }
            }
        }
    }

    Scope (\_SB)
    {
        Device (MEM)
        {
            Name (_HID, EisaId ("PNP0C01"))
            Name (_STA, 0x0F)
            Method (_CRS, 0, NotSerialized)
            {
                Return (CRS (0x01))
            }

            OperationRegion (SRAM, SystemMemory, 0x000EE800, 0x1800)
            Field (SRAM, AnyAcc, NoLock, Preserve)
            {
                PAR1,   16, 
                PAR2,   16, 
                PAR3,   16, 
                PAR4,   16, 
                PAR5,   16, 
                PAR6,   16
            }

            Field (SRAM, AnyAcc, NoLock, Preserve)
            {
                Offset (0x02), 
                RDID,   32, 
                RDSN,   32, 
                CAPB,   16
            }

            Field (SRAM, AnyAcc, NoLock, Preserve)
            {
                IEAX,   32, 
                IEBX,   32, 
                IECX,   32, 
                IEDX,   32, 
                IESI,   32, 
                IEDI,   32, 
                IEBP,   32, 
                Offset (0x20), 
                OEAX,   32, 
                OEBX,   32, 
                OECX,   32, 
                OEDX,   32, 
                OESI,   32, 
                OEDI,   32, 
                OEBP,   32, 
                Offset (0xFF), 
                ACST,   1, 
                BES1,   1, 
                BES2,   1, 
                Offset (0x100), 
                BMN1,   104, 
                BSN1,   88, 
                BTP1,   72, 
                BPU1,   32, 
                BDC1,   32, 
                BLF1,   32, 
                BTC1,   32, 
                BDV1,   32, 
                BST1,   32, 
                BPR1,   32, 
                BRC1,   32, 
                BPV1,   32, 
                Offset (0x149), 
                BCW1,   32, 
                BCL1,   32, 
                BG11,   32, 
                BG21,   32, 
                BOI1,   8, 
                BRF1,   1, 
                Offset (0x200), 
                BMN2,   104, 
                BSN2,   88, 
                BTP2,   72, 
                BPU2,   32, 
                BDC2,   32, 
                BLF2,   32, 
                BTC2,   32, 
                BDV2,   32, 
                BST2,   32, 
                BPR2,   32, 
                BRC2,   32, 
                BPV2,   32, 
                Offset (0x249), 
                BCW2,   32, 
                BCL2,   32, 
                BG12,   32, 
                BG22,   32, 
                BOI2,   32, 
                Offset (0x300), 
                AC01,   16, 
                AC11,   16, 
                PSV1,   16, 
                CRT1,   16, 
                TMP1,   16, 
                AST1,   16, 
                AC21,   16, 
                AC31,   16, 
                AC02,   16, 
                AC12,   16, 
                PSV2,   16, 
                CRT2,   16, 
                TMP2,   16, 
                AST2,   16, 
                AC22,   16, 
                AC32,   16, 
                AC03,   16, 
                AC13,   16, 
                PSV3,   16, 
                CRT3,   16, 
                TMP3,   16, 
                AST3,   16, 
                AC23,   16, 
                AC33,   16, 
                Offset (0x340), 
                TMPF,   16, 
                Offset (0x3F0), 
                FANH,   1, 
                FANL,   7, 
                TF11,   1, 
                TF21,   1, 
                TF31,   1, 
                    ,   1, 
                TF10,   1, 
                TF20,   1, 
                TF30,   1, 
                Offset (0x3F2), 
                TP11,   1, 
                TP21,   1, 
                TP31,   1, 
                Offset (0x400), 
                GP50,   1, 
                GP51,   1, 
                GP52,   1, 
                GP53,   1, 
                GP54,   1, 
                Offset (0x401), 
                GP60,   1, 
                GP61,   1, 
                GP62,   1, 
                GP63,   1, 
                GP64,   1, 
                GP65,   1, 
                GP66,   1, 
                Offset (0x402), 
                GP70,   1, 
                GP71,   1, 
                GP72,   1, 
                GP73,   1, 
                GP74,   1, 
                GP75,   1, 
                GP76,   1, 
                GP77,   1, 
                WED0,   1, 
                WED1,   1, 
                WED2,   1, 
                WED3,   1, 
                WED4,   1, 
                Offset (0x404), 
                SBL0,   1, 
                SBL1,   1, 
                SBL2,   1, 
                SBL3,   1, 
                Offset (0x405), 
                LIDS,   1, 
                VALF,   1, 
                DCST,   1, 
                DOS2,   1, 
                DCKI,   1, 
                DCKF,   1, 
                BT1F,   1, 
                BT2F,   1, 
                NXLA,   1, 
                NXCA,   1, 
                NXTA,   1, 
                NXDA,   1, 
                CTLA,   1, 
                CTCA,   1, 
                CTTA,   1, 
                CTDA,   1, 
                LANA,   1, 
                Offset (0x483), 
                GCVS,   8, 
                Offset (0x4C0), 
                PSS0,   16, 
                PSS1,   16, 
                Offset (0x4D0), 
                SYU0,   1, 
                SYU1,   1, 
                SYU2,   1, 
                SYU3,   1, 
                SYU4,   1, 
                SYU5,   1, 
                SYU6,   1, 
                SYU7,   1, 
                RPPC,   1, 
                Offset (0x500), 
                HKCD,   8, 
                Offset (0x502), 
                DLID,   32, 
                DSRN,   32, 
                Offset (0x50E), 
                BDID,   32, 
                DSPW,   1, 
                VGAF,   1, 
                VWE0,   1, 
                VWE1,   1, 
                PPSC,   1, 
                SPSC,   1, 
                EWLD,   1, 
                EPWS,   1, 
                LCDS,   4, 
                CRTS,   4, 
                VWE2,   1, 
                WEF0,   1, 
                WEF1,   1, 
                WED5,   1, 
                IEWE,   1, 
                Offset (0x515), 
                BTMD,   1, 
                WSF0,   1, 
                WSF1,   1, 
                GP83,   1, 
                WUIE,   1, 
                    ,   1, 
                BPFE,   1, 
                BWUE,   1, 
                DVIS,   4, 
                Offset (0x517), 
                HTM0,   1, 
                HTM1,   1, 
                Offset (0x518), 
                PSND,   1, 
                PMDM,   1, 
                Offset (0x520), 
                VGAR,   1, 
                KBCR,   1, 
                ID0R,   1, 
                ID1R,   1, 
                ID2R,   1, 
                ID3R,   1, 
                IDAR,   1, 
                ACLR,   1, 
                BTRE,   1, 
                Offset (0x701), 
                HAPS,   2, 
                HHSW,   2, 
                HPSU,   2, 
                HRCU,   2, 
                HGSU,   2, 
                HEBI,   2, 
                HTMD,   2, 
                Offset (0x708), 
                TNVS,   1, 
                OSPC,   1, 
                ACBK,   1, 
                Offset (0x70A), 
                PULD,   8, 
                PULA,   8, 
                BCLD,   8, 
                BCLA,   8, 
                Offset (0x710), 
                OSID,   8, 
                Offset (0x720), 
                MSSI,   16, 
                MSSS,   8, 
                MSSR,   8, 
                MSP0,   8, 
                MSC0,   8, 
                MSP1,   8, 
                MSC1,   8, 
                Offset (0x740), 
                Offset (0x800), 
                PRES,   32768
            }

            Field (SRAM, AnyAcc, NoLock, Preserve)
            {
                Offset (0x406), 
                NXDD,   4, 
                CTDD,   4
            }

            Field (SRAM, AnyAcc, NoLock, Preserve)
            {
                Offset (0x800), 
                Offset (0x808), 
                Offset (0x812), 
                Offset (0x814), 
                Offset (0x818), 
                FSDP,   8, 
                Offset (0x823), 
                Offset (0x826), 
                Offset (0x836), 
                Offset (0x87E), 
                Offset (0x87F), 
                EDCK,   8
            }
        }

        Device (PCI0)
        {
            Name (_HID, EisaId ("PNP0A03"))
            Name (_ADR, 0x00)
            Name (_CRS, ResourceTemplate ()
            {
                WordBusNumber (ResourceProducer, MinFixed, MaxFixed,
PosDecode, 0x0000,
                    0x0000,
                    0x00FF,
                    0x0000,
                    0x0100)
                IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
                WordIO (ResourceProducer, MinFixed, MaxFixed,
PosDecode, EntireRange, 0x0000,
                    0x0000,
                    0x0CF7,
                    0x0000,
                    0x0CF8)
                WordIO (ResourceProducer, MinFixed, MaxFixed,
PosDecode, EntireRange, 0x0000,
                    0x0D00,
                    0xFFFF,
                    0x0000,
                    0xF300)
                DWordMemory (ResourceProducer, PosDecode, MinFixed,
MaxFixed, NonCacheable, ReadWrite, 0x00000000,
                    0x000A0000,
                    0x000BFFFF,
                    0x00000000,
                    0x00020000)
                DWordMemory (ResourceProducer, PosDecode, MinFixed,
MaxFixed, NonCacheable, ReadWrite, 0x00000000,
                    0x000D8000,
                    0x000DFFFF,
                    0x00000000,
                    0x00008000)
                DWordMemory (ResourceProducer, PosDecode, MinFixed,
MaxFixed, NonCacheable, ReadWrite, 0x00000000,
                    0x40100000,
                    0xFEE9FFFF,
                    0x00000000,
                    0xBEEA0000)
            })
            Name (_PRT, Package (0x09)
            {
                Package (0x04)
                {
                    0x0011FFFF, 
                    0x00, 
                    \_SB.PCI0.FNC0.LNKA, 
                    0x00
                }, 

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

                Package (0x04)
                {
                    0x000AFFFF, 
                    0x00, 
                    \_SB.PCI0.FNC0.LNKD, 
                    0x00
                }, 

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

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

                Package (0x04)
                {
                    0x000CFFFF, 
                    0x00, 
                    \_SB.PCI0.FNC0.LNKD, 
                    0x00
                }, 

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

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

                Package (0x04)
                {
                    0x0002FFFF, 
                    0x00, 
                    \_SB.PCI0.FNC0.LNKG, 
                    0x00
                }
            })
            Device (FNC0)
            {
                Name (_ADR, 0x00070000)
                OperationRegion (M153, PCI_Config, 0x00, 0xFF)
                Field (M153, ByteAcc, NoLock, Preserve)
                {
                    Offset (0x44), 
                    IRQJ,   4, 
                        ,   3, 
                    RSTC,   1, 
                    Offset (0x48), 
                    IRQA,   4, 
                    IRQB,   4, 
                    IRQC,   4, 
                    IRQD,   4, 
                    IRQE,   4, 
                    IRQF,   4, 
                    IRQI,   4, 
                    IRQH,   4, 
                    Offset (0x52), 
                        ,   13, 
                    CUS1,   1, 
                    Offset (0x74), 
                    IRQG,   4, 
                    Offset (0x75), 
                    IRQK,   4, 
                    Offset (0x77), 
                        ,   3, 
                    CSND,   1, 
                        ,   1, 
                    CMDM,   1
                }

                Device (LNKA)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x01)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STAL (\_SB.PCI0.FNC0.IRQA))
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11}
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRSL (\_SB.PCI0.FNC0.IRQA))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        Store (0x00, \_SB.PCI0.FNC0.IRQA)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        Name (IRQT, Package (0x10)
                        {
                            0x00, 
                            0x08, 
                            0x00, 
                            0x02, 
                            0x04, 
                            0x05, 
                            0x07, 
                            0x06, 
                            0x00, 
                            0x01, 
                            0x03, 
                            0x09, 
                            0x0B, 
                            0x00, 
                            0x0D, 
                            0x0F
                        })
                        CreateWordField (Arg0, 0x01, IRQX)
                        FindSetRightBit (IRQX, Local0)
                        Decrement (Local0)
                        Store (DerefOf (Index (IRQT, Local0)), Local1)
                        Store (Local1, \_SB.PCI0.FNC0.IRQA)
                    }
                }

                Device (LNKB)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x02)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STAL (\_SB.PCI0.FNC0.IRQB))
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11}
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRSL (\_SB.PCI0.FNC0.IRQB))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        Store (0x00, \_SB.PCI0.FNC0.IRQB)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        Name (IRQT, Package (0x10)
                        {
                            0x00, 
                            0x08, 
                            0x00, 
                            0x02, 
                            0x04, 
                            0x05, 
                            0x07, 
                            0x06, 
                            0x00, 
                            0x01, 
                            0x03, 
                            0x09, 
                            0x0B, 
                            0x00, 
                            0x0D, 
                            0x0F
                        })
                        CreateWordField (Arg0, 0x01, IRQX)
                        FindSetRightBit (IRQX, Local0)
                        Decrement (Local0)
                        Store (DerefOf (Index (IRQT, Local0)), Local1)
                        Store (Local1, \_SB.PCI0.FNC0.IRQB)
                    }
                }

                Device (LNKC)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x03)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STAL (\_SB.PCI0.FNC0.IRQC))
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11}
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRSL (\_SB.PCI0.FNC0.IRQC))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        Store (0x00, \_SB.PCI0.FNC0.IRQC)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        Name (IRQT, Package (0x10)
                        {
                            0x00, 
                            0x08, 
                            0x00, 
                            0x02, 
                            0x04, 
                            0x05, 
                            0x07, 
                            0x06, 
                            0x00, 
                            0x01, 
                            0x03, 
                            0x09, 
                            0x0B, 
                            0x00, 
                            0x0D, 
                            0x0F
                        })
                        CreateWordField (Arg0, 0x01, IRQX)
                        FindSetRightBit (IRQX, Local0)
                        Decrement (Local0)
                        Store (DerefOf (Index (IRQT, Local0)), Local1)
                        Store (Local1, \_SB.PCI0.FNC0.IRQC)
                    }
                }

                Device (LNKD)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x04)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STAL (\_SB.PCI0.FNC0.IRQD))
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11}
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRSL (\_SB.PCI0.FNC0.IRQD))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        Store (0x00, \_SB.PCI0.FNC0.IRQD)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        Name (IRQT, Package (0x10)
                        {
                            0x00, 
                            0x08, 
                            0x00, 
                            0x02, 
                            0x04, 
                            0x05, 
                            0x07, 
                            0x06, 
                            0x00, 
                            0x01, 
                            0x03, 
                            0x09, 
                            0x0B, 
                            0x00, 
                            0x0D, 
                            0x0F
                        })
                        CreateWordField (Arg0, 0x01, IRQX)
                        FindSetRightBit (IRQX, Local0)
                        Decrement (Local0)
                        Store (DerefOf (Index (IRQT, Local0)), Local1)
                        Store (Local1, \_SB.PCI0.FNC0.IRQD)
                    }
                }

                Device (LNKG)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x07)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STAL (\_SB.PCI0.FNC0.IRQG))
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11}
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRSL (\_SB.PCI0.FNC0.IRQG))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        Store (0x00, \_SB.PCI0.FNC0.IRQG)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        Name (IRQT, Package (0x10)
                        {
                            0x00, 
                            0x08, 
                            0x00, 
                            0x02, 
                            0x04, 
                            0x05, 
                            0x07, 
                            0x06, 
                            0x00, 
                            0x01, 
                            0x03, 
                            0x09, 
                            0x0B, 
                            0x00, 
                            0x0D, 
                            0x0F
                        })
                        CreateWordField (Arg0, 0x01, IRQX)
                        FindSetRightBit (IRQX, Local0)
                        Decrement (Local0)
                        Store (DerefOf (Index (IRQT, Local0)), Local1)
                        Store (Local1, \_SB.PCI0.FNC0.IRQG)
                    }
                }

                Device (LNKH)
                {
                    Name (_HID, EisaId ("PNP0C0F"))
                    Name (_UID, 0x08)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STAL (\_SB.PCI0.FNC0.IRQH))
                    }

                    Name (_PRS, ResourceTemplate ()
                    {
                        IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,10,11}
                    })
                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRSL (\_SB.PCI0.FNC0.IRQH))
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        Store (0x00, \_SB.PCI0.FNC0.IRQH)
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        Name (IRQT, Package (0x10)
                        {
                            0x00, 
                            0x08, 
                            0x00, 
                            0x02, 
                            0x04, 
                            0x05, 
                            0x07, 
                            0x06, 
                            0x00, 
                            0x01, 
                            0x03, 
                            0x09, 
                            0x0B, 
                            0x00, 
                            0x0D, 
                            0x0F
                        })
                        CreateWordField (Arg0, 0x01, IRQX)
                        FindSetRightBit (IRQX, Local0)
                        Decrement (Local0)
                        Store (DerefOf (Index (IRQT, Local0)), Local1)
                        Store (Local1, \_SB.PCI0.FNC0.IRQH)
                    }
                }

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

                Device (PIC)
                {
                    Name (_HID, EisaId ("PNP0000"))
                    Name (_STA, 0x0F)
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
                        IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
                        IRQ (Edge, ActiveHigh, Exclusive) {2}
                    })
                }

                Device (PIT)
                {
                    Name (_HID, EisaId ("PNP0100"))
                    Name (_STA, 0x0F)
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0040, 0x0040, 0x01, 0x04)
                        IRQ (Edge, ActiveHigh, Exclusive) {0}
                    })
                }

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

                Device (NDP)
                {
                    Name (_HID, EisaId ("PNP0C04"))
                    Name (_STA, 0x0F)
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x00F0, 0x00F0, 0x01, 0x10)
                        IRQ (Edge, ActiveHigh, Shared) {13}
                    })
                }

                Device (KBC)
                {
                    Name (_HID, EisaId ("PNP0303"))
                    Method (_STA, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.KBCR, 0x00)) {}
                        Return (0x0F)
                    }

                    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"))
                    Method (_STA, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.KBCR, 0x00)) {}
                        Return (0x0F)
                    }

                    Name (_CRS, ResourceTemplate ()
                    {
                        IRQ (Edge, ActiveHigh, Exclusive) {12}
                    })
                }

                Device (RTC)
                {
                    Name (_HID, EisaId ("PNP0B00"))
                    Name (_STA, 0x0F)
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0070, 0x0070, 0x01, 0x02)
                        IRQ (Edge, ActiveHigh, Exclusive) {8}
                    })
                }

                Device (SYSR)
                {
                    Name (_HID, EisaId ("PNP0C02"))
                    Name (_STA, 0x0F)
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x002E, 0x002E, 0x01, 0x02)
                        IO (Decode16, 0x0062, 0x0062, 0x01, 0x01)
                        IO (Decode16, 0x0066, 0x0066, 0x01, 0x01)
                        IO (Decode16, 0x0080, 0x0080, 0x01, 0x01)
                        IO (Decode16, 0x0084, 0x0084, 0x01, 0x03)
                        IO (Decode16, 0x0088, 0x0088, 0x01, 0x01)
                        IO (Decode16, 0x008C, 0x008C, 0x01, 0x03)
                        IO (Decode16, 0x0092, 0x0092, 0x01, 0x01)
                        IO (Decode16, 0x00B0, 0x00B0, 0x01, 0x04)
                        IO (Decode16, 0x00E0, 0x00E0, 0x01, 0x10)
                        IO (Decode16, 0x0370, 0x0370, 0x01, 0x02)
                        IO (Decode16, 0x040B, 0x040B, 0x01, 0x01)
                        IO (Decode16, 0x0480, 0x0480, 0x01, 0x10)
                        IO (Decode16, 0x04D0, 0x04D0, 0x01, 0x02)
                        IO (Decode16, 0x04D6, 0x04D6, 0x01, 0x01)
                        IO (Decode16, 0x06C0, 0x06C0, 0x01, 0x40)
                        IO (Decode16, 0xE000, 0xE000, 0x01, 0x80)
                        IO (Decode16, 0xE080, 0xE080, 0x01, 0x80)
                        IO (Decode16, 0xE400, 0xE400, 0x01, 0x80)
                        IO (Decode16, 0xE480, 0xE480, 0x01, 0x80)
                        IO (Decode16, 0xE800, 0xE800, 0x01, 0x80)
                        IO (Decode16, 0xE880, 0xE880, 0x01, 0x80)
                        IO (Decode16, 0xEC00, 0xEC00, 0x01, 0x80)
                        IO (Decode16, 0xEC80, 0xEC80, 0x01, 0x80)
                        IO (Decode16, 0xEE00, 0xEE00, 0x01, 0x42)
                        IO (Decode16, 0xEE90, 0xEE90, 0x01, 0x10)
                        IO (Decode16, 0xEEAC, 0xEEAC, 0x01, 0x01)
                        IO (Decode16, 0xEF00, 0xEF00, 0x01, 0x40)
                        IO (Decode16, 0xEF40, 0xEF40, 0x01, 0x20)
                    })
                    OperationRegion (SRG1, SystemIO, 0xB1, 0x01)
                    Field (SRG1, ByteAcc, NoLock, Preserve)
                    {
                        TRP4,   8
                    }
                }

                Device (COM)
                {
                    Name (_HID, EisaId ("PNP0501"))
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STA (0x0E))
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRS (0x0E))
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        Return (PRS (0x0E))
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        SRS (0x0E, Arg0)
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DIS (0x0E)
                    }

                    Method (_PS0, 0, NotSerialized)
                    {
                        PS0 (0x0E)
                    }

                    Method (_PS3, 0, NotSerialized)
                    {
                        PS3 (0x0E)
                    }

                    Method (_PSC, 0, NotSerialized)
                    {
                        Return (PSC (0x0E))
                    }

                    Name (_PRW, Package (0x02)
                    {
                        0x08, 
                        0x03
                    })
                    Method (_PSW, 1, NotSerialized)
                    {
                        Store (Arg0, \_SB.MEM.WED0)
                    }
                }

                Device (FSIR)
                {
                    Name (_HID, EisaId ("SMCF010"))
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STA (0x0F))
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRS (0x0F))
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        Return (PRS (0x0F))
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        SRS (0x0F, Arg0)
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DIS (0x0F)
                    }
                }

                Device (PRT)
                {
                    Name (_HID, EisaId ("PNP0401"))
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STA (0x10))
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRS (0x10))
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        Return (PRS (0x10))
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        SRS (0x10, Arg0)
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DIS (0x10)
                    }
                }

                Device (PRT1)
                {
                    Name (_HID, EisaId ("PNP0400"))
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STA (0x12))
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRS (0x12))
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        Return (PRS (0x12))
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        SRS (0x12, Arg0)
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DIS (0x12)
                    }
                }

                Device (PCC0)
                {
                    Name (_HID, EisaId ("PNP0E00"))
                    Name (_UID, 0x01)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STA (0x13))
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRS (0x13))
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        Return (PRS (0x13))
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        SRS (0x13, Arg0)
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DIS (0x13)
                    }

                    Name (_PRW, Package (0x02)
                    {
                        0x09, 
                        0x03
                    })
                    Method (_PSW, 1, NotSerialized)
                    {
                        Store (Arg0, \_SB.MEM.WED2)
                    }

                    Device (PCS0)
                    {
                        Name (_ADR, 0x00)
                        Name (_SUN, 0x00)
                    }

                    Device (PCS1)
                    {
                        Name (_ADR, 0x01)
                        Name (_SUN, 0x01)
                    }
                }

                Device (ATA)
                {
                    Name (_HID, EisaId ("PNP0600"))
                    Name (_UID, 0x03)
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (STA (0x16))
                    }

                    Method (_CRS, 0, NotSerialized)
                    {
                        Return (CRS (0x16))
                    }

                    Method (_PRS, 0, NotSerialized)
                    {
                        Return (PRS (0x16))
                    }

                    Method (_SRS, 1, NotSerialized)
                    {
                        SRS (0x16, Arg0)
                    }

                    Method (_DIS, 0, NotSerialized)
                    {
                        DIS (0x16)
                    }
                }
            }

            Device (FNC1)
            {
                Name (_ADR, 0x00040000)
                OperationRegion (IDEC, PCI_Config, 0x00, 0xFF)
                Field (IDEC, ByteAcc, NoLock, Preserve)
                {
                    Offset (0x54), 
                    FTHP,   4, 
                    Offset (0x55), 
                    FTHS,   4, 
                    Offset (0x56), 
                    PUDS,   4, 
                    Offset (0x57), 
                    SUDS,   4, 
                    Offset (0x58), 
                    PAST,   3, 
                    Offset (0x59), 
                    PCRC,   4, 
                    PCAC,   3, 
                    Offset (0x5A), 
                    PDRC,   4, 
                    PDAC,   3, 
                    Offset (0x5C), 
                    SAST,   3, 
                    Offset (0x5D), 
                    SCRC,   4, 
                    SCAC,   3, 
                    Offset (0x5E), 
                    SDRC,   4, 
                    SDAC,   3
                }

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

                    Method (_PS0, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID0R, 0x00)) {}
                        Store (0x00, \_SB.MEM.PPSC)
                    }

                    Method (_PS3, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID0R, 0x00)) {}
                        Store (0x01, \_SB.MEM.PPSC)
                    }

                    Method (_PSC, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID0R, 0x00)) {}
                        If (\_SB.MEM.PPSC)
                        {
                            Return (0x03)
                        }
                        Else
                        {
                            Return (0x00)
                        }
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID0R, 0x00)) {}
                        Store (0x01, \_SB.MEM.HTM0)
                        CreateDWordField (Arg0, 0x00, PPIO)
                        CreateDWordField (Arg0, 0x04, PDMA)
                        CreateDWordField (Arg0, 0x10, PFLG)
                        Store (PPIO, Local0)
                        Store (0x03, Local1)
                        Store (0x0A, Local2)
                        Store (0x00, Local3)
                        Store (0x08, Local4)
                        Store (0x08, Local5)
                        If (LNot (LGreater (Local0, 0x78)))
                        {
                            Store (0x02, Local1)
                            Store (0x01, Local2)
                            Store (0x03, Local3)
                            Store (0x01, Local4)
                            Store (0x03, Local5)
                        }
                        Else
                        {
                            If (LNot (LGreater (Local0, 0xB4)))
                            {
                                Store (0x02, Local1)
                                Store (0x03, Local2)
                                Store (0x03, Local3)
                                Store (0x03, Local4)
                                Store (0x03, Local5)
                            }
                            Else
                            {
                                If (LNot (LGreater (Local0, 0xF0)))
                                {
                                    Store (0x02, Local1)
                                    Store (0x01, Local2)
                                    Store (0x00, Local3)
                                    Store (0x04, Local4)
                                    Store (0x04, Local5)
                                }
                                Else
                                {
                                    If (LNot (LGreater (Local0,
0x017F))) {
                                        Store (0x02, Local1)
                                        Store (0x03, Local2)
                                        Store (0x00, Local3)
                                        Store (0x08, Local4)
                                        Store (0x05, Local5)
                                    }
                                }
                            }
                        }

                        If (LNot (LEqual (Local0, 0xFFFFFFFF)))
                        {
                            Store (Local1, \_SB.PCI0.FNC1.PAST)
                            Store (Local2, \_SB.PCI0.FNC1.PCRC)
                            Store (Local3, \_SB.PCI0.FNC1.PCAC)
                            Store (Local4, \_SB.PCI0.FNC1.PDRC)
                            Store (Local5, \_SB.PCI0.FNC1.PDAC)
                            Store (0x05, \_SB.PCI0.FNC1.FTHP)
                        }

                        Store (PDMA, Local0)
                        Store (PFLG, Local1)
                        And (Local1, 0x01, Local1)
                        ShiftLeft (Local1, 0x03, Local1)
                        If (Local1)
                        {
                            Store (0x04, Local2)
                            If (LNot (LGreater (Local0, 0x1E)))
                            {
                                Store (0x00, Local2)
                            }
                            Else
                            {
                                If (LNot (LGreater (Local0, 0x2D)))
                                {
                                    Store (0x01, Local2)
                                }
                                Else
                                {
                                    If (LNot (LGreater (Local0, 0x3C)))
                                    {
                                        Store (0x02, Local2)
                                    }
                                    Else
                                    {
                                        If (LNot (LGreater (Local0,
0x5A))) {
                                            Store (0x03, Local2)
                                        }
                                    }
                                }
                            }
                        }
                        Else
                        {
                            Store (0x07, Local2)
                            If (LNot (LGreater (Local0, 0x4B)))
                            {
                                Store (0x05, Local2)
                            }
                            Else
                            {
                                If (LNot (LGreater (Local0, 0x5A)))
                                {
                                    Store (0x06, Local2)
                                }
                            }
                        }

                        If (LNot (LEqual (Local0, 0xFFFFFFFF)))
                        {
                            Or (Local1, Local2, Local1)
                            Store (Local1, \_SB.PCI0.FNC1.PUDS)
                            Store (0x01, \_SB.PCI0.FNC1.FTHP)
                        }
                    }

                    Method (_GTM, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID0R, 0x00)) {}
                        Store (0x01, \_SB.MEM.HTM0)
                        Store (\_SB.PCI0.FNC1.PCRC, Local0)
                        Store (\_SB.PCI0.FNC1.PCAC, Local1)
                        ShiftLeft (Local1, 0x04, Local1)
                        Or (Local0, Local1, Local0)
                        Store (0x0258, Local2)
                        If (LEqual (Local0, 0x31))
                        {
                            Store (0x78, Local2)
                        }
                        Else
                        {
                            If (LEqual (Local0, 0x33))
                            {
                                Store (0xB4, Local2)
                            }
                            Else
                            {
                                If (LEqual (Local0, 0x01))
                                {
                                    Store (0xF0, Local2)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x03))
                                    {
                                        Store (0x017F, Local2)
                                    }
                                }
                            }
                        }

                        Store (\_SB.PCI0.FNC1.PUDS, Local0)
                        And (Local0, 0x08, Local1)
                        And (Local0, 0x07, Local0)
                        Store (0x02, Local4)
                        If (Local1)
                        {
                            Store (0x03, Local4)
                            Store (0x78, Local3)
                            If (LEqual (Local0, 0x00))
                            {
                                Store (0x1E, Local3)
                            }
                            Else
                            {
                                If (LEqual (Local0, 0x01))
                                {
                                    Store (0x2D, Local3)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x02))
                                    {
                                        Store (0x3C, Local3)
                                    }
                                    Else
                                    {
                                        If (LEqual (Local0, 0x03))
                                        {
                                            Store (0x5A, Local3)
                                        }
                                    }
                                }
                            }
                        }
                        Else
                        {
                            Store (0x69, Local3)
                            If (LEqual (Local0, 0x05))
                            {
                                Store (0x4B, Local3)
                            }
                            Else
                            {
                                If (LEqual (Local0, 0x06))
                                {
                                    Store (0x5A, Local3)
                                }
                            }
                        }

                        Name (BUFF, Buffer (0x14) {})
                        CreateDWordField (BUFF, 0x00, PIO1)
                        CreateDWordField (BUFF, 0x04, DMA1)
                        CreateDWordField (BUFF, 0x08, PIO2)
                        CreateDWordField (BUFF, 0x0C, DMA2)
                        CreateDWordField (BUFF, 0x10, FLGS)
                        Store (Local2, PIO1)
                        Store (Local3, DMA1)
                        Store (0xFFFFFFFF, PIO2)
                        Store (0xFFFFFFFF, DMA2)
                        Store (Local4, FLGS)
                        Return (BUFF)
                    }

                    Device (HD_0)
                    {
                        Name (_ADR, 0x00)
                        Method (_GTF, 0, NotSerialized)
                        {
                            While (LEqual (\_SB.MEM.ID0R, 0x00)) {}
                            Store (0x01, \_SB.MEM.HTM0)
                            Name (BUFF, Buffer (0x0E)
                            {
                                0x03, 0x0C, 0x00, 0x00, 0x00, 0x00,
0xEF, 0x03, 0x23, 0x00, 0x00, 0x00, 0x00, 0xEF
                            })
                            CreateByteField (BUFF, 0x01, PIOM)
                            CreateByteField (BUFF, 0x08, DMAM)
                            Store (\_SB.PCI0.FNC1.PCRC, Local0)
                            Store (\_SB.PCI0.FNC1.PCAC, Local1)
                            ShiftLeft (Local1, 0x04, Local1)
                            Or (Local0, Local1, Local0)
                            Store (0x08, Local1)
                            If (LEqual (Local0, 0x31))
                            {
                                Store (0x0C, Local1)
                            }
                            Else
                            {
                                If (LEqual (Local0, 0x33))
                                {
                                    Store (0x0B, Local1)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x01))
                                    {
                                        Store (0x0A, Local1)
                                    }
                                    Else
                                    {
                                        If (LEqual (Local0, 0x03))
                                        {
                                            Store (0x09, Local1)
                                        }
                                    }
                                }
                            }

                            Store (\_SB.PCI0.FNC1.PUDS, Local0)
                            And (Local0, 0x08, Local2)
                            And (Local0, 0x07, Local0)
                            If (Local2)
                            {
                                Store (0x40, Local2)
                                If (LEqual (Local0, 0x00))
                                {
                                    Store (0x44, Local2)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x01))
                                    {
                                        Store (0x43, Local2)
                                    }
                                    Else
                                    {
                                        If (LEqual (Local0, 0x02))
                                        {
                                            Store (0x42, Local2)
                                        }
                                        Else
                                        {
                                            If (LEqual (Local0, 0x03))
                                            {
                                                Store (0x41, Local2)
                                            }
                                        }
                                    }
                                }
                            }
                            Else
                            {
                                Store (0x20, Local2)
                                If (LEqual (Local0, 0x05))
                                {
                                    Store (0x22, Local2)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x06))
                                    {
                                        Store (0x21, Local2)
                                    }
                                }
                            }

                            Store (Local1, PIOM)
                            Store (Local2, DMAM)
                            Return (BUFF)
                        }
                    }
                }

                Device (IDE1)
                {
                    Name (_ADR, 0x01)
                    Method (_PS0, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID1R, 0x00)) {}
                        SMBR (0xFE00, 0x14, 0x00, 0x00, 0xB2)
                        And (\_SB.MEM.OECX, 0x02, Local0)
                        If (Local0)
                        {
                            Store (0x00, \_SB.MEM.SPSC)
                            Store (0x01, \_SB.MEM.IESI)
                            Store (0x02, \_SB.MEM.IEDI)
                            SMBR (0xFE00, 0x23, 0x20, 0x00, 0xB2)
                            If (\_SB.MEM.OEDX)
                            {
                                Store (0x01, \_SB.MEM.IESI)
                                Store (0x02, \_SB.MEM.IEDI)
                                SMBR (0xFF00, 0x23, 0x20, 0x00, 0xB2)
                                Store (0x01, \_SB.MEM.OECX)
                                While (\_SB.MEM.OECX)
                                {
                                    Store (0x01, \_SB.MEM.IESI)
                                    Store (0x02, \_SB.MEM.IEDI)
                                    SMBR (0xFE00, 0x23, 0x20, 0x00,
0xB2) }
                            }
                        }
                    }

                    Method (_PS3, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID1R, 0x00)) {}
                        SMBR (0xFE00, 0x14, 0x00, 0x00, 0xB2)
                        And (\_SB.MEM.OECX, 0x02, Local0)
                        If (Local0)
                        {
                            Store (0x01, \_SB.MEM.SPSC)
                            Store (0x01, \_SB.MEM.IESI)
                            Store (0x02, \_SB.MEM.IEDI)
                            SMBR (0xFE00, 0x23, 0x20, 0x00, 0xB2)
                            If (LNot (LEqual (\_SB.MEM.OEDX, 0x03)))
                            {
                                Store (0x01, \_SB.MEM.IESI)
                                Store (0x02, \_SB.MEM.IEDI)
                                SMBR (0xFF00, 0x23, 0x20, 0x03, 0xB2)
                                Store (0x01, \_SB.MEM.OECX)
                                While (\_SB.MEM.OECX)
                                {
                                    Store (0x01, \_SB.MEM.IESI)
                                    Store (0x02, \_SB.MEM.IEDI)
                                    SMBR (0xFE00, 0x23, 0x20, 0x00,
0xB2) }
                            }
                        }
                    }

                    Method (_PSC, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID1R, 0x00)) {}
                        SMBR (0xFE00, 0x14, 0x00, 0x00, 0xB2)
                        And (\_SB.MEM.OECX, 0x02, Local0)
                        If (Local0)
                        {
                            If (\_SB.MEM.SPSC)
                            {
                                Return (0x03)
                            }
                            Else
                            {
                                Return (0x00)
                            }
                        }
                        Else
                        {
                            Return (0x00)
                        }
                    }

                    Method (_STM, 3, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID1R, 0x00)) {}
                        Store (0x01, \_SB.MEM.HTM1)
                        CreateDWordField (Arg0, 0x00, PPIO)
                        CreateDWordField (Arg0, 0x04, PDMA)
                        CreateDWordField (Arg0, 0x10, PFLG)
                        Store (PPIO, Local0)
                        Store (0x03, Local1)
                        Store (0x0A, Local2)
                        Store (0x00, Local3)
                        Store (0x08, Local4)
                        Store (0x08, Local5)
                        If (LNot (LGreater (Local0, 0x78)))
                        {
                            Store (0x02, Local1)
                            Store (0x01, Local2)
                            Store (0x03, Local3)
                            Store (0x01, Local4)
                            Store (0x03, Local5)
                        }
                        Else
                        {
                            If (LNot (LGreater (Local0, 0xB4)))
                            {
                                Store (0x02, Local1)
                                Store (0x03, Local2)
                                Store (0x03, Local3)
                                Store (0x03, Local4)
                                Store (0x03, Local5)
                            }
                            Else
                            {
                                If (LNot (LGreater (Local0, 0xF0)))
                                {
                                    Store (0x02, Local1)
                                    Store (0x01, Local2)
                                    Store (0x00, Local3)
                                    Store (0x04, Local4)
                                    Store (0x04, Local5)
                                }
                                Else
                                {
                                    If (LNot (LGreater (Local0,
0x017F))) {
                                        Store (0x02, Local1)
                                        Store (0x03, Local2)
                                        Store (0x00, Local3)
                                        Store (0x08, Local4)
                                        Store (0x05, Local5)
                                    }
                                }
                            }
                        }

                        If (LNot (LEqual (Local0, 0xFFFFFFFF)))
                        {
                            Store (Local1, \_SB.PCI0.FNC1.SAST)
                            Store (Local2, \_SB.PCI0.FNC1.SCRC)
                            Store (Local3, \_SB.PCI0.FNC1.SCAC)
                            Store (Local4, \_SB.PCI0.FNC1.SDRC)
                            Store (Local5, \_SB.PCI0.FNC1.SDAC)
                            Store (0x05, \_SB.PCI0.FNC1.FTHS)
                        }

                        Store (PDMA, Local0)
                        Store (PFLG, Local1)
                        And (Local1, 0x01, Local1)
                        ShiftLeft (Local1, 0x03, Local1)
                        If (Local1)
                        {
                            Store (0x04, Local2)
                            If (LNot (LGreater (Local0, 0x1E)))
                            {
                                Store (0x00, Local2)
                            }
                            Else
                            {
                                If (LNot (LGreater (Local0, 0x2D)))
                                {
                                    Store (0x01, Local2)
                                }
                                Else
                                {
                                    If (LNot (LGreater (Local0, 0x3C)))
                                    {
                                        Store (0x02, Local2)
                                    }
                                    Else
                                    {
                                        If (LNot (LGreater (Local0,
0x5A))) {
                                            Store (0x03, Local2)
                                        }
                                    }
                                }
                            }
                        }
                        Else
                        {
                            Store (0x07, Local2)
                            If (LNot (LGreater (Local0, 0x4B)))
                            {
                                Store (0x05, Local2)
                            }
                            Else
                            {
                                If (LNot (LGreater (Local0, 0x5A)))
                                {
                                    Store (0x06, Local2)
                                }
                            }
                        }

                        If (LNot (LEqual (Local0, 0xFFFFFFFF)))
                        {
                            Or (Local1, Local2, Local1)
                            Store (Local1, \_SB.PCI0.FNC1.SUDS)
                            Store (0x01, \_SB.PCI0.FNC1.FTHS)
                        }
                    }

                    Method (_GTM, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.ID1R, 0x00)) {}
                        Store (0x01, \_SB.MEM.HTM1)
                        Store (\_SB.PCI0.FNC1.SCRC, Local0)
                        Store (\_SB.PCI0.FNC1.SCAC, Local1)
                        ShiftLeft (Local1, 0x04, Local1)
                        Or (Local0, Local1, Local0)
                        Store (0x0258, Local2)
                        If (LEqual (Local0, 0x31))
                        {
                            Store (0x78, Local2)
                        }
                        Else
                        {
                            If (LEqual (Local0, 0x33))
                            {
                                Store (0xB4, Local2)
                            }
                            Else
                            {
                                If (LEqual (Local0, 0x01))
                                {
                                    Store (0xF0, Local2)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x03))
                                    {
                                        Store (0x017F, Local2)
                                    }
                                }
                            }
                        }

                        Store (\_SB.PCI0.FNC1.SUDS, Local0)
                        And (Local0, 0x08, Local1)
                        And (Local0, 0x07, Local0)
                        Store (0x02, Local4)
                        If (Local1)
                        {
                            Store (0x03, Local4)
                            Store (0x78, Local3)
                            If (LEqual (Local0, 0x00))
                            {
                                Store (0x1E, Local3)
                            }
                            Else
                            {
                                If (LEqual (Local0, 0x01))
                                {
                                    Store (0x2D, Local3)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x02))
                                    {
                                        Store (0x3C, Local3)
                                    }
                                    Else
                                    {
                                        If (LEqual (Local0, 0x03))
                                        {
                                            Store (0x5A, Local3)
                                        }
                                    }
                                }
                            }
                        }
                        Else
                        {
                            Store (0x69, Local3)
                            If (LEqual (Local0, 0x05))
                            {
                                Store (0x4B, Local3)
                            }
                            Else
                            {
                                If (LEqual (Local0, 0x06))
                                {
                                    Store (0x5A, Local3)
                                }
                            }
                        }

                        Name (BUFF, Buffer (0x14) {})
                        CreateDWordField (BUFF, 0x00, PIO1)
                        CreateDWordField (BUFF, 0x04, DMA1)
                        CreateDWordField (BUFF, 0x08, PIO2)
                        CreateDWordField (BUFF, 0x0C, DMA2)
                        CreateDWordField (BUFF, 0x10, FLGS)
                        Store (Local2, PIO1)
                        Store (Local3, DMA1)
                        Store (0xFFFFFFFF, PIO2)
                        Store (0xFFFFFFFF, DMA2)
                        Store (Local4, FLGS)
                        Return (BUFF)
                    }

                    Device (HD_1)
                    {
                        Name (_ADR, 0x00)
                        Method (_STA, 0, NotSerialized)
                        {
                            While (LEqual (\_SB.MEM.ID1R, 0x00)) {}
                            SMBR (0xFE00, 0x14, 0x00, 0x00, 0xB2)
                            And (\_SB.MEM.OECX, 0x02, Local0)
                            If (Local0)
                            {
                                Return (0x0F)
                            }
                            Else
                            {
                                Return (0x00)
                            }
                        }

                        Method (_EJ0, 1, NotSerialized)
                        {
                            SMBR (0xFE00, 0x14, 0x00, 0x00, 0xB2)
                            And (\_SB.MEM.OECX, 0x02, Local0)
                            If (Local0)
                            {
                                Store (0x01, \_SB.MEM.IESI)
                                Store (0x02, \_SB.MEM.IEDI)
                                SMBR (0xFE00, 0x23, 0x20, 0x00, 0xB2)
                                If (LNot (LEqual (\_SB.MEM.OEDX, 0x03)))
                                {
                                    Store (0x01, \_SB.MEM.IESI)
                                    Store (0x02, \_SB.MEM.IEDI)
                                    SMBR (0xFF00, 0x23, 0x20, 0x03,
0xB2) Store (0x01, \_SB.MEM.OECX)
                                    While (\_SB.MEM.OECX)
                                    {
                                        Store (0x01, \_SB.MEM.IESI)
                                        Store (0x02, \_SB.MEM.IEDI)
                                        SMBR (0xFE00, 0x23, 0x20, 0x00,
0xB2) }
                                }
                            }
                        }

                        Method (_GTF, 0, NotSerialized)
                        {
                            While (LEqual (\_SB.MEM.ID1R, 0x00)) {}
                            Store (0x01, \_SB.MEM.HTM1)
                            Name (BUFF, Buffer (0x0E)
                            {
                                0x03, 0x0C, 0x00, 0x00, 0x00, 0x00,
0xEF, 0x03, 0x23, 0x00, 0x00, 0x00, 0x00, 0xEF
                            })
                            CreateByteField (BUFF, 0x01, PIOM)
                            CreateByteField (BUFF, 0x08, DMAM)
                            Store (\_SB.PCI0.FNC1.SCRC, Local0)
                            Store (\_SB.PCI0.FNC1.SCAC, Local1)
                            ShiftLeft (Local1, 0x04, Local1)
                            Or (Local0, Local1, Local0)
                            Store (0x08, Local1)
                            If (LEqual (Local0, 0x31))
                            {
                                Store (0x0C, Local1)
                            }
                            Else
                            {
                                If (LEqual (Local0, 0x33))
                                {
                                    Store (0x0B, Local1)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x01))
                                    {
                                        Store (0x0A, Local1)
                                    }
                                    Else
                                    {
                                        If (LEqual (Local0, 0x03))
                                        {
                                            Store (0x09, Local1)
                                        }
                                    }
                                }
                            }

                            Store (\_SB.PCI0.FNC1.SUDS, Local0)
                            And (Local0, 0x08, Local2)
                            And (Local0, 0x07, Local0)
                            If (Local2)
                            {
                                Store (0x40, Local2)
                                If (LEqual (Local0, 0x00))
                                {
                                    Store (0x44, Local2)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x01))
                                    {
                                        Store (0x43, Local2)
                                    }
                                    Else
                                    {
                                        If (LEqual (Local0, 0x02))
                                        {
                                            Store (0x42, Local2)
                                        }
                                        Else
                                        {
                                            If (LEqual (Local0, 0x03))
                                            {
                                                Store (0x41, Local2)
                                            }
                                        }
                                    }
                                }
                            }
                            Else
                            {
                                Store (0x20, Local2)
                                If (LEqual (Local0, 0x05))
                                {
                                    Store (0x22, Local2)
                                }
                                Else
                                {
                                    If (LEqual (Local0, 0x06))
                                    {
                                        Store (0x21, Local2)
                                    }
                                }
                            }

                            Store (Local1, PIOM)
                            Store (Local2, DMAM)
                            Return (BUFF)
                        }
                    }
                }
            }

            Device (USB1)
            {
                Name (_ADR, 0x00020000)
                OperationRegion (USP1, PCI_Config, 0x00, 0xFF)
                Field (USP1, ByteAcc, NoLock, Preserve)
                {
                    UVI1,   16, 
                    UDI1,   16, 
                    Offset (0x09), 
                    UPI1,   8, 
                    USC1,   8, 
                    UBC1,   8
                }

                Name (_PRW, Package (0x02)
                {
                    0x09, 
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x01, \_SB.MEM.WED3)
                    }
                    Else
                    {
                        Store (0x00, \_SB.MEM.WED3)
                    }
                }

                Device (RHB0)
                {
                    Name (_ADR, 0x00)
                    Device (PT01)
                    {
                        Name (_ADR, 0x01)
                        Name (_EJD, "\\_SB_.PCI0.DOCK")
                    }

                    Device (PT02)
                    {
                        Name (_ADR, 0x02)
                        Name (_EJD, "\\_SB_.PCI0.DOCK")
                    }
                }
            }

            Device (ASND)
            {
                Name (_ADR, 0x00060000)
                Method (_PS0, 0, NotSerialized)
                {
                    While (LEqual (\_SB.MEM.ACLR, 0x00)) {}
                    Store (0x00, \_SB.MEM.PSND)
                }

                Method (_PS3, 0, NotSerialized)
                {
                    Store (0x01, \_SB.MEM.PSND)
                }

                Method (_PSC, 0, NotSerialized)
                {
                    If (\_SB.MEM.PSND)
                    {
                        Return (0x03)
                    }
                    Else
                    {
                        Return (0x00)
                    }
                }

                Name (_PRW, Package (0x02)
                {
                    0x09, 
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x01, \_SB.MEM.WED1)
                    }
                    Else
                    {
                        Store (0x00, \_SB.MEM.WED1)
                    }
                }
            }

            Device (IEEE)
            {
                Name (_ADR, 0x000C0000)
                OperationRegion (IEEC, PCI_Config, 0x00, 0xFF)
                Field (IEEC, ByteAcc, NoLock, Preserve)
                {
                    IVI0,   16, 
                    IDI0,   16, 
                    Offset (0x09), 
                    IPI0,   8, 
                    ISC0,   8, 
                    IBC0,   8
                }

                Name (_EJD, "\\_SB_.PCI0.DOCK")
            }

            Device (VIY0)
            {
                Name (_ADR, 0x00110000)
                Name (_SUN, 0x00)
                Name (_PRW, Package (0x02)
                {
                    0x09, 
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x01, \_SB.MEM.VWE0)
                    }
                    Else
                    {
                        Store (0x00, \_SB.MEM.VWE0)
                    }
                }
            }

            Device (VIY1)
            {
                Name (_ADR, 0x00110001)
                Name (_SUN, 0x01)
                Name (_PRW, Package (0x02)
                {
                    0x09, 
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x01, \_SB.MEM.VWE1)
                    }
                    Else
                    {
                        Store (0x00, \_SB.MEM.VWE1)
                    }
                }
            }

            Device (LAN)
            {
                Name (_ADR, 0x000A0000)
                OperationRegion (PLAN, PCI_Config, 0x00, 0xFF)
                Field (PLAN, ByteAcc, NoLock, Preserve)
                {
                    PLVI,   16, 
                    Offset (0xE1), 
                    PMES,   8
                }

                Name (_PRW, Package (0x02)
                {
                    0x09, 
                    0x04
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x01, \_SB.MEM.WED4)
                    }
                    Else
                    {
                        Store (0x00, \_SB.MEM.WED4)
                    }
                }
            }

            Device (MPC0)
            {
                Name (_ADR, 0x00100000)
                OperationRegion (MPF0, PCI_Config, 0x00, 0xFF)
                Field (MPF0, ByteAcc, NoLock, Preserve)
                {
                    Offset (0x0A), 
                    MCC0,   16
                }
            }

            Device (MPC1)
            {
                Name (_ADR, 0x00100001)
                OperationRegion (MPF1, PCI_Config, 0x00, 0xFF)
                Field (MPF1, ByteAcc, NoLock, Preserve)
                {
                    Offset (0x0A), 
                    MCC1,   16
                }
            }

            Device (SDC)
            {
                Name (_ADR, 0x00120000)
            }

            Device (DOCK)
            {
                Name (_HID, EisaId ("PNP0A05"))
                Method (_STA, 0, NotSerialized)
                {
                    SMBR (0x0136FA00, 0x05F3, 0x00, 0x00, 0xB2)
                    And (\_SB.MEM.OEAX, 0xFF00, Local0)
                    If (LOr (LAnd (LEqual (Local0, 0x00), LEqual
(\_SB.MEM.OECX, 0x00)), LNot (LEqual (Local0, 0x00)))) {
                        Store (0x00, \_SB.MEM.RDID)
                        Store (0x00, \_SB.MEM.RDSN)
                        Store (0x05, \_SB.PCI0.FNC0.SYSR.TRP4)
                        Store (\_SB.MEM.RDID, \_SB.MEM.DLID)
                        Store (\_SB.MEM.RDSN, \_SB.MEM.DSRN)
                        If (\_SB.MEM.PAR1)
                        {
                            Return (0x00)
                        }
                        Else
                        {
                            If (LEqual (0x1B51F351, \_SB.MEM.RDID))
                            {
                                Return (0x0F)
                            }
                            Else
                            {
                                Return (0x00)
                            }
                        }
                    }
                    Else
                    {
                        Return (0x00)
                    }
                }

                Method (_BDN, 0, NotSerialized)
                {
                    Store (0x00, \_SB.MEM.RDID)
                    Store (0x05, \_SB.PCI0.FNC0.SYSR.TRP4)
                    Return (\_SB.MEM.RDID)
                }

                Method (_UID, 0, NotSerialized)
                {
                    Store (0x00, \_SB.MEM.RDSN)
                    Store (0x05, \_SB.PCI0.FNC0.SYSR.TRP4)
                    Return (\_SB.MEM.RDSN)
                }

                Method (XDCK, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x05, \_SB.PCI0.FNC0.SYSR.TRP4)
                        If (\_SB.MEM.PAR1)
                        {
                            Store (0x41, \_SB.PCI0.FNC0.SYSR.TRP4)
                            Reset (\_SB.PCI0.DKSQ)
                            Wait (\_SB.PCI0.DKSQ, 0x0BB8)
                            Notify (\_SB.PCI0.PCI1.VGA, 0x80)
                            Return (One)
                        }

                        Return (Zero)
                    }
                    Else
                    {
                        Return (One)
                    }
                }

                Method (_EJ0, 1, NotSerialized)
                {
                    If (LOr (\_SB.MEM.BES1, \_SB.MEM.BES2))
                    {
                        Store (0x40, \_SB.PCI0.FNC0.SYSR.TRP4)
                        Reset (\_SB.PCI0.DKSQ)
                        Wait (\_SB.PCI0.DKSQ, 0x1388)
                        Notify (\_SB.PCI0.PCI1.VGA, 0x80)
                    }
                }

                PowerResource (PDOC, 0x01, 0x0000)
                {
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (\_SB.MEM.DSPW)
                    }

                    Method (_ON, 0, NotSerialized)
                    {
                        Store (0x01, \_SB.MEM.DSPW)
                    }

                    Method (_OFF, 0, NotSerialized)
                    {
                        Store (0x00, \_SB.MEM.DSPW)
                    }
                }

                Name (_PR0, Package (0x01)
                {
                    \_SB.PCI0.DOCK.PDOC
                })
                Name (_PR1, Package (0x01)
                {
                    \_SB.PCI0.DOCK.PDOC
                })
            }

            Event (DKSQ)
            Device (PCI1)
            {
                Name (_ADR, 0x00010000)
                Name (_PRT, Package (0x01)
                {
                    Package (0x04)
                    {
                        0xFFFF, 
                        0x00, 
                        \_SB.PCI0.FNC0.LNKC, 
                        0x00
                    }
                })
                Device (VGA)
                {
                    Name (_ADR, 0x00)
                    Method (_PS0, 0, Serialized)
                    {
                        While (LEqual (\_SB.MEM.VGAR, 0x00)) {}
                        Store (0x01, \_SB.MEM.IESI)
                        Store (0x00, \_SB.MEM.IEDI)
                        SMBR (0xFE00, 0x23, 0x0100, 0x00, 0xB2)
                        If (LEqual (\_SB.MEM.OEAX, 0x00))
                        {
                            Store (0x01, \_SB.MEM.IESI)
                            Store (0x00, \_SB.MEM.IEDI)
                            SMBR (0xFF00, 0x23, 0x0100, 0x00, 0xB2)
                            WPSX (0x0100, 0x01, 0x00, 0x00)
                            Store (0x00, \_SB.MEM.VGAF)
                        }
                    }

                    Method (_PS3, 0, Serialized)
                    {
                        While (LEqual (\_SB.MEM.VGAR, 0x00)) {}
                        Store (0x01, \_SB.MEM.IESI)
                        Store (0x00, \_SB.MEM.IEDI)
                        SMBR (0xFE00, 0x23, 0x0100, 0x00, 0xB2)
                        If (LEqual (\_SB.MEM.OEAX, 0x00))
                        {
                            Store (0x01, \_SB.MEM.IESI)
                            Store (0x00, \_SB.MEM.IEDI)
                            SMBR (0xFF00, 0x23, 0x0100, 0x03, 0xB2)
                            WPSX (0x0100, 0x01, 0x00, 0x03)
                            Store (0x01, \_SB.MEM.VGAF)
                        }
                    }

                    Method (_PSC, 0, NotSerialized)
                    {
                        While (LEqual (\_SB.MEM.VGAR, 0x00)) {}
                        Store (0x01, \_SB.MEM.IESI)
                        Store (0x00, \_SB.MEM.IEDI)
                        SMBR (0xFE00, 0x23, 0x0100, 0x00, 0xB2)
                        Return (\_SB.MEM.OEDX)
                    }

                    Method (_DOS, 1, NotSerialized)
                    {
                        If (LEqual (Arg0, 0x00))
                        {
                            Store (0x01, \_SB.MEM.DCST)
                            Store (0x00, \_SB.MEM.DOS2)
                        }
                        Else
                        {
                            If (LEqual (Arg0, 0x01))
                            {
                                Store (0x00, \_SB.MEM.DCST)
                                Store (0x01, \_SB.MEM.DOS2)
                            }
                            Else
                            {
                                If (LEqual (Arg0, 0x02))
                                {
                                    Store (0x01, \_SB.MEM.DCST)
                                    Store (0x01, \_SB.MEM.DOS2)
                                }
                            }
                        }
                    }

                    Method (_DOD, 0, NotSerialized)
                    {
                        Name (BUFF, Package (0x02)
                        {
                            0x0110, 
                            0x0100
                        })
                        Return (BUFF)
                    }

                    Method (_ROM, 2, NotSerialized)
                    {
                        Add (Arg0, 0x000C0000, Local0)
                        ShiftLeft (Arg1, 0x03, Local1)
                        Name (BUFF, Buffer (Arg1) {})
                        Scope (\)
                        {
                            OperationRegion (VROM, SystemMemory,
Local0, Local1) Field (VROM, ByteAcc, NoLock, Preserve)
                            {
                                ROMI,   65536
                            }
                        }

                        Store (\ROMI, BUFF)
                        Return (BUFF)
                    }

                    Device (LCD)
                    {
                        Name (_ADR, 0x0110)
                        Method (_DCS, 0, NotSerialized)
                        {
                            If (\_SB.MEM.CTLA)
                            {
                                Return (0x0F)
                            }
                            Else
                            {
                                Return (0x0D)
                            }
                        }

                        Method (_DDC, 1, NotSerialized)
                        {
                            If (LEqual (Arg0, 0x01))
                            {
                                Store (0x80, Local0)
                            }
                            Else
                            {
                                If (LEqual (Arg0, 0x02))
                                {
                                    Store (0x0100, Local0)
                                }
                                Else
                                {
                                    Return (Zero)
                                }
                            }

                            Store (0x00, \_SB.MEM.PRES)
                            ShiftLeft (Arg0, 0x08, Local1)
                            Or (Local1, 0x01, Local1)
                            Name (BUFF, Buffer (Local0) {})
                            SMBR (0xFE00, 0x37, Local1, 0x000EF000,
0xB2) And (Local1, 0xFF00, Local1)
                            Store (0x0100, \_SB.MEM.OECX)
                            While (\_SB.MEM.OECX)
                            {
                                SMBR (0xFE00, 0x37, Local1, 0x00, 0xB2)
                            }

                            Store (\_SB.MEM.FSDP, Local0)
                            Or (Local0, 0x22, \_SB.MEM.FSDP)
                            Subtract (\_SB.MEM.FSDP, Local0, Local0)
                            Subtract (\_SB.MEM.EDCK, Local0,
\_SB.MEM.EDCK) Store (\_SB.MEM.PRES, BUFF)
                            Return (BUFF)
                        }

                        Method (_DGS, 0, NotSerialized)
                        {
                            If (\_SB.MEM.NXLA)
                            {
                                Return (One)
                            }
                            Else
                            {
                                Return (Zero)
                            }
                        }

                        Method (_DSS, 1, NotSerialized)
                        {
                            Store (Arg0, Local0)
                            And (Local0, 0x01, Local1)
                            If (Local1)
                            {
                                Store (0x01, \_SB.MEM.NXLA)
                            }
                            Else
                            {
                                Store (0x00, \_SB.MEM.NXLA)
                            }

                            And (Local0, 0x80000000, Local1)
                            If (Local1)
                            {
                                Store (0x0100, Local1)
                                If (\_SB.MEM.NXLA)
                                {
                                    Or (0x01, Local1, Local1)
                                }

                                If (\_SB.MEM.NXCA)
                                {
                                    Or (0x02, Local1, Local1)
                                }

                                If (\_SB.MEM.NXTA)
                                {
                                    Or (0x04, Local1, Local1)
                                }

                                If (\_SB.MEM.NXDA)
                                {
                                    Or (0x08, Local1, Local1)
                                }

                                SMBR (0xFF00, 0x1C, Local1, 0x00, 0xB2)
                                And (\_SB.MEM.OEAX, 0xFF00, Local1)
                                If (LEqual (Local1, 0x00))
                                {
                                    Store (0x80, Local1)
                                    While (LEqual (Local1, 0x80))
                                    {
                                        SMBR (0xFE00, 0x1C, 0x00, 0x00,
0xB2) And (\_SB.MEM.OECX, 0x80, Local1)
                                    }

                                    If (\_SB.MEM.CTLA)
                                    {
                                        If (LEqual (\_SB.MEM.LCDS,
0x00)) {
                                            SMBR (0xFF00, 0x02, 0x01,
0x00, 0xB2) Store (0x01, \_SB.MEM.OEDX)
                                            While (\_SB.MEM.OEDX)
                                            {
                                                SMBR (0xFE00, 0x02,
0x00, 0x00, 0xB2) }
                                        }
                                    }
                                }
                            }
                        }

                        Method (_BCL, 0, NotSerialized)
                        {
                            Name (BUFF, Package (0x05)
                            {
                                0x64, 
                                0x28, 
                                0x00, 
                                0x28, 
                                0x64
                            })
                            If (\_SB.MEM.HPSU)
                            {
                                Store (\_SB.MEM.BCLA, Index (BUFF,
0x00)) Store (\_SB.MEM.BCLD, Index (BUFF, 0x01))
                            }

                            Return (BUFF)
                        }

                        Method (_BCM, 1, NotSerialized)
                        {
                            If (LEqual (\_SB.MEM.HPSU, 0x00))
                            {
                                Multiply (Arg0, 0xFFFF, Local0)
                                Divide (Local0, 0x64, , Local0)
                                SMBR (0xFF00, 0x2A, Local0, 0x00, 0xB2)
                            }
                        }

                        Method (_PS0, 0, Serialized)
                        {
                            Store (0x00, \_SB.MEM.LCDS)
                            If (LEqual (\_SB.MEM.RPPC, 0x01))
                            {
                                Notify (\_PR.CPU0, 0x80)
                                Store (0x00, \_SB.MEM.RPPC)
                            }
                        }

                        Method (_PS3, 0, Serialized)
                        {
                            Store (0x03, \_SB.MEM.LCDS)
                        }

                        Method (_PSC, 0, Serialized)
                        {
                            Return (\_SB.MEM.LCDS)
                        }
                    }

                    Device (CRT)
                    {
                        Name (_ADR, 0x0100)
                        Method (_DCS, 0, NotSerialized)
                        {
                            If (\_SB.MEM.CTCA)
                            {
                                Return (0x0F)
                            }
                            Else
                            {
                                Return (0x0D)
                            }
                        }

                        Method (_DDC, 1, NotSerialized)
                        {
                            If (LEqual (Arg0, 0x01))
                            {
                                Store (0x80, Local0)
                            }
                            Else
                            {
                                If (LEqual (Arg0, 0x02))
                                {
                                    Store (0x0100, Local0)
                                }
                                Else
                                {
                                    Return (Zero)
                                }
                            }

                            Store (0x00, \_SB.MEM.PRES)
                            ShiftLeft (Arg0, 0x08, Local1)
                            Or (Local1, 0x02, Local1)
                            Name (BUFF, Buffer (Local0) {})
                            SMBR (0xFE00, 0x37, Local1, 0x000EF000,
0xB2) And (Local1, 0xFF00, Local1)
                            Store (0x0100, \_SB.MEM.OECX)
                            While (\_SB.MEM.OECX)
                            {
                                SMBR (0xFE00, 0x37, Local1, 0x00, 0xB2)
                            }

                            Store (\_SB.MEM.PRES, BUFF)
                            Return (BUFF)
                        }

                        Method (_DGS, 0, NotSerialized)
                        {
                            If (\_SB.MEM.NXCA)
                            {
                                Return (One)
                            }
                            Else
                            {
                                Return (Zero)
                            }
                        }

                        Method (_DSS, 1, NotSerialized)
                        {
                            Store (Arg0, Local0)
                            And (Local0, 0x01, Local1)
                            If (Local1)
                            {
                                Store (0x01, \_SB.MEM.NXCA)
                            }
                            Else
                            {
                                Store (0x00, \_SB.MEM.NXCA)
                            }

                            And (Local0, 0x80000000, Local1)
                            If (Local1)
                            {
                                Store (0x0100, Local1)
                                If (\_SB.MEM.NXLA)
                                {
                                    Or (0x01, Local1, Local1)
                                }

                                If (\_SB.MEM.NXCA)
                                {
                                    Or (0x02, Local1, Local1)
                                }

                                If (\_SB.MEM.NXTA)
                                {
                                    Or (0x04, Local1, Local1)
                                }

                                If (\_SB.MEM.NXDA)
                                {
                                    Or (0x08, Local1, Local1)
                                }

                                SMBR (0xFF00, 0x1C, Local1, 0x00, 0xB2)
                                And (\_SB.MEM.OEAX, 0xFF00, Local1)
                                If (LEqual (Local1, 0x00))
                                {
                                    Store (0x80, Local1)
                                    While (LEqual (Local1, 0x80))
                                    {
                                        SMBR (0xFE00, 0x1C, 0x00, 0x00,
0xB2) And (\_SB.MEM.OECX, 0x80, Local1)
                                    }

                                    If (\_SB.MEM.CTLA)
                                    {
                                        If (LEqual (\_SB.MEM.LCDS,
0x00)) {
                                            SMBR (0xFF00, 0x02, 0x01,
0x00, 0xB2) Store (0x01, \_SB.MEM.OEDX)
                                            While (\_SB.MEM.OEDX)
                                            {
                                                SMBR (0xFE00, 0x02,
0x00, 0x00, 0xB2) }
                                        }
                                    }
                                }
                            }
                        }

                        Method (_PS0, 0, Serialized)
                        {
                            Store (0x00, \_SB.MEM.CRTS)
                            If (LEqual (\_SB.MEM.RPPC, 0x01))
                            {
                                Notify (\_PR.CPU0, 0x80)
                                Store (0x00, \_SB.MEM.RPPC)
                            }
                        }

                        Method (_PS3, 0, Serialized)
                        {
                            Store (0x03, \_SB.MEM.CRTS)
                        }

                        Method (_PSC, 0, Serialized)
                        {
                            Return (\_SB.MEM.CRTS)
                        }
                    }
                }
            }

            Method (_INI, 0, NotSerialized)
            {
                Store (\_SB.MEM.BES1, \_SB.MEM.BT1F)
                Store (\_SB.MEM.BES2, \_SB.MEM.BT2F)
                Store (0x00, \_SB.MEM.DSPW)
                Store (0x00, \_SB.MEM.VGAF)
                Store (0x00, \_SB.MEM.VWE0)
                Store (0x00, \_SB.MEM.VWE1)
                Store (0x00, \_SB.MEM.PPSC)
                Store (0x00, \_SB.MEM.SPSC)
                Store (0x00, Local0)
                If (CMPS (\_OS, "Microsoft Windows NT"))
                {
                    Store (0x03, Local0)
                    If (CondRefOf (\_OSI, Local1))
                    {
                        If (\_OSI ("Windows 2001"))
                        {
                            Store (0x04, Local0)
                        }
                    }
                }
                Else
                {
                    If (CMPS (\_OS, "Microsoft Windows"))
                    {
                        Store (0x01, Local0)
                    }

                    If (CMPS (\_OS, "Microsoft WindowsME:Millennium
Edition")) {
                        Store (0x02, Local0)
                    }
                }

                Store (Local0, \_SB.MEM.OSID)
                DIS (0x14)
                While (LEqual (\_SB.MEM.BTRE, 0x00)) {}
                SMBR (0xFF00, 0x1E, 0x01, 0x00, 0xB2)
                Store (0x01, \_SB.MEM.PAR1)
                Store (0x60, \_SB.PCI0.FNC0.SYSR.TRP4)
            }
        }

        Device (BT)
        {
            Name (_HID, "TOS6205")
            Method (_STA, 0, NotSerialized)
            {
                If (\_SB.MEM.BTMD)
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (0x00)
                }
            }

            Name (_PRW, Package (0x02)
            {
                0x09, 
                0x04
            })
            Method (BTST, 0, NotSerialized)
            {
                Store (0x00, \_SB.MEM.OESI)
                SMBR (0xFE00, 0x4D, 0x01, 0xC600, 0xB2)
                Store (0x01, Local0)
                While (Local0)
                {
                    SMBR (0xFE00, 0x4D, 0x0101, 0xC600, 0xB2)
                    Store (\_SB.MEM.OESI, Local2)
                    And (\_SB.MEM.OEAX, 0xFF00, Local1)
                    If (Local1)
                    {
                        And (\_SB.MEM.OEAX, 0xFF, Local1)
                        If (LNot (LEqual (Local1, 0x20)))
                        {
                            Store (0x00, Local2)
                            Store (0x00, Local0)
                        }
                    }
                    Else
                    {
                        Store (0x00, Local0)
                    }
                }

                And (Local2, 0x02, Local0)
                ShiftLeft (Local0, 0x06, Local0)
                And (Local2, 0x04, Local1)
                ShiftLeft (Local1, 0x04, Local1)
                Or (Local0, Local1, Local0)
                And (Local2, 0x10, Local3)
                ShiftRight (Local3, 0x04, Local3)
                Or (Local0, Local3, Local0)
                Return (Local0)
            }

            Method (AUSB, 0, NotSerialized)
            {
                If (\_SB.MEM.BTMD)
                {
                    Store (0x00, \_SB.MEM.IEDI)
                    Store (0x03, \_SB.MEM.IESI)
                    SMBR (0xFF00, 0x4D, 0x01, 0x7C00, 0xB2)
                    Store (0x01, Local0)
                    While (Local0)
                    {
                        SMBR (0xFF00, 0x4D, 0x0101, 0x7C00, 0xB2)
                        And (\_SB.MEM.OEAX, 0xFF00, Local1)
                        If (Local1)
                        {
                            And (\_SB.MEM.OEAX, 0xFF, Local1)
                            If (LNot (LEqual (Local1, 0x20)))
                            {
                                Store (0x00, Local0)
                            }
                        }
                        Else
                        {
                            Store (0x00, Local0)
                        }
                    }
                }
            }

            Method (DUSB, 0, NotSerialized)
            {
                If (\_SB.MEM.BTMD)
                {
                    Store (0x00, \_SB.MEM.IEDI)
                    Store (0x04, \_SB.MEM.IESI)
                    SMBR (0xFF00, 0x4D, 0x01, 0x7C00, 0xB2)
                    Store (0x01, Local0)
                    While (Local0)
                    {
                        SMBR (0xFF00, 0x4D, 0x0101, 0x7C00, 0xB2)
                        And (\_SB.MEM.OEAX, 0xFF00, Local1)
                        If (Local1)
                        {
                            And (\_SB.MEM.OEAX, 0xFF, Local1)
                            If (LNot (LEqual (Local1, 0x20)))
                            {
                                Store (0x00, Local0)
                            }
                        }
                        Else
                        {
                            Store (0x00, Local0)
                        }
                    }
                }
            }

            Method (BTPO, 0, NotSerialized)
            {
                If (\_SB.MEM.BTMD)
                {
                    Store (0x00, \_SB.MEM.IEDI)
                    Store (0x01, \_SB.MEM.IESI)
                    SMBR (0xFF00, 0x4D, 0x01, 0x7C00, 0xB2)
                    Store (0x01, Local0)
                    While (Local0)
                    {
                        SMBR (0xFF00, 0x4D, 0x0101, 0x7C00, 0xB2)
                        And (\_SB.MEM.OEAX, 0xFF00, Local1)
                        If (Local1)
                        {
                            And (\_SB.MEM.OEAX, 0xFF, Local1)
                            If (LNot (LEqual (Local1, 0x20)))
                            {
                                Store (0x00, Local0)
                            }
                        }
                        Else
                        {
                            Store (0x00, Local0)
                        }
                    }
                }
            }

            Method (BTPF, 0, NotSerialized)
            {
                If (\_SB.MEM.BTMD)
                {
                    Store (0x00, \_SB.MEM.IEDI)
                    Store (0x02, \_SB.MEM.IESI)
                    SMBR (0xFF00, 0x4D, 0x01, 0x7C00, 0xB2)
                    Store (0x01, Local0)
                    While (Local0)
                    {
                        SMBR (0xFF00, 0x4D, 0x0101, 0x7C00, 0xB2)
                        And (\_SB.MEM.OEAX, 0xFF00, Local1)
                        If (Local1)
                        {
                            And (\_SB.MEM.OEAX, 0xFF, Local1)
                            If (LNot (LEqual (Local1, 0x20)))
                            {
                                Store (0x00, Local0)
                            }
                        }
                        Else
                        {
                            Store (0x00, Local0)
                        }
                    }
                }
            }
        }

        Device (LID)
        {
            Name (_HID, EisaId ("PNP0C0D"))
            Method (_LID, 0, NotSerialized)
            {
                Return (\_SB.MEM.LIDS)
            }

            Name (_PRW, Package (0x02)
            {
                0x25, 
                0x04
            })
            Method (_PSW, 1, NotSerialized)
            {
                If (LEqual (Arg0, 0x00))
                {
                    Store (0x00, \_SB.MEM.EWLD)
                }
                Else
                {
                    Store (0x01, \_SB.MEM.EWLD)
                }
            }
        }

        Device (BAT1)
        {
            Name (_HID, EisaId ("PNP0C0A"))
            Name (_UID, 0x01)
            Name (_PCL, Package (0x01)
            {
                \_SB
            })
            Method (_STA, 0, NotSerialized)
            {
                If (\_SB.MEM.BES1)
                {
                    Return (0x1F)
                }
                Else
                {
                    Return (0x0F)
                }
            }

            Method (_BIF, 0, NotSerialized)
            {
                Name (BUFF, Package (0x0D) {})
                Store (0x00, Index (BUFF, 0x00))
                Store (\_SB.MEM.BDV1, Local2)
                Multiply (\_SB.MEM.BDC1, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x01))
                Multiply (\_SB.MEM.BLF1, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x02))
                Store (\_SB.MEM.BTC1, Index (BUFF, 0x03))
                Store (\_SB.MEM.BDV1, Index (BUFF, 0x04))
                Multiply (\_SB.MEM.BCW1, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x05))
                Multiply (\_SB.MEM.BCL1, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x06))
                Multiply (\_SB.MEM.BG11, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x07))
                Multiply (\_SB.MEM.BG21, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x08))
                Store (\_SB.MEM.BMN1, Index (BUFF, 0x09))
                Store (\_SB.MEM.BSN1, Index (BUFF, 0x0A))
                Store (\_SB.MEM.BTP1, Index (BUFF, 0x0B))
                Store (\_SB.MEM.BOI1, Index (BUFF, 0x0C))
                Return (BUFF)
            }

            Method (_BST, 0, NotSerialized)
            {
                If (\_SB.MEM.BES2)
                {
                    And (\_SB.MEM.BST1, 0x03, Local0)
                    And (\_SB.MEM.BST2, 0x03, Local1)
                    If (LOr (Local0, Local1))
                    {
                        Multiply (\_SB.MEM.BPR1, \_SB.MEM.BDV1, Local0)
                        Divide (Local0, 0x07D0, Local1, Local0)
                    }
                    Else
                    {
                        Store (0x00, Local0)
                    }
                }
                Else
                {
                    If (LAnd (\_SB.MEM.BST1, 0x03))
                    {
                        Multiply (\_SB.MEM.BPR1, \_SB.MEM.BDV1, Local0)
                        Divide (Local0, 0x03E8, Local1, Local0)
                    }
                    Else
                    {
                        Store (0x00, Local0)
                    }
                }

                Name (BUFF, Package (0x04) {})
                Store (\_SB.MEM.BST1, Index (BUFF, 0x00))
                Store (Local0, Index (BUFF, 0x01))
                Multiply (\_SB.MEM.BRC1, \_SB.MEM.BDV1, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x02))
                Store (\_SB.MEM.BPV1, Index (BUFF, 0x03))
                Return (BUFF)
            }

            Method (_BTP, 1, NotSerialized)
            {
                Store (0x01, \_SB.MEM.PAR1)
                Store (Arg0, \_SB.MEM.PAR2)
                Store (0x61, \_SB.PCI0.FNC0.SYSR.TRP4)
            }
        }

        Device (BAT2)
        {
            Name (_HID, EisaId ("PNP0C0A"))
            Name (_UID, 0x02)
            Name (_PCL, Package (0x01)
            {
                \_SB
            })
            Method (_STA, 0, NotSerialized)
            {
                If (\_SB.MEM.BES2)
                {
                    Return (0x1F)
                }
                Else
                {
                    Return (0x0F)
                }
            }

            Method (_BIF, 0, NotSerialized)
            {
                Name (BUFF, Package (0x0D) {})
                Store (0x00, Index (BUFF, 0x00))
                Store (\_SB.MEM.BDV2, Local2)
                Multiply (\_SB.MEM.BDC2, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x01))
                Multiply (\_SB.MEM.BLF2, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x02))
                Store (\_SB.MEM.BTC2, Index (BUFF, 0x03))
                Store (\_SB.MEM.BDV2, Index (BUFF, 0x04))
                Multiply (\_SB.MEM.BCW2, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x05))
                Multiply (\_SB.MEM.BCL2, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x06))
                Multiply (\_SB.MEM.BG12, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x07))
                Multiply (\_SB.MEM.BG22, Local2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x08))
                Store (\_SB.MEM.BMN2, Index (BUFF, 0x09))
                Store (\_SB.MEM.BSN2, Index (BUFF, 0x0A))
                Store (\_SB.MEM.BTP2, Index (BUFF, 0x0B))
                Store (\_SB.MEM.BOI2, Index (BUFF, 0x0C))
                Return (BUFF)
            }

            Method (_BST, 0, NotSerialized)
            {
                If (\_SB.MEM.BES1)
                {
                    And (\_SB.MEM.BST1, 0x03, Local0)
                    And (\_SB.MEM.BST2, 0x03, Local1)
                    If (LOr (Local0, Local1))
                    {
                        Multiply (\_SB.MEM.BPR2, \_SB.MEM.BDV2, Local0)
                        Divide (Local0, 0x07D0, Local1, Local0)
                    }
                    Else
                    {
                        Store (0x00, Local0)
                    }
                }
                Else
                {
                    If (LAnd (\_SB.MEM.BST2, 0x03))
                    {
                        Multiply (\_SB.MEM.BPR2, \_SB.MEM.BDV2, Local0)
                        Divide (Local0, 0x03E8, Local1, Local0)
                    }
                    Else
                    {
                        Store (0x00, Local0)
                    }
                }

                Name (BUFF, Package (0x04) {})
                Store (\_SB.MEM.BST2, Index (BUFF, 0x00))
                Store (Local0, Index (BUFF, 0x01))
                Multiply (\_SB.MEM.BRC2, \_SB.MEM.BDV2, Local0)
                Divide (Local0, 0x03E8, Local1, Local0)
                Store (Local0, Index (BUFF, 0x02))
                Store (\_SB.MEM.BPV2, Index (BUFF, 0x03))
                Return (BUFF)
            }

            Method (_BTP, 1, NotSerialized)
            {
                Store (0x02, \_SB.MEM.PAR1)
                Store (Arg0, \_SB.MEM.PAR2)
                Store (0x61, \_SB.PCI0.FNC0.SYSR.TRP4)
            }
        }

        Device (ADP1)
        {
            Name (_HID, "ACPI0003")
            Name (_PCL, Package (0x03)
            {
                \_SB, 
                \_SB.BAT1, 
                \_SB.BAT2
            })
            Name (_STA, 0x0F)
            Method (_PSR, 0, NotSerialized)
            {
                Return (\_SB.MEM.ACST)
            }
        }

        Device (VALD)
        {
            Name (_HID, EisaId ("TOS6200"))
            Name (_DDN, "VALD")
            Name (_STA, 0x0B)
            Method (ENAB, 0, NotSerialized)
            {
                Store (0x01, \_SB.MEM.VALF)
                SMBR (0xFF00, 0x16, 0x01, 0x00, 0xB2)
            }

            Method (INFO, 0, NotSerialized)
            {
                Store (0x00, \_SB.MEM.OECX)
                SMBR (0xFE00, 0x16, 0x00, 0x00, 0xB2)
                If (LNot (LEqual (\_SB.MEM.OEAX, 0x00)))
                {
                    Store (0x00, \_SB.MEM.OECX)
                }

                Return (\_SB.MEM.OECX)
            }

            Method (GHCI, 6, Serialized)
            {
                CreateDWordField (Arg0, 0x00, REAX)
                CreateWordField (Arg1, 0x00, R_BX)
                And (REAX, 0xFF00, Local0)
                If (LEqual (Local0, 0xFE00))
                {
                    If (LEqual (R_BX, 0xC000))
                    {
                        Return (G000 (Local0, R_BX, Arg2, Arg3, Arg4,
Arg5)) }

                    If (LEqual (R_BX, 0xC800))
                    {
                        Return (G800 (Local0, R_BX, Arg2, Arg3, Arg4,
Arg5)) }

                    If (LEqual (R_BX, 0xC801))
                    {
                        Return (G801 (Local0, R_BX, Arg2, Arg3, Arg4,
Arg5)) }
                }

                If (LEqual (Local0, 0xFF00))
                {
                    If (LEqual (R_BX, 0xC000))
                    {
                        Return (G000 (Local0, R_BX, Arg2, Arg3, Arg4,
Arg5)) }

                    If (LEqual (R_BX, 0xC801))
                    {
                        Return (G801 (Local0, R_BX, Arg2, Arg3, Arg4,
Arg5)) }
                }

                Return (GCH0 (Arg0, Arg1, Arg2, Arg3, Arg4, Arg5))
            }

            Method (GCH0, 6, NotSerialized)
            {
                Store (Arg4, \_SB.MEM.IESI)
                Store (Arg5, \_SB.MEM.IEDI)
                SMBR (Arg0, Arg1, Arg2, Arg3, 0xB2)
                Name (BUFF, Package (0x06) {})
                Store (\_SB.MEM.OEAX, Index (BUFF, 0x00))
                Store (\_SB.MEM.OEBX, Index (BUFF, 0x01))
                Store (\_SB.MEM.OECX, Index (BUFF, 0x02))
                Store (\_SB.MEM.OEDX, Index (BUFF, 0x03))
                Store (\_SB.MEM.OESI, Index (BUFF, 0x04))
                Store (\_SB.MEM.OEDI, Index (BUFF, 0x05))
                Return (BUFF)
            }

            Method (G000, 6, NotSerialized)
            {
                Name (BUFF, Package (0x06) {})
                CreateDWordField (Arg2, 0x00, RECX)
                CreateDWordField (Arg3, 0x00, REDX)
                CreateDWordField (Arg4, 0x00, RESI)
                CreateDWordField (Arg5, 0x00, REDI)
                CreateByteField (Arg2, 0x00, R_CL)
                Store (0x00, Index (BUFF, 0x00))
                Store (Arg1, Index (BUFF, 0x01))
                Store (RECX, Index (BUFF, 0x02))
                Store (REDX, Index (BUFF, 0x03))
                Store (RESI, Index (BUFF, 0x04))
                Store (REDI, Index (BUFF, 0x05))
                If (\_SB.MEM.GCVS)
                {
                    If (LEqual (Arg0, 0xFE00))
                    {
                        If (LEqual (R_CL, 0x00))
                        {
                            Store (\_SB.MEM.TNVS, Local0)
                            Store (Local0, Index (BUFF, 0x02))
                        }
                        Else
                        {
                            If (LAnd (LNot (LLess (R_CL, 0x01)), LNot
(LGreater (R_CL, 0x04)))) {
                                Store (R_CL, Local0)
                                Or (Local0, 0x3000, Local0)
                                SMBR (0xFA00, Local0, 0x00, 0x00, 0xB2)
                                Store (\_SB.MEM.OECX, Index (BUFF,
0x02)) Store (\_SB.MEM.OEDX, Index (BUFF, 0x03))
                            }
                            Else
                            {
                                If (LEqual (R_CL, 0x05))
                                {
                                    Store (0x21, Index (BUFF, 0x02))
                                }
                                Else
                                {
                                    Store (0x8300, Index (BUFF, 0x00))
                                }
                            }
                        }
                    }
                    Else
                    {
                        CreateWordField (Arg3, 0x00, R_DX)
                        If (LEqual (R_CL, 0x00))
                        {
                            If (LEqual (R_DX, 0x00))
                            {
                                Store (0x00, \_SB.MEM.TNVS)
                            }
                            Else
                            {
                                Store (0x01, \_SB.MEM.TNVS)
                            }
                        }
                        Else
                        {
                            If (LEqual (R_CL, 0x01))
                            {
                                Store (R_CL, Local0)
                                Or (Local0, 0x3080, Local0)
                                SMBR (0xFA00, Local0, R_DX, 0x00, 0xB2)
                            }
                            Else
                            {
                                If (LEqual (R_CL, 0x02))
                                {
                                    FindSetRightBit (R_DX, Local0)
                                    Store (Local0, \_SB.MEM.NXDD)
                                    If (LLess (\_SB.MEM.OSID, 0x03))
                                    {
                                        Or (Local0, 0x0100, Local0)
                                        SMBR (0xFF00, 0x1C, Local0,
0x00, 0xB2) And (\_SB.MEM.OEAX, 0xFF00, Local0)
                                        If (LEqual (Local0, 0x00))
                                        {
                                            Store (0x80, Local0)
                                            While (LEqual (Local0,
0x80)) {
                                                SMBR (0xFE00, 0x1C,
0x00, 0x00, 0xB2) And (\_SB.MEM.OECX, 0x80, Local0)
                                            }

                                            If (\_SB.MEM.CTLA)
                                            {
                                                If (LEqual
(\_SB.MEM.LCDS, 0x00)) {
                                                    SMBR (0xFF00, 0x02,
0x01, 0x00, 0xB2) Store (0x01, \_SB.MEM.OEDX)
                                                    While
(\_SB.MEM.OEDX) {
                                                        SMBR (0xFE00,
0x02, 0x00, 0x00, 0xB2) }
                                                }
                                            }
                                        }
                                    }
                                    Else
                                    {
                                        Notify (\_SB.PCI0.PCI1.VGA,
0x80) }
                                }
                                Else
                                {
                                    Store (0x8300, Index (BUFF, 0x00))
                                }
                            }
                        }
                    }
                }
                Else
                {
                    Store (0x8000, Index (BUFF, 0x00))
                }

                Return (BUFF)
            }

            Method (G800, 6, NotSerialized)
            {
                Store (\_SB.MEM.OSPC, Local0)
                Name (BUFF, Package (0x06) {})
                CreateDWordField (Arg3, 0x00, REDX)
                CreateDWordField (Arg4, 0x00, RESI)
                CreateDWordField (Arg5, 0x00, REDI)
                Store (0x00, Index (BUFF, 0x00))
                Store (Arg1, Index (BUFF, 0x01))
                Store (Local0, Index (BUFF, 0x02))
                Store (REDX, Index (BUFF, 0x03))
                Store (RESI, Index (BUFF, 0x04))
                Store (REDI, Index (BUFF, 0x05))
                Return (BUFF)
            }

            Method (G801, 6, NotSerialized)
            {
                CreateDWordField (Arg2, 0x00, RECX)
                CreateDWordField (Arg3, 0x00, REDX)
                CreateDWordField (Arg4, 0x00, RESI)
                CreateDWordField (Arg5, 0x00, REDI)
                Store (0x8300, Local0)
                Store (RECX, Local1)
                If (LEqual (REDX, 0x01))
                {
                    Store (0x00, Local0)
                    If (LEqual (Arg0, 0xFE00))
                    {
                        Store (\_SB.MEM.PULD, Local1)
                        Store (\_SB.MEM.PULA, Local2)
                        ShiftLeft (Local2, 0x08, Local2)
                        Or (Local1, Local2, Local1)
                    }
                    Else
                    {
                        And (Local1, 0xFF, Local2)
                        ShiftRight (Local1, 0x08, Local3)
                        Store (Local2, \_SB.MEM.PULD)
                        Store (Local3, \_SB.MEM.PULA)
                    }
                }

                If (LEqual (REDX, 0x02))
                {
                    Store (0x00, Local0)
                    If (LEqual (Arg0, 0xFE00))
                    {
                        Store (\_SB.MEM.BCLD, Local1)
                        Store (\_SB.MEM.BCLA, Local2)
                        ShiftLeft (Local2, 0x08, Local2)
                        Or (Local1, Local2, Local1)
                    }
                    Else
                    {
                        And (Local1, 0xFF, Local2)
                        ShiftRight (Local1, 0x08, Local3)
                        Store (Local2, \_SB.MEM.BCLD)
                        Store (Local3, \_SB.MEM.BCLA)
                    }
                }

                Name (BUFF, Package (0x06) {})
                Store (Local0, Index (BUFF, 0x00))
                Store (Arg1, Index (BUFF, 0x01))
                Store (Local1, Index (BUFF, 0x02))
                Store (REDX, Index (BUFF, 0x03))
                Store (RESI, Index (BUFF, 0x04))
                Store (REDI, Index (BUFF, 0x05))
                Return (BUFF)
            }
        }

        Device (VALG)
        {
            Name (_HID, EisaId ("TOS6202"))
            Name (_DDN, "VALGeneral")
            Name (_STA, 0x0B)
            Method (VCID, 0, NotSerialized)
            {
                Store (0x00, \_SB.MEM.RDID)
                Store (0x05, \_SB.PCI0.FNC0.SYSR.TRP4)
                Return (\_SB.MEM.RDID)
            }

            Method (VUID, 0, NotSerialized)
            {
                Store (0x00, \_SB.MEM.RDSN)
                Store (0x05, \_SB.PCI0.FNC0.SYSR.TRP4)
                Return (\_SB.MEM.RDSN)
            }

            Method (VDCK, 1, NotSerialized)
            {
                If (Arg0)
                {
                    Store (0x05, \_SB.PCI0.FNC0.SYSR.TRP4)
                    If (\_SB.MEM.PAR1)
                    {
                        Store (0x41, \_SB.PCI0.FNC0.SYSR.TRP4)
                        Reset (\_SB.PCI0.DKSQ)
                        Wait (\_SB.PCI0.DKSQ, 0x0BB8)
                        Notify (\_SB.PCI0.PCI1.VGA, 0x80)
                        Return (One)
                    }

                    Return (Zero)
                }
                Else
                {
                    Return (One)
                }
            }

            Method (VEJ0, 1, NotSerialized)
            {
                If (LOr (\_SB.MEM.BES1, \_SB.MEM.BES2))
                {
                    Store (0x40, \_SB.PCI0.FNC0.SYSR.TRP4)
                    Reset (\_SB.PCI0.DKSQ)
                    Wait (\_SB.PCI0.DKSQ, 0x1388)
                    Notify (\_SB.PCI0.PCI1.VGA, 0x80)
                }
            }

            Method (DLSZ, 0, NotSerialized)
            {
                Return (0x03)
            }

            Method (DLIB, 0, NotSerialized)
            {
                Name (BUFF, Buffer (0x30)
                {
                    0x80, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                    0x80, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                    0x80, 0x00, 0x00, 0x00, 0x02, 0x60, 0x00, 0x00, 
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                })
                Store (\_SB.PCI0.USB1.UVI1, Local0)
                CreateByteField (BUFF, 0x08, VI1L)
                CreateByteField (BUFF, 0x09, VI1H)
                CreateByteField (BUFF, 0x18, VI2L)
                CreateByteField (BUFF, 0x19, VI2H)
                ShiftRight (Local0, 0x08, Local1)
                And (Local0, 0xFF, Local0)
                Store (Local0, VI1L)
                Store (Local1, VI1H)
                Store (Local0, VI2L)
                Store (Local1, VI2H)
                Store (\_SB.PCI0.USB1.UDI1, Local0)
                CreateByteField (BUFF, 0x0A, DI1L)
                CreateByteField (BUFF, 0x0B, DI1H)
                CreateByteField (BUFF, 0x1A, DI2L)
                CreateByteField (BUFF, 0x1B, DI2H)
                ShiftRight (Local0, 0x08, Local1)
                And (Local0, 0xFF, Local0)
                Store (Local0, DI1L)
                Store (Local1, DI1H)
                Store (Local0, DI2L)
                Store (Local1, DI2H)
                Store (\_SB.PCI0.USB1.UPI1, Local0)
                CreateByteField (BUFF, 0x01, PIC1)
                CreateByteField (BUFF, 0x11, PIC2)
                Store (Local0, PIC1)
                Store (Local0, PIC2)
                Store (\_SB.PCI0.USB1.USC1, Local0)
                CreateByteField (BUFF, 0x02, SCC1)
                CreateByteField (BUFF, 0x12, SCC2)
                Store (Local0, SCC1)
                Store (Local0, SCC2)
                Store (\_SB.PCI0.USB1.UBC1, Local0)
                CreateByteField (BUFF, 0x03, BCC1)
                CreateByteField (BUFF, 0x13, BCC2)
                Store (Local0, BCC1)
                Store (Local0, BCC2)
                Store (\_SB.PCI0.IEEE.IVI0, Local0)
                CreateByteField (BUFF, 0x28, VI3L)
                CreateByteField (BUFF, 0x29, VI3H)
                ShiftRight (Local0, 0x08, Local1)
                And (Local0, 0xFF, Local0)
                Store (Local0, VI3L)
                Store (Local1, VI3H)
                Store (\_SB.PCI0.IEEE.IDI0, Local0)
                CreateByteField (BUFF, 0x2A, DI3L)
                CreateByteField (BUFF, 0x2B, DI3H)
                ShiftRight (Local0, 0x08, Local1)
                And (Local0, 0xFF, Local0)
                Store (Local0, DI3L)
                Store (Local1, DI3H)
                Store (\_SB.PCI0.IEEE.IPI0, Local0)
                CreateByteField (BUFF, 0x21, PIC3)
                Store (Local0, PIC3)
                Store (\_SB.PCI0.IEEE.ISC0, Local0)
                CreateByteField (BUFF, 0x22, SCC3)
                Store (Local0, SCC3)
                Store (\_SB.PCI0.IEEE.IBC0, Local0)
                CreateByteField (BUFF, 0x23, BCC3)
                Store (Local0, BCC3)
                Return (BUFF)
            }

            Method (VNTF, 1, NotSerialized)
            {
                And (Arg0, 0xFFFF, Local0)
                ShiftRight (Arg0, 0x10, Local1)
                If (LEqual (Local1, 0x01))
                {
                    Notify (\_PR.CPU0, Local0)
                }
            }

            Method (EHSS, 0, NotSerialized)
            {
                Name (BUFF, Buffer (0x20)
                {
                    0x07, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 
                    0x32, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 
                    0x03, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 
                    0x3C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00
                })
                If (LNot (LEqual (\_SB.MEM.MSP0, 0x00)))
                {
                    CreateWordField (BUFF, 0x00, INF0)
                    CreateDWordField (BUFF, 0x04, SSP0)
                    CreateDWordField (BUFF, 0x08, SSP1)
                    CreateDWordField (BUFF, 0x0C, SSCH)
                    CreateDWordField (BUFF, 0x10, SSCL)
                    CreateDWordField (BUFF, 0x14, SSSI)
                    CreateDWordField (BUFF, 0x18, SSS0)
                    CreateDWordField (BUFF, 0x1C, SSR0)
                    Divide (SizeOf (BUFF), 0x04, Local1, Local0)
                    Decrement (Local0)
                    Store (Local0, INF0)
                    Store (\_SB.MEM.MSP0, SSP0)
                    Store (\_SB.MEM.MSP1, SSP1)
                    Store (\_SB.MEM.MSC0, SSCH)
                    Store (\_SB.MEM.MSC1, SSCL)
                    Store (\_SB.MEM.MSSI, SSSI)
                    Store (\_SB.MEM.MSSS, SSS0)
                    Store (\_SB.MEM.MSSR, SSR0)
                }

                Return (BUFF)
            }
        }
    }

    Scope (\_TZ)
    {
        PowerResource (PFAN, 0x00, 0x0000)
        {
            Method (_STA, 0, NotSerialized)
            {
                SMBR (0xFA00, 0x2201, 0x00, 0x00, 0xB2)
                If (\_SB.MEM.OECX)
                {
                    Return (One)
                }
                Else
                {
                    Return (0x00)
                }
            }

            Method (_ON, 0, Serialized)
            {
                SMBR (0xFA00, 0x2200, 0xFF, 0x00, 0xB2)
            }

            Method (_OFF, 0, Serialized)
            {
                SMBR (0xFA00, 0x2200, 0x00, 0x00, 0xB2)
            }
        }

        Device (FAN)
        {
            Name (_HID, EisaId ("PNP0C0B"))
            Name (_PR0, Package (0x01)
            {
                \_TZ.PFAN
            })
        }

        ThermalZone (THRM)
        {
            Method (_TMP, 0, NotSerialized)
            {
                If (LNot (LGreater (\_SB.MEM.TMP1, 0x0B4C)))
                {
                    Store (0x0B4C, \_SB.MEM.AST1)
                    Return (0x0B4C)
                }
                Else
                {
                    Store (\_SB.MEM.TMP1, \_SB.MEM.AST1)
                    Return (\_SB.MEM.TMP1)
                }
            }

            Method (_AC0, 0, NotSerialized)
            {
                Return (\_SB.MEM.AC01)
            }

            Method (_AC1, 0, NotSerialized)
            {
                Return (\_SB.MEM.AC11)
            }

            Name (_AL0, Package (0x01)
            {
                \_TZ.FAN
            })
            Name (_AL1, Package (0x01)
            {
                \_TZ.FAN
            })
            Method (_PSV, 0, NotSerialized)
            {
                Return (\_SB.MEM.PSV1)
            }

            Name (_PSL, Package (0x01)
            {
                \_PR.CPU0
            })
            Method (_CRT, 0, NotSerialized)
            {
                Return (\_SB.MEM.CRT1)
            }

            Name (_TC1, 0x09)
            Name (_TC2, 0x02)
            Name (_TSP, 0x0708)
        }
    }

    Scope (\_GPE)
    {
        Method (_L08, 0, Serialized)
        {
            If (\_SB.MEM.GP72)
            {
                Store (0x00, \_SB.MEM.GP72)
                Notify (\_SB.PCI0.FNC0.COM, 0x02)
            }
        }

        Method (_L09, 0, Serialized)
        {
            If (LNot (LEqual (\_SB.PCI0.LAN.PLVI, 0xFFFF)))
            {
                And (\_SB.PCI0.LAN.PMES, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Notify (\_SB.PCI0.LAN, 0x02)
                }
            }

            While (LOr (\_SB.MEM.GP73, LOr (\_SB.MEM.GP74, LOr
(\_SB.MEM.GP75, LOr (\_SB.MEM.GP83, \_SB.MEM.BWUE))))) {
                If (\_SB.MEM.GP73)
                {
                    Store (0x00, \_SB.MEM.GP73)
                    Notify (\_SB.PCI0.ASND, 0x02)
                }

                If (\_SB.MEM.GP74)
                {
                    Store (0x00, \_SB.MEM.GP74)
                    Notify (\_SB.PCI0.FNC0.PCC0, 0x02)
                    Notify (\_SB.PCI0.VIY0, 0x02)
                    Notify (\_SB.PCI0.VIY1, 0x02)
                }

                If (\_SB.MEM.GP75)
                {
                    Store (0x00, \_SB.MEM.GP75)
                    Notify (\_SB.PCI0.USB1, 0x02)
                }

                If (\_SB.MEM.GP83)
                {
                    Store (0x00, \_SB.MEM.GP83)
                    Notify (\_SB.PCI0.LAN, 0x02)
                }

                If (\_SB.MEM.BWUE)
                {
                    Store (0x00, \_SB.MEM.BWUE)
                    Notify (\_SB.BT, 0x80)
                }
            }
        }

        Method (_L25, 0, Serialized)
        {
            Store (0xAF, \_SB.MEM.IEDI)
            SMBR (0xFF00, 0x0028B10B, 0x00, 0x00, 0xB2)
            While (LOr (\_SB.MEM.GP50, LOr (\_SB.MEM.GP51, LOr
(\_SB.MEM.GP52, LOr (\_SB.MEM.GP53, LOr (\_SB.MEM.GP54, LOr
(\_SB.MEM.GP60, LOr (\_SB.MEM.GP61, LOr (\_SB.MEM.GP62, LOr
(\_SB.MEM.GP63, LOr (\_SB.MEM.GP64, LOr (\_SB.MEM.GP66, LOr
(\_SB.MEM.GP70, LOr (\_SB.MEM.GP71, \_SB.MEM.BPFE)))))))))))))) { If
(\_SB.MEM.GP50) { Store (0x00, \_SB.MEM.GP50) Notify (\_SB.ADP1, 0x80)
                    Notify (\_PR.CPU0, 0x80)
                }

                If (\_SB.MEM.GP51)
                {
                    Store (0x00, \_SB.MEM.GP51)
                    If (LEqual (\_SB.MEM.BES2, \_SB.MEM.BT2F))
                    {
                        Notify (\_SB.BAT2, 0x80)
                    }
                    Else
                    {
                        Store (\_SB.MEM.BES2, \_SB.MEM.BT2F)
                        If (\_SB.MEM.BES2)
                        {
                            Notify (\_SB.BAT2, 0x00)
                        }
                        Else
                        {
                            Notify (\_SB.BAT2, 0x01)
                        }
                    }
                }

                If (\_SB.MEM.GP52)
                {
                    Store (0x00, \_SB.MEM.GP52)
                    If (LEqual (\_SB.MEM.BES1, \_SB.MEM.BT1F))
                    {
                        Notify (\_SB.BAT1, 0x80)
                    }
                    Else
                    {
                        Store (\_SB.MEM.BES1, \_SB.MEM.BT1F)
                        If (\_SB.MEM.BES1)
                        {
                            Notify (\_SB.BAT1, 0x00)
                        }
                        Else
                        {
                            Notify (\_SB.BAT1, 0x01)
                        }
                    }
                }

                If (\_SB.MEM.GP53)
                {
                    Store (0x00, \_SB.MEM.GP53)
                    If (LNot (LEqual (\_SB.MEM.TMP1, \_SB.MEM.AST1)))
                    {
                        Notify (\_TZ.THRM, 0x80)
                    }
                }

                If (\_SB.MEM.GP54)
                {
                    Store (0x00, \_SB.MEM.GP54)
                    If (\_SB.MEM.LANA)
                    {
                        Store (0x00, \_SB.MEM.LANA)
                        Notify (\_SB.PCI0.LAN, 0x01)
                    }
                }

                If (\_SB.MEM.GP60)
                {
                    Store (0x00, \_SB.MEM.GP60)
                    SMBR (0x0136FA00, 0x05F3, 0x00, 0x00, 0xB2)
                    And (\_SB.MEM.OEAX, 0xFF00, Local0)
                    If (LOr (LAnd (LEqual (Local0, 0x00), LEqual
(\_SB.MEM.OECX, 0x00)), LNot (LEqual (Local0, 0x00)))) {
                        Notify (\_SB.PCI0.DOCK, 0x00)
                    }
                    Else
                    {
                        Notify (\_SB.VALG, 0x83)
                    }

                    Notify (\_PR.CPU0, 0x80)
                }

                If (\_SB.MEM.GP61)
                {
                    Signal (\_SB.PCI0.DKSQ)
                    Store (0x00, \_SB.MEM.GP61)
                    SMBR (0x0136FA00, 0x05F3, 0x00, 0x00, 0xB2)
                    And (\_SB.MEM.OEAX, 0xFF00, Local0)
                    If (LOr (LAnd (LEqual (Local0, 0x00), LEqual
(\_SB.MEM.OECX, 0x00)), LNot (LEqual (Local0, 0x00)))) {
                        Notify (\_SB.PCI0.DOCK, 0x00)
                    }
                    Else
                    {
                        Notify (\_SB.VALG, 0x83)
                    }

                    Notify (\_PR.CPU0, 0x80)
                }

                If (\_SB.MEM.GP62)
                {
                    Store (0x00, \_SB.MEM.GP62)
                    SMBR (0x0136FA00, 0x05F3, 0x00, 0x00, 0xB2)
                    And (\_SB.MEM.OEAX, 0xFF00, Local0)
                    If (LOr (LAnd (LEqual (Local0, 0x00), LEqual
(\_SB.MEM.OECX, 0x00)), LNot (LEqual (Local0, 0x00)))) {
                        Notify (\_SB.PCI0.DOCK, 0x01)
                    }
                    Else
                    {
                        Notify (\_SB.VALG, 0x82)
                    }
                }

                If (\_SB.MEM.GP63)
                {
                    Store (0x00, \_SB.MEM.GP63)
                    If (LEqual (\_SB.MEM.DCKF, 0x00))
                    {
                        Store (0x01, \_SB.MEM.DCKF)
                        SMBR (0x0136FA00, 0x05F3, 0x00, 0x00, 0xB2)
                        And (\_SB.MEM.OEAX, 0xFF00, Local0)
                        If (LOr (LAnd (LEqual (Local0, 0x00), LEqual
(\_SB.MEM.OECX, 0x00)), LNot (LEqual (Local0, 0x00)))) {
                            Notify (\_SB.PCI0.DOCK, 0x00)
                        }
                        Else
                        {
                            Notify (\_SB.VALG, 0x81)
                        }
                    }
                    Else
                    {
                        Signal (\_SB.PCI0.DKSQ)
                        Store (0x00, \_SB.MEM.DCKF)
                    }

                    Notify (\_PR.CPU0, 0x80)
                }

                If (\_SB.MEM.GP64)
                {
                    Store (0x00, \_SB.MEM.GP64)
                    If (\_SB.MEM.VALF)
                    {
                        Notify (\_SB.VALD, 0x80)
                    }
                    Else
                    {
                        If (\_SB.MEM.SBL0)
                        {
                            Store (0x00, \_SB.MEM.SBL0)
                            SMBR (0xFE00, 0x14, 0x00, 0x00, 0xB2)
                            Store (\_SB.MEM.OECX, \_SB.MEM.BDID)
                            If (LNot (LEqual (\_SB.MEM.OECX, 0x00)))
                            {
                                If (LEqual (\_SB.MEM.OECX, 0x01)) {}
                                Else
                                {
                                    If (LEqual (\_SB.MEM.OECX, 0x04)) {}
                                    Else
                                    {
                                        Notify (\_SB.PCI0.FNC1.IDE1,
0x03) }
                                }
                            }
                        }

                        If (\_SB.MEM.SBL1)
                        {
                            Store (0x00, \_SB.MEM.SBL1)
                            SMBR (0xFE00, 0x14, 0x00, 0x00, 0xB2)
                            If (LNot (LEqual (\_SB.MEM.OECX, 0x00)))
                            {
                                If (LEqual (\_SB.MEM.OECX, 0x01)) {}
                                Else
                                {
                                    If (LEqual (\_SB.MEM.OECX, 0x04)) {}
                                    Else
                                    {
                                        Notify (\_SB.PCI0.FNC1.IDE1,
0x00) Sleep (0x64)
                                        Notify (\_SB.PCI0.FNC1.IDE1,
0x01) }
                                }
                            }
                        }

                        If (\_SB.MEM.SBL2)
                        {
                            Store (0x00, \_SB.MEM.SBL2)
                            If (LNot (LEqual (\_SB.MEM.BDID, 0x00)))
                            {
                                If (LEqual (\_SB.MEM.BDID, 0x01)) {}
                                Else
                                {
                                    If (LEqual (\_SB.MEM.BDID, 0x04)) {}
                                    Else
                                    {
                                        Notify (\_SB.PCI0.FNC1.IDE1,
0x01) }
                                }
                            }
                        }

                        If (\_SB.MEM.SBL3)
                        {
                            Store (0x00, \_SB.MEM.SBL3)
                        }
                    }
                }

                If (\_SB.MEM.GP66)
                {
                    Store (0x00, \_SB.MEM.GP66)
                    SMBR (0xFE00, 0x14, 0x00, 0x00, 0xB2)
                    If (LNot (LEqual (\_SB.MEM.OECX, 0x00)))
                    {
                        If (LEqual (\_SB.MEM.OECX, 0x01)) {}
                        Else
                        {
                            If (LEqual (\_SB.MEM.OECX, 0x04))
                            {
                                Notify (\_SB.BAT2, 0x00)
                            }
                            Else
                            {
                                Notify (\_SB.PCI0.FNC1.IDE1, 0x00)
                                Sleep (0x64)
                                Notify (\_SB.PCI0.FNC1.IDE1, 0x01)
                            }
                        }
                    }
                }

                If (\_SB.MEM.GP70)
                {
                    Store (0x00, \_SB.MEM.GP70)
                    If (\_SB.MEM.VALF)
                    {
                        Notify (\_SB.VALD, 0x80)
                    }

                    If (LEqual (\_SB.MEM.HKCD, 0x3D))
                    {
                        TRAP (\_SB.MEM.HKCD)
                    }

                    If (LEqual (\_SB.MEM.DOS2, 0x00))
                    {
                        If (LEqual (\_SB.MEM.HKCD, 0x3F))
                        {
                            If (LEqual (\_SB.MEM.TNVS, 0x00))
                            {
                                Notify (\_SB.PCI0.PCI1.VGA, 0x80)
                            }
                        }
                    }
                }

                If (\_SB.MEM.GP71)
                {
                    Store (0x00, \_SB.MEM.GP71)
                    Notify (\_SB.LID, 0x80)
                }

                If (\_SB.MEM.BPFE)
                {
                    Store (0x00, \_SB.MEM.BPFE)
                    Notify (\_SB.BT, 0x90)
                }
            }
        }
    }

    Method (_PTS, 1, NotSerialized)
    {
        If (LOr (LOr (\_SB.MEM.VWE0, \_SB.MEM.VWE1), \_SB.MEM.VWE2))
        {
            Store (0x01, \_SB.MEM.WED2)
        }
        Else
        {
            Store (0x00, \_SB.MEM.WED2)
        }

        Store (\_SB.MEM.ACST, \_SB.MEM.ACBK)
        Store (0x01, \_SB.MEM.RPPC)
        If (LAnd (LNot (LLess (Arg0, 0x01)), LNot (LGreater (Arg0,
0x04)))) {
            Store (\_SB.MEM.EWLD, \_SB.MEM.PAR1)
            Store (0x60, \_SB.PCI0.FNC0.SYSR.TRP4)
        }

        And (Arg0, 0x07, Local0)
        Or (Local0, 0x2100, Local0)
        SMBR (0xFA00, Local0, 0x00, 0x00, 0xB2)
    }

    Method (_WAK, 1, NotSerialized)
    {
        And (Arg0, 0x07, Local0)
        Or (Local0, 0x2180, Local0)
        SMBR (0xFA00, Local0, 0x00, 0x00, 0xB2)
        Notify (\_SB.PCI0.FNC1.IDE1, 0x00)
        Store (0x00, \_SB.MEM.RDID)
        Store (0x00, \_SB.MEM.RDSN)
        Store (0x05, \_SB.PCI0.FNC0.SYSR.TRP4)
        If (LEqual (\_SB.MEM.PAR1, 0x00))
        {
            If (LEqual (0x1B51F351, \_SB.MEM.RDID))
            {
                If (LOr (LNot (LEqual (\_SB.MEM.RDID, \_SB.MEM.DLID)),
LNot (LEqual (\_SB.MEM.RDSN, \_SB.MEM.DSRN)))) {
                    SMBR (0x0136FA00, 0x05F3, 0x00, 0x00, 0xB2)
                    And (\_SB.MEM.OEAX, 0xFF00, Local0)
                    If (LOr (LAnd (LEqual (Local0, 0x00), LEqual
(\_SB.MEM.OECX, 0x00)), LNot (LEqual (Local0, 0x00)))) {
                        Notify (\_SB.PCI0.DOCK, 0x00)
                    }
                    Else
                    {
                        Notify (\_SB.VALG, 0x81)
                    }
                }
            }
        }
        Else
        {
            If (\_SB.MEM.DLID)
            {
                SMBR (0x0136FA00, 0x05F3, 0x00, 0x00, 0xB2)
                And (\_SB.MEM.OEAX, 0xFF00, Local0)
                If (LOr (LAnd (LEqual (Local0, 0x00), LEqual
(\_SB.MEM.OECX, 0x00)), LNot (LEqual (Local0, 0x00)))) {
                    Notify (\_SB.PCI0.DOCK, 0x01)
                }
                Else
                {
                    Notify (\_SB.VALG, 0x83)
                }
            }
        }

        If (LEqual (\_SB.MEM.DOS2, 0x00))
        {
            If (LOr (LNot (LEqual (\_SB.MEM.CTLA, \_SB.MEM.NXLA)), LNot
(LEqual (\_SB.MEM.CTCA, \_SB.MEM.NXCA)))) {
                Notify (\_SB.PCI0.PCI1.VGA, 0x80)
            }
            Else
            {
                If (LNot (LEqual (\_SB.MEM.CTTA, \_SB.MEM.NXTA)))
                {
                    Notify (\_SB.PCI0.PCI1.VGA, 0x80)
                }
            }
        }

        DIS (0x14)
        SMBR (0xFF00, 0x1E, 0x01, 0x00, 0xB2)
        If (LNot (LGreater (\_SB.MEM.OSID, 0x03)))
        {
            While (LEqual (\_SB.MEM.KBCR, 0x00)) {}
        }

        Store (0x01, \_SB.MEM.PAR1)
        Store (0x60, \_SB.PCI0.FNC0.SYSR.TRP4)
        If (LNot (LEqual (\_SB.MEM.ACST, \_SB.MEM.ACBK)))
        {
            If (LNot (LEqual (\_SB.MEM.RPPC, 0x01)))
            {
                Notify (\_PR.CPU0, 0x80)
            }
        }

        Name (BUFF, Package (0x02)
        {
            0x00, 
            0x01
        })
        If (LEqual (\_SB.MEM.ACST, 0x00))
        {
            And (\_SB.MEM.BST1, 0x04, Local0)
            If (LEqual (Local0, 0x04))
            {
                Store (0x01, Index (BUFF, 0x00))
            }
        }

        Return (BUFF)
    }

    Method (TRAP, 1, NotSerialized)
    {
        Add (Arg0, 0x12340000, Debug)
    }

    Method (SMBR, 5, NotSerialized)
    {
        Store (Arg0, \_SB.MEM.IEAX)
        Store (Arg1, \_SB.MEM.IEBX)
        Store (Arg2, \_SB.MEM.IECX)
        Store (Arg3, \_SB.MEM.IEDX)
        Store (Arg4, \_SB.PCI0.FNC0.SYSR.TRP4)
    }

    Method (STA, 1, NotSerialized)
    {
        Store (Arg0, \_SB.MEM.PAR1)
        Store (0x00, \_SB.MEM.PAR2)
        Store (0x00, \_SB.MEM.PAR3)
        Store (0x00, \_SB.MEM.PAR4)
        Store (0x00, \_SB.MEM.PAR5)
        Store (0x00, \_SB.MEM.PAR6)
        Store (0x01, \_SB.PCI0.FNC0.SYSR.TRP4)
        Return (\_SB.MEM.PAR4)
    }

    Method (CRS, 1, NotSerialized)
    {
        Store (Arg0, \_SB.MEM.PAR1)
        Store (0x00, \_SB.MEM.PAR2)
        Store (0x00, \_SB.MEM.PAR3)
        Store (0x00, \_SB.MEM.PAR4)
        Store (0x00, \_SB.MEM.PAR5)
        Store (0x00, \_SB.MEM.PAR6)
        Store (0x01, \_SB.PCI0.FNC0.SYSR.TRP4)
        If (LEqual (\_SB.MEM.PAR3, 0x00))
        {
            Return (ResourceTemplate ()
            {
            })
        }

        Name (BUFF, Buffer (\_SB.MEM.PAR3) {})
        Store (\_SB.MEM.PRES, BUFF)
        Return (BUFF)
    }

    Method (PRS, 1, NotSerialized)
    {
        Store (Arg0, \_SB.MEM.PAR1)
        Store (0x01, \_SB.MEM.PAR2)
        Store (0x00, \_SB.MEM.PAR3)
        Store (0x00, \_SB.MEM.PAR4)
        Store (0x00, \_SB.MEM.PAR5)
        Store (0x00, \_SB.MEM.PAR6)
        Store (0x01, \_SB.PCI0.FNC0.SYSR.TRP4)
        If (LEqual (\_SB.MEM.PAR3, 0x00))
        {
            Return (ResourceTemplate ()
            {
            })
        }

        Name (BUFF, Buffer (\_SB.MEM.PAR3) {})
        Store (\_SB.MEM.PRES, BUFF)
        Return (BUFF)
    }

    Method (SRS, 2, NotSerialized)
    {
        Store (Arg0, \_SB.MEM.PAR1)
        Store (0x00, \_SB.MEM.PAR2)
        Store (0x00, \_SB.MEM.PAR3)
        Store (0x00, \_SB.MEM.PAR4)
        Store (0x00, \_SB.MEM.PAR5)
        Store (0x00, \_SB.MEM.PAR6)
        Store (Arg1, \_SB.MEM.PRES)
        Store (0x02, \_SB.PCI0.FNC0.SYSR.TRP4)
    }

    Method (DIS, 1, NotSerialized)
    {
        Store (Arg0, \_SB.MEM.PAR1)
        Store (0x00, \_SB.MEM.PAR2)
        Store (0x00, \_SB.MEM.PAR3)
        Store (0x00, \_SB.MEM.PAR4)
        Store (0x00, \_SB.MEM.PAR5)
        Store (0x00, \_SB.MEM.PAR6)
        Store (0x03, \_SB.PCI0.FNC0.SYSR.TRP4)
    }

    Method (PS0, 1, NotSerialized)
    {
        Store (0x00, \_SB.MEM.IESI)
        SMBR (0xFE00, 0x23, Arg0, 0x00, 0xB2)
        If (LEqual (\_SB.MEM.OEAX, 0x00))
        {
            Store (0x00, \_SB.MEM.IESI)
            SMBR (0xFF00, 0x23, Arg0, 0x00, 0xB2)
            WPSX (Arg0, 0x00, 0x00, 0x00)
        }
    }

    Method (PS3, 1, NotSerialized)
    {
        Store (0x00, \_SB.MEM.IESI)
        SMBR (0xFE00, 0x23, Arg0, 0x00, 0xB2)
        If (LEqual (\_SB.MEM.OEAX, 0x00))
        {
            Store (0x00, \_SB.MEM.IESI)
            SMBR (0xFF00, 0x23, Arg0, 0x03, 0xB2)
            WPSX (Arg0, 0x00, 0x00, 0x03)
        }
    }

    Method (WPSX, 4, NotSerialized)
    {
        Store (Arg1, \_SB.MEM.IESI)
        Store (Arg2, \_SB.MEM.IEDI)
        SMBR (0xFE00, 0x23, Arg0, 0x00, 0xB2)
        While (LNot (LEqual (\_SB.MEM.OECX, 0x00)))
        {
            Store (Arg1, \_SB.MEM.IESI)
            Store (Arg2, \_SB.MEM.IEDI)
            SMBR (0xFE00, 0x23, Arg0, 0x00, 0xB2)
        }
    }

    Method (PSC, 1, NotSerialized)
    {
        Store (0x00, \_SB.MEM.IESI)
        SMBR (0xFE00, 0x23, Arg0, 0x00, 0xB2)
        Return (\_SB.MEM.OEDX)
    }

    Method (CMPS, 2, NotSerialized)
    {
        If (LEqual (SizeOf (Arg0), SizeOf (Arg1)))
        {
            Return (One)
        }
        Else
        {
            Return (Zero)
        }
    }

    Method (STAL, 1, NotSerialized)
    {
        If (LEqual (Arg0, 0x00))
        {
            Return (0x09)
        }
        Else
        {
            Return (0x0B)
        }
    }

    Method (CRSL, 1, NotSerialized)
    {
        Name (IRQB, ResourceTemplate ()
        {
            IRQ (Level, ActiveLow, Shared) {}
        })
        CreateWordField (IRQB, 0x01, INTX)
        If (LNot (LEqual (Arg0, 0x00)))
        {
            Name (IRQT, Package (0x10)
            {
                0x00, 
                0x0200, 
                0x08, 
                0x0400, 
                0x10, 
                0x20, 
                0x80, 
                0x40, 
                0x02, 
                0x0800, 
                0x00, 
                0x1000, 
                0x00, 
                0x4000, 
                0x00, 
                0x8000
            })
            Store (DerefOf (Index (IRQT, Arg0)), Local0)
            Store (Local0, INTX)
        }

        Return (IRQB)
    }

    Mutex (MTEX, 0x00)
}

-- 
Russell A. Jackson <raj_at_csub.edu>
"I dread success.  To have succeeded is to have finished one's business
on earth, like the male spider, who is killed by the female the moment
he has succeeded in his courtship.  I like a state of continual
becoming, with a goal in front and not behind."
		-- George Bernard Shaw
Received on Fri Dec 16 2005 - 19:21:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:49 UTC