# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/12 21:29:20-08:00 akpm@bix.(none) 
#   Merge http://linux-acpi.bkbits.net/linux-acpi-test-mm
#   into bix.(none):/usr/src/bk-acpi
# 
# arch/x86_64/Kconfig
#   2004/12/12 21:29:16-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/12/12 21:29:16-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/06 17:23:23-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-stable-dev
#   into intel.com:/home/lenb/src/26-latest-dev
# 
# drivers/acpi/tables/tbxfroot.c
#   2004/12/06 17:23:20-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/06 17:12:37-05:00 len.brown@intel.com 
#   [ACPI] ACPICA 20041203 from Bob Moore and Alexey Starikovskiy
#   
#   The low-level field insertion/extraction code (exfldio)
#   has been completely rewritten to eliminate unnecessary
#   complexity, bugs, and boundary conditions.
#   
#   Fixed a problem in the ToInteger, ToBuffer, ToHexString,
#   and ToDecimalString operators where the input operand could
#   be inadvertently deleted if no conversion was necessary
#   (e.g., if the input to ToInteger was an Integer object.)
#   
#   Fixed a problem with the ToDecimalString and ToHexString
#   where an incorrect exception code was returned if the
#   resulting string would be > 200 chars.  AE_STRING_LIMIT is
#   now returned.
#   
#   Fixed a problem with the Concatenate operator where AE_OK
#   was always returned, even if the operation failed.
#   
#   Fixed a problem in oswinxf (used by AcpiExec and iASL)
#   to allow > 128 semaphores to be allocated.
#   
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# include/acpi/amlcode.h
#   2004/12/06 16:15:20-05:00 len.brown@intel.com +1 -0
#   ACPICA 20041203
# 
# include/acpi/acobject.h
#   2004/12/06 16:15:20-05:00 len.brown@intel.com +1 -3
#   ACPICA 20041203
# 
# include/acpi/acmacros.h
#   2004/12/06 16:15:21-05:00 len.brown@intel.com +1 -0
#   ACPICA 20041203
# 
# include/acpi/acconfig.h
#   2004/12/06 16:15:21-05:00 len.brown@intel.com +1 -1
#   ACPICA 20041203
# 
# drivers/acpi/parser/psopcode.c
#   2004/12/06 16:15:25-05:00 len.brown@intel.com +4 -4
#   ACPICA 20041203
# 
# drivers/acpi/executer/exprep.c
#   2004/12/06 16:15:26-05:00 len.brown@intel.com +2 -22
#   ACPICA 20041203
# 
# drivers/acpi/executer/exoparg1.c
#   2004/12/06 16:15:26-05:00 len.brown@intel.com +22 -4
#   ACPICA 20041203
# 
# drivers/acpi/executer/exmisc.c
#   2004/12/06 16:15:26-05:00 len.brown@intel.com +1 -1
#   ACPICA 20041203
# 
# drivers/acpi/executer/exfldio.c
#   2004/12/06 16:15:26-05:00 len.brown@intel.com +114 -432
#   ACPICA 20041203
# 
# drivers/acpi/executer/exdump.c
#   2004/12/06 16:15:26-05:00 len.brown@intel.com +0 -3
#   ACPICA 20041203
# 
# drivers/acpi/events/evgpe.c
#   2004/12/06 16:15:25-05:00 len.brown@intel.com +13 -13
#   ACPICA 20041203
# 
# drivers/acpi/dispatcher/dswexec.c
#   2004/12/06 16:15:25-05:00 len.brown@intel.com +16 -8
#   ACPICA 20041203
# 
# drivers/acpi/dispatcher/dsopcode.c
#   2004/12/06 16:15:25-05:00 len.brown@intel.com +2 -3
#   ACPICA 20041203
# 
# ChangeSet
#   2004/12/06 16:57:17-05:00 len.brown@intel.com 
#   [ACPI] ACPICA 20041119 from Bob Moore
#   
#   Fixed a problem in acpi_ex_convert_to_integer
#   where new integers were not truncated to 32 bits for
#   32-bit ACPI tables. This routine converts buffers and
#   strings to integers.
#   
#   Implemented support to store a value to an Index() on a
#   String object.  This is an ACPI 2.0 feature that had not
#   yet been implemented.
#   
#   Implemented new behavior for storing objects to individual
#   package elements (via the Index() operator). The
#   previous behavior was to invoke the implicit conversion
#   rules if an object was already present at the index.
#   The new behavior is to simply delete any existing object
#   and directly store the new object. Although the ACPI
#   specification seems unclear on this subject, other ACPI
#   implementations behave in this manner.  (This is the root
#   of the AE_BAD_HEX_CONSTANT issue.)
#   
#   Modified the RSDP memory scan mechanism to support the
#   extended checksum for ACPI 2.0 (and above) RSDPs. Note
#   that the search continues until a valid RSDP signature is
#   found with a valid checksum.
#   
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# include/acpi/acoutput.h
#   2004/12/06 16:02:10-05:00 len.brown@intel.com +1 -1
#   ACPICA 20041119
# 
# include/acpi/acmacros.h
#   2004/12/06 16:02:10-05:00 len.brown@intel.com +12 -12
#   ACPICA 20041119
# 
# include/acpi/acconfig.h
#   2004/12/06 16:02:10-05:00 len.brown@intel.com +1 -1
#   ACPICA 20041119
# 
# drivers/acpi/tables/tbxfroot.c
#   2004/12/06 16:02:13-05:00 len.brown@intel.com +34 -11
#   ACPICA 20041119
# 
# drivers/acpi/tables/tbrsdt.c
#   2004/12/06 16:02:13-05:00 len.brown@intel.com +1 -0
#   ACPICA 20041119
# 
# drivers/acpi/executer/exstore.c
#   2004/12/06 16:02:13-05:00 len.brown@intel.com +26 -36
#   ACPICA 20041119
# 
# drivers/acpi/executer/exoparg2.c
#   2004/12/06 16:02:13-05:00 len.brown@intel.com +2 -2
#   ACPICA 20041119
# 
# drivers/acpi/executer/exdump.c
#   2004/12/06 16:56:20-05:00 len.brown@intel.com +5 -3
#   ACPICA 20041119
# 
# drivers/acpi/executer/exconvrt.c
#   2004/12/06 16:02:13-05:00 len.brown@intel.com +9 -7
#   ACPICA 20041119
# 
# drivers/acpi/executer/exconfig.c
#   2004/12/06 16:02:13-05:00 len.brown@intel.com +1 -1
#   ACPICA 20041119
# 
# ChangeSet
#   2004/12/06 16:08:50-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-hotplug
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/linux/acpi.h
#   2004/12/06 16:08:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/processor.c
#   2004/12/06 16:08:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_irq.c
#   2004/12/06 16:08:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/12/06 16:08:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/12/06 16:08:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/12/06 16:08:38-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/06 15:58:53-05:00 len.brown@intel.com 
#   merge
# 
# drivers/acpi/processor.c
#   2004/12/06 15:58:46-05:00 len.brown@intel.com +1 -1
#   merge
# 
# include/linux/acpi.h
#   2004/12/06 15:23:34-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_irq.c
#   2004/12/06 15:23:34-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_bind.c
#   2004/12/06 15:23:34-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/12/06 15:23:33-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/06 15:00:40-05:00 len.brown@intel.com 
#   build fix
# 
# include/acpi/acpixf.h
#   2004/12/06 15:00:29-05:00 len.brown@intel.com +1 -1
#   build fix
# 
# ChangeSet
#   2004/12/06 01:43:31-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-stable-dev
#   into intel.com:/home/lenb/src/26-latest-dev
# 
# drivers/acpi/ec.c
#   2004/12/06 01:43:27-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/06 01:40:07-05:00 len.brown@intel.com 
#   [ACPI] 32-bit EC access
#   
#   http://bugzilla.kernel.org/show_bug.cgi?id=1744
#   
#   Signed-off-by: Luming Yu <luming.yu@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/acpi/ec.c
#   2004/12/01 08:46:15-05:00 len.brown@intel.com +24 -0
#   32-bit EC access
# 
# ChangeSet
#   2004/12/06 00:09:58-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-stable-dev
#   into intel.com:/home/lenb/src/26-latest-dev
# 
# drivers/acpi/events/evxfevnt.c
#   2004/12/06 00:09:54-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/06 00:08:27-05:00 len.brown@intel.com 
#   build fix
# 
# drivers/acpi/events/evxfevnt.c
#   2004/12/06 00:08:18-05:00 len.brown@intel.com +1 -2
#   build fix
# 
# ChangeSet
#   2004/12/06 00:03:42-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-stable-dev
#   into intel.com:/home/lenb/src/26-latest-dev
# 
# drivers/acpi/thermal.c
#   2004/12/06 00:03:38-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/sleep/proc.c
#   2004/12/06 00:03:38-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_link.c
#   2004/12/06 00:03:38-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_irq.c
#   2004/12/06 00:03:38-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/ec.c
#   2004/12/06 00:03:38-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/12/06 00:03:38-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/12/06 00:03:38-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/05 23:40:35-05:00 len.brown@intel.com 
#   [ACPI] fixes from stack consumption audit
#   
#   http://bugzilla.kernel.org/show_bug.cgi?id=2901
#   
#   Signed-off-by: Luming Yu <luming.yu@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/acpi/video.c
#   2004/12/01 06:31:48-05:00 len.brown@intel.com +7 -6
#   stack consumption audit
# 
# drivers/acpi/thermal.c
#   2004/12/01 06:49:30-05:00 len.brown@intel.com +22 -5
#   stack consumption audit
# 
# drivers/acpi/pci_link.c
#   2004/12/01 06:42:40-05:00 len.brown@intel.com +36 -26
#   stack consumption audit
# 
# drivers/acpi/pci_irq.c
#   2004/12/01 06:31:47-05:00 len.brown@intel.com +12 -2
#   stack consumption audit
# 
# drivers/acpi/pci_bind.c
#   2004/12/01 06:31:47-05:00 len.brown@intel.com +30 -7
#   stack consumption audit
# 
# ChangeSet
#   2004/12/05 23:38:12-05:00 len.brown@intel.com 
#   [ACPI] handle GPE sharing between button and lid
#   
#   http://bugzilla.kernel.org/show_bug.cgi?id=3518
#   
#   Signed-off-by: David Shaohua Li <shaohua.li@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/acpi/sleep/proc.c
#   2004/12/05 23:38:04-05:00 len.brown@intel.com +17 -0
#   sharing GPE w/ button and LID
# 
# ChangeSet
#   2004/12/05 23:23:53-05:00 len.brown@intel.com 
#   [ACPI] add "acpi_fake_ecdt" workaround for Gateway:
#   ex_access_region Region EmbeddedControl(3) has no handler
#   
#   http://bugzilla.kernel.org/show_bug.cgi?id=1690
#   
#   Signed-off-by: David Shaohua Li <shaohua.li@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/acpi/ec.c
#   2004/12/05 23:23:45-05:00 len.brown@intel.com +107 -4
#   "acpi_fake_ecdt"
# 
# Documentation/kernel-parameters.txt
#   2004/12/05 23:23:45-05:00 len.brown@intel.com +2 -0
#   "acpi_fake_ecdt"
# 
# ChangeSet
#   2004/12/05 23:10:31-05:00 len.brown@intel.com 
#   [ACPI] fix "Error getting context for object" warning
#   http://bugzilla.kernel.org/show_bug.cgi?id=3805
#   
#   Signed-off-by: David Shaohua Li <shaohua.li@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/pnp/pnpacpi/core.c
#   2004/11/25 20:28:37-05:00 len.brown@intel.com +3 -3
#   fix "Error getting context for object" warning
# 
# drivers/acpi/bus.c
#   2004/11/25 20:09:42-05:00 len.brown@intel.com +1 -1
#   fix "Error getting context for object" warning
# 
# ChangeSet
#   2004/12/05 22:52:35-05:00 len.brown@intel.com 
#   [ACPI] S3 resume using RTC
#   http://bugzilla.kernel.org/show_bug.cgi?id=1320
#   
#   By: Patrick Mochel, Karol Kozimor, Shaohua Li
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/acpi/sleep/proc.c
#   2004/11/22 22:02:27-05:00 len.brown@intel.com +36 -25
#   wake on RTC
# 
# ChangeSet
#   2004/12/03 22:40:32-05:00 len.brown@intel.com 
#   [ACPI] fix VIA IRQ issue by enabling VIA quirk
#   http://bugzilla.kernel.org/show_bug.cgi?id=3319
#   
#   Signed-off-by: David Shaohua Li <shaohua.li@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/pci/quirks.c
#   2004/12/02 20:01:29-05:00 len.brown@intel.com +1 -0
#   yet another example of VIA quirk
# 
# ChangeSet
#   2004/12/01 23:50:22-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-ref
#   into intel.com:/home/lenb/src/26-latest-dev
# 
# arch/ia64/kernel/process.c
#   2004/12/01 23:50:18-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/01 19:21:17-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-ref
#   into intel.com:/home/lenb/src/26-latest-dev
# 
# arch/ia64/kernel/process.c
#   2004/12/01 19:21:13-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/01 11:27:11-05:00 len.brown@intel.com 
#   fix merge error specific to the mm tree, which resulted in a build warning
#   in drivers/char/ipmi/ipmi_si_intf.c
# 
# drivers/char/ipmi/ipmi_si_intf.c
#   2004/12/01 11:27:03-05:00 len.brown@intel.com +3 -1
#   fix merge error specific to the mm tree, which resulted in a build warning.
# 
# ChangeSet
#   2004/12/01 02:39:43-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/asm-i386/io_apic.h
#   2004/12/01 02:39:39-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-i386/acpi.h
#   2004/12/01 02:39:39-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/char/ipmi/ipmi_si_intf.c
#   2004/12/01 02:39:39-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/mpparse.c
#   2004/12/01 02:39:39-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/12/01 02:39:39-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/30 21:59:51-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-hotplug
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/asm-x86_64/io_apic.h
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/scan.c
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_irq.c
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Makefile
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/io_apic.c
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/ia64/kernel/setup.c
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# BitKeeper/deleted/.del-acpi_ksyms.c~3e52a41ca5aed029
#   2004/11/30 21:59:46-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# BitKeeper/deleted/.del-acpi_ksyms.c~3e52a41ca5aed029
#   2004/11/30 21:59:45-05:00 len.brown@intel.com +0 -0
#   Merge rename: drivers/acpi/acpi_ksyms.c -> BitKeeper/deleted/.del-acpi_ksyms.c~3e52a41ca5aed029
# 
# ChangeSet
#   2004/11/30 17:38:34-05:00 len.brown@intel.com 
#   merge
# 
# drivers/acpi/scan.c
#   2004/11/30 17:38:27-05:00 len.brown@intel.com +0 -2
#   merge
# 
# BitKeeper/deleted/.del-acpi_ksyms.c~3e52a41ca5aed029
#   2004/11/30 17:15:57-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_irq.c
#   2004/11/30 17:15:57-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_bind.c
#   2004/11/30 17:15:57-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/11/30 17:15:57-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Makefile
#   2004/11/30 17:15:57-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/11/30 17:15:57-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# BitKeeper/deleted/.del-acpi_ksyms.c~3e52a41ca5aed029
#   2004/11/30 17:15:57-05:00 len.brown@intel.com +0 -0
#   Merge rename: drivers/acpi/acpi_ksyms.c -> BitKeeper/deleted/.del-acpi_ksyms.c~3e52a41ca5aed029
# 
# ChangeSet
#   2004/11/11 03:42:08-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/asm-i386/acpi.h
#   2004/11/11 03:42:04-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/dmi_scan.c
#   2004/11/11 03:42:04-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/Makefile
#   2004/11/11 03:42:04-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/11 02:58:05-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-hotplug
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/linux/acpi.h
#   2004/11/11 02:58:02-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/scan.c
#   2004/11/11 02:58:02-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/processor.c
#   2004/11/11 02:58:02-05:00 len.brown@intel.com +0 -5
#   Auto merged
# 
# drivers/acpi/pci_irq.c
#   2004/11/11 02:58:01-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/11/11 02:58:01-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/11/11 02:58:01-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/11 02:56:38-05:00 len.brown@intel.com 
#   [ACPI] CPU hotplug, use kobject_hotplug(), kobject_register()
#   
#   Signed-off-by: Anil S. Keshavamurthy <anil.s.keshavamurthy@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/acpi/scan.c
#   2004/11/11 02:56:31-05:00 len.brown@intel.com +1 -2
#   Use kobject_register()
# 
# drivers/acpi/processor.c
#   2004/11/11 02:56:31-05:00 len.brown@intel.com +4 -54
#   Use kobject_hotplug()
# 
# drivers/acpi/container.c
#   2004/11/11 02:56:31-05:00 len.brown@intel.com +3 -49
#   Use kobject_hotplug()
# 
# ChangeSet
#   2004/11/11 02:44:40-05:00 len.brown@intel.com 
#   merge
# 
# include/linux/acpi.h
#   2004/11/11 02:44:32-05:00 len.brown@intel.com +0 -0
#   merge
# 
# drivers/acpi/scan.c
#   2004/11/11 02:44:32-05:00 len.brown@intel.com +0 -0
#   merge
# 
# drivers/acpi/processor.c
#   2004/11/11 02:44:32-05:00 len.brown@intel.com +5 -4
#   merge
# 
# ChangeSet
#   2004/11/11 02:35:00-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/asm-i386/acpi.h
#   2004/11/11 02:34:56-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/11/11 02:34:56-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/Makefile
#   2004/11/11 02:34:56-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_irq.c
#   2004/11/10 23:16:23-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/11/10 23:16:23-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/11/10 23:16:17-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/10 18:30:19-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/asm-i386/acpi.h
#   2004/11/10 18:30:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/scan.c
#   2004/11/10 18:30:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/processor.c
#   2004/11/10 18:30:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/11/10 18:30:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/dmi_scan.c
#   2004/11/10 18:30:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/10 18:30:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/09 04:12:53-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/asm-i386/acpi.h
#   2004/11/09 04:12:50-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/pci_irq.c
#   2004/11/09 04:12:50-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/mpparse.c
#   2004/11/09 04:12:50-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/08 15:53:36-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# arch/x86_64/kernel/Makefile
#   2004/11/08 15:53:27-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/08 15:53:27-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/05 23:13:12-05:00 len.brown@intel.com 
#   merge
# 
# include/linux/acpi.h
#   2004/11/05 23:13:06-05:00 len.brown@intel.com +9 -8
#   merge
# 
# drivers/acpi/processor.c
#   2004/11/05 23:13:05-05:00 len.brown@intel.com +5 -4
#   merge
# 
# arch/x86_64/kernel/setup.c
#   2004/11/05 23:07:24-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/11/05 23:07:24-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/dmi_scan.c
#   2004/11/05 23:07:24-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/05 23:07:24-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/02 03:52:41-05:00 len.brown@intel.com 
#   Merge
# 
# drivers/acpi/scan.c
#   2004/11/02 03:52:39-05:00 len.brown@intel.com +0 -0
#   SCCS merged
# 
# include/asm-x86_64/mpspec.h
#   2004/11/02 03:43:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/processor.c
#   2004/11/02 03:43:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/11/02 03:43:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/mpparse.c
#   2004/11/02 03:43:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/io_apic.c
#   2004/11/02 03:43:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/11/02 03:43:15-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/11/02 03:43:14-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/Makefile
#   2004/11/02 03:43:14-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/02 03:43:14-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/31 01:17:23-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-hotplug
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# drivers/acpi/processor.c
#   2004/10/31 01:17:19-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/31 01:14:20-05:00 len.brown@intel.com 
#   [ACPI] fix mis-merge in processor.c
# 
# drivers/acpi/processor.c
#   2004/10/31 01:14:09-05:00 len.brown@intel.com +2 -60
#   delete dupe acpi_processor_start() definition
# 
# ChangeSet
#   2004/10/28 05:02:07-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-hotplug
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/linux/acpi.h
#   2004/10/28 05:02:03-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/acpi/acpi_bus.h
#   2004/10/28 05:02:03-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/processor.c
#   2004/10/28 05:02:02-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/10/28 05:01:56-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/28 05:00:02-04:00 len.brown@intel.com 
#   merge
# 
# include/acpi/acpi_bus.h
#   2004/10/28 04:59:55-04:00 len.brown@intel.com +0 -0
#   merge
# 
# drivers/acpi/processor.c
#   2004/10/28 04:59:55-04:00 len.brown@intel.com +66 -2
#   merge
# 
# include/linux/acpi.h
#   2004/10/28 04:45:11-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/scan.c
#   2004/10/28 04:45:11-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/28 04:05:58-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-hotplug
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/linux/acpi.h
#   2004/10/28 04:05:54-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/acpi/acpi_drivers.h
#   2004/10/28 04:05:54-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/acpi/acpi_bus.h
#   2004/10/28 04:05:54-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/processor.c
#   2004/10/28 04:05:54-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/acpi_ksyms.c
#   2004/10/28 04:05:54-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Makefile
#   2004/10/28 04:05:54-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Kconfig
#   2004/10/28 04:05:53-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/ia64/kernel/acpi.c
#   2004/10/28 04:05:53-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/10/28 04:05:53-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/28 04:01:25-04:00 len.brown@intel.com 
#   [ACPI] Initial container driver to support hotplug notifications
#   on ACPI0004, PNP0A05 and PNP0A06 devices.
#   
#   Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# include/acpi/container.h
#   2004/09/24 18:26:34-04:00 len.brown@intel.com +13 -0
#   Import patch container_drv.patch
# 
# drivers/acpi/container.c
#   2004/09/24 18:26:34-04:00 len.brown@intel.com +344 -0
#   Import patch container_drv.patch
# 
# include/acpi/container.h
#   2004/09/24 18:26:34-04:00 len.brown@intel.com +0 -0
#   BitKeeper file /home/lenb/src/26-latest-hotplug/include/acpi/container.h
# 
# drivers/acpi/container.c
#   2004/09/24 18:26:34-04:00 len.brown@intel.com +0 -0
#   BitKeeper file /home/lenb/src/26-latest-hotplug/drivers/acpi/container.c
# 
# drivers/acpi/Makefile
#   2004/09/24 18:26:34-04:00 len.brown@intel.com +1 -0
#   Import patch container_drv.patch
# 
# drivers/acpi/Kconfig
#   2004/09/24 18:26:34-04:00 len.brown@intel.com +9 -1
#   Import patch container_drv.patch
# 
# ChangeSet
#   2004/10/28 03:55:03-04:00 len.brown@intel.com 
#   [ACPI] Extend processor driver to support ACPI-based Physical CPU hotplug
#   
#   Signed-off-by Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
#   Signed-off-by: Len Brown <len.brown2intel.com>
# 
# drivers/acpi/processor.c
#   2004/10/28 03:54:49-04:00 len.brown@intel.com +414 -66
#   Import patch processor_drv.patch
# 
# drivers/acpi/Kconfig
#   2004/09/24 18:26:31-04:00 len.brown@intel.com +8 -0
#   Import patch processor_drv.patch
# 
# ChangeSet
#   2004/10/28 03:41:43-04:00 len.brown@intel.com 
#   IA64 CPU hotplug topology
#   
#   Extend support for dynamic registration and unregistration of the cpu,
#   by implementing and exporting arch_register_cpu()/arch_unregister_cpu().
#   Also combine multiple implementation of topology_init() functions to
#   single topology_init() in case of ia64 architecture.
#   
#   Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# include/linux/cpu.h
#   2004/09/24 18:26:27-04:00 len.brown@intel.com +3 -0
#   Import patch topology.patch
# 
# include/asm-ia64/cpu.h
#   2004/09/24 18:26:27-04:00 len.brown@intel.com +5 -0
#   Import patch topology.patch
# 
# include/asm-i386/cpu.h
#   2004/09/24 18:26:27-04:00 len.brown@intel.com +4 -13
#   Import patch topology.patch
# 
# drivers/base/cpu.c
#   2004/09/24 18:26:27-04:00 len.brown@intel.com +18 -2
#   Import patch topology.patch
# 
# arch/ia64/mm/numa.c
#   2004/10/28 03:36:29-04:00 len.brown@intel.com +0 -36
#   Import patch topology.patch
# 
# arch/ia64/kernel/topology.c
#   2004/09/24 18:26:27-04:00 len.brown@intel.com +70 -23
#   Import patch topology.patch
# 
# arch/ia64/kernel/Makefile
#   2004/09/24 18:26:27-04:00 len.brown@intel.com +2 -1
#   Import patch topology.patch
# 
# arch/ia64/dig/Makefile
#   2004/09/24 18:26:27-04:00 len.brown@intel.com +0 -5
#   Import patch topology.patch
# 
# arch/i386/mach-default/topology.c
#   2004/09/24 18:26:27-04:00 len.brown@intel.com +31 -0
#   Import patch topology.patch
# 
# ChangeSet
#   2004/10/28 03:28:17-04:00 len.brown@intel.com 
#   [ACPI] IA64-specific support for mapping lsapic to cpu array.
#   analogous i386 and x86_64 code TBD
#   
#   Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# include/linux/acpi.h
#   2004/09/27 12:55:27-04:00 len.brown@intel.com +14 -0
#   Import patch acpi_hotplug_arch.patch
# 
# include/asm-ia64/acpi.h
#   2004/09/27 13:00:17-04:00 len.brown@intel.com +1 -1
#   Import patch acpi_hotplug_arch.patch
# 
# drivers/acpi/numa.c
#   2004/09/27 13:04:23-04:00 len.brown@intel.com +20 -1
#   Import patch acpi_hotplug_arch.patch
# 
# arch/ia64/kernel/acpi.c
#   2004/10/28 03:26:31-04:00 len.brown@intel.com +106 -2
#   Import patch acpi_hotplug_arch.patch
# 
# arch/i386/kernel/acpi/boot.c
#   2004/09/27 12:55:27-04:00 len.brown@intel.com +22 -0
#   Import patch acpi_hotplug_arch.patch
# 
# ChangeSet
#   2004/10/28 03:14:52-04:00 len.brown@intel.com 
#   [ACPI] create ACPI hotplug eject interface
#   
#   The kernel when it receives an hardware sci eject request it simply passes this
#   to user mode agent and the agent in turn will offline all the child devices and
#   then echo's 1 onto the eject file for that acpi device.
#   
#   This patch provides the sysfs "eject" interface for the user mode agent
#   to notify the core acpi so that the core acpi can trim its bus which 
#   causes .remove function to be called for all child devices.
#   
#   For example for LSB0 which is an ejectable device, we will see
#   /sys/firmware/acpi/namespace/ACPI/_SB/LSB/eject.
#   
#   Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/acpi/scan.c
#   2004/09/24 18:26:20-04:00 len.brown@intel.com +153 -0
#   Import patch acpi_core_eject.patch
# 
# ChangeSet
#   2004/10/28 02:59:39-04:00 len.brown@intel.com 
#   [ACPI] Provide core hotplug support in ACPI
#   
#   Create acpi_bus_trim(), acpi_bus_remove() and acpi_pci_unbind(),
#   The reverse of of acpi_bus_scan(), acpi_bus_add() and acpi_pci_bind()
#   
#   Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# include/acpi/acpi_drivers.h
#   2004/09/24 18:26:17-04:00 len.brown@intel.com +2 -0
#   Import patch acpi_core.patch
# 
# include/acpi/acpi_bus.h
#   2004/10/28 02:59:06-04:00 len.brown@intel.com +9 -1
#   Import patch acpi_core.patch
# 
# drivers/acpi/scan.c
#   2004/09/24 18:26:17-04:00 len.brown@intel.com +122 -9
#   Import patch acpi_core.patch
# 
# drivers/acpi/pci_irq.c
#   2004/09/24 18:26:17-04:00 len.brown@intel.com +39 -3
#   Import patch acpi_core.patch
# 
# drivers/acpi/pci_bind.c
#   2004/09/24 18:26:17-04:00 len.brown@intel.com +45 -0
#   Import patch acpi_core.patch
# 
# drivers/acpi/bus.c
#   2004/09/24 18:26:17-04:00 len.brown@intel.com +0 -4
#   Import patch acpi_core.patch
# 
# drivers/acpi/acpi_ksyms.c
#   2004/09/24 18:26:17-04:00 len.brown@intel.com +3 -0
#   Import patch acpi_core.patch
# 
# ChangeSet
#   2004/10/26 02:34:54-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/acpi/acpi_bus.h
#   2004/10/26 02:34:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Makefile
#   2004/10/26 02:34:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Kconfig
#   2004/10/26 02:34:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/Makefile
#   2004/10/26 02:34:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/10/26 02:34:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/10/26 02:34:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/Makefile
#   2004/10/26 02:34:49-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/23 02:53:12-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# sound/drivers/mpu401/mpu401.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-x86_64/mpspec.h
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-x86_64/acpi.h
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-i386/mpspec.h
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/char/ipmi/ipmi_si_intf.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/processor.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Makefile
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Kconfig
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/Makefile
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/mpparse.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/io_apic.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/ia64/kernel/acpi.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/mpparse.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/10/23 02:47:28-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/10/23 02:47:27-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/10/23 02:47:27-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/19 13:36:18-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# drivers/acpi/processor.c
#   2004/10/19 13:36:14-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/10/19 13:36:14-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/19 12:22:10-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# include/asm-i386/io_apic.h
#   2004/10/19 12:22:03-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/10/19 12:22:03-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/10/19 12:22:03-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/10/19 12:22:03-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/10/19 12:22:02-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/10/19 12:22:02-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/14 14:05:31-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# arch/i386/kernel/io_apic.c
#   2004/10/14 14:05:27-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/10 04:34:32-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-dominik
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# drivers/acpi/acpi_ksyms.c
#   2004/10/10 04:34:29-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/08 18:51:45-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-dev
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# drivers/acpi/Kconfig
#   2004/10/08 18:51:41-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/10/08 18:51:41-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/08 18:44:00-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-latest-dominik
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# arch/x86_64/kernel/io_apic.c
#   2004/10/08 18:43:56-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/10/08 18:43:56-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/08 18:01:04-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-ref
#   into intel.com:/home/lenb/bk/26-latest-mm
# 
# drivers/Makefile
#   2004/10/08 18:01:00-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/10/08 18:01:00-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/io_apic.c
#   2004/10/08 18:01:00-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/10/08 18:01:00-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/ia64/kernel/setup.c
#   2004/10/08 18:01:00-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/ia64/kernel/acpi.c
#   2004/10/08 18:01:00-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/setup.c
#   2004/10/08 18:01:00-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/10/08 18:01:00-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/17 00:29:39-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/linux-acpi-test-mm
# 
# drivers/Makefile
#   2004/09/17 00:29:35-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/Kconfig
#   2004/09/17 00:29:35-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/dmi_scan.c
#   2004/09/17 00:29:35-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/09/17 00:29:35-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/10 16:26:55-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/linux-acpi-test-mm
# 
# include/asm-x86_64/mpspec.h
#   2004/09/10 16:26:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/Makefile
#   2004/09/10 16:26:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/09/10 16:26:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/ia64/kernel/acpi.c
#   2004/09/10 16:26:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/02 03:39:43-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/linux-acpi-test-mm
# 
# include/linux/acpi.h
#   2004/09/02 03:39:35-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/acpi/acpi_drivers.h
#   2004/09/02 03:39:35-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/acpi/Kconfig
#   2004/09/02 03:39:35-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/io_apic.c
#   2004/09/02 03:39:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/09/02 03:39:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/dmi_scan.c
#   2004/09/02 03:39:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/09/02 03:39:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/02 03:25:49-04:00 len.brown@intel.com 
#   merge
# 
# arch/x86_64/Kconfig
#   2004/09/02 03:25:42-04:00 len.brown@intel.com +1 -0
#   merge
# 
# sound/drivers/mpu401/mpu401.c
#   2004/09/02 03:20:35-04:00 len.brown@intel.com +3 -3
#   Auto merged
# 
# include/asm-x86_64/mpspec.h
#   2004/09/02 03:20:35-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-x86_64/acpi.h
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-i386/fixmap.h
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-i386/acpi.h
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/char/ipmi/ipmi_si_intf.c
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +1 -2
#   Auto merged
# 
# drivers/Makefile
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/setup.c
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/Makefile
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/09/02 03:20:34-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/02 03:00:54-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/linux-acpi-test-mm
# 
# sound/drivers/mpu401/mpu401.c
#   2004/09/02 03:00:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/setup.c
#   2004/09/02 03:00:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/09/02 03:00:50-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/Makefile
#   2004/09/02 03:00:49-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/01 20:28:43-04:00 len.brown@intel.com 
#   Cset exclude: len.brown@intel.com|ChangeSet|20040817220851|52337
# 
# arch/i386/kernel/dmi_scan.c
#   2004/09/01 20:28:41-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# ChangeSet
#   2004/09/01 20:26:54-04:00 len.brown@intel.com 
#   Cset exclude: len.brown@intel.com|ChangeSet|20040826050001|40089
# 
# sound/drivers/mpu401/mpu401.c
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/linux/acpi.h
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/asm-i386/mpspec.h
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/asm-i386/io_apic.h
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/asm-i386/fixmap.h
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# drivers/acpi/acpi_ksyms.c
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# drivers/acpi/Makefile
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# drivers/acpi/Kconfig
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# drivers/Makefile
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/x86_64/Kconfig
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/ia64/kernel/setup.c
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/ia64/kernel/acpi.c
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/i386/kernel/setup.c
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/i386/kernel/mpparse.c
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/i386/kernel/io_apic.c
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/i386/kernel/dmi_scan.c
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/i386/kernel/acpi/Makefile
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/i386/kernel/Makefile
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/i386/Kconfig
#   2004/09/01 20:26:43-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/asm-x86_64/mpspec.h
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/asm-x86_64/io_apic.h
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/asm-x86_64/acpi.h
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/asm-i386/acpi.h
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/acpi/acpi_drivers.h
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# include/acpi/acpi_bus.h
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# drivers/char/ipmi/ipmi_si_intf.c
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/x86_64/kernel/setup.c
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/x86_64/kernel/mpparse.c
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/x86_64/kernel/io_apic.c
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/x86_64/kernel/acpi/Makefile
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/x86_64/kernel/Makefile
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# arch/i386/kernel/acpi/boot.c
#   2004/09/01 20:26:42-04:00 len.brown@intel.com +0 -0
#   Exclude
# 
# ChangeSet
#   2004/08/27 01:25:27-04:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/bk/26-latest-test
#   into intel.com:/home/lenb/bk/linux-acpi-test-mm
# 
# include/asm-i386/acpi.h
#   2004/08/27 01:25:23-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/acpi/boot.c
#   2004/08/27 01:25:23-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/Makefile
#   2004/08/27 01:25:23-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/26 01:04:55-04:00 len.brown@intel.com 
#   merge
# 
# arch/x86_64/Kconfig
#   2004/08/26 01:04:50-04:00 len.brown@intel.com +0 -1
#   merge
# 
# include/asm-x86_64/mpspec.h
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-x86_64/acpi.h
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-i386/fixmap.h
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# include/asm-i386/acpi.h
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# drivers/char/ipmi/ipmi_si_intf.c
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -3
#   Auto merged
# 
# drivers/Makefile
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/io_apic.c
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/Makefile
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/08/26 01:01:12-04:00 len.brown@intel.com +0 -0
#   Auto merged
# 
diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt	2004-12-12 21:35:26 -08:00
+++ b/Documentation/kernel-parameters.txt	2004-12-12 21:35:26 -08:00
@@ -150,6 +150,8 @@
 			debugging. After system has booted up, it can be set
 			via /proc/acpi/debug_level.
 
+	acpi_fake_ecdt	[HW,ACPI] Workaround failure due to BIOS lacking ECDT
+
 	ad1816=		[HW,OSS]
 			Format: <io>,<irq>,<dma>,<dma2>
 			See also Documentation/sound/oss/AD1816.
diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
--- a/arch/i386/kernel/acpi/boot.c	2004-12-12 21:35:26 -08:00
+++ b/arch/i386/kernel/acpi/boot.c	2004-12-12 21:35:26 -08:00
@@ -484,6 +484,28 @@
 }
 EXPORT_SYMBOL(acpi_register_gsi);
 
+/*
+ *  ACPI based hotplug support for CPU
+ */
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
+int
+acpi_map_lsapic(acpi_handle handle, int *pcpu)
+{
+	/* TBD */
+	return -EINVAL;
+}
+EXPORT_SYMBOL(acpi_map_lsapic);
+
+
+int
+acpi_unmap_lsapic(int cpu)
+{
+	/* TBD */
+	return -EINVAL;
+}
+EXPORT_SYMBOL(acpi_unmap_lsapic);
+#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+
 static unsigned long __init
 acpi_scan_rsdp (
 	unsigned long		start,
diff -Nru a/arch/i386/mach-default/topology.c b/arch/i386/mach-default/topology.c
--- a/arch/i386/mach-default/topology.c	2004-12-12 21:35:26 -08:00
+++ b/arch/i386/mach-default/topology.c	2004-12-12 21:35:26 -08:00
@@ -32,6 +32,37 @@
 
 struct i386_cpu cpu_devices[NR_CPUS];
 
+int arch_register_cpu(int num){
+	struct node *parent = NULL;
+	
+#ifdef CONFIG_NUMA
+	int node = cpu_to_node(num);
+	if (node_online(node))
+		parent = &node_devices[node].node;
+#endif /* CONFIG_NUMA */
+
+	return register_cpu(&cpu_devices[num].cpu, num, parent);
+}
+
+#ifdef CONFIG_HOTPLUG_CPU
+
+void arch_unregister_cpu(int num) {
+	struct node *parent = NULL;
+
+#ifdef CONFIG_NUMA
+	int node = cpu_to_node(num);
+	if (node_online(node))
+		parent = &node_devices[node].node;
+#endif /* CONFIG_NUMA */
+
+	return unregister_cpu(&cpu_devices[num].cpu, parent);
+}
+EXPORT_SYMBOL(arch_register_cpu);
+EXPORT_SYMBOL(arch_unregister_cpu);
+#endif /*CONFIG_HOTPLUG_CPU*/
+
+
+
 #ifdef CONFIG_NUMA
 #include <linux/mmzone.h>
 #include <asm/node.h>
diff -Nru a/arch/ia64/dig/Makefile b/arch/ia64/dig/Makefile
--- a/arch/ia64/dig/Makefile	2004-12-12 21:35:26 -08:00
+++ b/arch/ia64/dig/Makefile	2004-12-12 21:35:26 -08:00
@@ -6,9 +6,4 @@
 #
 
 obj-y := setup.o
-
-ifndef CONFIG_NUMA
-obj-$(CONFIG_IA64_DIG) += topology.o
-endif
-
 obj-$(CONFIG_IA64_GENERIC) += machvec.o
diff -Nru a/arch/ia64/dig/topology.c b/arch/ia64/dig/topology.c
--- a/arch/ia64/dig/topology.c	2004-12-12 21:35:26 -08:00
+++ /dev/null	Wed Dec 31 16:00:00 196900
@@ -1,43 +0,0 @@
-/*
- * arch/ia64/dig/topology.c
- *	Popuate driverfs with topology information.
- *	Derived entirely from i386/mach-default.c
- *  Intel Corporation - Ashok Raj
- */
-#include <linux/init.h>
-#include <linux/smp.h>
-#include <linux/cpumask.h>
-#include <linux/percpu.h>
-#include <linux/notifier.h>
-#include <linux/cpu.h>
-#include <asm/cpu.h>
-
-static DEFINE_PER_CPU(struct ia64_cpu, cpu_devices);
-
-/*
- * First Pass: simply borrowed code for now. Later should hook into
- * hotplug notification for node/cpu/memory as applicable
- */
-
-static int arch_register_cpu(int num)
-{
-	struct node *parent = NULL;
-
-#ifdef CONFIG_NUMA
-	//parent = &node_devices[cpu_to_node(num)].node;
-#endif
-
-	return register_cpu(&per_cpu(cpu_devices,num).cpu, num, parent);
-}
-
-static int __init topology_init(void)
-{
-    int i;
-
-    for_each_cpu(i) {
-        arch_register_cpu(i);
-	}
-    return 0;
-}
-
-subsys_initcall(topology_init);
diff -Nru a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
--- a/arch/ia64/kernel/Makefile	2004-12-12 21:35:26 -08:00
+++ b/arch/ia64/kernel/Makefile	2004-12-12 21:35:26 -08:00
@@ -6,7 +6,8 @@
 
 obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o	\
 	 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o		\
-	 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o unwind.o mca.o mca_asm.o
+	 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
+	 unwind.o mca.o mca_asm.o topology.o
 
 obj-$(CONFIG_IA64_BRL_EMU)	+= brl_emu.o
 obj-$(CONFIG_IA64_GENERIC)	+= acpi-ext.o
diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
--- a/arch/ia64/kernel/acpi.c	2004-12-12 21:35:26 -08:00
+++ b/arch/ia64/kernel/acpi.c	2004-12-12 21:35:26 -08:00
@@ -355,11 +355,11 @@
 #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)
 
 static int __initdata srat_num_cpus;			/* number of cpus */
-static u32 __initdata pxm_flag[PXM_FLAG_LEN];
+static u32 __devinitdata pxm_flag[PXM_FLAG_LEN];
 #define pxm_bit_set(bit)	(set_bit(bit,(void *)pxm_flag))
 #define pxm_bit_test(bit)	(test_bit(bit,(void *)pxm_flag))
 /* maps to convert between proximity domain and logical node ID */
-int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS];
+int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
 int __initdata nid_to_pxm_map[MAX_NUMNODES];
 static struct acpi_table_slit __initdata *slit_table;
 
@@ -651,6 +651,110 @@
 	}
 	return 0;
 }
+
+/*
+ *  ACPI based hotplug CPU support
+ */
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
+static
+int
+acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
+{
+#ifdef CONFIG_ACPI_NUMA
+	int 			pxm_id;
+
+	pxm_id = acpi_get_pxm(handle);
+
+	/*
+	 * Assuming that the container driver would have set the proximity
+	 * domain and would have initialized pxm_to_nid_map[pxm_id] && pxm_flag
+	 */
+	node_cpuid[cpu].nid = (pxm_id < 0) ? 0:
+			pxm_to_nid_map[pxm_id];
+
+	node_cpuid[cpu].phys_id =  physid;
+#endif
+	return(0);
+}
+
+
+int
+acpi_map_lsapic(acpi_handle handle, int *pcpu)
+{
+	struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+	union acpi_object *obj;
+	struct acpi_table_lsapic *lsapic;
+	cpumask_t tmp_map;
+	long physid;
+	int cpu;
+ 
+	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
+		return -EINVAL;
+
+	if (!buffer.length ||  !buffer.pointer)
+		return -EINVAL;
+ 
+	obj = buffer.pointer;
+	if (obj->type != ACPI_TYPE_BUFFER ||
+	    obj->buffer.length < sizeof(*lsapic)) {
+		acpi_os_free(buffer.pointer);
+		return -EINVAL;
+	}
+
+	lsapic = (struct acpi_table_lsapic *)obj->buffer.pointer;
+
+	if ((lsapic->header.type != ACPI_MADT_LSAPIC) ||
+	    (!lsapic->flags.enabled)) {
+		acpi_os_free(buffer.pointer);
+		return -EINVAL;
+	}
+
+	physid = ((lsapic->id <<8) | (lsapic->eid));
+
+	acpi_os_free(buffer.pointer);
+	buffer.length = ACPI_ALLOCATE_BUFFER;
+	buffer.pointer = NULL;
+
+	cpus_complement(tmp_map, cpu_present_map);
+	cpu = first_cpu(tmp_map);
+	if(cpu >= NR_CPUS)
+		return -EINVAL;
+
+	acpi_map_cpu2node(handle, cpu, physid);
+
+ 	cpu_set(cpu, cpu_present_map);
+	ia64_cpu_to_sapicid[cpu] = physid;
+	ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu];
+
+	*pcpu = cpu;
+	return(0);
+}
+EXPORT_SYMBOL(acpi_map_lsapic);
+
+
+int
+acpi_unmap_lsapic(int cpu)
+{
+	int i;
+
+	for (i=0; i<MAX_SAPICS; i++) {
+ 		if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) {
+ 			ia64_acpiid_to_sapicid[i] = -1;
+ 			break;
+ 		}
+ 	}
+	ia64_cpu_to_sapicid[cpu] = -1;
+	cpu_clear(cpu,cpu_present_map);
+
+#ifdef CONFIG_ACPI_NUMA
+	/* NUMA specific cleanup's */
+#endif
+
+	return(0);
+}
+EXPORT_SYMBOL(acpi_unmap_lsapic);
+#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+ 
 
 #ifdef CONFIG_NUMA
 acpi_status __init
diff -Nru a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/arch/ia64/kernel/topology.c	2004-12-12 21:35:26 -08:00
@@ -0,0 +1,90 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * This file contains NUMA specific variables and functions which can
+ * be split away from DISCONTIGMEM and are used on NUMA machines with
+ * contiguous memory.
+ * 		2002/08/07 Erich Focht <efocht@ess.nec.de>
+ * Populate cpu entries in sysfs for non-numa systems as well
+ *  	Intel Corporation - Ashok Raj
+ */
+
+#include <linux/config.h>
+#include <linux/cpu.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/node.h>
+#include <linux/init.h>
+#include <linux/bootmem.h>
+#include <asm/mmzone.h>
+#include <asm/numa.h>
+#include <asm/cpu.h>
+
+#ifdef CONFIG_NUMA
+static struct node *sysfs_nodes;
+#endif
+static struct ia64_cpu *sysfs_cpus;
+
+int arch_register_cpu(int num)
+{
+	struct node *parent = NULL;
+	
+#ifdef CONFIG_NUMA
+	parent = &sysfs_nodes[cpu_to_node(num)];
+#endif /* CONFIG_NUMA */
+
+	return register_cpu(&sysfs_cpus[num].cpu, num, parent);
+}
+
+#ifdef CONFIG_HOTPLUG_CPU
+
+void arch_unregister_cpu(int num)
+{
+	struct node *parent = NULL;
+
+#ifdef CONFIG_NUMA
+	int node = cpu_to_node(num);
+	parent = &sysfs_nodes[node];
+#endif /* CONFIG_NUMA */
+
+	return unregister_cpu(&sysfs_cpus[num].cpu, parent);
+}
+EXPORT_SYMBOL(arch_register_cpu);
+EXPORT_SYMBOL(arch_unregister_cpu);
+#endif /*CONFIG_HOTPLUG_CPU*/
+
+
+static int __init topology_init(void)
+{
+	int i, err = 0;
+
+#ifdef CONFIG_NUMA
+	sysfs_nodes = kmalloc(sizeof(struct node) * MAX_NUMNODES, GFP_KERNEL);
+	if (!sysfs_nodes) {
+		err = -ENOMEM;
+		goto out;
+	}
+	memset(sysfs_nodes, 0, sizeof(struct node) * MAX_NUMNODES);
+
+	for (i = 0; i < numnodes; i++)
+		if ((err = register_node(&sysfs_nodes[i], i, 0)))
+			goto out;
+#endif
+
+	sysfs_cpus = kmalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
+	if (!sysfs_cpus) {
+		err = -ENOMEM;
+		goto out;
+	}
+	memset(sysfs_cpus, 0, sizeof(struct ia64_cpu) * NR_CPUS);
+
+	for_each_present_cpu(i)
+		if((err = arch_register_cpu(i)))
+			goto out;
+out:
+	return err;
+}
+
+__initcall(topology_init);
diff -Nru a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
--- a/arch/ia64/mm/numa.c	2004-12-12 21:35:26 -08:00
+++ b/arch/ia64/mm/numa.c	2004-12-12 21:35:26 -08:00
@@ -20,8 +20,6 @@
 #include <asm/mmzone.h>
 #include <asm/numa.h>
 
-static struct node *sysfs_nodes;
-static struct cpu *sysfs_cpus;
 
 /*
  * The following structures are usually initialized by ACPI or
@@ -49,37 +47,3 @@
 
 	return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0);
 }
-
-static int __init topology_init(void)
-{
-	int i, err = 0;
-
-	sysfs_nodes = kmalloc(sizeof(struct node) * numnodes, GFP_KERNEL);
-	if (!sysfs_nodes) {
-		err = -ENOMEM;
-		goto out;
-	}
-	memset(sysfs_nodes, 0, sizeof(struct node) * numnodes);
-
-	sysfs_cpus = kmalloc(sizeof(struct cpu) * NR_CPUS, GFP_KERNEL);
-	if (!sysfs_cpus) {
-		kfree(sysfs_nodes);
-		err = -ENOMEM;
-		goto out;
-	}
-	memset(sysfs_cpus, 0, sizeof(struct cpu) * NR_CPUS);
-
-	for (i = 0; i < numnodes; i++)
-		if ((err = register_node(&sysfs_nodes[i], i, NULL)))
-			goto out;
-
-	for (i = 0; i < NR_CPUS; i++)
-		if (cpu_online(i))
-			if((err = register_cpu(&sysfs_cpus[i], i,
-					       &sysfs_nodes[cpu_to_node(i)])))
-				goto out;
- out:
-	return err;
-}
-
-__initcall(topology_init);
diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
--- a/arch/x86_64/Kconfig	2004-12-12 21:35:26 -08:00
+++ b/arch/x86_64/Kconfig	2004-12-12 21:35:26 -08:00
@@ -170,7 +170,7 @@
 	bool
 	depends on SMP && !MK8
 	default y
-
+       
 config MATH_EMULATION
 	bool
 
diff -Nru a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
--- a/drivers/acpi/Kconfig	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/Kconfig	2004-12-12 21:35:26 -08:00
@@ -144,6 +144,15 @@
 	  ACPI C2 and C3 processor states to save power, on systems that
 	  support it.
 
+config ACPI_HOTPLUG_CPU
+	bool "Processor Hotplug (EXPERIMENTAL)"
+	depends on ACPI_PROCESSOR && HOTPLUG_CPU && EXPERIMENTAL
+	depends on !IA64_SGI_SN
+	select ACPI_CONTAINER
+	default n
+	 ---help---
+	 Select this option if your platform support physical CPU hotplug.
+
 config ACPI_THERMAL
 	tristate "Thermal Zone"
 	depends on ACPI_PROCESSOR
@@ -325,5 +334,12 @@
 	  kernel logs, and/or you are using this on a notebook which
 	  does not yet have an HPET, you should say "Y" here.
 
-endmenu
+config ACPI_CONTAINER
+	tristate "ACPI0004,PNP0A05 and PNP0A06 Container Driver (EXPERIMENTAL)"
+	depends on ACPI && EXPERIMENTAL
+	default (ACPI_HOTPLUG_MEMORY || ACPI_HOTPLUG_CPU || ACPI_HOTPLUG_IO)
+	 ---help---
+	 	This is the ACPI generic container driver which supports
+		ACPI0004, PNP0A05 and PNP0A06 devices
 
+endmenu
diff -Nru a/drivers/acpi/Makefile b/drivers/acpi/Makefile
--- a/drivers/acpi/Makefile	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/Makefile	2004-12-12 21:35:26 -08:00
@@ -40,6 +40,7 @@
 obj-$(CONFIG_ACPI_PCI)		+= pci_root.o pci_link.o pci_irq.o pci_bind.o
 obj-$(CONFIG_ACPI_POWER)	+= power.o
 obj-$(CONFIG_ACPI_PROCESSOR)	+= processor.o
+obj-$(CONFIG_ACPI_CONTAINER)	+= container.o
 obj-$(CONFIG_ACPI_THERMAL)	+= thermal.o
 obj-$(CONFIG_ACPI_SYSTEM)	+= system.o event.o
 obj-$(CONFIG_ACPI_DEBUG)	+= debug.o
diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c
--- a/drivers/acpi/bus.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/bus.c	2004-12-12 21:35:26 -08:00
@@ -57,10 +57,6 @@
                                 Device Management
    -------------------------------------------------------------------------- */
 
-extern void acpi_bus_data_handler (
-	acpi_handle		handle,
-	u32			function,
-	void			*context);
 int
 acpi_bus_get_device (
 	acpi_handle		handle,
@@ -77,7 +73,7 @@
 
 	status = acpi_get_data(handle, acpi_bus_data_handler, (void**) device);
 	if (ACPI_FAILURE(status) || !*device) {
-		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context for object [%p]\n",
+		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No context for object [%p]\n",
 			handle));
 		return_VALUE(-ENODEV);
 	}
diff -Nru a/drivers/acpi/container.c b/drivers/acpi/container.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/drivers/acpi/container.c	2004-12-12 21:35:26 -08:00
@@ -0,0 +1,298 @@
+/*
+ * acpi_container.c  - ACPI Generic Container Driver
+ * ($Revision: )
+ *
+ * Copyright (C) 2004 Anil S Keshavamurthy (anil.s.keshavamurthy@intel.com)
+ * Copyright (C) 2004 Keiichiro Tokunaga (tokunaga.keiich@jp.fujitsu.com)
+ * Copyright (C) 2004 Motoyuki Ito (motoyuki@soft.fujitsu.com)
+ * Copyright (C) 2004 Intel Corp.
+ * Copyright (C) 2004 FUJITSU LIMITED
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/acpi.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <acpi/container.h>
+
+#define ACPI_CONTAINER_DRIVER_NAME	"ACPI container driver"
+#define ACPI_CONTAINER_DEVICE_NAME	"ACPI container device"
+#define ACPI_CONTAINER_CLASS		"container"
+
+#define INSTALL_NOTIFY_HANDLER		1
+#define UNINSTALL_NOTIFY_HANDLER	2
+
+#define ACPI_CONTAINER_COMPONENT	0x01000000
+#define _COMPONENT			ACPI_CONTAINER_COMPONENT
+ACPI_MODULE_NAME			("acpi_container")
+
+MODULE_AUTHOR("Anil S Keshavamurthy");
+MODULE_DESCRIPTION(ACPI_CONTAINER_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+
+#define ACPI_STA_PRESENT		(0x00000001)
+
+static int acpi_container_add(struct acpi_device *device);
+static int acpi_container_remove(struct acpi_device *device, int type);
+
+static struct acpi_driver acpi_container_driver = {
+	.name =		ACPI_CONTAINER_DRIVER_NAME,
+	.class =	ACPI_CONTAINER_CLASS,
+	.ids =		"ACPI0004,PNP0A05,PNP0A06",
+	.ops =		{
+				.add =		acpi_container_add,
+				.remove =	acpi_container_remove,
+			},
+};
+
+
+/*******************************************************************/
+
+static int
+is_device_present(acpi_handle handle)
+{
+	acpi_handle		temp;
+	acpi_status		status;
+	unsigned long	sta;
+
+	ACPI_FUNCTION_TRACE("is_device_present");
+
+	status = acpi_get_handle(handle, "_STA", &temp);
+	if (ACPI_FAILURE(status))
+		return_VALUE(1); /* _STA not found, assmue device present */
+
+	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
+	if (ACPI_FAILURE(status))
+		return_VALUE(0); /* Firmware error */
+
+	return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
+}
+
+/*******************************************************************/
+static int
+acpi_container_add(struct acpi_device *device)
+{
+	struct acpi_container *container;
+
+	ACPI_FUNCTION_TRACE("acpi_container_add");
+
+	if (!device) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "device is NULL\n"));
+		return_VALUE(-EINVAL);
+	}
+
+	container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
+	if(!container)
+		return_VALUE(-ENOMEM);
+	
+	memset(container, 0, sizeof(struct acpi_container));
+	container->handle = device->handle;
+	strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME);
+	strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS);
+	acpi_driver_data(device) = container;
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",	\
+		acpi_device_name(device), acpi_device_bid(device)));
+
+
+	return_VALUE(0);
+}
+
+static int
+acpi_container_remove(struct acpi_device *device, int type)
+{
+	acpi_status		status = AE_OK;
+	struct acpi_container	*pc = NULL;
+	pc = (struct acpi_container*) acpi_driver_data(device);
+
+	if (pc)
+		kfree(pc);
+
+	return status;
+}
+
+
+static int
+container_device_add(struct acpi_device **device, acpi_handle handle)
+{
+	acpi_handle phandle;
+	struct acpi_device *pdev;
+	int result;
+
+	ACPI_FUNCTION_TRACE("container_device_add");
+
+	if (acpi_get_parent(handle, &phandle)) {
+		return_VALUE(-ENODEV);
+	}
+
+	if (acpi_bus_get_device(phandle, &pdev)) {
+		return_VALUE(-ENODEV);
+	}
+
+	if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
+		return_VALUE(-ENODEV);
+	}
+
+	result = acpi_bus_scan(*device);
+
+	return_VALUE(result);
+}
+
+static void
+container_notify_cb(acpi_handle handle, u32 type, void *context)
+{
+	struct acpi_device		*device = NULL;
+	int result;
+	int present;
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE("container_notify_cb");
+
+	present = is_device_present(handle);
+	
+	switch (type) {
+	case ACPI_NOTIFY_BUS_CHECK:
+		/* Fall through */
+	case ACPI_NOTIFY_DEVICE_CHECK:
+		printk("Container driver received %s event\n",
+			(type == ACPI_NOTIFY_BUS_CHECK)?
+			"ACPI_NOTIFY_BUS_CHECK":"ACPI_NOTIFY_DEVICE_CHECK");
+		if (present) {
+			status = acpi_bus_get_device(handle, &device);
+			if (ACPI_FAILURE(status) || !device) {
+				result = container_device_add(&device, handle);
+				if (!result)
+					kobject_hotplug(&device->kobj, KOBJ_ONLINE);
+			} else {
+				/* device exist and this is a remove request */
+				kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
+			}
+		}
+		break;
+	case ACPI_NOTIFY_EJECT_REQUEST:
+		if (!acpi_bus_get_device(handle, &device) && device) {
+			kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
+		}
+		break;
+	default:
+		break;
+	}
+	return_VOID;
+}
+
+static acpi_status
+container_walk_namespace_cb(acpi_handle handle,
+	u32 lvl,
+	void *context,
+	void **rv)
+{
+	char 				*hid = NULL;
+	struct acpi_buffer 		buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+	struct acpi_device_info 	*info;
+	acpi_status 			status;
+	int 				*action = context;
+
+	ACPI_FUNCTION_TRACE("container_walk_namespace_cb");
+
+	status = acpi_get_object_info(handle, &buffer);
+	if (ACPI_FAILURE(status) || !buffer.pointer) {
+		return_ACPI_STATUS(AE_OK);
+	}
+
+	info = buffer.pointer;
+	if (info->valid & ACPI_VALID_HID)
+		hid = info->hardware_id.value;
+
+	if (hid == NULL) {
+		goto end;
+	}
+
+	if (strcmp(hid, "ACPI0004") && strcmp(hid, "PNP0A05") &&
+			strcmp(hid, "PNP0A06")) {
+		goto end;
+	}
+
+	switch(*action) {
+	case INSTALL_NOTIFY_HANDLER:
+		acpi_install_notify_handler(handle,
+			ACPI_SYSTEM_NOTIFY,
+			container_notify_cb,
+			NULL);
+		break;
+	case UNINSTALL_NOTIFY_HANDLER:
+		acpi_remove_notify_handler(handle,
+			ACPI_SYSTEM_NOTIFY,
+			container_notify_cb);
+		break;
+	default:
+		break;
+	}
+
+end:
+	acpi_os_free(buffer.pointer);
+
+	return_ACPI_STATUS(AE_OK);
+}
+
+
+int __init
+acpi_container_init(void)
+{
+	int	result = 0;
+	int	action = INSTALL_NOTIFY_HANDLER;
+
+	result = acpi_bus_register_driver(&acpi_container_driver);
+	if (result < 0) {
+		return(result);
+	}
+
+	/* register notify handler to every container device */
+	acpi_walk_namespace(ACPI_TYPE_DEVICE,
+				     ACPI_ROOT_OBJECT,
+				     ACPI_UINT32_MAX,
+				     container_walk_namespace_cb,
+				     &action, NULL);
+
+	return(0);
+}
+
+void __exit
+acpi_container_exit(void)
+{
+	int			action = UNINSTALL_NOTIFY_HANDLER;
+
+	ACPI_FUNCTION_TRACE("acpi_container_exit");
+
+	acpi_walk_namespace(ACPI_TYPE_DEVICE,
+				     ACPI_ROOT_OBJECT,
+				     ACPI_UINT32_MAX,
+				     container_walk_namespace_cb,
+				     &action, NULL);
+
+	acpi_bus_unregister_driver(&acpi_container_driver);
+
+	return_VOID;
+}
+
+module_init(acpi_container_init);
+module_exit(acpi_container_exit);
diff -Nru a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
--- a/drivers/acpi/dispatcher/dsopcode.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/dispatcher/dsopcode.c	2004-12-12 21:35:26 -08:00
@@ -762,9 +762,8 @@
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Get the operands and complete the following data objec types:
- *              Buffer
- *              Package
+ * DESCRIPTION: Get the operands and complete the following data object types:
+ *              Buffer, Package.
  *
  ****************************************************************************/
 
diff -Nru a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
--- a/drivers/acpi/dispatcher/dswexec.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/dispatcher/dswexec.c	2004-12-12 21:35:26 -08:00
@@ -399,16 +399,24 @@
 			goto cleanup;
 		}
 
-		/* Resolve all operands */
+		/*
+		 * All opcodes require operand resolution, with the only exceptions
+		 * being the object_type and size_of operators.
+		 */
+		if (!(walk_state->op_info->flags & AML_NO_OPERAND_RESOLVE)) {
+			/* Resolve all operands */
 
-		status = acpi_ex_resolve_operands (walk_state->opcode,
-				  &(walk_state->operands [walk_state->num_operands -1]),
-				  walk_state);
-		if (ACPI_SUCCESS (status)) {
-			ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
-					  acpi_ps_get_opcode_name (walk_state->opcode),
-					  walk_state->num_operands, "after ex_resolve_operands");
+			status = acpi_ex_resolve_operands (walk_state->opcode,
+					  &(walk_state->operands [walk_state->num_operands -1]),
+					  walk_state);
+			if (ACPI_SUCCESS (status)) {
+				ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
+						  acpi_ps_get_opcode_name (walk_state->opcode),
+						  walk_state->num_operands, "after ex_resolve_operands");
+			}
+		}
 
+		if (ACPI_SUCCESS (status)) {
 			/*
 			 * Dispatch the request to the appropriate interpreter handler
 			 * routine.  There is one routine per opcode "type" based upon the
diff -Nru a/drivers/acpi/ec.c b/drivers/acpi/ec.c
--- a/drivers/acpi/ec.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/ec.c	2004-12-12 21:35:26 -08:00
@@ -442,6 +442,8 @@
 	int			result = 0;
 	struct acpi_ec		*ec = NULL;
 	u32			temp = 0;
+	acpi_integer		f_v = 0;
+	int 			i = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_ec_space_handler");
 
@@ -456,6 +458,7 @@
 
 	ec = (struct acpi_ec *) handler_context;
 
+next_byte:
 	switch (function) {
 	case ACPI_READ:
 		result = acpi_ec_read(ec, (u8) address, &temp);
@@ -466,9 +469,29 @@
 		break;
 	default:
 		result = -EINVAL;
+		goto out;
 		break;
 	}
 
+	bit_width -= 8;
+	if(bit_width){
+
+		if(function == ACPI_READ)
+			f_v |= (acpi_integer) (*value) << 8*i;
+		if(function == ACPI_WRITE)
+			(*value) >>=8; 
+		i++;
+		goto next_byte;
+	}
+
+
+	if(function == ACPI_READ){
+		f_v |= (acpi_integer) (*value) << 8*i;
+		*value = f_v;
+	}
+
+		
+out:
 	switch (result) {
 	case -EINVAL:
 		return_VALUE(AE_BAD_PARAMETER);
@@ -482,6 +505,7 @@
 	default:
 		return_VALUE(AE_OK);
 	}
+	
 
 }
 
@@ -787,9 +811,81 @@
 	return_VALUE(0);
 }
 
+static acpi_status __init
+acpi_fake_ecdt_callback (
+	acpi_handle	handle,
+	u32		Level,
+	void		*context,
+	void		**retval)
+{
+	acpi_status	status;
 
-int __init
-acpi_ec_ecdt_probe (void)
+	status = acpi_walk_resources(handle, METHOD_NAME__CRS,
+		acpi_ec_io_ports, ec_ecdt);
+	if (ACPI_FAILURE(status))
+		return status;
+	ec_ecdt->status_addr = ec_ecdt->command_addr;
+
+	ec_ecdt->uid = -1;
+	acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->uid);
+
+	status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec_ecdt->gpe_bit);
+	if (ACPI_FAILURE(status))
+		return status;
+	ec_ecdt->lock = SPIN_LOCK_UNLOCKED;
+	ec_ecdt->global_lock = TRUE;
+	ec_ecdt->handle = handle;
+
+	printk(KERN_INFO PREFIX  "GPE=0x%02x, ports=0x%2x, 0x%2x\n",
+		(u32) ec_ecdt->gpe_bit, (u32) ec_ecdt->command_addr.address,
+		(u32) ec_ecdt->data_addr.address);
+
+	return AE_CTRL_TERMINATE;
+}
+
+/*
+ * Some BIOS (such as some from Gateway laptops) access EC region very early
+ * such as in BAT0._INI or EC._INI before an EC device is found and
+ * do not provide an ECDT. According to ACPI spec, ECDT isn't mandatorily
+ * required, but if EC regison is accessed early, it is required.
+ * The routine tries to workaround the BIOS bug by pre-scan EC device
+ * It assumes that _CRS, _HID, _GPE, _UID methods of EC don't touch any
+ * op region (since _REG isn't invoked yet). The assumption is true for
+ * all systems found.
+ */
+static int __init
+acpi_ec_fake_ecdt(void)
+{
+	acpi_status	status;
+	int		ret = 0;
+
+	printk(KERN_INFO PREFIX "Try to make an fake ECDT\n");
+
+	ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
+	if (!ec_ecdt) {
+		ret = -ENOMEM;
+		goto error;
+	}
+	memset(ec_ecdt, 0, sizeof(struct acpi_ec));
+
+	status = acpi_get_devices (ACPI_EC_HID,
+				acpi_fake_ecdt_callback,
+				NULL,
+				NULL);
+	if (ACPI_FAILURE(status)) {
+		kfree(ec_ecdt);
+		ec_ecdt = NULL;
+		ret = -ENODEV;
+		goto error;
+	}
+	return 0;
+error:
+	printk(KERN_ERR PREFIX "Can't make an fake ECDT\n");
+	return ret;
+}
+
+static int __init
+acpi_ec_get_real_ecdt(void)
 {
 	acpi_status		status;
 	struct acpi_table_ecdt 	*ecdt_ptr;
@@ -797,11 +893,11 @@
 	status = acpi_get_firmware_table("ECDT", 1, ACPI_LOGICAL_ADDRESSING, 
 		(struct acpi_table_header **) &ecdt_ptr);
 	if (ACPI_FAILURE(status))
-		return 0;
+		return -ENODEV;
 
 	printk(KERN_INFO PREFIX "Found ECDT\n");
 
-	 /*
+	/*
 	 * Generate a temporary ec context to use until the namespace is scanned
 	 */
 	ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
@@ -823,6 +919,31 @@
 		goto error;
 	}
 
+	return 0;
+error:
+	printk(KERN_ERR PREFIX "Could not use ECDT\n");
+	kfree(ec_ecdt);
+	ec_ecdt = NULL;
+
+	return -ENODEV;
+}
+
+static int __initdata acpi_fake_ecdt_enabled;
+int __init
+acpi_ec_ecdt_probe (void)
+{
+	acpi_status		status;
+	int			ret;
+
+	ret = acpi_ec_get_real_ecdt();
+	/* Try to make a fake ECDT */
+	if (ret && acpi_fake_ecdt_enabled) {
+		ret = acpi_ec_fake_ecdt();
+	}
+
+	if (ret)
+		return 0;
+
 	/*
 	 * Install GPE handler
 	 */
@@ -895,3 +1016,9 @@
 }
 #endif /* 0 */
 
+static int __init acpi_fake_ecdt_setup(char *str)
+{
+	acpi_fake_ecdt_enabled = 1;
+	return 0;
+}
+__setup("acpi_fake_ecdt", acpi_fake_ecdt_setup);
diff -Nru a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
--- a/drivers/acpi/events/evgpe.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/events/evgpe.c	2004-12-12 21:35:26 -08:00
@@ -605,8 +605,8 @@
 	if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED) {
 		status = acpi_hw_clear_gpe (gpe_event_info);
 		if (ACPI_FAILURE (status)) {
-			ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n",
-				gpe_number));
+			ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n",
+				acpi_format_exception (status), gpe_number));
 			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
 		}
 	}
@@ -643,8 +643,8 @@
 			status = acpi_hw_clear_gpe (gpe_event_info);
 			if (ACPI_FAILURE (status)) {
 				ACPI_REPORT_ERROR ((
-					"acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n",
-					gpe_number));
+					"acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n",
+					acpi_format_exception (status), gpe_number));
 				return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
 			}
 		}
@@ -659,8 +659,8 @@
 		status = acpi_ev_disable_gpe (gpe_event_info);
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR ((
-				"acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
-				gpe_number));
+				"acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n",
+				acpi_format_exception (status), gpe_number));
 			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
 		}
 
@@ -668,12 +668,12 @@
 		 * Execute the method associated with the GPE
 		 * NOTE: Level-triggered GPEs are cleared after the method completes.
 		 */
-		if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
-				 acpi_ev_asynch_execute_gpe_method,
-				 gpe_event_info))) {
+		status = acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
+				 acpi_ev_asynch_execute_gpe_method, gpe_event_info);
+		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR ((
-				"acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%2X], event is disabled\n",
-				gpe_number));
+				"acpi_ev_gpe_dispatch: %s, Unable to queue handler for GPE[%2X] - event disabled\n",
+				acpi_format_exception (status), gpe_number));
 		}
 		break;
 
@@ -692,8 +692,8 @@
 		status = acpi_ev_disable_gpe (gpe_event_info);
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR ((
-				"acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
-				gpe_number));
+				"acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n",
+				acpi_format_exception (status), gpe_number));
 			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
 		}
 		break;
diff -Nru a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
--- a/drivers/acpi/events/evxfevnt.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/events/evxfevnt.c	2004-12-12 21:35:26 -08:00
@@ -435,7 +435,7 @@
  * DESCRIPTION: Clear an ACPI event (fixed)
  *
  ******************************************************************************/
-#ifdef ACPI_FUTURE_USAGE
+
 acpi_status
 acpi_clear_event (
 	u32                             event)
@@ -462,7 +462,6 @@
 	return_ACPI_STATUS (status);
 }
 EXPORT_SYMBOL(acpi_clear_event);
-#endif  /*  ACPI_FUTURE_USAGE  */
 
 
 /*******************************************************************************
diff -Nru a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
--- a/drivers/acpi/executer/exconfig.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exconfig.c	2004-12-12 21:35:26 -08:00
@@ -95,7 +95,7 @@
 
 	ACPI_MEMSET (&table_info, 0, sizeof (struct acpi_table_desc));
 
-	table_info.type        = 5;
+	table_info.type        = ACPI_TABLE_SSDT;
 	table_info.pointer     = table;
 	table_info.length      = (acpi_size) table->length;
 	table_info.allocation  = ACPI_MEM_ALLOCATED;
diff -Nru a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c
--- a/drivers/acpi/executer/exconvrt.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exconvrt.c	2004-12-12 21:35:26 -08:00
@@ -115,12 +115,6 @@
 	 */
 	result = 0;
 
-	/* Transfer no more than an integer's worth of data */
-
-	if (count > acpi_gbl_integer_byte_width) {
-		count = acpi_gbl_integer_byte_width;
-	}
-
 	/*
 	 * String conversion is different than Buffer conversion
 	 */
@@ -142,6 +136,12 @@
 
 	case ACPI_TYPE_BUFFER:
 
+		/* Transfer no more than an integer's worth of data */
+
+		if (count > acpi_gbl_integer_byte_width) {
+			count = acpi_gbl_integer_byte_width;
+		}
+
 		/*
 		 * Convert buffer to an integer - we simply grab enough raw data
 		 * from the buffer to fill an integer
@@ -173,6 +173,7 @@
 	/* Save the Result */
 
 	return_desc->integer.value = result;
+	acpi_ex_truncate_for32bit_table (return_desc);
 	*result_desc = return_desc;
 	return_ACPI_STATUS (AE_OK);
 }
@@ -520,7 +521,8 @@
 
 			/* Recalculate length */
 
-			return_desc->string.length = ACPI_STRLEN (return_desc->string.pointer);
+			return_desc->string.length = (u32)
+				ACPI_STRLEN (return_desc->string.pointer);
 			break;
 
 		default:
diff -Nru a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
--- a/drivers/acpi/executer/exdump.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exdump.c	2004-12-12 21:35:26 -08:00
@@ -110,10 +110,12 @@
 	/* obj_desc is a valid object */
 
 	if (depth > 0) {
-		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "%*s[%u] ", depth, " ", depth));
+		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ",
+			depth, " ", depth, obj_desc));
+	}
+	else {
+		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
 	}
-	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "%p ", obj_desc));
-
 
 	switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
 	case ACPI_TYPE_LOCAL_REFERENCE:
@@ -712,9 +714,6 @@
 		acpi_ex_out_integer ("bit_length",  obj_desc->common_field.bit_length);
 		acpi_ex_out_integer ("fld_bit_offset", obj_desc->common_field.start_field_bit_offset);
 		acpi_ex_out_integer ("base_byte_offset", obj_desc->common_field.base_byte_offset);
-		acpi_ex_out_integer ("datum_valid_bits", obj_desc->common_field.datum_valid_bits);
-		acpi_ex_out_integer ("end_fld_valid_bits",obj_desc->common_field.end_field_valid_bits);
-		acpi_ex_out_integer ("end_buf_valid_bits",obj_desc->common_field.end_buffer_valid_bits);
 		acpi_ex_out_pointer ("parent_node", obj_desc->common_field.node);
 
 		switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
diff -Nru a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
--- a/drivers/acpi/executer/exfldio.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exfldio.c	2004-12-12 21:35:26 -08:00
@@ -612,210 +612,6 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ex_get_buffer_datum
- *
- * PARAMETERS:  Datum               - Where the Datum is returned
- *              Buffer              - Raw field buffer
- *              buffer_length       - Entire length (used for big-endian only)
- *              byte_granularity    - 1/2/4/8 Granularity of the field
- *                                    (aka Datum Size)
- *              buffer_offset       - Datum offset into the buffer
- *
- * RETURN:      none
- *
- * DESCRIPTION: Get a datum from the buffer according to the buffer field
- *              byte granularity
- *
- ******************************************************************************/
-
-void
-acpi_ex_get_buffer_datum (
-	acpi_integer                    *datum,
-	void                            *buffer,
-	u32                             buffer_length,
-	u32                             byte_granularity,
-	u32                             buffer_offset)
-{
-	u32                             index;
-
-
-	ACPI_FUNCTION_TRACE_U32 ("ex_get_buffer_datum", byte_granularity);
-
-
-	/* Get proper index into buffer (handles big/little endian) */
-
-	index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity);
-
-	/* Move the requested number of bytes */
-
-	switch (byte_granularity) {
-	case ACPI_FIELD_BYTE_GRANULARITY:
-
-		*datum = ((u8 *) buffer) [index];
-		break;
-
-	case ACPI_FIELD_WORD_GRANULARITY:
-
-		ACPI_MOVE_16_TO_64 (datum, &(((u16 *) buffer) [index]));
-		break;
-
-	case ACPI_FIELD_DWORD_GRANULARITY:
-
-		ACPI_MOVE_32_TO_64 (datum, &(((u32 *) buffer) [index]));
-		break;
-
-	case ACPI_FIELD_QWORD_GRANULARITY:
-
-		ACPI_MOVE_64_TO_64 (datum, &(((u64 *) buffer) [index]));
-		break;
-
-	default:
-		/* Should not get here */
-		break;
-	}
-
-	return_VOID;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ex_set_buffer_datum
- *
- * PARAMETERS:  merged_datum        - Value to store
- *              Buffer              - Receiving buffer
- *              buffer_length       - Entire length (used for big-endian only)
- *              byte_granularity    - 1/2/4/8 Granularity of the field
- *                                    (aka Datum Size)
- *              buffer_offset       - Datum offset into the buffer
- *
- * RETURN:      none
- *
- * DESCRIPTION: Store the merged datum to the buffer according to the
- *              byte granularity
- *
- ******************************************************************************/
-
-void
-acpi_ex_set_buffer_datum (
-	acpi_integer                    merged_datum,
-	void                            *buffer,
-	u32                             buffer_length,
-	u32                             byte_granularity,
-	u32                             buffer_offset)
-{
-	u32                             index;
-
-
-	ACPI_FUNCTION_TRACE_U32 ("ex_set_buffer_datum", byte_granularity);
-
-
-	/* Get proper index into buffer (handles big/little endian) */
-
-	index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity);
-
-	/* Move the requested number of bytes */
-
-	switch (byte_granularity) {
-	case ACPI_FIELD_BYTE_GRANULARITY:
-
-		((u8 *) buffer) [index] = (u8) merged_datum;
-		break;
-
-	case ACPI_FIELD_WORD_GRANULARITY:
-
-		ACPI_MOVE_64_TO_16 (&(((u16 *) buffer)[index]), &merged_datum);
-		break;
-
-	case ACPI_FIELD_DWORD_GRANULARITY:
-
-		ACPI_MOVE_64_TO_32 (&(((u32 *) buffer)[index]), &merged_datum);
-		break;
-
-	case ACPI_FIELD_QWORD_GRANULARITY:
-
-		ACPI_MOVE_64_TO_64 (&(((u64 *) buffer)[index]), &merged_datum);
-		break;
-
-	default:
-		/* Should not get here */
-		break;
-	}
-
-	return_VOID;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ex_common_buffer_setup
- *
- * PARAMETERS:  obj_desc            - Field object
- *              buffer_length       - Length of caller's buffer
- *              datum_count         - Where the datum_count is returned
- *
- * RETURN:      Status, datum_count
- *
- * DESCRIPTION: Common code to validate the incoming buffer size and compute
- *              the number of field "datums" that must be read or written.
- *              A "datum" is the smallest unit that can be read or written
- *              to the field, it is either 1,2,4, or 8 bytes.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ex_common_buffer_setup (
-	union acpi_operand_object       *obj_desc,
-	u32                             buffer_length,
-	u32                             *datum_count)
-{
-	u32                             byte_field_length;
-	u32                             actual_byte_field_length;
-
-
-	ACPI_FUNCTION_TRACE ("ex_common_buffer_setup");
-
-
-	/*
-	 * Incoming buffer must be at least as long as the field, we do not
-	 * allow "partial" field reads/writes.  We do not care if the buffer is
-	 * larger than the field, this typically happens when an integer is
-	 * read/written to a field that is actually smaller than an integer.
-	 */
-	byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (
-			 obj_desc->common_field.bit_length);
-	if (byte_field_length > buffer_length) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-			"Field size %X (bytes) is too large for buffer (%X)\n",
-			byte_field_length, buffer_length));
-
-		return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
-	}
-
-	/*
-	 * Create "actual" field byte count (minimum number of bytes that
-	 * must be read), then convert to datum count (minimum number
-	 * of datum-sized units that must be read)
-	 */
-	actual_byte_field_length = ACPI_ROUND_BITS_UP_TO_BYTES (
-			  obj_desc->common_field.start_field_bit_offset +
-			  obj_desc->common_field.bit_length);
-
-
-	*datum_count = ACPI_ROUND_UP_TO (actual_byte_field_length,
-			   obj_desc->common_field.access_byte_width);
-
-	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-		"buffer_bytes %X, actual_bytes %X, Datums %X, byte_gran %X\n",
-		byte_field_length, actual_byte_field_length,
-		*datum_count, obj_desc->common_field.access_byte_width));
-
-	return_ACPI_STATUS (AE_OK);
-}
-
-
-/*******************************************************************************
- *
  * FUNCTION:    acpi_ex_extract_from_field
  *
  * PARAMETERS:  obj_desc            - Field to be read
@@ -835,128 +631,92 @@
 	u32                             buffer_length)
 {
 	acpi_status                     status;
-	u32                             field_datum_byte_offset;
-	u32                             buffer_datum_offset;
-	acpi_integer                    previous_raw_datum = 0;
-	acpi_integer                    this_raw_datum = 0;
-	acpi_integer                    merged_datum = 0;
+	acpi_integer                    raw_datum;
+	acpi_integer                    merged_datum;
+	u32                             field_offset = 0;
+	u32                             buffer_offset = 0;
+	u32                             buffer_tail_bits;
 	u32                             datum_count;
+	u32                             field_datum_count;
 	u32                             i;
 
 
 	ACPI_FUNCTION_TRACE ("ex_extract_from_field");
 
 
-	/* Validate buffer, compute number of datums */
+	/* Validate target buffer and clear it */
 
-	status = acpi_ex_common_buffer_setup (obj_desc, buffer_length, &datum_count);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+	if (buffer_length < ACPI_ROUND_BITS_UP_TO_BYTES (
+			 obj_desc->common_field.bit_length)) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Field size %X (bits) is too large for buffer (%X)\n",
+			obj_desc->common_field.bit_length, buffer_length));
 
-	/*
-	 * Clear the caller's buffer (the whole buffer length as given)
-	 * This is very important, especially in the cases where the buffer
-	 * is longer than the size of the field.
-	 */
+		return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
+	}
 	ACPI_MEMSET (buffer, 0, buffer_length);
 
-	field_datum_byte_offset = 0;
-	buffer_datum_offset= 0;
-
-	/* Read the entire field */
+	/* Compute the number of datums (access width data items) */
 
-	for (i = 0; i < datum_count; i++) {
-		status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
-				  &this_raw_datum, ACPI_READ);
-		if (ACPI_FAILURE (status)) {
-			return_ACPI_STATUS (status);
-		}
+	datum_count = ACPI_ROUND_UP_TO (
+			   obj_desc->common_field.bit_length,
+			   obj_desc->common_field.access_bit_width);
+	field_datum_count = ACPI_ROUND_UP_TO (
+			   obj_desc->common_field.bit_length +
+			   obj_desc->common_field.start_field_bit_offset,
+			   obj_desc->common_field.access_bit_width);
 
-		/* We might actually be done if the request fits in one datum */
+	/* Priming read from the field */
 
-		if ((datum_count == 1) &&
-			(obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) {
-			/* 1) Shift the valid data bits down to start at bit 0 */
+	status = acpi_ex_field_datum_io (obj_desc, field_offset, &raw_datum, ACPI_READ);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
+	merged_datum = raw_datum >> obj_desc->common_field.start_field_bit_offset;
 
-			merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset);
+	/* Read the rest of the field */
 
-			/* 2) Mask off any upper unused bits (bits not part of the field) */
+	for (i = 1; i < field_datum_count; i++) {
+		/* Get next input datum from the field */
 
-			if (obj_desc->common_field.end_buffer_valid_bits) {
-				merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits);
-			}
+		field_offset += obj_desc->common_field.access_byte_width;
+		status = acpi_ex_field_datum_io (obj_desc, field_offset,
+				  &raw_datum, ACPI_READ);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-			/* Store the datum to the caller buffer */
+		/* Merge with previous datum if necessary */
 
-			acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
-					obj_desc->common_field.access_byte_width, buffer_datum_offset);
+		merged_datum |= raw_datum <<
+			(obj_desc->common_field.access_bit_width - obj_desc->common_field.start_field_bit_offset);
 
-			return_ACPI_STATUS (AE_OK);
+		if (i == datum_count) {
+			break;
 		}
 
-		/* Special handling for the last datum to ignore extra bits */
+		/* Write merged datum to target buffer */
 
-		if ((i >= (datum_count -1))          &&
-			(obj_desc->common_field.end_field_valid_bits)) {
-			/*
-			 * This is the last iteration of the loop.  We need to clear
-			 * any unused bits (bits that are not part of this field) before
-			 * we store the final merged datum into the caller buffer.
-			 */
-			this_raw_datum &=
-				ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
-		}
+		ACPI_MEMCPY (((char *) buffer) + buffer_offset, &merged_datum,
+			ACPI_MIN(obj_desc->common_field.access_byte_width,
+					 buffer_length - buffer_offset));
 
-		/*
-		 * Create the (possibly) merged datum to be stored to the caller buffer
-		 */
-		if (obj_desc->common_field.start_field_bit_offset == 0) {
-			/* Field is not skewed and we can just copy the datum */
-
-			acpi_ex_set_buffer_datum (this_raw_datum, buffer, buffer_length,
-					obj_desc->common_field.access_byte_width, buffer_datum_offset);
-			buffer_datum_offset++;
-		}
-		else {
-			/* Not aligned -- on the first iteration, just save the datum */
+		buffer_offset += obj_desc->common_field.access_byte_width;
+		merged_datum = raw_datum >> obj_desc->common_field.start_field_bit_offset;
+	}
 
-			if (i != 0) {
-				/*
-				 * Put together the appropriate bits of the two raw data to make a
-				 * single complete field datum
-				 *
-				 * 1) Normalize the first datum down to bit 0
-				 */
-				merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset);
-
-				/* 2) Insert the second datum "above" the first datum */
-
-				merged_datum |= (this_raw_datum << obj_desc->common_field.datum_valid_bits);
-
-				acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
-						obj_desc->common_field.access_byte_width, buffer_datum_offset);
-				buffer_datum_offset++;
-			}
-
-			/*
-			 * Save the raw datum that was just acquired since it may contain bits
-			 * of the *next* field datum
-			 */
-			previous_raw_datum = this_raw_datum;
-		}
+	/* Mask off any extra bits in the last datum */
 
-		field_datum_byte_offset += obj_desc->common_field.access_byte_width;
+	buffer_tail_bits = obj_desc->common_field.bit_length % obj_desc->common_field.access_bit_width;
+	if (buffer_tail_bits) {
+		merged_datum &= ACPI_MASK_BITS_ABOVE (buffer_tail_bits);
 	}
 
-	/* For non-aligned case, there is one last datum to insert */
-
-	if (obj_desc->common_field.start_field_bit_offset != 0) {
-		merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset);
+	/* Write the last datum to the buffer */
 
-		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
-				obj_desc->common_field.access_byte_width, buffer_datum_offset);
-	}
+	ACPI_MEMCPY (((char *) buffer) + buffer_offset, &merged_datum,
+		ACPI_MIN(obj_desc->common_field.access_byte_width,
+				 buffer_length - buffer_offset));
 
 	return_ACPI_STATUS (AE_OK);
 }
@@ -983,169 +743,91 @@
 	u32                             buffer_length)
 {
 	acpi_status                     status;
-	u32                             field_datum_byte_offset;
-	u32                             datum_offset;
 	acpi_integer                    mask;
 	acpi_integer                    merged_datum;
-	acpi_integer                    previous_raw_datum;
-	acpi_integer                    this_raw_datum;
+	acpi_integer                    raw_datum = 0;
+	u32                             field_offset = 0;
+	u32                             buffer_offset = 0;
+	u32                             buffer_tail_bits;
 	u32                             datum_count;
+	u32                             field_datum_count;
+	u32                             i;
 
 
 	ACPI_FUNCTION_TRACE ("ex_insert_into_field");
 
 
-	/* Validate buffer, compute number of datums */
+	/* Validate input buffer */
 
-	status = acpi_ex_common_buffer_setup (obj_desc, buffer_length, &datum_count);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+	if (buffer_length < ACPI_ROUND_BITS_UP_TO_BYTES (
+			 obj_desc->common_field.bit_length)) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Field size %X (bits) is too large for buffer (%X)\n",
+			obj_desc->common_field.bit_length, buffer_length));
+
+		return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
 	}
 
-	/*
-	 * Break the request into up to three parts (similar to an I/O request):
-	 * 1) non-aligned part at start
-	 * 2) aligned part in middle
-	 * 3) non-aligned part at the end
-	 */
-	field_datum_byte_offset = 0;
-	datum_offset= 0;
-
-	/* Get a single datum from the caller's buffer */
-
-	acpi_ex_get_buffer_datum (&previous_raw_datum, buffer, buffer_length,
-			obj_desc->common_field.access_byte_width, datum_offset);
-
-	/*
-	 * Part1:
-	 * Write a partial field datum if field does not begin on a datum boundary
-	 * Note: The code in this section also handles the aligned case
-	 *
-	 * Construct Mask with 1 bits where the field is, 0 bits elsewhere
-	 * (Only the bottom 5 bits of bit_length are valid for a shift operation)
-	 *
-	 * Mask off bits that are "below" the field (if any)
-	 */
+	/* Compute the number of datums (access width data items) */
+
 	mask = ACPI_MASK_BITS_BELOW (obj_desc->common_field.start_field_bit_offset);
+	datum_count = ACPI_ROUND_UP_TO (obj_desc->common_field.bit_length,
+			  obj_desc->common_field.access_bit_width);
+	field_datum_count = ACPI_ROUND_UP_TO (obj_desc->common_field.bit_length +
+			   obj_desc->common_field.start_field_bit_offset,
+			   obj_desc->common_field.access_bit_width);
 
-	/* If the field fits in one datum, may need to mask upper bits */
+	/* Get initial Datum from the input buffer */
 
-	if ((obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM) &&
-		 obj_desc->common_field.end_field_valid_bits) {
-		/* There are bits above the field, mask them off also */
+	ACPI_MEMCPY (&raw_datum, buffer,
+		ACPI_MIN(obj_desc->common_field.access_byte_width,
+				 buffer_length - buffer_offset));
 
-		mask &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
-	}
+	merged_datum = raw_datum << obj_desc->common_field.start_field_bit_offset;
 
-	/* Shift and mask the value into the field position */
+	/* Write the entire field */
 
-	merged_datum = (previous_raw_datum << obj_desc->common_field.start_field_bit_offset);
-	merged_datum &= mask;
+	for (i = 1; i < field_datum_count; i++) {
+		/* Write merged datum to the target field */
 
-	/* Apply the update rule (if necessary) and write the datum to the field */
+		merged_datum &= mask;
+		status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum, field_offset);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-	status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum,
-			   field_datum_byte_offset);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+		/* Start new output datum by merging with previous input datum */
 
-	/* We just wrote the first datum */
+		field_offset += obj_desc->common_field.access_byte_width;
+		merged_datum = raw_datum >>
+			(obj_desc->common_field.access_bit_width - obj_desc->common_field.start_field_bit_offset);
+		mask = ACPI_INTEGER_MAX;
 
-	datum_offset++;
+		if (i == datum_count) {
+			break;
+		}
 
-	/* If the entire field fits within one datum, we are done. */
+		/* Get the next input datum from the buffer */
 
-	if ((datum_count == 1) &&
-	   (obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) {
-		return_ACPI_STATUS (AE_OK);
+		buffer_offset += obj_desc->common_field.access_byte_width;
+		ACPI_MEMCPY (&raw_datum, ((char *) buffer) + buffer_offset,
+			ACPI_MIN(obj_desc->common_field.access_byte_width,
+					 buffer_length - buffer_offset));
+		merged_datum |= raw_datum << obj_desc->common_field.start_field_bit_offset;
 	}
 
-	/*
-	 * Part2:
-	 * Write the aligned data.
-	 *
-	 * We don't need to worry about the update rule for these data, because
-	 * all of the bits in each datum are part of the field.
-	 *
-	 * The last datum must be special cased because it might contain bits
-	 * that are not part of the field -- therefore the "update rule" must be
-	 * applied in Part3 below.
-	 */
-	while (datum_offset < datum_count) {
-		field_datum_byte_offset += obj_desc->common_field.access_byte_width;
-
-		/*
-		 * Get the next raw buffer datum.  It may contain bits of the previous
-		 * field datum
-		 */
-		acpi_ex_get_buffer_datum (&this_raw_datum, buffer, buffer_length,
-				obj_desc->common_field.access_byte_width, datum_offset);
-
-		/* Create the field datum based on the field alignment */
-
-		if (obj_desc->common_field.start_field_bit_offset != 0) {
-			/*
-			 * Put together appropriate bits of the two raw buffer data to make
-			 * a single complete field datum
-			 */
-			merged_datum =
-				(previous_raw_datum >> obj_desc->common_field.datum_valid_bits) |
-				(this_raw_datum << obj_desc->common_field.start_field_bit_offset);
-		}
-		else {
-			/* Field began aligned on datum boundary */
-
-			merged_datum = this_raw_datum;
-		}
+	/* Mask off any extra bits in the last datum */
 
-		/*
-		 * Special handling for the last datum if the field does NOT end on
-		 * a datum boundary.  Update Rule must be applied to the bits outside
-		 * the field.
-		 */
-		datum_offset++;
-		if ((datum_offset == datum_count) &&
-			(obj_desc->common_field.end_field_valid_bits)) {
-			/*
-			 * If there are dangling non-aligned bits, perform one more merged write
-			 * Else - field is aligned at the end, no need for any more writes
-			 */
-
-			/*
-			 * Part3:
-			 * This is the last datum and the field does not end on a datum boundary.
-			 * Build the partial datum and write with the update rule.
-			 *
-			 * Mask off the unused bits above (after) the end-of-field
-			 */
-			mask = ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
-			merged_datum &= mask;
-
-			/* Write the last datum with the update rule */
-
-			status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum,
-					   field_datum_byte_offset);
-			if (ACPI_FAILURE (status)) {
-				return_ACPI_STATUS (status);
-			}
-		}
-		else {
-			/* Normal (aligned) case -- write the completed datum */
+	buffer_tail_bits = (obj_desc->common_field.bit_length +
+			obj_desc->common_field.start_field_bit_offset) % obj_desc->common_field.access_bit_width;
+	if (buffer_tail_bits) {
+		mask &= ACPI_MASK_BITS_ABOVE (buffer_tail_bits);
+	}
 
-			status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
-					  &merged_datum, ACPI_WRITE);
-			if (ACPI_FAILURE (status)) {
-				return_ACPI_STATUS (status);
-			}
-		}
+	/* Write the last datum to the field */
 
-		/*
-		 * Save the most recent datum since it may contain bits of the *next*
-		 * field datum.  Update current byte offset.
-		 */
-		previous_raw_datum = this_raw_datum;
-	}
+	merged_datum &= mask;
+	status = acpi_ex_write_with_update_rule (obj_desc, mask, merged_datum, field_offset);
 
 	return_ACPI_STATUS (status);
 }
diff -Nru a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c
--- a/drivers/acpi/executer/exmisc.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exmisc.c	2004-12-12 21:35:26 -08:00
@@ -389,7 +389,7 @@
 	if (local_operand1 != operand1) {
 		acpi_ut_remove_reference (local_operand1);
 	}
-	return_ACPI_STATUS (AE_OK);
+	return_ACPI_STATUS (status);
 }
 
 
diff -Nru a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
--- a/drivers/acpi/executer/exoparg1.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exoparg1.c	2004-12-12 21:35:26 -08:00
@@ -507,6 +507,10 @@
 
 		status = acpi_ex_convert_to_string (operand[0], &return_desc,
 				 ACPI_EXPLICIT_CONVERT_DECIMAL);
+		if (return_desc == operand[0]) {
+			/* No conversion performed, add ref to handle return value */
+			acpi_ut_add_reference (return_desc);
+		}
 		break;
 
 
@@ -514,12 +518,20 @@
 
 		status = acpi_ex_convert_to_string (operand[0], &return_desc,
 				 ACPI_EXPLICIT_CONVERT_HEX);
+		if (return_desc == operand[0]) {
+			/* No conversion performed, add ref to handle return value */
+			acpi_ut_add_reference (return_desc);
+		}
 		break;
 
 
 	case AML_TO_BUFFER_OP:          /* to_buffer (Data, Result) */
 
 		status = acpi_ex_convert_to_buffer (operand[0], &return_desc);
+		if (return_desc == operand[0]) {
+			/* No conversion performed, add ref to handle return value */
+			acpi_ut_add_reference (return_desc);
+		}
 		break;
 
 
@@ -527,6 +539,10 @@
 
 		status = acpi_ex_convert_to_integer (operand[0], &return_desc,
 				 ACPI_ANY_BASE);
+		if (return_desc == operand[0]) {
+			/* No conversion performed, add ref to handle return value */
+			acpi_ut_add_reference (return_desc);
+		}
 		break;
 
 
@@ -551,10 +567,12 @@
 		goto cleanup;
 	}
 
-	/*
-	 * Store the return value computed above into the target object
-	 */
-	status = acpi_ex_store (return_desc, operand[1], walk_state);
+	if (ACPI_SUCCESS (status)) {
+		/*
+		 * Store the return value computed above into the target object
+		 */
+		status = acpi_ex_store (return_desc, operand[1], walk_state);
+	}
 
 
 cleanup:
diff -Nru a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
--- a/drivers/acpi/executer/exoparg2.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exoparg2.c	2004-12-12 21:35:26 -08:00
@@ -410,7 +410,7 @@
 		index = (u32) operand[1]->integer.value;
 
 		/*
-		 * At this point, the Source operand is either a Package or a Buffer
+		 * At this point, the Source operand is a Package, Buffer, or String
 		 */
 		if (ACPI_GET_OBJECT_TYPE (operand[0]) == ACPI_TYPE_PACKAGE) {
 			/* Object to be indexed is a Package */
@@ -428,7 +428,7 @@
 			return_desc->reference.where     = &operand[0]->package.elements [index];
 		}
 		else {
-			/* Object to be indexed is a Buffer */
+			/* Object to be indexed is a Buffer/String */
 
 			if (index >= operand[0]->buffer.length) {
 				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
diff -Nru a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c
--- a/drivers/acpi/executer/exprep.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exprep.c	2004-12-12 21:35:26 -08:00
@@ -339,6 +339,8 @@
 	obj_desc->common_field.access_byte_width = (u8)
 			ACPI_DIV_8 (access_bit_width); /* 1, 2, 4,  8 */
 
+	obj_desc->common_field.access_bit_width = (u8) access_bit_width;
+
 	/*
 	 * base_byte_offset is the address of the start of the field within the
 	 * region.  It is the byte address of the first *datum* (field-width data
@@ -360,28 +362,6 @@
 	 */
 	obj_desc->common_field.start_field_bit_offset = (u8)
 		(field_bit_position - ACPI_MUL_8 (obj_desc->common_field.base_byte_offset));
-
-	/*
-	 * Valid bits -- the number of bits that compose a partial datum,
-	 * 1) At the end of the field within the region (arbitrary starting bit
-	 *    offset)
-	 * 2) At the end of a buffer used to contain the field (starting offset
-	 *    always zero)
-	 */
-	obj_desc->common_field.end_field_valid_bits = (u8)
-		((obj_desc->common_field.start_field_bit_offset + field_bit_length) %
-				  access_bit_width);
-	/* start_buffer_bit_offset always = 0 */
-
-	obj_desc->common_field.end_buffer_valid_bits = (u8)
-		(field_bit_length % access_bit_width);
-
-	/*
-	 * datum_valid_bits is the number of valid field bits in the first
-	 * field datum.
-	 */
-	obj_desc->common_field.datum_valid_bits  = (u8)
-		(access_bit_width - obj_desc->common_field.start_field_bit_offset);
 
 	/*
 	 * Does the entire field fit within a single field access element? (datum)
diff -Nru a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
--- a/drivers/acpi/executer/exstore.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/executer/exstore.c	2004-12-12 21:35:26 -08:00
@@ -295,56 +295,45 @@
 	switch (index_desc->reference.target_type) {
 	case ACPI_TYPE_PACKAGE:
 		/*
-		 * Storing to a package element is not simple.  The source must be
-		 * evaluated and converted to the type of the destination and then the
-		 * source is copied into the destination - we can't just point to the
-		 * source object.
-		 */
-		/*
+		 * Storing to a package element. Copy the object and replace
+		 * any existing object with the new object. No implicit
+		 * conversion is performed.
+		 *
 		 * The object at *(index_desc->Reference.Where) is the
 		 * element within the package that is to be modified.
 		 * The parent package object is at index_desc->Reference.Object
 		 */
 		obj_desc = *(index_desc->reference.where);
 
-		/* Do the conversion/store */
-
-		status = acpi_ex_store_object_to_object (source_desc, obj_desc, &new_desc,
-				  walk_state);
+		status = acpi_ut_copy_iobject_to_iobject (source_desc, &new_desc, walk_state);
 		if (ACPI_FAILURE (status)) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Could not store object to indexed package element\n"));
 			return_ACPI_STATUS (status);
 		}
 
-		/*
-		 * If a new object was created, we must install it as the new
-		 * package element
-		 */
-		if (new_desc != obj_desc) {
-			acpi_ut_remove_reference (obj_desc);
-			*(index_desc->reference.where) = new_desc;
-
-			/* If same as the original source, add a reference */
+		if (obj_desc) {
+			/* Decrement reference count by the ref count of the parent package */
 
-			if (new_desc == source_desc) {
-				acpi_ut_add_reference (new_desc);
+			for (i = 0; i < ((union acpi_operand_object *) index_desc->reference.object)->common.reference_count; i++) {
+				acpi_ut_remove_reference (obj_desc);
 			}
+		}
 
-			/* Increment reference count by the ref count of the parent package -1 */
+		*(index_desc->reference.where) = new_desc;
 
-			for (i = 1; i < ((union acpi_operand_object *) index_desc->reference.object)->common.reference_count; i++) {
-				acpi_ut_add_reference (new_desc);
-			}
+		/* Increment reference count by the ref count of the parent package -1 */
+
+		for (i = 1; i < ((union acpi_operand_object *) index_desc->reference.object)->common.reference_count; i++) {
+			acpi_ut_add_reference (new_desc);
 		}
+
 		break;
 
 
 	case ACPI_TYPE_BUFFER_FIELD:
 
 		/*
-		 * Store into a Buffer (not actually a real buffer_field) at a
-		 * location defined by an Index.
+		 * Store into a Buffer or String (not actually a real buffer_field)
+		 * at a location defined by an Index.
 		 *
 		 * The first 8-bit element of the source object is written to the
 		 * 8-bit Buffer location defined by the Index destination object,
@@ -352,10 +341,13 @@
 		 */
 
 		/*
-		 * Make sure the target is a Buffer
+		 * Make sure the target is a Buffer or String. An error should
+		 * not happen here, since the reference_object was constructed
+		 * by the INDEX_OP code.
 		 */
 		obj_desc = index_desc->reference.object;
-		if (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_BUFFER) {
+		if ((ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_BUFFER) &&
+			(ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_STRING)) {
 			return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 		}
 
@@ -372,13 +364,11 @@
 			break;
 
 		case ACPI_TYPE_BUFFER:
-
-			value = source_desc->buffer.pointer[0];
-			break;
-
 		case ACPI_TYPE_STRING:
 
-			value = (u8) source_desc->string.pointer[0];
+			/* Note: Takes advantage of common string/buffer fields */
+
+			value = source_desc->buffer.pointer[0];
 			break;
 
 		default:
diff -Nru a/drivers/acpi/numa.c b/drivers/acpi/numa.c
--- a/drivers/acpi/numa.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/numa.c	2004-12-12 21:35:26 -08:00
@@ -22,7 +22,7 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
  */
-
+#include <linux/module.h>
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -199,3 +199,22 @@
 	acpi_numa_arch_fixup();
 	return 0;
 }
+
+int
+acpi_get_pxm(acpi_handle h)
+{
+	unsigned long pxm;
+	acpi_status status;
+	acpi_handle handle;
+	acpi_handle phandle = h;
+
+	do {
+		handle = phandle;
+		status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
+		if (ACPI_SUCCESS(status))
+			return (int)pxm;
+		status = acpi_get_parent(handle, &phandle);
+	} while(ACPI_SUCCESS(status));
+	return -1;
+}
+EXPORT_SYMBOL(acpi_get_pxm);
diff -Nru a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c
--- a/drivers/acpi/parser/psopcode.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/parser/psopcode.c	2004-12-12 21:35:26 -08:00
@@ -318,7 +318,7 @@
 #define ARGI_SHIFT_LEFT_OP              ARGI_LIST3 (ARGI_INTEGER,    ARGI_INTEGER,       ARGI_TARGETREF)
 #define ARGI_SHIFT_RIGHT_OP             ARGI_LIST3 (ARGI_INTEGER,    ARGI_INTEGER,       ARGI_TARGETREF)
 #define ARGI_SIGNAL_OP                  ARGI_LIST1 (ARGI_EVENT)
-#define ARGI_SIZE_OF_OP                 ARGI_LIST1 (ARGI_REFERENCE) /* Force delay of operand resolution */
+#define ARGI_SIZE_OF_OP                 ARGI_LIST1 (ARGI_DATAOBJECT)
 #define ARGI_SLEEP_OP                   ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_STALL_OP                   ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_STATICSTRING_OP            ARGI_INVALID_OPCODE
@@ -333,7 +333,7 @@
 #define ARGI_TO_HEX_STR_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
 #define ARGI_TO_INTEGER_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
 #define ARGI_TO_STRING_OP               ARGI_LIST3 (ARGI_BUFFER,     ARGI_INTEGER,       ARGI_FIXED_TARGET)
-#define ARGI_TYPE_OP                    ARGI_LIST1 (ARGI_REFERENCE) /* Force delay of operand resolution */
+#define ARGI_TYPE_OP                    ARGI_LIST1 (ARGI_ANYTYPE)
 #define ARGI_UNLOAD_OP                  ARGI_LIST1 (ARGI_DDBHANDLE)
 #define ARGI_VAR_PACKAGE_OP             ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_WAIT_OP                    ARGI_LIST2 (ARGI_EVENT,      ARGI_INTEGER)
@@ -521,14 +521,14 @@
 /* 2D */ ACPI_OP ("FindSetRightBit",    ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_1A_1T_1R,   AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
 /* 2E */ ACPI_OP ("DerefOf",            ARGP_DEREF_OF_OP,          ARGI_DEREF_OF_OP,           ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_1A_0T_1R,   AML_FLAGS_EXEC_1A_0T_1R),
 /* 2F */ ACPI_OP ("Notify",             ARGP_NOTIFY_OP,            ARGI_NOTIFY_OP,             ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_2A_0T_0R,   AML_FLAGS_EXEC_2A_0T_0R),
-/* 30 */ ACPI_OP ("SizeOf",             ARGP_SIZE_OF_OP,           ARGI_SIZE_OF_OP,            ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_1A_0T_1R,   AML_FLAGS_EXEC_1A_0T_1R),
+/* 30 */ ACPI_OP ("SizeOf",             ARGP_SIZE_OF_OP,           ARGI_SIZE_OF_OP,            ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_1A_0T_1R,   AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
 /* 31 */ ACPI_OP ("Index",              ARGP_INDEX_OP,             ARGI_INDEX_OP,              ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_2A_1T_1R,   AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
 /* 32 */ ACPI_OP ("Match",              ARGP_MATCH_OP,             ARGI_MATCH_OP,              ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_6A_0T_1R,   AML_FLAGS_EXEC_6A_0T_1R | AML_CONSTANT),
 /* 33 */ ACPI_OP ("CreateDWordField",   ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD,      AML_CLASS_CREATE,          AML_TYPE_CREATE_FIELD,    AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
 /* 34 */ ACPI_OP ("CreateWordField",    ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP,  ACPI_TYPE_BUFFER_FIELD,      AML_CLASS_CREATE,          AML_TYPE_CREATE_FIELD,    AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
 /* 35 */ ACPI_OP ("CreateByteField",    ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP,  ACPI_TYPE_BUFFER_FIELD,      AML_CLASS_CREATE,          AML_TYPE_CREATE_FIELD,    AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
 /* 36 */ ACPI_OP ("CreateBitField",     ARGP_CREATE_BIT_FIELD_OP,  ARGI_CREATE_BIT_FIELD_OP,   ACPI_TYPE_BUFFER_FIELD,      AML_CLASS_CREATE,          AML_TYPE_CREATE_FIELD,    AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
-/* 37 */ ACPI_OP ("ObjectType",         ARGP_TYPE_OP,              ARGI_TYPE_OP,               ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_1A_0T_1R,   AML_FLAGS_EXEC_1A_0T_1R),
+/* 37 */ ACPI_OP ("ObjectType",         ARGP_TYPE_OP,              ARGI_TYPE_OP,               ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_1A_0T_1R,   AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
 /* 38 */ ACPI_OP ("LAnd",               ARGP_LAND_OP,              ARGI_LAND_OP,               ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_2A_0T_1R,   AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT),
 /* 39 */ ACPI_OP ("LOr",                ARGP_LOR_OP,               ARGI_LOR_OP,                ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_2A_0T_1R,   AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT),
 /* 3A */ ACPI_OP ("LNot",               ARGP_LNOT_OP,              ARGI_LNOT_OP,               ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,         AML_TYPE_EXEC_1A_0T_1R,   AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
diff -Nru a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c
--- a/drivers/acpi/pci_bind.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/pci_bind.c	2004-12-12 21:35:26 -08:00
@@ -126,8 +126,8 @@
 	acpi_status		status = AE_OK;
 	struct acpi_pci_data	*data = NULL;
 	struct acpi_pci_data	*pdata = NULL;
-	char			pathname[ACPI_PATHNAME_MAX] = {0};
-	struct acpi_buffer	buffer = {ACPI_PATHNAME_MAX, pathname};
+	char			*pathname = NULL;
+	struct acpi_buffer	buffer = {0, NULL};
 	acpi_handle		handle = NULL;
 
 	ACPI_FUNCTION_TRACE("acpi_pci_bind");
@@ -135,9 +135,18 @@
 	if (!device || !device->parent)
 		return_VALUE(-EINVAL);
 
+	pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
+	if(!pathname)
+		return_VALUE(-ENOMEM);
+	memset(pathname, 0, ACPI_PATHNAME_MAX);
+	buffer.length = ACPI_PATHNAME_MAX;
+	buffer.pointer = pathname;
+
 	data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
-	if (!data)
+	if (!data){
+		kfree (pathname);
 		return_VALUE(-ENOMEM);
+	}
 	memset(data, 0, sizeof(struct acpi_pci_data));
 
 	acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
@@ -216,6 +225,7 @@
 			data->id.device, data->id.function));
 		data->bus = data->dev->subordinate;
 		device->ops.bind = acpi_pci_bind;
+		device->ops.unbind = acpi_pci_unbind;
 	}
 
 	/*
@@ -253,12 +263,56 @@
 	}
 
 end:
+	kfree(pathname);
 	if (result)
 		kfree(data);
 
 	return_VALUE(result);
 }
 
+int acpi_pci_unbind(
+	struct acpi_device      *device)
+{
+	int                     result = 0;
+	acpi_status             status = AE_OK;
+	struct acpi_pci_data    *data = NULL;
+	char                    pathname[ACPI_PATHNAME_MAX] = {0};
+	struct acpi_buffer      buffer = {ACPI_PATHNAME_MAX, pathname};
+
+	ACPI_FUNCTION_TRACE("acpi_pci_unbind");
+
+	if (!device || !device->parent)
+		return_VALUE(-EINVAL);
+
+	acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unbinding PCI device [%s]...\n",
+		pathname));
+
+	status = acpi_get_data(device->handle, acpi_pci_data_handler, (void**)&data);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Unable to get data from device %s\n",
+			acpi_device_bid(device)));
+		result = -ENODEV;
+		goto end;
+	}
+
+	status = acpi_detach_data(device->handle, acpi_pci_data_handler);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Unable to detach data from device %s\n",
+			acpi_device_bid(device)));
+		result = -ENODEV;
+		goto end;
+	}
+	if (data->dev->subordinate) {
+		acpi_pci_irq_del_prt(data->id.segment, data->bus->number);
+	}
+	kfree(data);
+
+end:
+	return_VALUE(result);
+}
 
 int 
 acpi_pci_bind_root (
@@ -269,22 +323,35 @@
 	int			result = 0;
 	acpi_status		status = AE_OK;
 	struct acpi_pci_data	*data = NULL;
-	char			pathname[ACPI_PATHNAME_MAX] = {0};
-	struct acpi_buffer	buffer = {ACPI_PATHNAME_MAX, pathname};
+	char			*pathname = NULL;
+	struct acpi_buffer	buffer = {0, NULL};
 
 	ACPI_FUNCTION_TRACE("acpi_pci_bind_root");
 
-	if (!device || !id || !bus)
+	pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
+	if(!pathname)
+		return_VALUE(-ENOMEM);
+	memset(pathname, 0, ACPI_PATHNAME_MAX);
+
+	buffer.length = sizeof(pathname);
+	buffer.pointer = pathname;
+
+	if (!device || !id || !bus){
+		kfree(pathname);
 		return_VALUE(-EINVAL);
+	}
 
 	data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
-	if (!data)
+	if (!data){
+		kfree(pathname);
 		return_VALUE(-ENOMEM);
+	}
 	memset(data, 0, sizeof(struct acpi_pci_data));
 
 	data->id = *id;
 	data->bus = bus;
 	device->ops.bind = acpi_pci_bind;
+	device->ops.unbind = acpi_pci_unbind;
 
 	acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
 
@@ -301,6 +368,7 @@
 	}
 
 end:
+	kfree(pathname);
 	if (result != 0)
 		kfree(data);
 
diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
--- a/drivers/acpi/pci_irq.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/pci_irq.c	2004-12-12 21:35:26 -08:00
@@ -43,7 +43,7 @@
 ACPI_MODULE_NAME		("pci_irq")
 
 struct acpi_prt_list		acpi_prt;
-
+spinlock_t acpi_prt_lock = SPIN_LOCK_UNLOCKED;
 
 /* --------------------------------------------------------------------------
                          PCI IRQ Routing Table (PRT) Support
@@ -68,18 +68,20 @@
 	 * Parse through all PRT entries looking for a match on the specified
 	 * PCI device's segment, bus, device, and pin (don't care about func).
 	 *
-	 * TBD: Acquire/release lock
 	 */
+	spin_lock(&acpi_prt_lock);
 	list_for_each(node, &acpi_prt.entries) {
 		entry = list_entry(node, struct acpi_prt_entry, node);
 		if ((segment == entry->id.segment) 
 			&& (bus == entry->id.bus) 
 			&& (device == entry->id.device)
 			&& (pin == entry->pin)) {
+			spin_unlock(&acpi_prt_lock);
 			return_PTR(entry);
 		}
 	}
 
+	spin_unlock(&acpi_prt_lock);
 	return_PTR(NULL);
 }
 
@@ -141,14 +143,29 @@
 		entry->id.segment, entry->id.bus, entry->id.device, 
 		('A' + entry->pin), prt->source, entry->link.index));
 
-	/* TBD: Acquire/release lock */
+	spin_lock(&acpi_prt_lock);
 	list_add_tail(&entry->node, &acpi_prt.entries);
 	acpi_prt.count++;
+	spin_unlock(&acpi_prt_lock);
 
 	return_VALUE(0);
 }
 
 
+static void
+acpi_pci_irq_del_entry (
+	int				segment,
+	int				bus,
+	struct acpi_prt_entry		*entry)
+{
+	if (segment == entry->id.segment && bus == entry->id.bus){
+		acpi_prt.count--;
+		list_del(&entry->node);
+		kfree(entry);
+	}
+}
+
+
 int
 acpi_pci_irq_add_prt (
 	acpi_handle		handle,
@@ -156,7 +173,7 @@
 	int			bus)
 {
 	acpi_status			status = AE_OK;
-	char				pathname[ACPI_PATHNAME_MAX] = {0};
+	char				*pathname = NULL;
 	struct acpi_buffer		buffer = {0, NULL};
 	struct acpi_pci_routing_table	*prt = NULL;
 	struct acpi_pci_routing_table	*entry = NULL;
@@ -164,6 +181,11 @@
 
 	ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt");
 
+	pathname = (char *) kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
+	if(!pathname)
+		return_VALUE(-ENOMEM);
+	memset(pathname, 0, ACPI_PATHNAME_MAX);
+
 	if (first_time) {
 		acpi_prt.count = 0;
 		INIT_LIST_HEAD(&acpi_prt.entries);
@@ -192,12 +214,15 @@
 	if (status != AE_BUFFER_OVERFLOW) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n",
 			acpi_format_exception(status)));
+		kfree(pathname);
 		return_VALUE(-ENODEV);
 	}
 
 	prt = kmalloc(buffer.length, GFP_KERNEL);
-	if (!prt)
+	if (!prt){
+		kfree(pathname);
 		return_VALUE(-ENOMEM);
+	}
 	memset(prt, 0, buffer.length);
 	buffer.pointer = prt;
 
@@ -205,6 +230,7 @@
 	if (ACPI_FAILURE(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PRT [%s]\n",
 			acpi_format_exception(status)));
+		kfree(pathname);
 		kfree(buffer.pointer);
 		return_VALUE(-ENODEV);
 	}
@@ -217,12 +243,32 @@
 			((unsigned long) entry + entry->length);
 	}
 
+	kfree(pathname);
 	kfree(prt);
 
 	return_VALUE(0);
 }
 
+void
+acpi_pci_irq_del_prt (int segment, int bus)
+{
+	struct list_head        *node = NULL, *n = NULL;
+	struct acpi_prt_entry   *entry = NULL;
+
+	if (!acpi_prt.count)    {
+		return;
+	}
 
+	printk(KERN_DEBUG "ACPI: Delete PCI Interrupt Routing Table for %x:%x\n",
+		segment, bus);
+	spin_lock(&acpi_prt_lock);
+	list_for_each_safe(node, n, &acpi_prt.entries) {
+		entry = list_entry(node, struct acpi_prt_entry, node);
+
+		acpi_pci_irq_del_entry(segment, bus, entry);
+	}
+	spin_unlock(&acpi_prt_lock);
+}
 /* --------------------------------------------------------------------------
                           PCI Interrupt Routing Support
    -------------------------------------------------------------------------- */
diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
--- a/drivers/acpi/pci_link.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/pci_link.c	2004-12-12 21:35:26 -08:00
@@ -307,50 +307,57 @@
 	struct {
 		struct acpi_resource	res;
 		struct acpi_resource	end;
-	}                       resource;
-	struct acpi_buffer	buffer = {sizeof(resource)+1, &resource};
+	}    *resource;
+	struct acpi_buffer	buffer = {0, NULL};
 
 	ACPI_FUNCTION_TRACE("acpi_pci_link_set");
 
 	if (!link || !irq)
 		return_VALUE(-EINVAL);
 
-	memset(&resource, 0, sizeof(resource));
+	resource = kmalloc( sizeof(*resource)+1, GFP_KERNEL);
+	if(!resource)
+		return_VALUE(-ENOMEM);
+
+	memset(resource, 0, sizeof(*resource)+1);
+	buffer.length = sizeof(*resource) +1;
+	buffer.pointer = resource;
 
 	switch(link->irq.resource_type) {
 	case ACPI_RSTYPE_IRQ:
-		resource.res.id = ACPI_RSTYPE_IRQ;
-		resource.res.length = sizeof(struct acpi_resource);
-		resource.res.data.irq.edge_level = link->irq.edge_level;
-		resource.res.data.irq.active_high_low = link->irq.active_high_low;
+		resource->res.id = ACPI_RSTYPE_IRQ;
+		resource->res.length = sizeof(struct acpi_resource);
+		resource->res.data.irq.edge_level = link->irq.edge_level;
+		resource->res.data.irq.active_high_low = link->irq.active_high_low;
 		if (link->irq.edge_level == ACPI_EDGE_SENSITIVE)
-			resource.res.data.irq.shared_exclusive = ACPI_EXCLUSIVE;
+			resource->res.data.irq.shared_exclusive = ACPI_EXCLUSIVE;
 		else
-			resource.res.data.irq.shared_exclusive = ACPI_SHARED;
-		resource.res.data.irq.number_of_interrupts = 1;
-		resource.res.data.irq.interrupts[0] = irq;
+			resource->res.data.irq.shared_exclusive = ACPI_SHARED;
+		resource->res.data.irq.number_of_interrupts = 1;
+		resource->res.data.irq.interrupts[0] = irq;
 		break;
 	   
 	case ACPI_RSTYPE_EXT_IRQ:
-		resource.res.id = ACPI_RSTYPE_EXT_IRQ;
-		resource.res.length = sizeof(struct acpi_resource);
-		resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER;
-		resource.res.data.extended_irq.edge_level = link->irq.edge_level;
-		resource.res.data.extended_irq.active_high_low = link->irq.active_high_low;
+		resource->res.id = ACPI_RSTYPE_EXT_IRQ;
+		resource->res.length = sizeof(struct acpi_resource);
+		resource->res.data.extended_irq.producer_consumer = ACPI_CONSUMER;
+		resource->res.data.extended_irq.edge_level = link->irq.edge_level;
+		resource->res.data.extended_irq.active_high_low = link->irq.active_high_low;
 		if (link->irq.edge_level == ACPI_EDGE_SENSITIVE)
-			resource.res.data.irq.shared_exclusive = ACPI_EXCLUSIVE;
+			resource->res.data.irq.shared_exclusive = ACPI_EXCLUSIVE;
 		else
-			resource.res.data.irq.shared_exclusive = ACPI_SHARED;
-		resource.res.data.extended_irq.number_of_interrupts = 1;
-		resource.res.data.extended_irq.interrupts[0] = irq;
+			resource->res.data.irq.shared_exclusive = ACPI_SHARED;
+		resource->res.data.extended_irq.number_of_interrupts = 1;
+		resource->res.data.extended_irq.interrupts[0] = irq;
 		/* ignore resource_source, it's optional */
 		break;
 	default:
 		printk("ACPI BUG: resource_type %d\n", link->irq.resource_type);
-		return_VALUE(-EINVAL);
+		result = -EINVAL;
+		goto end;
 
 	}
-	resource.end.id = ACPI_RSTYPE_END_TAG;
+	resource->end.id = ACPI_RSTYPE_END_TAG;
 
 	/* Attempt to set the resource */
 	status = acpi_set_current_resources(link->handle, &buffer);
@@ -358,14 +365,15 @@
 	/* check for total failure */
 	if (ACPI_FAILURE(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n"));
-		return_VALUE(-ENODEV);
+		result = -ENODEV;
+		goto end;
 	}
 
 	/* Query _STA, set device->status */
 	result = acpi_bus_get_status(link->device);
 	if (result) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unable to read status\n"));
-		return_VALUE(result);
+		goto end;
 	}
 	if (!link->device->status.enabled) {
 		printk(KERN_WARNING PREFIX
@@ -377,7 +385,7 @@
 	/* Query _CRS, set link->irq.active */
 	result = acpi_pci_link_get_current(link);
 	if (result) {
-		return_VALUE(result);
+		goto end;
 	}
 
 	/*
@@ -399,7 +407,9 @@
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active));
 	
-	return_VALUE(0);
+end:
+	kfree(resource);
+	return_VALUE(result);
 }
 
 
diff -Nru a/drivers/acpi/processor.c b/drivers/acpi/processor.c
--- a/drivers/acpi/processor.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/processor.c	2004-12-12 21:35:26 -08:00
@@ -4,6 +4,8 @@
  *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
  *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
  *  Copyright (C) 2004       Dominik Brodowski <linux@brodo.de>
+ *  Copyright (C) 2004  Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
+ *  			- Added processor hotplug support
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
@@ -37,6 +39,7 @@
 #include <linux/pci.h>
 #include <linux/pm.h>
 #include <linux/cpufreq.h>
+#include <linux/cpu.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/dmi.h>
@@ -44,6 +47,7 @@
 
 #include <asm/io.h>
 #include <asm/system.h>
+#include <asm/cpu.h>
 #include <asm/delay.h>
 #include <asm/uaccess.h>
 #include <asm/processor.h>
@@ -71,10 +75,11 @@
 #define C2_OVERHEAD			4	/* 1us (3.579 ticks per us) */
 #define C3_OVERHEAD			4	/* 1us (3.579 ticks per us) */
 
-
 #define ACPI_PROCESSOR_LIMIT_USER	0
 #define ACPI_PROCESSOR_LIMIT_THERMAL	1
 
+#define ACPI_STA_PRESENT 0x00000001
+
 #define _COMPONENT		ACPI_PROCESSOR_COMPONENT
 ACPI_MODULE_NAME		("acpi_processor")
 
@@ -84,12 +89,16 @@
 
 
 static int acpi_processor_add (struct acpi_device *device);
+static int acpi_processor_start (struct acpi_device *device);
 static int acpi_processor_remove (struct acpi_device *device, int type);
 static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
 static int acpi_processor_throttling_open_fs(struct inode *inode, struct file *file);
 static int acpi_processor_power_open_fs(struct inode *inode, struct file *file);
 static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file);
 static int acpi_processor_get_limit_info(struct acpi_processor *pr);
+static void acpi_processor_notify ( acpi_handle	handle, u32 event, void *data);
+static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu);
+static int acpi_processor_handle_eject(struct acpi_processor *pr);
 
 static struct acpi_driver acpi_processor_driver = {
 	.name =		ACPI_PROCESSOR_DRIVER_NAME,
@@ -98,9 +107,13 @@
 	.ops =		{
 				.add =		acpi_processor_add,
 				.remove =	acpi_processor_remove,
+				.start	= 	acpi_processor_start,
 			},
 };
 
+#define INSTALL_NOTIFY_HANDLER		1
+#define UNINSTALL_NOTIFY_HANDLER	2
+
 
 struct acpi_processor_errata {
 	u8			smp;
@@ -339,7 +352,7 @@
 {
 	struct acpi_processor	*pr = NULL;
 	struct acpi_processor_cx *cx = NULL;
-	unsigned int			next_state = 0;
+	unsigned int		next_state = 0;
 	unsigned int		sleep_ticks = 0;
 	u32			t1, t2 = 0;
 
@@ -2341,23 +2354,30 @@
 
 	cpu_index = convert_acpiid_to_cpu(pr->acpi_id);
 
-	if ( !cpu0_initialized && (cpu_index == 0xff)) {
-		/* Handle UP system running SMP kernel, with no LAPIC in MADT */
-		cpu_index = 0;
-	} else if (cpu_index > num_online_cpus()) {
-		/*
-		 *  Extra Processor objects may be enumerated on MP systems with
-		 *  less than the max # of CPUs. They should be ignored.
-		 */
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-			"Error getting cpuindex for acpiid 0x%x\n",
-			pr->acpi_id));
-		return_VALUE(-ENODEV);
-	}
-	cpu0_initialized = 1;
-
-	pr->id = cpu_index;
-
+  	/* Handle UP system running SMP kernel, with no LAPIC in MADT */
+  	if ( !cpu0_initialized && (cpu_index == 0xff) &&
+  		       	(num_online_cpus() == 1)) {
+   		cpu_index = 0;
+   	}
+
+   	cpu0_initialized = 1;
+
+   	pr->id = cpu_index;
+
+  	/*
+  	 *  Extra Processor objects may be enumerated on MP systems with
+  	 *  less than the max # of CPUs. They should be ignored _iff
+  	 *  they are physically not present.
+  	 */
+   	if (cpu_index >=  NR_CPUS) {
+   		if (ACPI_FAILURE(acpi_processor_hotadd_init(pr->handle, &pr->id))) {
+   			ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+   				"Error getting cpuindex for acpiid 0x%x\n",
+   				pr->acpi_id));
+   			return_VALUE(-ENODEV);
+   		}
+    	}
+ 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id, 
 		pr->acpi_id));
 
@@ -2395,6 +2415,71 @@
 	return_VALUE(0);
 }
 
+static int
+acpi_processor_start(
+	struct acpi_device	*device)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	u32			i = 0;
+	struct acpi_processor	*pr;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_start");
+
+	pr = acpi_driver_data(device);
+
+	result = acpi_processor_get_info(pr);
+	if (result) {
+		/* Processor is physically not present */
+		return_VALUE(0);
+	}
+
+	BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0));
+
+	processors[pr->id] = pr;
+
+	result = acpi_processor_add_fs(device);
+	if (result)
+		goto end;
+
+	status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
+		acpi_processor_notify, pr);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error installing device notify handler\n"));
+	}
+
+	/*
+	 * Install the idle handler if processor power management is supported.
+	 * Note that we use previously set idle handler will be used on 
+	 * platforms that only support C1.
+	 */
+	if ((pr->flags.power) && (!boot_option_idle_override)) {
+		printk(KERN_INFO PREFIX "%s [%s] (supports",
+			acpi_device_name(device), acpi_device_bid(device));
+		for (i = 1; i < ACPI_C_STATE_COUNT; i++)
+			if (pr->power.states[i].valid)
+				printk(" C%d", i);
+		printk(")\n");
+		if (pr->id == 0) {
+			pm_idle_save = pm_idle;
+			pm_idle = acpi_processor_idle;
+		}
+	}
+	
+	if (pr->flags.throttling) {
+		printk(KERN_INFO PREFIX "%s [%s] (supports",
+			acpi_device_name(device), acpi_device_bid(device));
+		printk(" %d throttling states", pr->throttling.state_count);
+		printk(")\n");
+	}
+
+end:
+
+	return_VALUE(result);
+}
+
+
 
 static void
 acpi_processor_notify (
@@ -2437,10 +2522,7 @@
 acpi_processor_add (
 	struct acpi_device	*device)
 {
-	int			result = 0;
-	acpi_status		status = AE_OK;
 	struct acpi_processor	*pr = NULL;
-	u32			i = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_processor_add");
 
@@ -2457,57 +2539,7 @@
 	strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
 	acpi_driver_data(device) = pr;
 
-	result = acpi_processor_get_info(pr);
-	if (result)
-		goto end;
-
-	result = acpi_processor_add_fs(device);
-	if (result)
-		goto end;
-
-	status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, 
-		acpi_processor_notify, pr);
-	if (ACPI_FAILURE(status)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
-			"Error installing notify handler\n"));
-		result = -ENODEV;
-		goto end;
-	}
-
-	processors[pr->id] = pr;
-
-	/*
-	 * Install the idle handler if processor power management is supported.
-	 * Note that we use previously set idle handler will be used on 
-	 * platforms that only support C1.
-	 */
-	if ((pr->flags.power) && (!boot_option_idle_override)) {
-		printk(KERN_INFO PREFIX "%s [%s] (supports",
-			acpi_device_name(device), acpi_device_bid(device));
-		for (i = 1; i < ACPI_C_STATE_COUNT; i++)
-			if (pr->power.states[i].valid)
-				printk(" C%d", i);
-		printk(")\n");
-		if (pr->id == 0) {
-			pm_idle_save = pm_idle;
-			pm_idle = acpi_processor_idle;
-		}
-	}
-	
-	if (pr->flags.throttling) {
-		printk(KERN_INFO PREFIX "%s [%s] (supports",
-			acpi_device_name(device), acpi_device_bid(device));
-		printk(" %d throttling states", pr->throttling.state_count);
-		printk(")\n");
-	}
-
-end:
-	if (result) {
-		acpi_processor_remove_fs(device);
-		kfree(pr);
-	}
-
-	return_VALUE(result);
+	return_VALUE(0);
 }
 
 
@@ -2526,6 +2558,16 @@
 
 	pr = (struct acpi_processor *) acpi_driver_data(device);
 
+	if (pr->id >= NR_CPUS) {
+		kfree(pr);
+		return_VALUE(0);
+	}
+
+	if (type == ACPI_BUS_REMOVAL_EJECT) {
+		if (acpi_processor_handle_eject(pr))
+			return_VALUE(-EINVAL);
+	}
+
 	/* Unregister the idle handler when processor #0 is removed. */
 	if (pr->id == 0) {
 		pm_idle = pm_idle_save;
@@ -2582,9 +2624,262 @@
 	{},
 };
 
-/* We keep the driver loaded even when ACPI is not running. 
-   This is needed for the powernow-k8 driver, that works even without
-   ACPI, but needs symbols from this driver */
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
+/****************************************************************************
+ * 	Acpi processor hotplug support 				       	    *
+ ****************************************************************************/
+
+static int is_processor_present(acpi_handle handle);
+
+static int
+is_processor_present(
+	acpi_handle handle)
+{
+	acpi_status 		status;
+	unsigned long		sta = 0;
+
+	ACPI_FUNCTION_TRACE("is_processor_present");
+
+	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
+	if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Processor Device is not present\n"));
+		return_VALUE(0);
+	}
+	return_VALUE(1);
+}
+
+
+static
+int acpi_processor_device_add(
+	acpi_handle	handle,
+	struct acpi_device **device)
+{
+	acpi_handle		phandle;
+	struct acpi_device 	*pdev;
+	struct acpi_processor	*pr;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_device_add");
+
+	if (acpi_get_parent(handle, &phandle)) {
+		return_VALUE(-ENODEV);
+	}
+
+	if (acpi_bus_get_device(phandle, &pdev)) {
+		return_VALUE(-ENODEV);
+	}
+
+	if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_PROCESSOR)) {
+		return_VALUE(-ENODEV);
+	}
+
+	acpi_bus_scan(*device);
+
+	pr = acpi_driver_data(*device);
+	if (!pr)
+		return_VALUE(-ENODEV);
+
+	if ((pr->id >=0) && (pr->id < NR_CPUS)) {
+		kobject_hotplug(&(*device)->kobj, KOBJ_ONLINE);
+	}
+	return_VALUE(0);
+}
+
+
+static void
+acpi_processor_hotplug_notify (
+	acpi_handle		handle,
+	u32			event,
+	void			*data)
+{
+	struct acpi_processor	*pr;
+	struct acpi_device	*device = NULL;
+	int result;
+
+	ACPI_FUNCTION_TRACE("acpi_processor_hotplug_notify");
+
+	switch (event) {
+	case ACPI_NOTIFY_BUS_CHECK:
+	case ACPI_NOTIFY_DEVICE_CHECK:
+		printk("Processor driver received %s event\n",
+			(event==ACPI_NOTIFY_BUS_CHECK)?
+			"ACPI_NOTIFY_BUS_CHECK":"ACPI_NOTIFY_DEVICE_CHECK");
+
+		if (!is_processor_present(handle))
+			break;
+
+		if (acpi_bus_get_device(handle, &device)) {
+			result = acpi_processor_device_add(handle, &device);
+			if (result)
+				ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+					"Unable to add the device\n"));
+			break;
+		}
+
+		pr = acpi_driver_data(device);
+		if (!pr) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+				"Driver data is NULL\n"));
+			break;
+		}
+		
+		if (pr->id >= 0 && (pr->id < NR_CPUS)) {
+			kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
+			break;
+		}
+
+		result = acpi_processor_start(device);
+		if ((!result) && ((pr->id >=0) && (pr->id < NR_CPUS))) {
+			kobject_hotplug(&device->kobj, KOBJ_ONLINE);
+		} else {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+				"Device [%s] failed to start\n",
+				acpi_device_bid(device)));
+		}
+	break;
+	case ACPI_NOTIFY_EJECT_REQUEST:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,"received ACPI_NOTIFY_EJECT_REQUEST\n"));
+
+		if (acpi_bus_get_device(handle, &device)) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"Device don't exist, dropping EJECT\n"));
+			break;
+		}
+		pr = acpi_driver_data(device);
+		if (!pr) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"Driver data is NULL, dropping EJECT\n"));
+			return_VOID;
+		}
+
+		if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))
+			kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
+		break;
+	default:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"Unsupported event [0x%x]\n", event));
+		break;
+	}
+
+	return_VOID;
+}
+
+static acpi_status
+processor_walk_namespace_cb(acpi_handle handle,
+	u32 lvl,
+	void *context,
+	void **rv)
+{
+	acpi_status 			status;
+	int *action = context;
+	acpi_object_type	type = 0;
+
+	status = acpi_get_type(handle, &type);
+	if (ACPI_FAILURE(status))
+		return(AE_OK);
+
+	if (type != ACPI_TYPE_PROCESSOR)
+		return(AE_OK);
+
+	switch(*action) {
+	case INSTALL_NOTIFY_HANDLER:
+		acpi_install_notify_handler(handle,
+			ACPI_SYSTEM_NOTIFY,
+			acpi_processor_hotplug_notify,
+			NULL);
+		break;
+	case UNINSTALL_NOTIFY_HANDLER:
+		acpi_remove_notify_handler(handle,
+			ACPI_SYSTEM_NOTIFY,
+			acpi_processor_hotplug_notify);
+		break;
+	default:
+		break;
+	}
+
+	return(AE_OK);
+}
+
+
+static acpi_status
+acpi_processor_hotadd_init(
+	acpi_handle		handle,
+	int			*p_cpu)
+{
+	ACPI_FUNCTION_TRACE("acpi_processor_hotadd_init");
+	
+	if (!is_processor_present(handle)) {
+		return_VALUE(AE_ERROR);
+	}
+
+	if (acpi_map_lsapic(handle, p_cpu))
+		return_VALUE(AE_ERROR);
+
+	if (arch_register_cpu(*p_cpu)) {
+		acpi_unmap_lsapic(*p_cpu);
+		return_VALUE(AE_ERROR);
+	}
+
+	return_VALUE(AE_OK);
+}
+
+
+static int
+acpi_processor_handle_eject(struct acpi_processor *pr)
+{
+	if (cpu_online(pr->id)) {
+		return(-EINVAL);
+	}
+	arch_unregister_cpu(pr->id);
+	acpi_unmap_lsapic(pr->id);
+	return(0);
+}
+#else
+static acpi_status
+acpi_processor_hotadd_init(
+	acpi_handle		handle,
+	int			*p_cpu)
+{
+	return AE_ERROR;
+}
+static int
+acpi_processor_handle_eject(struct acpi_processor *pr)
+{
+	return(-EINVAL);
+}
+#endif
+
+
+static
+void acpi_processor_install_hotplug_notify(void)
+{
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
+	int action = INSTALL_NOTIFY_HANDLER;
+	acpi_walk_namespace(ACPI_TYPE_PROCESSOR,
+				     ACPI_ROOT_OBJECT,
+				     ACPI_UINT32_MAX,
+				     processor_walk_namespace_cb,
+				     &action, NULL);
+#endif
+}
+
+
+static
+void acpi_processor_uninstall_hotplug_notify(void)
+{
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
+	int action = UNINSTALL_NOTIFY_HANDLER;
+	acpi_walk_namespace(ACPI_TYPE_PROCESSOR,
+				     ACPI_ROOT_OBJECT,
+				     ACPI_UINT32_MAX,
+				     processor_walk_namespace_cb,
+				     &action, NULL);
+#endif
+}
+
+/*
+ * We keep the driver loaded even when ACPI is not running. 
+ * This is needed for the powernow-k8 driver, that works even without
+ * ACPI, but needs symbols from this driver
+ */
 
 static int __init
 acpi_processor_init (void)
@@ -2607,6 +2902,8 @@
 		return_VALUE(0);
 	}
 
+	acpi_processor_install_hotplug_notify();
+
 	acpi_thermal_cpufreq_init();
 
 	acpi_processor_ppc_init();
@@ -2628,6 +2925,8 @@
 	acpi_processor_ppc_exit();
 
 	acpi_thermal_cpufreq_exit();
+
+	acpi_processor_uninstall_hotplug_notify();
 
 	acpi_bus_unregister_driver(&acpi_processor_driver);
 
diff -Nru a/drivers/acpi/scan.c b/drivers/acpi/scan.c
--- a/drivers/acpi/scan.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/scan.c	2004-12-12 21:35:26 -08:00
@@ -2,9 +2,9 @@
  * scan.c - support for transforming the ACPI namespace into individual objects
  */
 
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
-#include <linux/module.h>
 
 #include <acpi/acpi_drivers.h>
 #include <acpi/acinterp.h>	/* for acpi_ex_eisa_id_to_string() */
@@ -35,7 +35,49 @@
 	kfree(dev);
 }
 
+struct acpi_device_attribute {
+	struct attribute attr;
+	ssize_t (*show)(struct acpi_device *, char *);
+	ssize_t (*store)(struct acpi_device *, const char *, size_t);
+};
+
+typedef void acpi_device_sysfs_files(struct kobject *,
+				const struct attribute *);
+
+static void setup_sys_fs_device_files(struct acpi_device *dev,
+		acpi_device_sysfs_files *func);
+
+#define create_sysfs_device_files(dev)	\
+	setup_sys_fs_device_files(dev, (acpi_device_sysfs_files *)&sysfs_create_file)
+#define remove_sysfs_device_files(dev)	\
+	setup_sys_fs_device_files(dev, (acpi_device_sysfs_files *)&sysfs_remove_file)
+
+
+#define to_acpi_device(n) container_of(n, struct acpi_device, kobj)
+#define to_handle_attr(n) container_of(n, struct acpi_device_attribute, attr);
+
+static ssize_t acpi_device_attr_show(struct kobject *kobj,
+		struct attribute *attr, char *buf)
+{
+	struct acpi_device *device = to_acpi_device(kobj);
+	struct acpi_device_attribute *attribute = to_handle_attr(attr);
+	return attribute->show ? attribute->show(device, buf) : 0;
+}
+static ssize_t acpi_device_attr_store(struct kobject *kobj,
+		struct attribute *attr, const char *buf, size_t len)
+{
+	struct acpi_device *device = to_acpi_device(kobj);
+	struct acpi_device_attribute *attribute = to_handle_attr(attr);
+	return attribute->store ? attribute->store(device, buf, len) : len;
+}
+
+static struct sysfs_ops acpi_device_sysfs_ops = {
+	.show	= acpi_device_attr_show,
+	.store	= acpi_device_attr_store,
+};
+
 static struct kobj_type ktype_acpi_ns = {
+	.sysfs_ops	= &acpi_device_sysfs_ops,
 	.release	= acpi_device_release,
 };
 
@@ -58,6 +100,7 @@
 	INIT_LIST_HEAD(&device->children);
 	INIT_LIST_HEAD(&device->node);
 	INIT_LIST_HEAD(&device->g_list);
+	INIT_LIST_HEAD(&device->wakeup_list);
 
 	spin_lock(&acpi_device_lock);
 	if (device->parent) {
@@ -65,15 +108,17 @@
 		list_add_tail(&device->g_list,&device->parent->g_list);
 	} else
 		list_add_tail(&device->g_list,&acpi_device_list);
+	if (device->wakeup.flags.valid)
+		list_add_tail(&device->wakeup_list,&acpi_wakeup_device_list);
 	spin_unlock(&acpi_device_lock);
 
-	kobject_init(&device->kobj);
 	strlcpy(device->kobj.name,device->pnp.bus_id,KOBJ_NAME_LEN);
 	if (parent)
 		device->kobj.parent = &parent->kobj;
 	device->kobj.ktype = &ktype_acpi_ns;
 	device->kobj.kset = &acpi_namespace_kset;
-	kobject_add(&device->kobj);
+	kobject_register(&device->kobj);
+	create_sysfs_device_files(device);
 }
 
 static int
@@ -81,6 +126,19 @@
 	struct acpi_device	*device, 
 	int			type)
 {
+	spin_lock(&acpi_device_lock);
+	if (device->parent) {
+		list_del(&device->node);
+		list_del(&device->g_list);
+	} else
+		list_del(&device->g_list);
+
+	list_del(&device->wakeup_list);
+
+	spin_unlock(&acpi_device_lock);
+
+	acpi_detach_data(device->handle, acpi_bus_data_handler);
+	remove_sysfs_device_files(device);
 	kobject_unregister(&device->kobj);
 	return 0;
 }
@@ -272,12 +330,6 @@
 	if (!acpi_match_ids(device, "PNP0C0D,PNP0C0C,PNP0C0E"))
 		device->wakeup.flags.run_wake = 1;
 
-	/* TBD: lock */
-	INIT_LIST_HEAD(&device->wakeup_list);
-	spin_lock(&acpi_device_lock);
-	list_add_tail(&device->wakeup_list, &acpi_wakeup_device_list);
-	spin_unlock(&acpi_device_lock);
-
 end:
 	if (ACPI_FAILURE(status))
 		device->flags.wake_capable = 0;
@@ -285,6 +337,114 @@
 }
 
 /* --------------------------------------------------------------------------
+		ACPI hotplug sysfs device file support
+   -------------------------------------------------------------------------- */
+static ssize_t acpi_eject_store(struct acpi_device *device, 
+		const char *buf, size_t count);
+
+#define ACPI_DEVICE_ATTR(_name,_mode,_show,_store) \
+static struct acpi_device_attribute acpi_device_attr_##_name = \
+		__ATTR(_name, _mode, _show, _store)
+
+ACPI_DEVICE_ATTR(eject, 0200, NULL, acpi_eject_store);
+
+/**
+ * setup_sys_fs_device_files - sets up the device files under device namespace
+ * @@dev:	acpi_device object
+ * @@func:	function pointer to create or destroy the device file
+ */
+static void
+setup_sys_fs_device_files (
+	struct acpi_device *dev,
+	acpi_device_sysfs_files *func)
+{
+	if (dev->flags.ejectable == 1)
+		(*(func))(&dev->kobj,&acpi_device_attr_eject.attr);
+}
+
+static int
+acpi_eject_operation(acpi_handle handle, int lockable)
+{
+	struct acpi_object_list arg_list;
+	union acpi_object arg;
+	acpi_status status = AE_OK;
+
+	/*
+	 * TBD: evaluate _PS3?
+	 */
+
+	if (lockable) {
+		arg_list.count = 1;
+		arg_list.pointer = &arg;
+		arg.type = ACPI_TYPE_INTEGER;
+		arg.integer.value = 0;
+		acpi_evaluate_object(handle, "_LCK", &arg_list, NULL);
+	}
+
+	arg_list.count = 1;
+	arg_list.pointer = &arg;
+	arg.type = ACPI_TYPE_INTEGER;
+	arg.integer.value = 1;
+
+	/*
+	 * TBD: _EJD support.
+	 */
+
+	status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL);
+	if (ACPI_FAILURE(status)) {
+		return(-ENODEV);
+	}
+
+	return(0);
+}
+
+
+static ssize_t
+acpi_eject_store(struct acpi_device *device, const char *buf, size_t count)
+{
+	int	result;
+	int	ret = count;
+	int	islockable;
+	acpi_status	status;
+	acpi_handle	handle;
+	acpi_object_type	type = 0;
+
+	if ((!count) || (buf[0] != '1')) {
+		return -EINVAL;
+	}
+
+#ifndef FORCE_EJECT
+	if (device->driver == NULL) {
+		ret = -ENODEV;
+		goto err;
+	}
+#endif
+	status = acpi_get_type(device->handle, &type);
+	if (ACPI_FAILURE(status) || (!device->flags.ejectable) ) {
+		ret = -ENODEV;
+		goto err;
+	}
+
+	islockable = device->flags.lockable;
+	handle = device->handle;
+
+	if (type == ACPI_TYPE_PROCESSOR)
+		result = acpi_bus_trim(device, 0);
+	else
+		result = acpi_bus_trim(device, 1);
+
+	if (!result)
+		result = acpi_eject_operation(handle, islockable);
+
+	if (result) {
+		ret = -EBUSY;
+	}
+err:
+	return ret;
+}
+
+
+/* --------------------------------------------------------------------------
                               Performance Management
    -------------------------------------------------------------------------- */
 
@@ -727,7 +887,7 @@
 #ifdef CONFIG_ACPI_DEBUG_OUTPUT
 	char		*type_string = NULL;
 	char		name[80] = {'?','\0'};
-	acpi_buffer	buffer = {sizeof(name), name};
+	struct acpi_buffer	buffer = {sizeof(name), name};
 
 	switch (type) {
 	case ACPI_BUS_TYPE_DEVICE:
@@ -764,7 +924,55 @@
 #endif /*CONFIG_ACPI_DEBUG_OUTPUT*/
 }
 
-int 
+
+int
+acpi_bus_remove (
+	struct acpi_device *dev,
+	int rmdevice)
+{
+	int 			result = 0;
+	struct acpi_driver	*driver;
+	
+	ACPI_FUNCTION_TRACE("acpi_bus_remove");
+
+	if (!dev)
+		return_VALUE(-EINVAL);
+
+	driver = dev->driver;
+
+	if ((driver) && (driver->ops.remove)) {
+
+		if (driver->ops.stop) {
+			result = driver->ops.stop(dev, ACPI_BUS_REMOVAL_EJECT);
+			if (result)
+				return_VALUE(result);
+		}
+
+		result = dev->driver->ops.remove(dev, ACPI_BUS_REMOVAL_EJECT);
+		if (result) {
+			return_VALUE(result);
+		}
+
+		atomic_dec(&dev->driver->references);
+		dev->driver = NULL;
+		acpi_driver_data(dev) = NULL;
+	}
+
+	if (!rmdevice)
+		return_VALUE(0);
+
+	if (dev->flags.bus_address) {
+		if ((dev->parent) && (dev->parent->ops.unbind))
+			dev->parent->ops.unbind(dev);
+	}
+	
+	acpi_device_unregister(dev, ACPI_BUS_REMOVAL_EJECT);
+
+	return_VALUE(0);
+}
+
+
+int
 acpi_bus_add (
 	struct acpi_device	**child,
 	struct acpi_device	*parent,
@@ -911,7 +1119,7 @@
 EXPORT_SYMBOL(acpi_bus_add);
 
 
-static int acpi_bus_scan (struct acpi_device	*start)
+int acpi_bus_scan (struct acpi_device	*start)
 {
 	acpi_status		status = AE_OK;
 	struct acpi_device	*parent = NULL;
@@ -1014,6 +1222,62 @@
 }
 EXPORT_SYMBOL(acpi_bus_scan);
 
+
+int
+acpi_bus_trim(struct acpi_device	*start,
+		int rmdevice)
+{
+	acpi_status		status;
+	struct acpi_device	*parent, *child;
+	acpi_handle		phandle, chandle;
+	acpi_object_type	type;
+	u32			level = 1;
+	int			err = 0;
+
+	parent  = start;
+	phandle = start->handle;
+	child = chandle = NULL;
+
+	while ((level > 0) && parent && (!err)) {
+		status = acpi_get_next_object(ACPI_TYPE_ANY, phandle,
+			chandle, &chandle);
+
+		/*
+		 * If this scope is exhausted then move our way back up.
+		 */
+		if (ACPI_FAILURE(status)) {
+			level--;
+			chandle = phandle;
+			acpi_get_parent(phandle, &phandle);
+			child = parent;
+			parent = parent->parent;
+
+			if (level == 0)
+				err = acpi_bus_remove(child, rmdevice);
+			else
+				err = acpi_bus_remove(child, 1);
+
+			continue;
+		}
+
+		status = acpi_get_type(chandle, &type);
+		if (ACPI_FAILURE(status)) {
+			continue;
+		}
+		/*
+		 * If there is a device corresponding to chandle then
+		 * parse it (depth-first).
+		 */
+		if (acpi_bus_get_device(chandle, &child) == 0) {
+			level++;
+			phandle = chandle;
+			chandle = NULL;
+			parent = child;
+		}
+		continue;
+	}
+	return err;
+}
 
 static int
 acpi_bus_scan_fixed (
diff -Nru a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
--- a/drivers/acpi/sleep/proc.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/sleep/proc.c	2004-12-12 21:35:26 -08:00
@@ -83,6 +83,7 @@
 {
 	u32			sec, min, hr;
 	u32			day, mo, yr;
+	unsigned char		rtc_control = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_system_alarm_seq_show");
 
@@ -91,10 +92,12 @@
 	sec = CMOS_READ(RTC_SECONDS_ALARM);
 	min = CMOS_READ(RTC_MINUTES_ALARM);
 	hr = CMOS_READ(RTC_HOURS_ALARM);
+	rtc_control = CMOS_READ(RTC_CONTROL);
 
-#if 0	/* If we ever get an FACP with proper values... */
+	/* If we ever get an FACP with proper values... */
 	if (acpi_gbl_FADT->day_alrm)
-		day = CMOS_READ(acpi_gbl_FADT->day_alrm);
+		/* ACPI spec: only low 6 its should be cared */
+		day = CMOS_READ(acpi_gbl_FADT->day_alrm) & 0x3F;
 	else
 		day =  CMOS_READ(RTC_DAY_OF_MONTH);
 	if (acpi_gbl_FADT->mon_alrm)
@@ -105,24 +108,20 @@
 		yr = CMOS_READ(acpi_gbl_FADT->century) * 100 + CMOS_READ(RTC_YEAR);
 	else
 		yr = CMOS_READ(RTC_YEAR);
-#else
-	day = CMOS_READ(RTC_DAY_OF_MONTH);
-	mo = CMOS_READ(RTC_MONTH);
-	yr = CMOS_READ(RTC_YEAR);
-#endif
 
 	spin_unlock(&rtc_lock);
 
-	BCD_TO_BIN(sec);
-	BCD_TO_BIN(min);
-	BCD_TO_BIN(hr);
-	BCD_TO_BIN(day);
-	BCD_TO_BIN(mo);
-	BCD_TO_BIN(yr);
+	if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
+		BCD_TO_BIN(sec);
+		BCD_TO_BIN(min);
+		BCD_TO_BIN(hr);
+		BCD_TO_BIN(day);
+		BCD_TO_BIN(mo);
+		BCD_TO_BIN(yr);
+	}
 
-#if 0
 	/* we're trusting the FADT (see above)*/
-#else
+	if (!acpi_gbl_FADT->century)
 	/* If we're not trusting the FADT, we should at least make it
 	 * right for _this_ century... ehm, what is _this_ century?
 	 *
@@ -141,8 +140,7 @@
 	 *        s/2000/2100
 	 *
 	 */
-	yr += 2000;
-#endif
+		yr += 2000;
 
 	seq_printf(seq,"%4.4u-", yr);
 	(mo > 12)  ? seq_puts(seq, "**-")  : seq_printf(seq, "%2.2u-", mo);
@@ -316,6 +314,13 @@
 	}
 
 	spin_lock_irq(&rtc_lock);
+	/*
+	 * Disable alarm interrupt before setting alarm timer or else
+	 * when ACPI_EVENT_RTC is enabled, a spurious ACPI interrupt occurs
+	 */
+	rtc_control &= ~RTC_AIE;
+	CMOS_WRITE(rtc_control, RTC_CONTROL);
+	CMOS_READ(RTC_INTR_FLAGS);
 
 	/* write the fields the rtc knows about */
 	CMOS_WRITE(hr, RTC_HOURS_ALARM);
@@ -327,24 +332,21 @@
 	 * offsets into the CMOS RAM here -- which for some reason are pointing
 	 * to the RTC area of memory.
 	 */
-#if 0
 	if (acpi_gbl_FADT->day_alrm)
 		CMOS_WRITE(day, acpi_gbl_FADT->day_alrm);
 	if (acpi_gbl_FADT->mon_alrm)
 		CMOS_WRITE(mo, acpi_gbl_FADT->mon_alrm);
 	if (acpi_gbl_FADT->century)
 		CMOS_WRITE(yr/100, acpi_gbl_FADT->century);
-#endif
 	/* enable the rtc alarm interrupt */
-	if (!(rtc_control & RTC_AIE)) {
-		rtc_control |= RTC_AIE;
-		CMOS_WRITE(rtc_control,RTC_CONTROL);
-		CMOS_READ(RTC_INTR_FLAGS);
-	}
+	rtc_control |= RTC_AIE;
+	CMOS_WRITE(rtc_control, RTC_CONTROL);
+	CMOS_READ(RTC_INTR_FLAGS);
 
 	spin_unlock_irq(&rtc_lock);
 
-	acpi_set_register(ACPI_BITREG_RT_CLOCK_ENABLE, 1, ACPI_MTX_LOCK);
+	acpi_clear_event(ACPI_EVENT_RTC);
+	acpi_enable_event(ACPI_EVENT_RTC, 0);
 
 	*ppos += count;
 
@@ -395,6 +397,7 @@
 	char		strbuf[5];
 	char		str[5] = "";
 	int 		len = count;
+	struct acpi_device *found_dev = NULL;
 
 	if (len > 4) len = 4;
 
@@ -411,9 +414,25 @@
 
 		if (!strncmp(dev->pnp.bus_id, str, 4)) {
 			dev->wakeup.state.enabled = dev->wakeup.state.enabled ? 0:1;
+			found_dev = dev;
 			break;
 		}
 	}
+	if (found_dev) {
+		list_for_each_safe(node, next, &acpi_wakeup_device_list) {
+			struct acpi_device * dev = container_of(node,
+				struct acpi_device, wakeup_list);
+
+			if ((dev != found_dev) &&
+				(dev->wakeup.gpe_number == found_dev->wakeup.gpe_number) &&
+				(dev->wakeup.gpe_device == found_dev->wakeup.gpe_device)) {
+				printk(KERN_WARNING "ACPI: '%s' and '%s' have the same GPE, "
+					"can't disable/enable one seperately\n",
+					dev->pnp.bus_id, found_dev->pnp.bus_id);
+				dev->wakeup.state.enabled = found_dev->wakeup.state.enabled;
+			}
+		}
+	}
 	spin_unlock(&acpi_device_lock);
 	return count;
 }
@@ -449,6 +468,14 @@
 };
 
 
+static u32 rtc_handler(void * context)
+{
+	acpi_clear_event(ACPI_EVENT_RTC);
+	acpi_disable_event(ACPI_EVENT_RTC, 0);
+
+	return ACPI_INTERRUPT_HANDLED;
+}
+
 static int acpi_sleep_proc_init(void)
 {
 	struct proc_dir_entry	*entry = NULL;
@@ -474,6 +501,7 @@
 	if (entry)
 		entry->proc_fops = &acpi_system_wakeup_device_fops;
 
+	acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL);
 	return 0;
 }
 
diff -Nru a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
--- a/drivers/acpi/tables/tbrsdt.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/tables/tbrsdt.c	2004-12-12 21:35:26 -08:00
@@ -277,6 +277,7 @@
 
 	acpi_tb_get_rsdt_address (&address);
 
+	table_info.type = ACPI_TABLE_XSDT;
 	status = acpi_tb_get_table (&address, &table_info);
 	if (ACPI_FAILURE (status)) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not get the RSDT/XSDT, %s\n",
diff -Nru a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c
--- a/drivers/acpi/tables/tbxfroot.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/tables/tbxfroot.c	2004-12-12 21:35:26 -08:00
@@ -387,35 +387,58 @@
 	u8                              *start_address,
 	u32                             length)
 {
-	u32                             offset;
 	u8                              *mem_rover;
+	u8                              *end_address;
+	u8                              checksum;
 
 
 	ACPI_FUNCTION_TRACE ("tb_scan_memory_for_rsdp");
 
 
-	/* Search from given start addr for the requested length  */
+	end_address = start_address + length;
 
-	for (offset = 0, mem_rover = start_address;
-		 offset < length;
-		 offset += ACPI_RSDP_SCAN_STEP, mem_rover += ACPI_RSDP_SCAN_STEP) {
+	/* Search from given start address for the requested length */
 
+	for (mem_rover = start_address; mem_rover < end_address;
+		 mem_rover += ACPI_RSDP_SCAN_STEP) {
 		/* The signature and checksum must both be correct */
 
-		if (ACPI_STRNCMP ((char *) mem_rover,
-				RSDP_SIG, sizeof (RSDP_SIG)-1) == 0 &&
-			acpi_tb_checksum (mem_rover, ACPI_RSDP_CHECKSUM_LENGTH) == 0) {
-			/* If so, we have found the RSDP */
+		if (ACPI_STRNCMP ((char *) mem_rover, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) {
+			/* No signature match, keep looking */
+
+			continue;
+		}
+
+		/* Signature matches, check the appropriate checksum */
+
+		if (((struct rsdp_descriptor *) mem_rover)->revision < 2) {
+			/* ACPI version 1.0 */
+
+			checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_CHECKSUM_LENGTH);
+		}
+		else {
+			/* Post ACPI 1.0, use extended_checksum */
+
+			checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_XCHECKSUM_LENGTH);
+		}
+
+		if (checksum == 0) {
+			/* Checksum valid, we have found a valid RSDP */
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-				"RSDP located at physical address %p\n",mem_rover));
+				"RSDP located at physical address %p\n", mem_rover));
 			return_PTR (mem_rover);
 		}
+
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+			"Found an RSDP at physical address %p, but it has a bad checksum\n",
+			mem_rover));
 	}
 
 	/* Searched entire block, no RSDP was found */
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,"Searched entire block, no RSDP was found.\n"));
+	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+		"Searched entire block, no valid RSDP was found.\n"));
 	return_PTR (NULL);
 }
 
diff -Nru a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
--- a/drivers/acpi/thermal.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/thermal.c	2004-12-12 21:35:26 -08:00
@@ -64,6 +64,7 @@
 #define ACPI_THERMAL_PATH_POWEROFF	"/sbin/poweroff"
 
 #define ACPI_THERMAL_MAX_ACTIVE	10
+#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65
 
 #define KELVIN_TO_CELSIUS(t)    (long)(((long)t-2732>=0) ? ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
 #define CELSIUS_TO_KELVIN(t)	((t+273)*10)
@@ -899,21 +900,33 @@
 	struct seq_file		*m = (struct seq_file *)file->private_data;
 	struct acpi_thermal	*tz = (struct acpi_thermal *)m->private;
 
-	char			limit_string[65] = {'\0'};
+	char			*limit_string; 
 	int			num, critical, hot, passive;
-	int			active[ACPI_THERMAL_MAX_ACTIVE];
+	int			*active; 
 	int			i = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_thermal_write_trip_points");
 
+	limit_string = kmalloc(ACPI_THERMAL_MAX_LIMIT_STR_LEN, GFP_KERNEL);
+	if(!limit_string)
+		return_VALUE(-ENOMEM);
+
+	memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
+
+	active = kmalloc(ACPI_THERMAL_MAX_ACTIVE *sizeof(int), GFP_KERNEL);
+	if(!active)
+		return_VALUE(-ENOMEM);
+
 	if (!tz || (count > sizeof(limit_string) - 1)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
-		return_VALUE(-EINVAL);
+		count = -EINVAL;
+		goto end;
 	}
 	
 	if (copy_from_user(limit_string, buffer, count)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data\n"));
-		return_VALUE(-EFAULT);
+		count = -EFAULT;
+		goto end;
 	}
 	
 	limit_string[count] = '\0';
@@ -924,7 +937,8 @@
 				&active[5], &active[6], &active[7], &active[8], &active[9]);
 	if(!(num >=5 && num < (ACPI_THERMAL_MAX_ACTIVE + 3))) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n"));
-		return_VALUE(-EINVAL);
+		count = -EINVAL;
+		goto end;
 	}
 
 	tz->trips.critical.temperature = CELSIUS_TO_KELVIN(critical);
@@ -936,6 +950,9 @@
 		tz->trips.active[i].temperature = CELSIUS_TO_KELVIN(active[i]);
 	}
 	
+end:
+	kfree(active);
+	kfree(limit_string);
 	return_VALUE(count);
 }
 
diff -Nru a/drivers/acpi/video.c b/drivers/acpi/video.c
--- a/drivers/acpi/video.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/acpi/video.c	2004-12-12 21:35:26 -08:00
@@ -242,6 +242,13 @@
 	.release	= single_release,
 };
 
+static char	device_decode[][30] = {
+	"motherboard VGA device",
+	"PCI VGA device",
+	"AGP VGA device",
+	"UNKNOWN",
+};
+
 static void acpi_video_device_notify ( acpi_handle handle, u32 event, void *data);
 static void acpi_video_device_rebind( struct acpi_video_bus *video);
 static void acpi_video_device_bind( struct acpi_video_bus *video, struct acpi_video_device *device);
@@ -1117,12 +1124,6 @@
 	struct acpi_video_bus	*video = (struct acpi_video_bus *) seq->private;
 	int			status;
 	unsigned long		id;
-	char			device_decode[][30] = {
-					"motherboard VGA device",
-					"PCI VGA device",
-					"AGP VGA device",
-					"UNKNOWN",
-	};
 
 	ACPI_FUNCTION_TRACE("acpi_video_bus_POST_seq_show");
 
diff -Nru a/drivers/base/cpu.c b/drivers/base/cpu.c
--- a/drivers/base/cpu.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/base/cpu.c	2004-12-12 21:35:26 -08:00
@@ -48,10 +48,23 @@
 }
 static SYSDEV_ATTR(online, 0600, show_online, store_online);
 
-static void __init register_cpu_control(struct cpu *cpu)
+static void __devinit register_cpu_control(struct cpu *cpu)
 {
 	sysdev_create_file(&cpu->sysdev, &attr_online);
 }
+void unregister_cpu(struct cpu *cpu, struct node *root)
+{
+
+	if (root)
+		sysfs_remove_link(&root->sysdev.kobj,
+				  kobject_name(&cpu->sysdev.kobj));
+	sysdev_remove_file(&cpu->sysdev, &attr_online);
+
+	sysdev_unregister(&cpu->sysdev);
+
+	return;
+}
+EXPORT_SYMBOL(unregister_cpu);
 #else /* ... !CONFIG_HOTPLUG_CPU */
 static inline void register_cpu_control(struct cpu *cpu)
 {
@@ -66,7 +79,7 @@
  *
  * Initialize and register the CPU device.
  */
-int __init register_cpu(struct cpu *cpu, int num, struct node *root)
+int __devinit register_cpu(struct cpu *cpu, int num, struct node *root)
 {
 	int error;
 
@@ -83,6 +96,9 @@
 		register_cpu_control(cpu);
 	return error;
 }
+#ifdef CONFIG_HOTPLUG_CPU
+EXPORT_SYMBOL(register_cpu);
+#endif
 
 
 
diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c
--- a/drivers/pci/quirks.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/pci/quirks.c	2004-12-12 21:35:26 -08:00
@@ -497,6 +497,7 @@
 DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C686_5,	quirk_via_irqpic );
 DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C686_6,	quirk_via_irqpic );
 DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8233_5,	quirk_via_irqpic );
+DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8233_7,	quirk_via_irqpic );
 
 
 /*
diff -Nru a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
--- a/drivers/pnp/pnpacpi/core.c	2004-12-12 21:35:26 -08:00
+++ b/drivers/pnp/pnpacpi/core.c	2004-12-12 21:35:26 -08:00
@@ -236,6 +236,8 @@
 
 	if (!acpi_bus_get_device(handle, &device))
 		pnpacpi_add_device(device);
+	else
+		return AE_CTRL_DEPTH;
 	return AE_OK;
 }
 
@@ -247,9 +249,7 @@
 	}
 	pnp_info("PnP ACPI init");
 	pnp_register_protocol(&pnpacpi_protocol);
-	acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-			ACPI_UINT32_MAX, pnpacpi_add_device_handler,
-			NULL, NULL);
+	acpi_get_devices(NULL, pnpacpi_add_device_handler, NULL, NULL);
 	pnp_info("PnP ACPI: found %d devices", num);
 	return 0;
 }
diff -Nru a/include/acpi/acconfig.h b/include/acpi/acconfig.h
--- a/include/acpi/acconfig.h	2004-12-12 21:35:26 -08:00
+++ b/include/acpi/acconfig.h	2004-12-12 21:35:26 -08:00
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20041105
+#define ACPI_CA_VERSION                 0x20041203
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
diff -Nru a/include/acpi/acmacros.h b/include/acpi/acmacros.h
--- a/include/acpi/acmacros.h	2004-12-12 21:35:26 -08:00
+++ b/include/acpi/acmacros.h	2004-12-12 21:35:26 -08:00
@@ -55,6 +55,7 @@
 
 #define ACPI_SET_BIT(target,bit)        ((target) |= (bit))
 #define ACPI_CLEAR_BIT(target,bit)      ((target) &= ~(bit))
+#define ACPI_MIN(a,b)                   (((a)<(b))?(a):(b))
 
 
 #if ACPI_MACHINE_WIDTH == 16
@@ -487,19 +488,19 @@
  * The first parameter should be the procedure name as a quoted string.  This is declared
  * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
  */
-#define ACPI_FUNCTION_NAME(a)               struct acpi_debug_print_info _dbg; \
-												_dbg.component_id = _COMPONENT; \
-												_dbg.proc_name   = a; \
-												_dbg.module_name = _THIS_MODULE;
+#define ACPI_FUNCTION_NAME(a)               struct acpi_debug_print_info _debug_info; \
+												_debug_info.component_id = _COMPONENT; \
+												_debug_info.proc_name  = a; \
+												_debug_info.module_name = _THIS_MODULE;
 
 #define ACPI_FUNCTION_TRACE(a)              ACPI_FUNCTION_NAME(a) \
-												acpi_ut_trace(__LINE__,&_dbg)
+												acpi_ut_trace(__LINE__,&_debug_info)
 #define ACPI_FUNCTION_TRACE_PTR(a,b)        ACPI_FUNCTION_NAME(a) \
-												acpi_ut_trace_ptr(__LINE__,&_dbg,(void *)b)
+												acpi_ut_trace_ptr(__LINE__,&_debug_info,(void *)b)
 #define ACPI_FUNCTION_TRACE_U32(a,b)        ACPI_FUNCTION_NAME(a) \
-												acpi_ut_trace_u32(__LINE__,&_dbg,(u32)b)
+												acpi_ut_trace_u32(__LINE__,&_debug_info,(u32)b)
 #define ACPI_FUNCTION_TRACE_STR(a,b)        ACPI_FUNCTION_NAME(a) \
-												acpi_ut_trace_str(__LINE__,&_dbg,(char *)b)
+												acpi_ut_trace_str(__LINE__,&_debug_info,(char *)b)
 
 #define ACPI_FUNCTION_ENTRY()               acpi_ut_track_stack_ptr()
 
@@ -516,10 +517,10 @@
 #define ACPI_DO_WHILE0(a)               a
 #endif
 
-#define return_VOID                     ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_dbg);return;})
-#define return_ACPI_STATUS(s)           ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_dbg,(s));return((s));})
-#define return_VALUE(s)                 ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_dbg,(acpi_integer)(s));return((s));})
-#define return_PTR(s)                   ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_dbg,(u8 *)(s));return((s));})
+#define return_VOID                     ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_debug_info);return;})
+#define return_ACPI_STATUS(s)           ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_debug_info,(s));return((s));})
+#define return_VALUE(s)                 ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_debug_info,(acpi_integer)(s));return((s));})
+#define return_PTR(s)                   ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_debug_info,(u8 *)(s));return((s));})
 
 /* Conditional execution */
 
diff -Nru a/include/acpi/acobject.h b/include/acpi/acobject.h
--- a/include/acpi/acobject.h	2004-12-12 21:35:26 -08:00
+++ b/include/acpi/acobject.h	2004-12-12 21:35:26 -08:00
@@ -94,9 +94,7 @@
 	u32                                     bit_length;         /* Length of field in bits */\
 	u32                                     base_byte_offset;   /* Byte offset within containing object */\
 	u8                                      start_field_bit_offset;/* Bit offset within first field datum (0-63) */\
-	u8                                      datum_valid_bits;   /* Valid bit in first "Field datum" */\
-	u8                                      end_field_valid_bits; /* Valid bits in the last "field datum" */\
-	u8                                      end_buffer_valid_bits; /* Valid bits in the last "buffer datum" */\
+	u8                                      access_bit_width;   /* Read/Write size in bits (8-64) */\
 	u32                                     value;              /* Value to store into the Bank or Index register */\
 	struct acpi_namespace_node              *node;              /* Link back to parent node */
 
diff -Nru a/include/acpi/acoutput.h b/include/acpi/acoutput.h
--- a/include/acpi/acoutput.h	2004-12-12 21:35:26 -08:00
+++ b/include/acpi/acoutput.h	2004-12-12 21:35:26 -08:00
@@ -136,7 +136,7 @@
 /*
  * Debug level macros that are used in the DEBUG_PRINT macros
  */
-#define ACPI_DEBUG_LEVEL(dl)        (u32) dl,__LINE__,&_dbg
+#define ACPI_DEBUG_LEVEL(dl)        (u32) dl,__LINE__,&_debug_info
 
 /* Exception level -- used in the global "debug_level" */
 
diff -Nru a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
--- a/include/acpi/acpi_bus.h	2004-12-12 21:35:26 -08:00
+++ b/include/acpi/acpi_bus.h	2004-12-12 21:35:26 -08:00
@@ -104,6 +104,7 @@
 typedef int (*acpi_op_resume)	(struct acpi_device *device, int state);
 typedef int (*acpi_op_scan)	(struct acpi_device *device);
 typedef int (*acpi_op_bind)	(struct acpi_device *device);
+typedef int (*acpi_op_unbind)	(struct acpi_device *device);
 typedef int (*acpi_op_match)	(struct acpi_device *device,
 				 struct acpi_driver *driver);
 
@@ -117,6 +118,7 @@
 	acpi_op_resume		resume;
 	acpi_op_scan		scan;
 	acpi_op_bind		bind;
+	acpi_op_unbind		unbind;
 	acpi_op_match		match;
 };
 
@@ -316,7 +318,8 @@
  * External Functions
  */
 
-int acpi_bus_get_device(acpi_handle, struct acpi_device **device);
+int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
+void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
 int acpi_bus_get_status (struct acpi_device *device);
 int acpi_bus_get_power (acpi_handle handle, int *state);
 int acpi_bus_set_power (acpi_handle handle, int state);
@@ -324,6 +327,11 @@
 int acpi_bus_receive_event (struct acpi_bus_event *event);
 int acpi_bus_register_driver (struct acpi_driver *driver);
 int acpi_bus_unregister_driver (struct acpi_driver *driver);
+int acpi_bus_scan (struct acpi_device *start);
+int acpi_bus_trim(struct acpi_device *start, int rmdevice);
+int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent,
+		acpi_handle handle, int type);
+
 
 int acpi_match_ids (struct acpi_device	*device, char	*ids);
 int acpi_create_dir(struct acpi_device *);
diff -Nru a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
--- a/include/acpi/acpi_drivers.h	2004-12-12 21:35:26 -08:00
+++ b/include/acpi/acpi_drivers.h	2004-12-12 21:35:26 -08:00
@@ -61,12 +61,14 @@
 /* ACPI PCI Interrupt Routing (pci_irq.c) */
 
 int acpi_pci_irq_add_prt (acpi_handle handle, int segment, int bus);
+void acpi_pci_irq_del_prt (int segment, int bus);
 
 /* ACPI PCI Device Binding (pci_bind.c) */
 
 struct pci_bus;
 
 int acpi_pci_bind (struct acpi_device *device);
+int acpi_pci_unbind (struct acpi_device *device);
 int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus);
 
 /* Arch-defined function to add a bus to the system */
diff -Nru a/include/acpi/acpixf.h b/include/acpi/acpixf.h
--- a/include/acpi/acpixf.h	2004-12-12 21:35:26 -08:00
+++ b/include/acpi/acpixf.h	2004-12-12 21:35:26 -08:00
@@ -345,11 +345,11 @@
 	u32                             event,
 	u32                             flags);
 
-#ifdef ACPI_FUTURE_USAGE
 acpi_status
 acpi_clear_event (
 	u32                             event);
 
+#ifdef ACPI_FUTURE_USAGE
 acpi_status
 acpi_get_event_status (
 	u32                             event,
diff -Nru a/include/acpi/amlcode.h b/include/acpi/amlcode.h
--- a/include/acpi/amlcode.h	2004-12-12 21:35:26 -08:00
+++ b/include/acpi/amlcode.h	2004-12-12 21:35:26 -08:00
@@ -320,6 +320,7 @@
 #define AML_HAS_TARGET              0x0800
 #define AML_HAS_ARGS                0x1000
 #define AML_CONSTANT                0x2000
+#define AML_NO_OPERAND_RESOLVE      0x4000
 
 /* Convenient flag groupings */
 
diff -Nru a/include/acpi/container.h b/include/acpi/container.h
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/include/acpi/container.h	2004-12-12 21:35:26 -08:00
@@ -0,0 +1,13 @@
+#ifndef __ACPI_CONTAINER_H
+#define __ACPI_CONTAINER_H
+
+#include <linux/kernel.h>
+
+struct acpi_container {
+	acpi_handle handle;
+	unsigned long sun;
+	int state;
+};
+
+#endif /* __ACPI_CONTAINER_H */
+
diff -Nru a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h
--- a/include/asm-i386/cpu.h	2004-12-12 21:35:26 -08:00
+++ b/include/asm-i386/cpu.h	2004-12-12 21:35:26 -08:00
@@ -12,18 +12,9 @@
 	struct cpu cpu;
 };
 extern struct i386_cpu cpu_devices[NR_CPUS];
-
-
-static inline int arch_register_cpu(int num){
-	struct node *parent = NULL;
-	
-#ifdef CONFIG_NUMA
-	int node = cpu_to_node(num);
-	if (node_online(node))
-		parent = &node_devices[node].node;
-#endif /* CONFIG_NUMA */
-
-	return register_cpu(&cpu_devices[num].cpu, num, parent);
-}
+extern int arch_register_cpu(int num);
+#ifdef CONFIG_HOTPLUG_CPU
+extern void arch_unregister_cpu(int);
+#endif
 
 #endif /* _ASM_I386_CPU_H_ */
diff -Nru a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
--- a/include/asm-ia64/acpi.h	2004-12-12 21:35:26 -08:00
+++ b/include/asm-ia64/acpi.h	2004-12-12 21:35:26 -08:00
@@ -101,7 +101,7 @@
 #ifdef CONFIG_ACPI_NUMA
 /* Proximity bitmap length; _PXM is at most 255 (8 bit)*/
 #define MAX_PXM_DOMAINS (256)
-extern int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS];
+extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
 extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
 #endif
 
diff -Nru a/include/asm-ia64/cpu.h b/include/asm-ia64/cpu.h
--- a/include/asm-ia64/cpu.h	2004-12-12 21:35:26 -08:00
+++ b/include/asm-ia64/cpu.h	2004-12-12 21:35:26 -08:00
@@ -14,4 +14,9 @@
 
 DECLARE_PER_CPU(int, cpu_state);
 
+extern int arch_register_cpu(int num);
+#ifdef CONFIG_HOTPLUG_CPU
+extern void arch_unregister_cpu(int);
+#endif
+
 #endif /* _ASM_IA64_CPU_H_ */
diff -Nru a/include/linux/acpi.h b/include/linux/acpi.h
--- a/include/linux/acpi.h	2004-12-12 21:35:26 -08:00
+++ b/include/linux/acpi.h	2004-12-12 21:35:26 -08:00
@@ -396,6 +396,12 @@
 void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma);
 void acpi_numa_arch_fixup(void);
 
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
+/* Arch dependent functions for cpu hotplug support */
+int acpi_map_lsapic(acpi_handle handle, int *pcpu);
+int acpi_unmap_lsapic(int cpu);
+#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+
 extern int acpi_mp_config;
 
 extern u32 pci_mmcfg_base_addr;
@@ -472,6 +478,15 @@
 }
 
 #endif /*!CONFIG_ACPI_INTERPRETER*/
+
+#ifdef CONFIG_ACPI_NUMA
+int acpi_get_pxm(acpi_handle handle);
+#else
+static inline int acpi_get_pxm(acpi_handle handle)
+{
+	return 0;
+}
+#endif
 
 #define	ACPI_CSTATE_LIMIT_DEFINED	/* for driver builds */
 #ifdef	CONFIG_ACPI
diff -Nru a/include/linux/cpu.h b/include/linux/cpu.h
--- a/include/linux/cpu.h	2004-12-12 21:35:26 -08:00
+++ b/include/linux/cpu.h	2004-12-12 21:35:26 -08:00
@@ -32,6 +32,9 @@
 };
 
 extern int register_cpu(struct cpu *, int, struct node *);
+#ifdef CONFIG_HOTPLUG_CPU
+extern void unregister_cpu(struct cpu *, struct node *);
+#endif
 struct notifier_block;
 
 #ifdef CONFIG_SMP
