Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2010 21:56:20 +0800
From:      Wei Yang Tan <hallucinator7@hotmail.com>
To:        <freebsd-acpi@freebsd.org>
Subject:   Errors encountered when performing hibernate / suspend
Message-ID:  <COL115-W50112BC1B4B4AE111E6876E8FC0@phx.gbl>

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

[-- Attachment #1 --]

Hi!


First, thank you very much for your help. I am very new to FreeBSD, so do bear with me for a while. Anyway, the problem is as follows:


Whenever I tried to hibernate, it will not be successful and I get the following error at my ~/.xession-error file:


** Message: xfsm-shutdown-helper.c:268: Using HAL to shutdown/reboot the computer.
** Message: xfsm-shutdown-helper.c:268: Using HAL to shutdown/reboot the computer.

** (xfce4-session:1124): WARNING **: xfsm-shutdown-helper.c:234: Failed to contact HAL: No back-end for your operating system



When I tried to suspend, it will not be successful and I will get the error message at my ~/.xession-error file:


** Message: xfsm-shutdown-helper.c:268: Using HAL to shutdown/reboot the computer.
** Message: xfsm-shutdown-helper.c:268: Using HAL to shutdown/reboot the computer.
thunar-volman: No property info.capabilities on device with id /org/freedesktop/Hal/devices/usb_device_45e_83_noserial.



I read the Handbook and I thought it may help by trying out the command "acpiconf -s1". Of course it is not successful and the error message ar ~/.xsession-error is:


** Message: xfsm-shutdown-helper.c:268: Using HAL to shutdown/reboot the computer.
** Message: xfsm-shutdown-helper.c:268: Using HAL to shutdown/reboot the computer.
thunar-volman: No property info.capabilities on device with id /org/freedesktop/Hal/devices/usb_device_45e_83_noserial.




while the following is my "dmesg" output:


Copyright (c) 1992-2009 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 is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009
    root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel Pentium III (996.77-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x68a  Stepping = 10
  Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
real memory  = 537395200 (512 MB)
avail memory = 510431232 (486 MB)
ACPI APIC Table: <COMPAQ SOLANO  >
ioapic0: Changing APIC ID to 8
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <COMPAQ CPQ0005> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, 1ff00000 (3) failed
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xf808-0xf80b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82815 (i815 GMCH) host to PCI bridge> on hostb0
pcib1: <PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
vgapci0: <VGA-compatible display> mem 0x41000000-0x41ffffff,0x44000000-0x45ffffff irq 18 at device 0.0 on pci1
pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci2: <ACPI PCI bus> on pcib2
fxp0: <Intel 82801BA/CAM (ICH2/3) Pro/100 Ethernet> port 0x1000-0x103f mem 0x40000000-0x40000fff irq 20 at device 8.0 on pci2
miibus0: <MII bus> on fxp0
inphy0: <i82562EM 10/100 media interface> PHY 1 on miibus0
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:02:a5:94:97:26
fxp0: [ITHREAD]
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH2 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x2460-0x246f at device 31.1 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci0
ata1: [ITHREAD]
uhci0: <Intel 82801BA/BAM (ICH2) USB controller USB-B> port 0x2440-0x245f irq 23 at device 31.4 on pci0
uhci0: [ITHREAD]
uhci0: LegSup = 0x0030
usbus0: <Intel 82801BA/BAM (ICH2) USB controller USB-B> on uhci0
pcm0: <Intel ICH2 (82801BA)> port 0x2000-0x20ff,0x2400-0x243f irq 17 at device 31.5 on pci0
pcm0: [ITHREAD]
pcm0: <Analog Devices AD1885 AC97 Codec>
acpi_button0: <Power Button> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 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]
atkbd0: [ITHREAD]
ppc0: <Parallel port> port 0x378-0x37f,0x778-0x77d irq 7 drq 3 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/13 bytes threshold
ppc0: [ITHREAD]
ppbus0: <Parallel port bus> on ppc0
ppbus0: IEEE1284 device found /NIBBLE
ppbus0: Probing for PnP devices:
ppbus0: <Canon S400SP/1.06> PRINTER BJL,BJRaster3,BSCC,TXT01,BJScan2
plip0: <PLIP network interface> on ppbus0
plip0: [ITHREAD]
lpt0: <Printer> on ppbus0
lpt0: [ITHREAD]
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
uart1: [FILTER]
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FILTER]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
cpu0: <ACPI CPU> on acpi0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
pmtimer0 on isa0
orm0: <ISA Option ROM> at iomem 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
Timecounter "TSC" frequency 996770364 Hz quality 800
Timecounters tick every 1.000 msec
usbus0: 12Mbps Full Speed USB v1.0
ad0: 39205MB <Maxtor 6E040L0 NAR61HA0> at ata0-master UDMA100
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
acd0: CDROM <LTN486S/YQS8> at ata1-master PIO4
pcm0: measured ac97 link rate at 55945 Hz
uhub0: 2 ports with 2 removable, self powered
Root mount waiting for: usbus0
ugen0.2: <Microsoft> at usbus0
ums0: <Microsoft Basic Optical Mouse, class 0/0, rev 1.10/0.00, addr 2> on usbus0
ums0: 3 buttons and [XYZ] coordinates ID=0
Trying to mount root from ufs:/dev/ad0s1a
acd0: FAILURE - READ_BIG ILLEGAL REQUEST asc=0x64 ascq=0x00 
acd0: FAILURE - unknown CMD (0x03) ILLEGAL REQUEST asc=0x20 ascq=0x00 
acd0: FAILURE - READ_DISK_INFO ILLEGAL REQUEST asc=0x20 ascq=0x00 
acd0: FAILURE - READ_DISK_INFO ILLEGAL REQUEST asc=0x20 ascq=0x00 
acpi0: AcpiEnterSleepState failed - AE_BAD_ADDRESS
wakeup from sleeping state (slept 00:00:03)
ugen0.2: <Microsoft> at usbus0 (disconnected)
ums0: at uhub0, port 2, addr 2 (disconnected)
ugen0.2: <Microsoft> at usbus0
ums0: <Microsoft Basic Optical Mouse, class 0/0, rev 1.10/0.00, addr 2> on usbus0
ums0: 3 buttons and [XYZ] coordinates ID=0





The output of "sysctl hw.acpi":


hw.acpi.supported_sleep_state: S1 S3 S4 S5
hw.acpi.power_button_state: S5
hw.acpi.sleep_button_state: S1
hw.acpi.lid_switch_state: NONE
hw.acpi.standby_state: S1
hw.acpi.suspend_state: S3
hw.acpi.sleep_delay: 1
hw.acpi.s4bios: 0
hw.acpi.verbose: 0
hw.acpi.disable_on_reboot: 0
hw.acpi.handle_reboot: 0
hw.acpi.reset_video: 0
hw.acpi.cpu.cx_lowest: C1





I am using FreeBSD 8.0 and Xfce desktop environment (Thunar is the file manager). For hardware, I am using Pentium III; Compaq Deskpro EN.

I am not sure if all these information are sufficient; do let me know if you need more information. Once again, thank you very much for your help.



WY









 		 	   		  
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969
[-- Attachment #2 --]
/*
  RSD PTR: OEM=COMPAQ, ACPI_Rev=1.0x (0)
	RSDT=0x000e0080, cksum=146
 */
/*
  RSDT: Length=76, Revision=1, Checksum=104,
	OEMID=COMPAQ, OEM Table ID=CPQ0005, OEM Revision=0x20010405,
	Creator ID=, Creator Revision=0x0
	Entries={ 0x000e0130, 0x000e136c, 0x000e14e0, 0x000e01a4, 0x000e3277, 0x000e2a8b, 0x000e2c1f, 0x000e2e83, 0x000e2d51, 0x000e307d }
 */
/*
  FACP: Length=116, Revision=1, Checksum=81,
	OEMID=COMPAQ, OEM Table ID=SOLANO, OEM Revision=0x1,
	Creator ID=, Creator Revision=0x0
 	FACS=0xe0040, DSDT=0xe0204
	INT_MODEL=APIC
	Preferred_PM_Profile=Unspecified (0)
	SCI_INT=9
	SMI_CMD=0xb2, ACPI_ENABLE=0x8a, ACPI_DISABLE=0x8b, S4BIOS_REQ=0x0
	PSTATE_CNT=0x0
	PM1a_EVT_BLK=0xf800-0xf803
	PM1a_CNT_BLK=0xf804-0xf805
	PM1b_CNT_BLK=0x460-0x461
	PM_TMR_BLK=0xf808-0xf80b
	GPE0_BLK=0xf828-0xf82b
	P_LVL2_LAT=101 us, P_LVL3_LAT=1001 us
	FLUSH_SIZE=16384, FLUSH_STRIDE=32
	DUTY_OFFSET=1, DUTY_WIDTH=3
	DAY_ALRM=13, MON_ALRM=0, CENTURY=50
	IAPC_BOOT_ARCH=
	Flags={WBINVD,PROC_C1,SLP_BUTTON,RTC_S4}
 */
/*
  FACS:	Length=64, HwSig=0x00000000, Firm_Wake_Vec=0x00001000
	Global_Lock=
	Flags=
	Version=0
 */
/*
  DSDT: Length=4456, Revision=1, Checksum=152,
	OEMID=COMPAQ, OEM Table ID=DSDT, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
  SSDT: Length=372, Revision=1, Checksum=218,
	OEMID=COMPAQ, OEM Table ID=CORE_UTL, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
  SSDT: Length=3744, Revision=1, Checksum=42,
	OEMID=COMPAQ, OEM Table ID=VILLTBL1, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
  APIC: Length=96, Revision=1, Checksum=156,
	OEMID=COMPAQ, OEM Table ID=SOLANO, OEM Revision=0x1,
	Creator ID=, Creator Revision=0x0
	Local APIC ADDR=0xfee00000
	Flags={PC-AT}

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

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

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

	Type=INT Override
	BUS=0
	IRQ=9
	INTR=9
	Flags={Polarity=active-hi, Trigger=level}

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

	Type=Local NMI
	ACPI CPU=2
	LINT Pin=1
	Flags={Polarity=active-hi, Trigger=edge}
 */
/*
  SSDT: Length=118, Revision=1, Checksum=94,
	OEMID=COMPAQ, OEM Table ID=APIC, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
  SSDT: Length=404, Revision=1, Checksum=203,
	OEMID=COMPAQ, OEM Table ID=S3, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
  SSDT: Length=306, Revision=1, Checksum=239,
	OEMID=COMPAQ, OEM Table ID=PIDETM, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
  SSDT: Length=253, Revision=1, Checksum=202,
	OEMID=COMPAQ, OEM Table ID=GTF0, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
  SSDT: Length=306, Revision=1, Checksum=167,
	OEMID=COMPAQ, OEM Table ID=SIDETM, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
  SSDT: Length=253, Revision=1, Checksum=54,
	OEMID=COMPAQ, OEM Table ID=GTF2, OEM Revision=0x1,
	Creator ID=MSFT, Creator Revision=0x100000d
 */
/*
 * Intel ACPI Component Architecture
 * AML Disassembler version 20090521
 *
 * Disassembly of /tmp/acpidump.yJBv50, Thu May 13 21:25:26 2010
 *
 *
 * Original Table Header:
 *     Signature        "DSDT"
 *     Length           0x000026C4 (9924)
 *     Revision         0x01 **** ACPI 1.0, no 64-bit math support
 *     Checksum         0xD7
 *     OEM ID           "COMPAQ"
 *     OEM Table ID     "DSDT"
 *     OEM Revision     0x00000001 (1)
 *     Compiler ID      "MSFT"
 *     Compiler Version 0x0100000D (16777229)
 */
DefinitionBlock ("/tmp/acpidump.aml", "DSDT", 1, "COMPAQ", "DSDT", 0x00000001)
{
    Name (\PICM, Zero)
    Method (\_PIC, 1, NotSerialized)
    {
        Store (Arg0, \PICM)
    }

    Scope (\_SB)
    {
        Device (LNKA)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x01)
            Name (CRES, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, _Y00)
                    {11}
            })
            Method (_STA, 0, NotSerialized)
            {
                And (\_SB.PCI0.LPC.PIRA, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x09)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Method (_DIS, 0, NotSerialized)
            {
                Or (\_SB.PCI0.LPC.PIRA, 0x80, \_SB.PCI0.LPC.PIRA)
            }

            Name (_PRS, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, )
                    {3,4,5,6,7,10,11}
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.LNKA._Y00._INT, IRQW)
                And (\_SB.PCI0.LPC.PIRA, 0x0F, Local0)
                Store (One, Local1)
                ShiftLeft (Local1, Local0, IRQW)
                Return (CRES)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRQW)
                And (\_SB.PCI0.LPC.PIRA, 0x70, Local0)
                Store (Zero, Local1)
                FindSetLeftBit (IRQW, Local1)
                Or (Local0, Decrement (Local1), \_SB.PCI0.LPC.PIRA)
            }
        }

        Device (LNKB)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x02)
            Name (CRES, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, _Y01)
                    {11}
            })
            Method (_STA, 0, NotSerialized)
            {
                And (\_SB.PCI0.LPC.PIRB, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x09)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Method (_DIS, 0, NotSerialized)
            {
                Or (\_SB.PCI0.LPC.PIRB, 0x80, \_SB.PCI0.LPC.PIRB)
            }

            Name (_PRS, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, )
                    {3,4,5,6,7,10,11}
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.LNKB._Y01._INT, IRQW)
                And (\_SB.PCI0.LPC.PIRB, 0x0F, Local0)
                Store (One, Local1)
                ShiftLeft (Local1, Local0, IRQW)
                Return (CRES)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRQW)
                And (\_SB.PCI0.LPC.PIRB, 0x70, Local0)
                Store (Zero, Local1)
                FindSetLeftBit (IRQW, Local1)
                Or (Local0, Decrement (Local1), \_SB.PCI0.LPC.PIRB)
            }
        }

        Device (LNKC)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x03)
            Name (CRES, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, _Y02)
                    {11}
            })
            Method (_STA, 0, NotSerialized)
            {
                And (\_SB.PCI0.LPC.PIRC, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x09)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Method (_DIS, 0, NotSerialized)
            {
                Or (\_SB.PCI0.LPC.PIRC, 0x80, \_SB.PCI0.LPC.PIRC)
            }

            Name (_PRS, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, )
                    {3,4,5,6,7,10,11}
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.LNKC._Y02._INT, IRQW)
                And (\_SB.PCI0.LPC.PIRC, 0x0F, Local0)
                Store (One, Local1)
                ShiftLeft (Local1, Local0, IRQW)
                Return (CRES)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRQW)
                And (\_SB.PCI0.LPC.PIRC, 0x70, Local0)
                Store (Zero, Local1)
                FindSetLeftBit (IRQW, Local1)
                Or (Local0, Decrement (Local1), \_SB.PCI0.LPC.PIRC)
            }
        }

        Device (LNKD)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x04)
            Name (CRES, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, _Y03)
                    {11}
            })
            Method (_STA, 0, NotSerialized)
            {
                And (\_SB.PCI0.LPC.PIRD, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x09)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Method (_DIS, 0, NotSerialized)
            {
                Or (\_SB.PCI0.LPC.PIRD, 0x80, \_SB.PCI0.LPC.PIRD)
            }

            Name (_PRS, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, )
                    {3,4,5,6,7,10,11}
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.LNKD._Y03._INT, IRQW)
                And (\_SB.PCI0.LPC.PIRD, 0x0F, Local0)
                Store (One, Local1)
                ShiftLeft (Local1, Local0, IRQW)
                Return (CRES)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRQW)
                And (\_SB.PCI0.LPC.PIRD, 0x70, Local0)
                Store (Zero, Local1)
                FindSetLeftBit (IRQW, Local1)
                Or (Local0, Decrement (Local1), \_SB.PCI0.LPC.PIRD)
            }
        }

        Device (LNKE)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x05)
            Name (CRES, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, _Y04)
                    {11}
            })
            Method (_STA, 0, NotSerialized)
            {
                And (\_SB.PCI0.LPC.PIRE, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x09)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Method (_DIS, 0, NotSerialized)
            {
                Or (\_SB.PCI0.LPC.PIRE, 0x80, \_SB.PCI0.LPC.PIRE)
            }

            Name (_PRS, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, )
                    {3,4,5,6,7,10,11}
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.LNKE._Y04._INT, IRQW)
                And (\_SB.PCI0.LPC.PIRE, 0x0F, Local0)
                Store (One, Local1)
                ShiftLeft (Local1, Local0, IRQW)
                Return (CRES)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRQW)
                And (\_SB.PCI0.LPC.PIRE, 0x70, Local0)
                Store (Zero, Local1)
                FindSetLeftBit (IRQW, Local1)
                Or (Local0, Decrement (Local1), \_SB.PCI0.LPC.PIRE)
            }
        }

        Device (LNKF)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x06)
            Name (CRES, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, _Y05)
                    {11}
            })
            Method (_STA, 0, NotSerialized)
            {
                And (\_SB.PCI0.LPC.PIRF, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x09)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Method (_DIS, 0, NotSerialized)
            {
                Or (\_SB.PCI0.LPC.PIRF, 0x80, \_SB.PCI0.LPC.PIRF)
            }

            Name (_PRS, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, )
                    {3,4,5,6,7,10,11}
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.LNKF._Y05._INT, IRQW)
                And (\_SB.PCI0.LPC.PIRF, 0x0F, Local0)
                Store (One, Local1)
                ShiftLeft (Local1, Local0, IRQW)
                Return (CRES)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRQW)
                And (\_SB.PCI0.LPC.PIRF, 0x70, Local0)
                Store (Zero, Local1)
                FindSetLeftBit (IRQW, Local1)
                Or (Local0, Decrement (Local1), \_SB.PCI0.LPC.PIRF)
            }
        }

        Device (LNKG)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x07)
            Name (CRES, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, _Y06)
                    {11}
            })
            Method (_STA, 0, NotSerialized)
            {
                And (\_SB.PCI0.LPC.PIRG, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x09)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Method (_DIS, 0, NotSerialized)
            {
                Or (\_SB.PCI0.LPC.PIRG, 0x80, \_SB.PCI0.LPC.PIRG)
            }

            Name (_PRS, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, )
                    {3,4,5,6,7,10,11}
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.LNKG._Y06._INT, IRQW)
                And (\_SB.PCI0.LPC.PIRG, 0x0F, Local0)
                Store (One, Local1)
                ShiftLeft (Local1, Local0, IRQW)
                Return (CRES)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRQW)
                And (\_SB.PCI0.LPC.PIRG, 0x70, Local0)
                Store (Zero, Local1)
                FindSetLeftBit (IRQW, Local1)
                Or (Local0, Decrement (Local1), \_SB.PCI0.LPC.PIRG)
            }
        }

        Device (LNKH)
        {
            Name (_HID, EisaId ("PNP0C0F"))
            Name (_UID, 0x08)
            Name (CRES, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, _Y07)
                    {11}
            })
            Method (_STA, 0, NotSerialized)
            {
                And (\_SB.PCI0.LPC.PIRH, 0x80, Local0)
                If (LEqual (Local0, 0x80))
                {
                    Return (0x09)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Method (_DIS, 0, NotSerialized)
            {
                Or (\_SB.PCI0.LPC.PIRH, 0x80, \_SB.PCI0.LPC.PIRH)
            }

            Name (_PRS, ResourceTemplate ()
            {
                IRQ (Level, ActiveLow, Shared, )
                    {3,4,5,6,7,10,11}
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.LNKH._Y07._INT, IRQW)
                And (\_SB.PCI0.LPC.PIRH, 0x0F, Local0)
                Store (One, Local1)
                ShiftLeft (Local1, Local0, IRQW)
                Return (CRES)
            }

            Method (_SRS, 1, NotSerialized)
            {
                CreateWordField (Arg0, 0x01, IRQW)
                And (\_SB.PCI0.LPC.PIRH, 0x70, Local0)
                Store (Zero, Local1)
                FindSetLeftBit (IRQW, Local1)
                Or (Local0, Decrement (Local1), \_SB.PCI0.LPC.PIRH)
            }
        }
    }

    Scope (\_SB)
    {
        Device (PCI0)
        {
            Name (_HID, EisaId ("PNP0A03"))
            Name (_ADR, 0x00)
            Name (_PRW, Package (0x02)
            {
                0x0B, 
                0x04
            })
            Method (_S1D, 0, NotSerialized)
            {
                Return (One)
            }

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

            Method (_S5D, 0, NotSerialized)
            {
                Return (One)
            }

            Method (_INI, 0, NotSerialized)
            {
                \OSFG ()
            }

            Name (CRES, ResourceTemplate ()
            {
                WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
                    0x0000,             // Granularity
                    0x0000,             // Range Minimum
                    0x00FF,             // Range Maximum
                    0x0000,             // Translation Offset
                    0x0100,             // Length
                    ,, )
                IO (Decode16,
                    0x0CF8,             // Range Minimum
                    0x0CF8,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    )
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x0000,             // Granularity
                    0x0000,             // Range Minimum
                    0x0CF7,             // Range Maximum
                    0x0000,             // Translation Offset
                    0x0CF8,             // Length
                    ,, , TypeStatic)
                WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                    0x0000,             // Granularity
                    0x0D00,             // Range Minimum
                    0xFFFF,             // Range Maximum
                    0x0000,             // Translation Offset
                    0xF300,             // Length
                    ,, , TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x000A0000,         // Range Minimum
                    0x000BFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00020000,         // Length
                    ,, , AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x000C8000,         // Range Minimum
                    0x000DFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0x00018000,         // Length
                    ,, , AddressRangeMemory, TypeStatic)
                DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                    0x00000000,         // Granularity
                    0x04000000,         // Range Minimum
                    0xFEBFFFFF,         // Range Maximum
                    0x00000000,         // Translation Offset
                    0xFAC00000,         // Length
                    ,, _Y08, AddressRangeMemory, TypeStatic)
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateDWordField (CRES, \_SB.PCI0._Y08._MIN, RAMT)
                CreateDWordField (CRES, \_SB.PCI0._Y08._LEN, PCIT)
                Add (MLEN (), 0x00100000, RAMT)
                Subtract (0xFEC00000, RAMT, PCIT)
                Return (CRES)
            }

            Method (_PRT, 0, NotSerialized)
            {
                If (LEqual (\PICM, Zero))
                {
                    Return (Package (0x07)
                    {
                        Package (0x04)
                        {
                            0x001FFFFF, 
                            0x01, 
                            \_SB.LNKB, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x001FFFFF, 
                            0x02, 
                            \_SB.LNKH, 
                            0x00
                        }, 

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

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

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

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

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

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

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

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

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

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

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

    Scope (\_SB.PCI0)
    {
        Device (HUB)
        {
            Name (_ADR, 0x001E0000)
            Name (_PRW, Package (0x02)
            {
                0x0B, 
                0x04
            })
            Method (_S1D, 0, NotSerialized)
            {
                Return (One)
            }

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

            Method (_S5D, 0, NotSerialized)
            {
                Return (One)
            }

            Method (_PRT, 0, NotSerialized)
            {
                If (LEqual (\PICM, Zero))
                {
                    Return (Package (0x16)
                    {
                        Package (0x04)
                        {
                            0x0004FFFF, 
                            0x00, 
                            \_SB.LNKA, 
                            0x00
                        }, 

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

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

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

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

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

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

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

                        Package (0x04)
                        {
                            0x000AFFFF, 
                            0x00, 
                            \_SB.LNKF, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x000AFFFF, 
                            0x01, 
                            \_SB.LNKG, 
                            0x00
                        }, 

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

                        Package (0x04)
                        {
                            0x000AFFFF, 
                            0x03, 
                            \_SB.LNKC, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x000BFFFF, 
                            0x00, 
                            \_SB.LNKG, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x000BFFFF, 
                            0x01, 
                            \_SB.LNKA, 
                            0x00
                        }, 

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

                        Package (0x04)
                        {
                            0x000BFFFF, 
                            0x03, 
                            \_SB.LNKF, 
                            0x00
                        }, 

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

                        Package (0x04)
                        {
                            0x000DFFFF, 
                            0x01, 
                            \_SB.LNKF, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x000DFFFF, 
                            0x02, 
                            \_SB.LNKG, 
                            0x00
                        }, 

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

                        Package (0x04)
                        {
                            0x0008FFFF, 
                            0x00, 
                            \_SB.LNKE, 
                            0x00
                        }, 

                        Package (0x04)
                        {
                            0x0006FFFF, 
                            0x00, 
                            \_SB.LNKE, 
                            0x00
                        }
                    })
                }
                Else
                {
                    Return (Package (0x16)
                    {
                        Package (0x04)
                        {
                            0x0004FFFF, 
                            0x00, 
                            0x00, 
                            0x10
                        }, 

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

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

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

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

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

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

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

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

                        Package (0x04)
                        {
                            0x000AFFFF, 
                            0x01, 
                            0x00, 
                            0x16
                        }, 

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

                        Package (0x04)
                        {
                            0x000AFFFF, 
                            0x03, 
                            0x00, 
                            0x12
                        }, 

                        Package (0x04)
                        {
                            0x000BFFFF, 
                            0x00, 
                            0x00, 
                            0x16
                        }, 

                        Package (0x04)
                        {
                            0x000BFFFF, 
                            0x01, 
                            0x00, 
                            0x10
                        }, 

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

                        Package (0x04)
                        {
                            0x000BFFFF, 
                            0x03, 
                            0x00, 
                            0x15
                        }, 

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

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

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

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

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

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

    Scope (\_SB.PCI0)
    {
        Device (LPC)
        {
            Name (_ADR, 0x001F0000)
            OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C)
            Field (PIRQ, ByteAcc, NoLock, Preserve)
            {
                PIRA,   8, 
                PIRB,   8, 
                PIRC,   8, 
                PIRD,   8, 
                        Offset (0x08), 
                PIRE,   8, 
                PIRF,   8, 
                PIRG,   8, 
                PIRH,   8
            }
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (NCP)
        {
            Name (_HID, EisaId ("PNP0C04"))
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x00F0,             // Range Minimum
                    0x00F0,             // Range Maximum
                    0x00,               // Alignment
                    0x10,               // Length
                    )
                IRQNoFlags ()
                    {13}
            })
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (PIC)
        {
            Name (_HID, EisaId ("PNP0000"))
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0020,             // Range Minimum
                    0x0020,             // Range Maximum
                    0x00,               // Alignment
                    0x0E,               // Length
                    )
                IO (Decode16,
                    0x0030,             // Range Minimum
                    0x0030,             // Range Maximum
                    0x00,               // Alignment
                    0x10,               // Length
                    )
                IO (Decode16,
                    0x00A0,             // Range Minimum
                    0x00A0,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IRQNoFlags ()
                    {2}
            })
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (TIME)
        {
            Name (_HID, EisaId ("PNP0100"))
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0040,             // Range Minimum
                    0x0040,             // Range Maximum
                    0x00,               // Alignment
                    0x04,               // Length
                    )
                IRQNoFlags ()
                    {0}
            })
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (IDMA)
        {
            Name (_HID, EisaId ("PNP0200"))
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0000,             // Range Minimum
                    0x0000,             // Range Maximum
                    0x00,               // Alignment
                    0x10,               // Length
                    )
                IO (Decode16,
                    0x0080,             // Range Minimum
                    0x0080,             // Range Maximum
                    0x00,               // Alignment
                    0x10,               // Length
                    )
                IO (Decode16,
                    0x00C0,             // Range Minimum
                    0x00C0,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                DMA (Compatibility, NotBusMaster, Transfer16, )
                    {4}
            })
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (RTC)
        {
            Name (_HID, EisaId ("PNP0B00"))
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0070,             // Range Minimum
                    0x0070,             // Range Maximum
                    0x00,               // Alignment
                    0x02,               // Length
                    )
                IRQNoFlags ()
                    {8}
            })
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (SPKR)
        {
            Name (_HID, EisaId ("PNP0800"))
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0061,             // Range Minimum
                    0x0061,             // Range Maximum
                    0x00,               // Alignment
                    0x01,               // Length
                    )
            })
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (PS2M)
        {
            Name (_HID, EisaId ("PNP0F13"))
            Name (_CID, EisaId ("PNP0F0E"))
            Name (_CRS, ResourceTemplate ()
            {
                IRQNoFlags ()
                    {12}
            })
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (KBD)
        {
            Name (_HID, EisaId ("PNP0303"))
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0060,             // Range Minimum
                    0x0060,             // Range Maximum
                    0x00,               // Alignment
                    0x01,               // Length
                    )
                IO (Decode16,
                    0x0064,             // Range Minimum
                    0x0064,             // Range Maximum
                    0x00,               // Alignment
                    0x01,               // Length
                    )
                IRQNoFlags ()
                    {1}
            })
        }
    }

    Scope (\_SB.PCI0)
    {
        Device (USB1)
        {
            Name (_ADR, 0x001F0002)
            Method (_S1D, 0, NotSerialized)
            {
                Return (One)
            }

            Method (_S4D, 0, NotSerialized)
            {
                If (WNME)
                {
                    Return (0x02)
                }
                Else
                {
                    Return (0x01)
                }
            }

            Method (_S5D, 0, NotSerialized)
            {
                If (WNME)
                {
                    Return (0x02)
                }
                Else
                {
                    Return (0x01)
                }
            }
        }

        Device (USB2)
        {
            Name (_ADR, 0x001F0004)
            Method (_S1D, 0, NotSerialized)
            {
                Return (One)
            }

            Method (_S4D, 0, NotSerialized)
            {
                If (WNME)
                {
                    Return (0x02)
                }
                Else
                {
                    Return (0x01)
                }
            }

            Method (_S5D, 0, NotSerialized)
            {
                If (WNME)
                {
                    Return (0x02)
                }
                Else
                {
                    Return (0x01)
                }
            }
        }
    }

    Method (SCMP, 2, NotSerialized)
    {
        Store (SizeOf (Arg0), Local7)
        If (LNotEqual (Local7, SizeOf (Arg1)))
        {
            Return (0x01)
        }

        Name (STR0, Buffer (Local7) {})
        Name (STR1, Buffer (Local7) {})
        Store (Arg0, STR0)
        Store (Arg1, STR1)
        Store (0x00, Local6)
        Store (0x00, Local0)
        While (LAnd (LNotEqual (Local6, Local7), LEqual (Local0, 0x00)))
        {
            Store (DerefOf (Index (STR0, Local6)), Local2)
            Store (DerefOf (Index (STR1, Local6)), Local3)
            Increment (Local6)
            If (LNotEqual (Local2, Local3))
            {
                Store (0x01, Local0)
            }
        }

        Return (Local0)
    }

    Method (WSTB, 4, NotSerialized)
    {
        OperationRegion (BPDS, SystemIO, Arg3, 0x01)
        Field (BPDS, ByteAcc, NoLock, Preserve)
        {
            BPRT,   8
        }

        Multiply (Arg2, 0x03E8, Local1)
        And (BPRT, Arg1, Local0)
        While (LAnd (LNotEqual (Local0, Arg0), Local1))
        {
            Decrement (Local1)
            Stall (0x0A)
            And (BPRT, Arg1, Local0)
        }

        Return (Local1)
    }

    Method (OSFG, 0, NotSerialized)
    {
        If (LNot (OSFS))
        {
            If (LNot (\SCMP (\_OS, "Microsoft Windows")))
            {
                Store (One, WN98)
            }
            Else
            {
                If (LNot (\SCMP (\_OS, "Microsoft WindowsME: Millennium Edition")))
                {
                    Store (One, WNME)
                }
                Else
                {
                    If (LNot (\SCMP (\_OS, "Microsoft Windows NT")))
                    {
                        Store (One, WN2K)
                    }
                }
            }

            Store (One, OSFS)
        }
    }

    OperationRegion (DBUG, SystemIO, 0x84, 0x02)
    Field (DBUG, ByteAcc, NoLock, Preserve)
    {
        P84,    8, 
        P85,    8
    }

    OperationRegion (BIOS, SystemMemory, 0x000E3500, 0x0B00)
    Field (BIOS, AnyAcc, NoLock, Preserve)
    {
        SSMC,   1, 
            ,   1, 
            ,   1, 
        S4BW,   1, 
        PKWN,   1, 
        PMWN,   1, 
        PKWU,   1, 
        PMWU,   1, 
        OPKW,   1, 
        OPMW,   1, 
        S3OC,   1, 
        WN98,   1, 
        WNME,   1, 
        WN2K,   1, 
            ,   1, 
        OSFS,   1, 
        MB16,   16, 
        NIFH,   1, 
            ,   1, 
            ,   1, 
        LPTN,   1, 
        CM2N,   1, 
        CM1N,   1, 
        FPMW,   1, 
        PS2S,   1, 
        ATPM,   1, 
        ATPS,   1, 
        ATSM,   1, 
        ATSS,   1, 
        ATPC,   2, 
        ATSC,   2, 
        PITB,   160, 
        SITB,   160, 
        PMCC,   8, 
        PMCB,   448, 
        PSCC,   8, 
        PSCB,   448, 
        SMCC,   8, 
        SMCB,   448, 
        SSCC,   8, 
        SSCB,   448, 
        ODDM,   32, 
        AP0C,   4, 
        APPC,   2, 
        ASPC,   2
    }

    OperationRegion (SSCR, SystemIO, 0xB2, 0x01)
    Field (SSCR, ByteAcc, NoLock, Preserve)
    {
        SSMI,   8
    }

    OperationRegion (CMOS, SystemIO, 0x70, 0x02)
    Field (CMOS, ByteAcc, NoLock, Preserve)
    {
        NVSI,   8, 
        NVSD,   8
    }

    IndexField (NVSI, NVSD, ByteAcc, NoLock, Preserve)
    {
                Offset (0x30), 
        MEML,   8, 
        MEMH,   8
    }

    OperationRegion (SIPM, SystemIO, 0x0400, 0x80)
    Field (SIPM, ByteAcc, NoLock, Preserve)
    {
        SIPU,   1, 
                Offset (0x08), 
        RI1U,   1, 
        RI2U,   1, 
                Offset (0x0E), 
        RI1N,   1, 
        RI2N,   1, 
                Offset (0x14), 
            ,   3, 
        PSMI,   1
    }

    Processor (\_PR.CPU0, 0x01, 0x0000F810, 0x06) {}
    Method (MLEN, 0, NotSerialized)
    {
        Store (MEMH, Local0)
        ShiftLeft (Local0, 0x08, Local0)
        Or (MEML, Local0, Local0)
        If (LEqual (Local0, 0xFC00))
        {
            Multiply (MB16, 0x00010000, Local1)
            Multiply (0x3C00, 0x0400, Local2)
            Add (Local1, Local2, Local1)
            Return (Local1)
        }

        If (LEqual (Local0, 0x3800))
        {
            Multiply (MB16, 0x00010000, Local1)
            Multiply (0x3C00, 0x0400, Local2)
            Add (Local1, Local2, Local1)
            Return (Local1)
        }
        Else
        {
            Multiply (Local0, 0x0400, Local0)
            Return (Local0)
        }
    }

    Scope (\_SB)
    {
        Device (PBTN)
        {
            Name (_HID, EisaId ("PNP0C0C"))
            Name (_PRW, Package (0x02)
            {
                0x08, 
                0x04
            })
            Method (_PSW, 1, NotSerialized)
            {
                If (LEqual (Arg0, 0x00))
                {
                    Store (Zero, OPKW)
                    Store (Zero, OPMW)
                }
                Else
                {
                    Store (One, OPKW)
                    Store (One, OPMW)
                }
            }
        }
    }

    Scope (\_SB)
    {
        Device (MBRD)
        {
            Name (_HID, EisaId ("PNP0C01"))
            Name (CRES, /**** Is ResourceTemplate, but EndTag not at buffer end ****/ Buffer (0x7A)
            {
                /* 0000 */    0x86, 0x09, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 
                /* 0008 */    0x00, 0x00, 0x0A, 0x00, 0x86, 0x09, 0x00, 0x0B, 
                /* 0010 */    0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x02, 0x00, 
                /* 0018 */    0x86, 0x09, 0x00, 0x0B, 0x00, 0x00, 0x10, 0x00, 
                /* 0020 */    0x00, 0x00, 0xF0, 0x01, 0x86, 0x09, 0x00, 0x09, 
                /* 0028 */    0x00, 0x00, 0xF8, 0xFF, 0x00, 0x00, 0x08, 0x00, 
                /* 0030 */    0x86, 0x09, 0x00, 0x0B, 0x00, 0x00, 0xEA, 0xFE, 
                /* 0038 */    0x00, 0x00, 0x02, 0x00, 0x79, 0x00, 0x00, 0x00, 
                /* 0040 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                /* 0048 */    0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                /* 0050 */    0x00, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 
                /* 0058 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                /* 0060 */    0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                /* 0068 */    0x00, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 
                /* 0070 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                /* 0078 */    0x79, 0x00
            })
            Method (_CRS, 0, NotSerialized)
            {
                CreateDWordField (CRES, 0x20, RAMT)
                Store (MLEN (), RAMT)
                OperationRegion (ODMT, SystemMemory, ODDM, 0x38)
                Field (ODMT, DWordAcc, NoLock, Preserve)
                {
                    OMTF,   448
                }

                Store (0x3C, Local0)
                Store (0x04, Local1)
                Store (GDBF (OMTF, Local1), Local2)
                While (LAnd (Local2, LLess (Local1, 0x30)))
                {
                    SDBF (CRES, Local0, 0x0B000986)
                    Add (Local0, 0x04, Local0)
                    SDBF (CRES, Local0, Local2)
                    Add (Local0, 0x04, Local0)
                    Add (Local1, 0x04, Local1)
                    SDBF (CRES, Local0, GDBF (OMTF, Local1))
                    Add (Local0, 0x04, Local0)
                    Add (Local1, 0x08, Local1)
                    Store (GDBF (OMTF, Local1), Local2)
                }

                If (NIFH)
                {
                    SDBF (CRES, Local0, 0x0B000986)
                    Add (Local0, 0x04, Local0)
                    SDBF (CRES, Local0, 0xFFB80000)
                    Add (Local0, 0x04, Local0)
                    SDBF (CRES, Local0, 0x00080000)
                }

                Return (CRES)
            }

            Method (GDBF, 2, NotSerialized)
            {
                CreateDWordField (Arg0, Arg1, BPTR)
                Return (BPTR)
            }

            Method (SDBF, 3, NotSerialized)
            {
                CreateDWordField (Arg0, Arg1, BPTR)
                Store (Arg2, BPTR)
            }
        }
    }

    Scope (\_SB.PCI0)
    {
        Device (SBD1)
        {
            Name (_HID, EisaId ("PNP0C02"))
            Name (_UID, 0x01)
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0010,             // Range Minimum
                    0x0010,             // Range Maximum
                    0x00,               // Alignment
                    0x10,               // Length
                    )
                IO (Decode16,
                    0x002E,             // Range Minimum
                    0x002E,             // Range Maximum
                    0x00,               // Alignment
                    0x02,               // Length
                    )
                IO (Decode16,
                    0x0050,             // Range Minimum
                    0x0050,             // Range Maximum
                    0x00,               // Alignment
                    0x04,               // Length
                    )
                IO (Decode16,
                    0x0072,             // Range Minimum
                    0x0072,             // Range Maximum
                    0x00,               // Alignment
                    0x06,               // Length
                    )
                IO (Decode16,
                    0x0090,             // Range Minimum
                    0x0090,             // Range Maximum
                    0x00,               // Alignment
                    0x10,               // Length
                    )
                IO (Decode16,
                    0x04D0,             // Range Minimum
                    0x04D0,             // Range Maximum
                    0x00,               // Alignment
                    0x02,               // Length
                    )
            })
        }
    }

    Scope (\_SB.PCI0)
    {
        Device (SBD2)
        {
            Name (_HID, EisaId ("PNP0C02"))
            Name (_UID, 0x02)
            Name (_CRS, ResourceTemplate ()
            {
                IO (Decode16,
                    0x0400,             // Range Minimum
                    0x0400,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IO (Decode16,
                    0x0420,             // Range Minimum
                    0x0420,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IO (Decode16,
                    0x0440,             // Range Minimum
                    0x0440,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IO (Decode16,
                    0x0460,             // Range Minimum
                    0x0460,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IO (Decode16,
                    0xF800,             // Range Minimum
                    0xF800,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IO (Decode16,
                    0xF820,             // Range Minimum
                    0xF820,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IO (Decode16,
                    0xF840,             // Range Minimum
                    0xF840,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IO (Decode16,
                    0xF860,             // Range Minimum
                    0xF860,             // Range Maximum
                    0x00,               // Alignment
                    0x20,               // Length
                    )
                IO (Decode16,
                    0xFA00,             // Range Minimum
                    0xFA00,             // Range Maximum
                    0x00,               // Alignment
                    0x40,               // Length
                    )
                IO (Decode16,
                    0xFC00,             // Range Minimum
                    0xFC00,             // Range Maximum
                    0x00,               // Alignment
                    0x80,               // Length
                    )
                IO (Decode16,
                    0xFC80,             // Range Minimum
                    0xFC80,             // Range Maximum
                    0x00,               // Alignment
                    0x80,               // Length
                    )
                IO (Decode16,
                    0xFE00,             // Range Minimum
                    0xFE00,             // Range Maximum
                    0x00,               // Alignment
                    0x80,               // Length
                    )
                IO (Decode16,
                    0xFE80,             // Range Minimum
                    0xFE80,             // Range Maximum
                    0x00,               // Alignment
                    0x80,               // Length
                    )
            })
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        OperationRegion (L47B, SystemIO, 0x2E, 0x02)
        Field (L47B, ByteAcc, NoLock, Preserve)
        {
            INDX,   8, 
            DATA,   8
        }

        IndexField (INDX, DATA, ByteAcc, NoLock, Preserve)
        {
                    Offset (0x02), 
            CFG,    8, 
                    Offset (0x07), 
            LDN,    8, 
                    Offset (0x22), 
            DPWR,   8, 
            APWR,   8, 
                    Offset (0x30), 
            ACTR,   8, 
                    Offset (0x60), 
            IOAH,   8, 
            IOAL,   8, 
                    Offset (0x70), 
            INTR,   8, 
                    Offset (0x74), 
            DMCH,   8, 
                    Offset (0xF0), 
            CFG1,   8, 
            CFG2,   8, 
            CFG3,   8, 
                    Offset (0xF4), 
            CFG4,   8, 
            CFG5,   8
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        OperationRegion (LPCC, SystemIO, 0x2E, 0x01)
        Field (LPCC, ByteAcc, NoLock, Preserve)
        {
            LCFG,   8
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Method (LETR, 0, NotSerialized)
        {
            Store (0x55, LCFG)
        }

        Method (LEXT, 0, NotSerialized)
        {
            Store (0xAA, LCFG)
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (ECP0)
        {
            Name (_HID, EisaId ("PNP0401"))
            Name (_DDN, "LPT1")
            Name (CRES, ResourceTemplate ()
            {
                IRQNoFlags (_Y09)
                    {7}
                DMA (Compatibility, NotBusMaster, Transfer8, _Y0A)
                    {3}
                IO (Decode16,
                    0x0378,             // Range Minimum
                    0x0378,             // Range Maximum
                    0x00,               // Alignment
                    0x08,               // Length
                    _Y0B)
                IO (Decode16,
                    0x0778,             // Range Minimum
                    0x0778,             // Range Maximum
                    0x00,               // Alignment
                    0x06,               // Length
                    _Y0C)
            })
            Method (_STA, 0, NotSerialized)
            {
                If (LPTN)
                {
                    LETR ()
                    Store (0x03, LDN)
                    Store (CFG1, Local0)
                    And (Local0, 0x07, Local0)
                    If (LEqual (Local0, 0x03))
                    {
                        If (ACTR)
                        {
                            LEXT ()
                            Return (0x0F)
                        }
                        Else
                        {
                            LEXT ()
                            Return (0x0D)
                        }
                    }
                    Else
                    {
                        LEXT ()
                        Return (Zero)
                    }
                }
                Else
                {
                    Return (Zero)
                }
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.PCI0.LPC.ECP0._Y09._INT, IRQW)
                CreateByteField (CRES, \_SB.PCI0.LPC.ECP0._Y0A._DMA, DMAC)
                CreateByteField (CRES, \_SB.PCI0.LPC.ECP0._Y0B._MIN, IOLO)
                CreateByteField (CRES, 0x09, IOHI)
                CreateByteField (CRES, \_SB.PCI0.LPC.ECP0._Y0B._MAX, IORL)
                CreateByteField (CRES, 0x0B, IORH)
                CreateByteField (CRES, \_SB.PCI0.LPC.ECP0._Y0B._LEN, LEN1)
                CreateByteField (CRES, \_SB.PCI0.LPC.ECP0._Y0C._MIN, ISL1)
                CreateByteField (CRES, 0x11, ISH1)
                CreateByteField (CRES, \_SB.PCI0.LPC.ECP0._Y0C._MAX, ISL2)
                CreateByteField (CRES, 0x13, ISH2)
                CreateByteField (CRES, \_SB.PCI0.LPC.ECP0._Y0C._LEN, LEN2)
                LETR ()
                Store (0x03, LDN)
                Store (IOAL, IOLO)
                Store (IOAH, IOHI)
                Store (IOAL, IORL)
                Store (IOAH, IORH)
                Store (IOAL, ISL1)
                Add (0x04, IOAH, ISH1)
                Store (IOAL, ISL2)
                Add (0x04, IOAH, ISH2)
                If (LEqual (IOAL, 0xBC))
                {
                    Store (0x03, LEN1)
                    Store (0x03, LEN2)
                }
                Else
                {
                    Store (0x08, LEN1)
                    Store (0x06, LEN2)
                }

                If (LEqual (INTR, Zero))
                {
                    Store (Zero, IRQW)
                }
                Else
                {
                    Store (One, Local0)
                    ShiftLeft (Local0, INTR, IRQW)
                }

                If (LEqual (DMCH, 0x04))
                {
                    Store (Zero, DMAC)
                }
                Else
                {
                    Store (One, Local0)
                    ShiftLeft (Local0, DMCH, DMAC)
                }

                LEXT ()
                Return (CRES)
            }
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (LPT0)
        {
            Name (_HID, EisaId ("PNP0400"))
            Name (_DDN, "LPT1")
            Name (CRES, ResourceTemplate ()
            {
                IRQNoFlags (_Y0D)
                    {7}
                IO (Decode16,
                    0x0378,             // Range Minimum
                    0x0378,             // Range Maximum
                    0x00,               // Alignment
                    0x03,               // Length
                    _Y0E)
            })
            Method (_STA, 0, NotSerialized)
            {
                If (LPTN)
                {
                    LETR ()
                    Store (0x03, LDN)
                    Store (CFG1, Local0)
                    And (Local0, 0x07, Local0)
                    If (LEqual (Local0, Zero))
                    {
                        If (ACTR)
                        {
                            LEXT ()
                            Return (0x0F)
                        }
                        Else
                        {
                            LEXT ()
                            Return (0x0D)
                        }
                    }

                    If (LEqual (Local0, 0x04))
                    {
                        If (ACTR)
                        {
                            LEXT ()
                            Return (0x0F)
                        }
                        Else
                        {
                            LEXT ()
                            Return (0x0D)
                        }
                    }
                    Else
                    {
                        LEXT ()
                        Return (Zero)
                    }
                }
                Else
                {
                    Return (Zero)
                }
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.PCI0.LPC.LPT0._Y0D._INT, IRQW)
                CreateByteField (CRES, \_SB.PCI0.LPC.LPT0._Y0E._MIN, IOLO)
                CreateByteField (CRES, 0x06, IOHI)
                CreateByteField (CRES, \_SB.PCI0.LPC.LPT0._Y0E._MAX, IORL)
                CreateByteField (CRES, 0x08, IORH)
                LETR ()
                Store (0x03, LDN)
                Store (IOAL, IOLO)
                Store (IOAH, IOHI)
                Store (IOAL, IORL)
                Store (IOAH, IORH)
                If (LEqual (INTR, Zero))
                {
                    Store (Zero, IRQW)
                }
                Else
                {
                    Store (One, Local0)
                    ShiftLeft (Local0, INTR, IRQW)
                }

                LEXT ()
                Return (CRES)
            }
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (COM1)
        {
            Name (_HID, EisaId ("PNP0501"))
            Name (_CID, EisaId ("PNP0500"))
            Name (_UID, 0x01)
            Name (_DDN, "COM1")
            Name (CRES, ResourceTemplate ()
            {
                IRQNoFlags (_Y0F)
                    {4}
                IO (Decode16,
                    0x03F8,             // Range Minimum
                    0x03F8,             // Range Maximum
                    0x00,               // Alignment
                    0x08,               // Length
                    _Y10)
            })
            Method (_STA, 0, NotSerialized)
            {
                If (CM1N)
                {
                    LETR ()
                    Store (0x04, LDN)
                    If (ACTR)
                    {
                        LEXT ()
                        Return (0x0F)
                    }
                    Else
                    {
                        LEXT ()
                        Return (0x0D)
                    }
                }
                Else
                {
                    Return (Zero)
                }
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.PCI0.LPC.COM1._Y0F._INT, IRQW)
                CreateByteField (CRES, \_SB.PCI0.LPC.COM1._Y10._MIN, IOLO)
                CreateByteField (CRES, 0x06, IOHI)
                CreateByteField (CRES, \_SB.PCI0.LPC.COM1._Y10._MAX, IORL)
                CreateByteField (CRES, 0x08, IORH)
                LETR ()
                Store (0x04, LDN)
                Store (IOAL, IOLO)
                Store (IOAH, IOHI)
                Store (IOAL, IORL)
                Store (IOAH, IORH)
                If (LEqual (INTR, Zero))
                {
                    Store (Zero, IRQW)
                }
                Else
                {
                    Store (One, Local0)
                    ShiftLeft (Local0, INTR, IRQW)
                }

                LEXT ()
                Return (CRES)
            }

            Name (_PRW, Package (0x02)
            {
                0x08, 
                0x04
            })
            Method (_PSW, 1, NotSerialized)
            {
                If (LEqual (Arg0, 0x00))
                {
                    Store (Zero, RI1N)
                }
                Else
                {
                    Store (One, RI1N)
                }
            }
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (COM2)
        {
            Name (_HID, EisaId ("PNP0501"))
            Name (_CID, EisaId ("PNP0500"))
            Name (_UID, 0x02)
            Name (_DDN, "COM2")
            Name (CRES, ResourceTemplate ()
            {
                IRQNoFlags (_Y11)
                    {3}
                IO (Decode16,
                    0x02F8,             // Range Minimum
                    0x02F8,             // Range Maximum
                    0x00,               // Alignment
                    0x08,               // Length
                    _Y12)
            })
            Method (_STA, 0, NotSerialized)
            {
                If (CM2N)
                {
                    LETR ()
                    Store (0x05, LDN)
                    If (ACTR)
                    {
                        LEXT ()
                        Return (0x0F)
                    }
                    Else
                    {
                        LEXT ()
                        Return (0x0D)
                    }
                }
                Else
                {
                    Return (Zero)
                }
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.PCI0.LPC.COM2._Y11._INT, IRQW)
                CreateByteField (CRES, \_SB.PCI0.LPC.COM2._Y12._MIN, IOLO)
                CreateByteField (CRES, 0x06, IOHI)
                CreateByteField (CRES, \_SB.PCI0.LPC.COM2._Y12._MAX, IORL)
                CreateByteField (CRES, 0x08, IORH)
                LETR ()
                Store (0x05, LDN)
                Store (IOAL, IOLO)
                Store (IOAH, IOHI)
                Store (IOAL, IORL)
                Store (IOAH, IORH)
                If (LEqual (INTR, Zero))
                {
                    Store (Zero, IRQW)
                }
                Else
                {
                    Store (One, Local0)
                    ShiftLeft (Local0, INTR, IRQW)
                }

                LEXT ()
                Return (CRES)
            }

            Name (_PRW, Package (0x02)
            {
                0x08, 
                0x04
            })
            Method (_PSW, 1, NotSerialized)
            {
                If (LEqual (Arg0, 0x00))
                {
                    Store (Zero, RI2N)
                }
                Else
                {
                    Store (One, RI2N)
                }
            }
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (FDC0)
        {
            Name (_HID, EisaId ("PNP0700"))
            Name (CRES, ResourceTemplate ()
            {
                IRQNoFlags (_Y13)
                    {6}
                DMA (Compatibility, NotBusMaster, Transfer8, _Y14)
                    {2}
                IO (Decode16,
                    0x03F0,             // Range Minimum
                    0x03F0,             // Range Maximum
                    0x01,               // Alignment
                    0x06,               // Length
                    _Y15)
                IO (Decode16,
                    0x03F7,             // Range Minimum
                    0x03F7,             // Range Maximum
                    0x01,               // Alignment
                    0x01,               // Length
                    )
            })
            Method (_STA, 0, NotSerialized)
            {
                LETR ()
                Store (0x00, LDN)
                If (ACTR)
                {
                    LEXT ()
                    Return (0x0F)
                }
                Else
                {
                    LEXT ()
                    Return (0x0D)
                }
            }

            Method (_CRS, 0, NotSerialized)
            {
                CreateWordField (CRES, \_SB.PCI0.LPC.FDC0._Y13._INT, IRQW)
                CreateByteField (CRES, \_SB.PCI0.LPC.FDC0._Y14._DMA, DMAC)
                CreateByteField (CRES, \_SB.PCI0.LPC.FDC0._Y15._MIN, IOLO)
                CreateByteField (CRES, 0x09, IOHI)
                CreateByteField (CRES, \_SB.PCI0.LPC.FDC0._Y15._MAX, IORL)
                CreateByteField (CRES, 0x0B, IORH)
                LETR ()
                Store (0x00, LDN)
                Store (IOAL, IOLO)
                Store (IOAH, IOHI)
                Store (IOAL, IORL)
                Store (IOAH, IORH)
                If (LEqual (INTR, Zero))
                {
                    Store (Zero, IRQW)
                }
                Else
                {
                    Store (One, Local0)
                    ShiftLeft (Local0, INTR, IRQW)
                }

                If (LEqual (DMCH, 0x04))
                {
                    Store (Zero, DMAC)
                }
                Else
                {
                    Store (One, Local0)
                    ShiftLeft (Local0, DMCH, DMAC)
                }

                LEXT ()
                Return (CRES)
            }
        }
    }

    Scope (\_GPE)
    {
        Method (_L03, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB1, 0x02)
            If (LOr (WN98, WNME))
            {
                Notify (\_SB.PBTN, 0x02)
            }
        }

        Method (_L04, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB2, 0x02)
            If (LOr (WN98, WNME))
            {
                Notify (\_SB.PBTN, 0x02)
            }
        }

        Method (_L08, 0, NotSerialized)
        {
            Store (One, Local0)
            If (RI1U)
            {
                Notify (\_SB.PCI0.LPC.COM1, 0x02)
                Store (One, RI1U)
                Store (Zero, Local0)
            }

            If (RI2U)
            {
                Notify (\_SB.PCI0.LPC.COM2, 0x02)
                Store (One, RI2U)
                Store (Zero, Local0)
            }

            If (LAnd (LOr (PKWU, PMWU), Local0))
            {
                Notify (\_SB.PBTN, 0x02)
                Store (Zero, PMWU)
                Store (Zero, PKWU)
            }

            Store (One, SIPU)
        }

        Method (_L0B, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.HUB, 0x02)
            Store (One, PSMI)
        }
    }

    Name (\_S0, Package (0x02)
    {
        0x00, 
        0x03
    })
    Name (\_S1, Package (0x02)
    {
        0x00, 
        0x04
    })
    Name (\_S4, Package (0x02)
    {
        0x00, 
        0x06
    })
    Name (\_S5, Package (0x02)
    {
        0x00, 
        0x07
    })
    Method (_PTS, 1, NotSerialized)
    {
        Store (OPKW, PKWN)
        Store (OPMW, PMWN)
        If (LEqual (Arg0, 0x03))
        {
            Store (Zero, SSMC)
            Store (0x8D, SSMI)
            If (LAnd (OPMW, FPMW))
            {
                Store (One, PMWN)
            }
            Else
            {
                Store (Zero, PMWN)
            }

            If (PS2S)
            {
                Store (PKWN, Local0)
                Store (PMWN, PKWN)
                Store (Local0, PMWN)
            }
        }

        Store (One, PSMI)
    }

    Method (_WAK, 1, NotSerialized)
    {
        If (S4BW)
        {
            Store (Zero, S4BW)
        }
    }

    Scope (\_SB.PCI0.LPC)
    {
        Device (APIC)
        {
            Name (_HID, EisaId ("PNP0003"))
            Method (_STA, 0, NotSerialized)
            {
                If (LEqual (\PICM, One))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (0x0B)
                }
            }

            Name (_CRS, ResourceTemplate ()
            {
                Memory32Fixed (ReadWrite,
                    0xFEC00000,         // Address Base
                    0x00001000,         // Address Length
                    )
            })
        }
    }

    Scope (\_SB.PCI0)
    {
        Device (IDE)
        {
            Name (_ADR, 0x001F0001)
            Method (GTF, 2, NotSerialized)
            {
                Multiply (Arg0, 0x07, Local0)
                Name (HCTM, Buffer (Local0) {})
                Store (Arg1, HCTM)
                Return (HCTM)
            }

            Method (XGTF, 3, NotSerialized)
            {
                Store (Zero, Local0)
                Store (Zero, Local1)
                Add (Arg2, 0x06, Local2)
                While (LAnd (WSTB (0x00, 0x80, 0x0BB8, Local2), LLess (Local0, Arg0)))
                {
                    Store (Zero, Local3)
                    While (LLess (Local3, 0x07))
                    {
                        Add (Local3, Arg2, Local4)
                        OTFB (DerefOf (Index (Arg1, Local1)), Local4)
                        Increment (Local1)
                        Increment (Local3)
                    }

                    Increment (Local0)
                }
            }

            Method (OTFB, 2, NotSerialized)
            {
                OperationRegion (IDEX, SystemIO, Arg1, 0x01)
                Field (IDEX, ByteAcc, NoLock, Preserve)
                {
                    I1XX,   8
                }

                Store (Arg0, I1XX)
            }

            Method (AAPB, 0, NotSerialized)
            {
                Increment (AP0C)
                Add (ATPC, ATSC, Local0)
                If (LEqual (AP0C, Local0))
                {
                    Store (Zero, AP0C)
                    Store (Zero, S3OC)
                }
            }
        }
    }

    Scope (\_SB.PCI0)
    {
        Method (_S3D, 0, NotSerialized)
        {
            Return (0x03)
        }
    }

    Scope (\_SB.PCI0.HUB)
    {
        Method (_S3D, 0, NotSerialized)
        {
            Return (0x03)
        }
    }

    Scope (\_SB.PCI0.USB1)
    {
        Name (_PRW, Package (0x02)
        {
            0x03, 
            0x03
        })
        Method (_S3D, 0, NotSerialized)
        {
            If (WNME)
            {
                Return (0x02)
            }
            Else
            {
                Return (0x01)
            }
        }
    }

    Scope (\_SB.PCI0.USB2)
    {
        Name (_PRW, Package (0x02)
        {
            0x04, 
            0x03
        })
        Method (_S3D, 0, NotSerialized)
        {
            If (WNME)
            {
                Return (0x02)
            }
            Else
            {
                Return (0x01)
            }
        }
    }

    Name (\_S3, Package (0x02)
    {
        0x00, 
        0x05
    })
    Scope (\_SB.PCI0.IDE)
    {
        Device (PIDE)
        {
            Name (_ADR, 0x00)
            Mutex (ATPX, 0x00)
            OperationRegion (IDEP, SystemIO, 0x01F0, 0x08)
            Field (IDEP, ByteAcc, NoLock, Preserve)
            {
                I1F0,   8, 
                I1F1,   8, 
                I1F2,   8, 
                I1F3,   8, 
                I1F4,   8, 
                I1F5,   8, 
                I1F6,   8, 
                I1F7,   8
            }

            OperationRegion (PFCO, SystemIO, 0x03F6, 0x01)
            Field (PFCO, ByteAcc, NoLock, Preserve)
            {
                PFCD,   8
            }

            Method (_PS0, 0, NotSerialized)
            {
                If (LAnd (LAnd (WN98, LOr (ATPM, ATPS)), S3OC))
                {
                    Acquire (ATPX, 0xFFFF)
                    Store (0x02, PFCD)
                    WSTB (0x00, 0x80, 0x0BB8, 0x01F7)
                    Release (ATPX)
                }
            }

            Method (_PS3, 0, NotSerialized)
            {
                Noop
            }

            Method (APPB, 0, NotSerialized)
            {
                Increment (APPC)
                If (LEqual (APPC, ATPC))
                {
                    Store (Zero, APPC)
                    Store (0x00, PFCD)
                }
            }

            Method (_GTM, 0, NotSerialized)
            {
                Return (PITB)
            }

            Method (_STM, 3, NotSerialized)
            {
                Store (Arg0, PITB)
                Store (Zero, SSMC)
                Store (0x91, SSMI)
            }
        }
    }

    Scope (\_SB.PCI0.IDE.PIDE)
    {
        Device (DRV0)
        {
            Name (_ADR, 0x00)
            Method (_PS0, 0, NotSerialized)
            {
                If (LAnd (LAnd (WN98, ATPM), S3OC))
                {
                    Acquire (ATPX, 0xFFFF)
                    Store (0xA0, \_SB.PCI0.IDE.PIDE.I1F6)
                    \_SB.PCI0.IDE.XGTF (PMCC, PMCB, 0x01F1)
                    \_SB.PCI0.IDE.AAPB ()
                    \_SB.PCI0.IDE.PIDE.APPB ()
                    Release (ATPX)
                }
            }

            Method (_PS3, 0, NotSerialized)
            {
                Noop
            }

            Method (_GTF, 0, NotSerialized)
            {
                Return (\_SB.PCI0.IDE.GTF (PMCC, PMCB))
            }
        }
    }

    Scope (\_SB.PCI0.IDE)
    {
        Device (SIDE)
        {
            Name (_ADR, 0x01)
            Mutex (ATSX, 0x00)
            OperationRegion (IDES, SystemIO, 0x0170, 0x08)
            Field (IDES, ByteAcc, NoLock, Preserve)
            {
                I170,   8, 
                I171,   8, 
                I172,   8, 
                I173,   8, 
                I174,   8, 
                I175,   8, 
                I176,   8, 
                I177,   8
            }

            OperationRegion (SFCO, SystemIO, 0x0376, 0x01)
            Field (SFCO, ByteAcc, NoLock, Preserve)
            {
                SFCD,   8
            }

            Method (_PS0, 0, NotSerialized)
            {
                If (LAnd (LAnd (WN98, LOr (ATSM, ATSS)), S3OC))
                {
                    Acquire (ATSX, 0xFFFF)
                    Store (0x02, SFCD)
                    WSTB (0x00, 0x80, 0x0BB8, 0x0177)
                    Release (ATSX)
                }
            }

            Method (_PS3, 0, NotSerialized)
            {
                Noop
            }

            Method (ASPB, 0, NotSerialized)
            {
                Increment (ASPC)
                If (LEqual (ASPC, ATSC))
                {
                    Store (Zero, ASPC)
                    Store (0x00, SFCD)
                }
            }

            Method (_GTM, 0, NotSerialized)
            {
                Return (SITB)
            }

            Method (_STM, 3, NotSerialized)
            {
                Store (Arg0, SITB)
                Store (Zero, SSMC)
                Store (0x91, SSMI)
            }
        }
    }

    Scope (\_SB.PCI0.IDE.SIDE)
    {
        Device (DRV0)
        {
            Name (_ADR, 0x00)
            Method (_PS0, 0, NotSerialized)
            {
                If (LAnd (LAnd (WN98, ATSM), S3OC))
                {
                    Acquire (ATSX, 0xFFFF)
                    Store (0xA0, \_SB.PCI0.IDE.SIDE.I176)
                    \_SB.PCI0.IDE.XGTF (SMCC, SMCB, 0x0171)
                    \_SB.PCI0.IDE.AAPB ()
                    \_SB.PCI0.IDE.SIDE.ASPB ()
                    Release (ATSX)
                }
            }

            Method (_PS3, 0, NotSerialized)
            {
                Noop
            }

            Method (_GTF, 0, NotSerialized)
            {
                Return (\_SB.PCI0.IDE.GTF (SMCC, SMCB))
            }
        }
    }
}


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