http://linux-acpi.bkbits.net/linux-acpi-test-mm
len.brown@intel.com|ChangeSet|20041109091253|07297 len.brown

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/11/10 17:19:45-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-acpi
# 
# arch/i386/kernel/io_apic.c
#   2004/11/10 17:19:40-08:00 akpm@bix.(none) +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/09 04:09:53-05:00 len.brown@intel.com 
#   Merge intel.com:/home/lenb/src/26-stable-dev
#   into intel.com:/home/lenb/src/26-latest-dev
# 
# include/asm-i386/acpi.h
#   2004/11/09 04:09:49-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/mpparse.c
#   2004/11/09 04:09:49-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# arch/i386/kernel/apic.c
#   2004/11/09 04:09:49-05:00 len.brown@intel.com +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/09 03:56:20-05:00 len.brown@intel.com 
#   [ACPI] fix LAPIC-mode poweroff on D600
#   http://bugzilla.kernel.org/show_bug.cgi?id=3643
#   
#   Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# arch/i386/kernel/apic.c
#   2004/10/20 04:56:42-04:00 len.brown@intel.com +17 -5
#   fix LAPIC-mode poweroff on D600
# 
# ChangeSet
#   2004/11/09 03:55:46-05:00 len.brown@intel.com 
#   fix non-ACPI IOAPIC build
# 
# include/asm-i386/acpi.h
#   2004/11/09 03:55:39-05:00 len.brown@intel.com +2 -1
#   fix non-ACPI IOAPIC build
# 
# arch/i386/kernel/mpparse.c
#   2004/11/09 03:55:39-05:00 len.brown@intel.com +1 -2
#   fix non-ACPI IOAPIC build
# 
# ChangeSet
#   2004/11/09 00:16:29-08:00 akpm@bix.(none) 
#   Merge http://linux-acpi.bkbits.net/linux-acpi-test-mm
#   into bix.(none):/usr/src/bk-acpi
# 
# include/asm-x86_64/processor.h
#   2004/11/09 00:16:25-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/11/09 00:16:25-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/i386/kernel/process.c
#   2004/11/09 00:16:25-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/09 00:16:24-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/09 03:08:42-05:00 len.brown@intel.com 
#   [ACPI] acpi_pci_irq_enable() now returns 0 on success.
#   This bubbles all the way up to pci_enable_device().
#   This allows IRQ0 to be used as a legal PCI device IRQ.
#   
#   The ES7000 uses an interrupt source override to assign pin20 to IRQ0.
#   Then platform_rename_gsi assigns pin0 a high-numbered IRQ -- available
#   for PCI devices.  But IRQ0 needs to be a legal PCI IRQ in the lookup code
#   to make it as far as the re-name code. 
#   
#   Signed-off-by: Natalie Protasevich <Natalie.Protasevich@UNISYS.com>
#   Signed-off-by: Len Brown <len.brown@intel.com>
# 
# drivers/acpi/pci_link.c
#   2004/11/09 03:08:36-05:00 len.brown@intel.com +10 -5
#   Import patch irq0_checks3.patch
# 
# drivers/acpi/pci_irq.c
#   2004/11/09 03:08:36-05:00 len.brown@intel.com +28 -13
#   Import patch irq0_checks3.patch
# 
# ChangeSet
#   2004/11/08 17:03:27-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-acpi
# 
# arch/i386/kernel/process.c
#   2004/11/08 17:03:22-08:00 akpm@bix.(none) +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/07 21:09:20-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-acpi
# 
# arch/x86_64/kernel/Makefile
#   2004/11/07 21:09:16-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/07 21:09:16-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/07 12:08:49-08:00 akpm@bix.(none) 
#   Merge http://linux-acpi.bkbits.net/linux-acpi-test-mm
#   into bix.(none):/usr/src/bk-acpi
# 
# include/asm-x86_64/processor.h
#   2004/11/07 12:08:44-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/serial/8250_pnp.c
#   2004/11/07 12:08:44-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/pnp/pnpbios/core.c
#   2004/11/07 12:08:44-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/acpi/sleep/main.c
#   2004/11/07 12:08:44-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/11/07 12:08:44-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/11/07 12:08:44-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/07 12:08:44-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/07 12:07:07-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-acpi
# 
# include/asm-x86_64/processor.h
#   2004/11/07 12:07:02-08:00 akpm@bix.(none) +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/03 13:05:03-08:00 akpm@bix.(none) 
#   kk
# 
# drivers/serial/8250_pnp.c
#   2004/11/03 13:04:56-08:00 akpm@bix.(none) +0 -1
#   ss
# 
# include/asm-x86_64/processor.h
#   2004/11/03 13:01:06-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/pnp/pnpbios/core.c
#   2004/11/03 13:01:06-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/acpi/sleep/main.c
#   2004/11/03 13:01:06-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/setup.c
#   2004/11/03 13:01:06-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/x86_64/kernel/Makefile
#   2004/11/03 13:01:06-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# Documentation/kernel-parameters.txt
#   2004/11/03 13:01:06-08:00 akpm@bix.(none) +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/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
--- a/arch/i386/kernel/acpi/boot.c	2004-11-10 17:21:03 -08:00
+++ b/arch/i386/kernel/acpi/boot.c	2004-11-10 17:21:03 -08:00
@@ -474,6 +474,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/kernel/apic.c b/arch/i386/kernel/apic.c
--- a/arch/i386/kernel/apic.c	2004-11-10 17:21:03 -08:00
+++ b/arch/i386/kernel/apic.c	2004-11-10 17:21:03 -08:00
@@ -536,13 +536,27 @@
 	unsigned int apic_thmr;
 } apic_pm_state;
 
-static int lapic_suspend(struct sys_device *dev, u32 state)
+static int lapic_shutdown(struct sys_device *dev)
 {
 	unsigned long flags;
 
 	if (!apic_pm_state.active)
 		return 0;
 
+	
+	local_irq_save(flags);
+	disable_local_APIC();
+	local_irq_restore(flags);
+	
+	return 0;
+}
+
+static int lapic_suspend(struct sys_device *dev, u32 state)
+{
+
+	if (!apic_pm_state.active)
+		return 0;
+
 	apic_pm_state.apic_id = apic_read(APIC_ID);
 	apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI);
 	apic_pm_state.apic_ldr = apic_read(APIC_LDR);
@@ -557,10 +571,7 @@
 	apic_pm_state.apic_tdcr = apic_read(APIC_TDCR);
 	apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR);
 	
-	local_irq_save(flags);
-	disable_local_APIC();
-	local_irq_restore(flags);
-	return 0;
+	return lapic_shutdown(dev);
 }
 
 static int lapic_resume(struct sys_device *dev)
@@ -609,6 +620,7 @@
 
 static struct sysdev_class lapic_sysclass = {
 	set_kset_name("lapic"),
+	.shutdown	= lapic_shutdown,
 	.resume		= lapic_resume,
 	.suspend	= lapic_suspend,
 };
diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
--- a/arch/i386/kernel/mpparse.c	2004-11-10 17:21:03 -08:00
+++ b/arch/i386/kernel/mpparse.c	2004-11-10 17:21:03 -08:00
@@ -808,6 +808,7 @@
 		smp_scan_config(address, 0x400);
 }
 
+int (*platform_rename_gsi)(int ioapic, int gsi);
 
 /* --------------------------------------------------------------------------
                             ACPI-based MP Configuration
@@ -1054,8 +1055,6 @@
 			panic("Max # of irq sources exceeded!\n");
 	}
 }
-
-int (*platform_rename_gsi)(int ioapic, int gsi);
 
 int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
 {
diff -Nru a/arch/i386/mach-default/topology.c b/arch/i386/mach-default/topology.c
--- a/arch/i386/mach-default/topology.c	2004-11-10 17:21:03 -08:00
+++ b/arch/i386/mach-default/topology.c	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/arch/ia64/dig/Makefile	2004-11-10 17:21:03 -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-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/arch/ia64/kernel/Makefile	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/arch/ia64/kernel/acpi.c	2004-11-10 17:21:03 -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-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/arch/ia64/mm/numa.c	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/arch/x86_64/Kconfig	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/drivers/acpi/Kconfig	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/drivers/acpi/Makefile	2004-11-10 17:21:03 -08:00
@@ -42,6 +42,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/acpi_ksyms.c b/drivers/acpi/acpi_ksyms.c
--- a/drivers/acpi/acpi_ksyms.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/acpi/acpi_ksyms.c	2004-11-10 17:21:03 -08:00
@@ -138,6 +138,9 @@
 EXPORT_SYMBOL(acpi_bus_receive_event);
 EXPORT_SYMBOL(acpi_bus_register_driver);
 EXPORT_SYMBOL(acpi_bus_unregister_driver);
+EXPORT_SYMBOL(acpi_bus_scan);
+EXPORT_SYMBOL(acpi_bus_trim);
+EXPORT_SYMBOL(acpi_bus_add);
 
 #endif /*CONFIG_ACPI_BUS*/
 
diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c
--- a/drivers/acpi/bus.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/acpi/bus.c	2004-11-10 17:21:03 -08:00
@@ -53,10 +53,6 @@
                                 Device Management
    -------------------------------------------------------------------------- */
 
-extern void acpi_bus_data_handler (
-	acpi_handle		handle,
-	u32			function,
-	void			*context);
 int
 acpi_bus_get_device (
 	acpi_handle		handle,
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-11-10 17:21:03 -08:00
@@ -0,0 +1,344 @@
+/*
+ * 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_run_sbin_hotplug(struct acpi_device *device, char *action)
+{
+	char *argv[3], *envp[6], action_str[32];
+	int i, ret;
+	int len;
+	char pathname[ACPI_PATHNAME_MAX] = {0};
+	acpi_status status;
+	char *container_str;
+	struct acpi_buffer buffer = {ACPI_PATHNAME_MAX, pathname};
+
+	ACPI_FUNCTION_TRACE("container_run_sbin_hotplug");
+
+
+	status = acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
+	if (ACPI_FAILURE(status)) {
+		return(-ENODEV);
+	}
+
+	len = strlen("CONTAINER=") + strlen(pathname) + 1;
+	container_str = kmalloc(len, GFP_KERNEL);
+	if (!container_str)
+		return(-ENOMEM);
+
+	sprintf(container_str, "CONTAINER=%s",pathname);
+	sprintf(action_str, "ACTION=%s", action);
+
+	i = 0;
+	argv[i++] = hotplug_path;
+	argv[i++] = "container";
+	argv[i] = NULL;
+
+	i = 0;
+	envp[i++] = "HOME=/";
+	envp[i++] = "PATH=/sbin;/bin;/usr/sbin;/usr/bin";
+	envp[i++] = action_str;
+	envp[i++] = container_str;
+	envp[i++] = "PLATFORM=ACPI";
+	envp[i] = NULL;
+
+	ret = call_usermodehelper(argv[0], argv, envp, 0);
+
+	kfree(container_str);
+	return_VALUE(ret);
+}
+
+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)
+					container_run_sbin_hotplug(device, "add");
+			} else {
+				/* device exist and this is a remove request */
+				container_run_sbin_hotplug(device, "remove");
+			}
+		}
+		break;
+	case ACPI_NOTIFY_EJECT_REQUEST:
+		if (!acpi_bus_get_device(handle, &device) && device) {
+			container_run_sbin_hotplug(device, "remove");
+		}
+		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/numa.c b/drivers/acpi/numa.c
--- a/drivers/acpi/numa.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/acpi/numa.c	2004-11-10 17:21:03 -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/pci_bind.c b/drivers/acpi/pci_bind.c
--- a/drivers/acpi/pci_bind.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/acpi/pci_bind.c	2004-11-10 17:21:03 -08:00
@@ -214,6 +214,7 @@
 			data->id.device, data->id.function));
 		data->bus = data->dev->subordinate;
 		device->ops.bind = acpi_pci_bind;
+		device->ops.unbind = acpi_pci_unbind;
 	}
 
 	/*
@@ -257,6 +258,49 @@
 	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 (
@@ -283,6 +327,7 @@
 	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);
 
diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
--- a/drivers/acpi/pci_irq.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/acpi/pci_irq.c	2004-11-10 17:21:03 -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,
@@ -222,11 +239,35 @@
 	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
    -------------------------------------------------------------------------- */
 
+/*
+ * acpi_pci_irq_lookup
+ * success: return IRQ >= 0
+ * failure: return -1
+ */
 static int
 acpi_pci_irq_lookup (
 	struct pci_bus		*bus,
@@ -249,14 +290,14 @@
 	entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin); 
 	if (!entry) {
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n"));
-		return_VALUE(0);
+		return_VALUE(-1);
 	}
 	
 	if (entry->link.handle) {
 		irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, edge_level, active_high_low);
-		if (!irq) {
+		if (irq < 0) {
 			ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n"));
-			return_VALUE(0);
+			return_VALUE(-1);
 		}
 	} else {
 		irq = entry->link.index;
@@ -269,6 +310,11 @@
 	return_VALUE(irq);
 }
 
+/*
+ * acpi_pci_irq_derive
+ * success: return IRQ >= 0
+ * failure: return < 0
+ */
 static int
 acpi_pci_irq_derive (
 	struct pci_dev		*dev,
@@ -277,7 +323,7 @@
 	int			*active_high_low)
 {
 	struct pci_dev		*bridge = dev;
-	int			irq = 0;
+	int			irq = -1;
 	u8			bridge_pin = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_pci_irq_derive");
@@ -289,7 +335,7 @@
 	 * Attempt to derive an IRQ for this device from a parent bridge's
 	 * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge).
 	 */
-	while (!irq && bridge->bus->self) {
+	while (irq < 0 && bridge->bus->self) {
 		pin = (pin + PCI_SLOT(bridge->devfn)) % 4;
 		bridge = bridge->bus->self;
 
@@ -299,7 +345,7 @@
 			if (!bridge_pin) {
 				ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 					"No interrupt pin configured for device %s\n", pci_name(bridge)));
-				return_VALUE(0);
+				return_VALUE(-1);
 			}
 			/* Pin is from 0 to 3 */
 			bridge_pin --;
@@ -310,9 +356,9 @@
 			pin, edge_level, active_high_low);
 	}
 
-	if (!irq) {
+	if (irq < 0) {
 		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to derive IRQ for device %s\n", pci_name(dev)));
-		return_VALUE(0);
+		return_VALUE(-1);
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n",
@@ -321,6 +367,11 @@
 	return_VALUE(irq);
 }
 
+/*
+ * acpi_pci_irq_enable
+ * success: return 0
+ * failure: return < 0
+ */
 
 int
 acpi_pci_irq_enable (
@@ -358,20 +409,20 @@
 	 * If no PRT entry was found, we'll try to derive an IRQ from the
 	 * device's parent bridge.
 	 */
-	if (!irq)
+	if (irq < 0)
  		irq = acpi_pci_irq_derive(dev, pin, &edge_level, &active_high_low);
  
 	/*
 	 * No IRQ known to the ACPI subsystem - maybe the BIOS / 
 	 * driver reported one, then use it. Exit in any case.
 	 */
-	if (!irq) {
+	if (irq < 0) {
 		printk(KERN_WARNING PREFIX "PCI interrupt %s[%c]: no GSI",
 			pci_name(dev), ('A' + pin));
 		/* Interrupt Line values above 0xF are forbidden */
-		if (dev->irq && (dev->irq <= 0xF)) {
+		if (dev->irq >= 0 && (dev->irq <= 0xF)) {
 			printk(" - using IRQ %d\n", dev->irq);
-			return_VALUE(dev->irq);
+			return_VALUE(0);
 		}
 		else {
 			printk("\n");
@@ -388,5 +439,5 @@
 		(active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high",
 		dev->irq);
 
-	return_VALUE(dev->irq);
+	return_VALUE(0);
 }
diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
--- a/drivers/acpi/pci_link.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/acpi/pci_link.c	2004-11-10 17:21:03 -08:00
@@ -577,6 +577,11 @@
 	return_VALUE(0);
 }
 
+/*
+ * acpi_pci_link_get_irq
+ * success: return IRQ >= 0
+ * failure: return -1
+ */
 
 int
 acpi_pci_link_get_irq (
@@ -594,27 +599,27 @@
 	result = acpi_bus_get_device(handle, &device);
 	if (result) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n"));
-		return_VALUE(0);
+		return_VALUE(-1);
 	}
 
 	link = (struct acpi_pci_link *) acpi_driver_data(device);
 	if (!link) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n"));
-		return_VALUE(0);
+		return_VALUE(-1);
 	}
 
 	/* TBD: Support multiple index (IRQ) entries per Link Device */
 	if (index) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid index %d\n", index));
-		return_VALUE(0);
+		return_VALUE(-1);
 	}
 
 	if (acpi_pci_link_allocate(link))
-		return_VALUE(0);
+		return_VALUE(-1);
 	   
 	if (!link->irq.active) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n"));
-		return_VALUE(0);
+		return_VALUE(-1);
 	}
 
 	if (edge_level) *edge_level = link->irq.edge_level;
diff -Nru a/drivers/acpi/processor.c b/drivers/acpi/processor.c
--- a/drivers/acpi/processor.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/acpi/processor.c	2004-11-10 17:21:03 -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
+
 static int c2 = -1;
 static int c3 = -1;
 
@@ -2342,23 +2355,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));
 
@@ -2396,6 +2416,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 (
@@ -2438,10 +2523,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");
 
@@ -2458,57 +2540,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);
 }
 
 
@@ -2527,6 +2559,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;
@@ -2578,9 +2620,312 @@
 	{},
 };
 
-/* 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
+processor_run_sbin_hotplug(struct acpi_device *device,
+	       int cpu, char *action)
+{
+	char *argv[3], *envp[7], action_str[32], cpu_str[15];
+	int i, ret;
+	int len;
+	char pathname[ACPI_PATHNAME_MAX] = {0};
+	acpi_status status;
+	char *processor_str;
+	struct acpi_buffer buffer = {ACPI_PATHNAME_MAX, pathname};
+
+	ACPI_FUNCTION_TRACE("processor_run_sbin_hotplug");
+
+
+	status = acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
+	if (ACPI_FAILURE(status)) {
+		return(-ENODEV);
+	}
+
+	len = strlen("PROCESSOR=") + strlen(pathname) + 1;
+	processor_str = kmalloc(len, GFP_KERNEL);
+	if (!processor_str)
+		return(-ENOMEM);
+
+	sprintf(processor_str, "PROCESSOR=%s",pathname);
+	sprintf(action_str, "ACTION=%s", action);
+	sprintf(cpu_str, "CPU=%d", cpu);
+
+	i = 0;
+	argv[i++] = hotplug_path;
+	argv[i++] = "cpu";
+	argv[i] = NULL;
+
+	i = 0;
+	envp[i++] = "HOME=/";
+	envp[i++] = "PATH=/sbin;/bin;/usr/sbin;/usr/bin";
+	envp[i++] = action_str;
+	envp[i++] = processor_str;
+	envp[i++] = cpu_str;
+	envp[i++] = "PLATFORM=ACPI";
+	envp[i] = NULL;
+
+	ret = call_usermodehelper(argv[0], argv, envp, 0);
+
+	kfree(processor_str);
+	return_VALUE(ret);
+}
+
+
+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)) {
+		processor_run_sbin_hotplug(*device, pr->id, "add");
+	}
+	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)) {
+			processor_run_sbin_hotplug(device, pr->id, "remove");
+			break;
+		}
+
+		result = acpi_processor_start(device);
+		if ((!result) && ((pr->id >=0) && (pr->id < NR_CPUS))) {
+			processor_run_sbin_hotplug(device, pr->id, "add");
+		} 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)))
+			processor_run_sbin_hotplug(device, pr->id, "remove");
+		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)
@@ -2603,6 +2948,8 @@
 		return_VALUE(0);
 	}
 
+	acpi_processor_install_hotplug_notify();
+
 	acpi_thermal_cpufreq_init();
 
 	acpi_processor_ppc_init();
@@ -2621,6 +2968,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-11-10 17:21:03 -08:00
+++ b/drivers/acpi/scan.c	2004-11-10 17:21:03 -08:00
@@ -2,6 +2,7 @@
  * scan.c - support for transforming the ACPI namespace into individual objects
  */
 
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
 
@@ -34,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,
 };
 
@@ -57,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) {
@@ -64,6 +108,8 @@
 		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);
@@ -73,6 +119,7 @@
 	device->kobj.ktype = &ktype_acpi_ns;
 	device->kobj.kset = &acpi_namespace_kset;
 	kobject_add(&device->kobj);
+	create_sysfs_device_files(device);
 }
 
 static int
@@ -80,6 +127,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;
 }
@@ -271,12 +331,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;
@@ -284,6 +338,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
    -------------------------------------------------------------------------- */
 
@@ -724,7 +886,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:
@@ -761,7 +923,55 @@
 #endif /*CONFIG_ACPI_DEBUG_OUTPUT*/
 }
 
-static 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,
@@ -908,7 +1118,7 @@
 
 
 
-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;
@@ -1010,6 +1220,62 @@
 	return_VALUE(0);
 }
 
+
+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/base/cpu.c b/drivers/base/cpu.c
--- a/drivers/base/cpu.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/base/cpu.c	2004-11-10 17:21:03 -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/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
--- a/drivers/char/ipmi/ipmi_si_intf.c	2004-11-10 17:21:03 -08:00
+++ b/drivers/char/ipmi/ipmi_si_intf.c	2004-11-10 17:21:03 -08:00
@@ -1331,7 +1331,7 @@
 static int acpi_failure = 0;
 
 /* For GPE-type interrupts. */
-u32 ipmi_acpi_gpe(void *context)
+void ipmi_acpi_gpe(void *context)
 {
 	struct smi_info *smi_info = context;
 	unsigned long   flags;
@@ -1355,8 +1355,6 @@
 	smi_event_handler(smi_info, 0);
  out:
 	spin_unlock_irqrestore(&(smi_info->si_lock), flags);
-
-	return ACPI_INTERRUPT_HANDLED;
 }
 
 static int acpi_gpe_irq_setup(struct smi_info *info)
diff -Nru a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
--- a/include/acpi/acpi_bus.h	2004-11-10 17:21:03 -08:00
+++ b/include/acpi/acpi_bus.h	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/include/acpi/acpi_drivers.h	2004-11-10 17:21:03 -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/container.h b/include/acpi/container.h
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/include/acpi/container.h	2004-11-10 17:21:03 -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/acpi.h b/include/asm-i386/acpi.h
--- a/include/asm-i386/acpi.h	2004-11-10 17:21:03 -08:00
+++ b/include/asm-i386/acpi.h	2004-11-10 17:21:03 -08:00
@@ -133,7 +133,6 @@
 #define FIX_ACPI_PAGES 4
 
 extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
-extern int (*platform_rename_gsi)(int ioapic, int gsi);
 
 #ifdef CONFIG_X86_IO_APIC
 extern int skip_ioapic_setup;
@@ -160,6 +159,8 @@
 #  define acpi_ioapic 0
 
 #endif
+
+extern int (*platform_rename_gsi)(int ioapic, int gsi);
 
 #ifdef CONFIG_ACPI_PCI
 static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
diff -Nru a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h
--- a/include/asm-i386/cpu.h	2004-11-10 17:21:03 -08:00
+++ b/include/asm-i386/cpu.h	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/include/asm-ia64/acpi.h	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/include/asm-ia64/cpu.h	2004-11-10 17:21:03 -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-11-10 17:21:02 -08:00
+++ b/include/linux/acpi.h	2004-11-10 17:21:03 -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-11-10 17:21:03 -08:00
+++ b/include/linux/cpu.h	2004-11-10 17:21:03 -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