---

 Documentation/kernel-parameters.txt |   17 +++
 arch/i386/kernel/acpi/boot.c        |   66 ++++++++++--
 arch/i386/kernel/cpu/cpufreq/acpi.c |   71 +++++++++++--
 arch/i386/kernel/dmi_scan.c         |   10 -
 arch/i386/kernel/io_apic.c          |   10 -
 arch/i386/kernel/mpparse.c          |   19 +++
 arch/i386/kernel/setup.c            |    9 -
 arch/i386/mach-es7000/es7000.c      |    2 
 arch/i386/pci/acpi.c                |   13 --
 arch/i386/pci/common.c              |    5 
 arch/i386/pci/pci.h                 |    1 
 arch/x86_64/kernel/acpi/boot.c      |   69 ++++++++++---
 arch/x86_64/kernel/io_apic.c        |    8 -
 arch/x86_64/kernel/mpparse.c        |    2 
 arch/x86_64/kernel/setup.c          |    8 +
 drivers/acpi/bus.c                  |    4 
 drivers/acpi/dispatcher/dsinit.c    |    4 
 drivers/acpi/dispatcher/dsmethod.c  |    4 
 drivers/acpi/dispatcher/dsmthdat.c  |   43 ++++++--
 drivers/acpi/dispatcher/dsopcode.c  |   18 +--
 drivers/acpi/dispatcher/dswexec.c   |   22 +++-
 drivers/acpi/dispatcher/dswload.c   |    8 -
 drivers/acpi/dispatcher/dswscope.c  |    8 -
 drivers/acpi/events/evgpe.c         |   57 +++++------
 drivers/acpi/events/evgpeblk.c      |    5 
 drivers/acpi/events/evmisc.c        |    3 
 drivers/acpi/events/evregion.c      |  134 ++++++++++++++++++--------
 drivers/acpi/events/evrgnini.c      |   32 +++++-
 drivers/acpi/events/evxfregn.c      |   24 +++-
 drivers/acpi/executer/exdump.c      |   50 ++++-----
 drivers/acpi/executer/exfldio.c     |  184 ++++++++++++++++++------------------
 drivers/acpi/executer/exmisc.c      |    6 -
 drivers/acpi/executer/exmutex.c     |   12 +-
 drivers/acpi/executer/exoparg1.c    |    3 
 drivers/acpi/executer/exoparg3.c    |    5 
 drivers/acpi/executer/exprep.c      |    4 
 drivers/acpi/executer/exregion.c    |   10 -
 drivers/acpi/executer/exresolv.c    |    6 -
 drivers/acpi/executer/exresop.c     |    4 
 drivers/acpi/executer/exstore.c     |    3 
 drivers/acpi/executer/exsystem.c    |   21 ++--
 drivers/acpi/hardware/hwacpi.c      |   13 +-
 drivers/acpi/hardware/hwregs.c      |   12 --
 drivers/acpi/hardware/hwsleep.c     |   89 ++++++++++++-----
 drivers/acpi/namespace/nsaccess.c   |    8 -
 drivers/acpi/namespace/nsalloc.c    |    7 -
 drivers/acpi/namespace/nsdump.c     |   37 +++----
 drivers/acpi/namespace/nsdumpdv.c   |    2 
 drivers/acpi/namespace/nsinit.c     |   63 +++++++-----
 drivers/acpi/namespace/nsobject.c   |    7 -
 drivers/acpi/namespace/nssearch.c   |    4 
 drivers/acpi/namespace/nsutils.c    |    6 -
 drivers/acpi/namespace/nsxfname.c   |    2 
 drivers/acpi/parser/psargs.c        |    4 
 drivers/acpi/parser/psparse.c       |    4 
 drivers/acpi/parser/psxface.c       |   34 +++++-
 drivers/acpi/pci_link.c             |  180 ++++++++++++++++++++++++++++++-----
 drivers/acpi/pci_root.c             |   95 ------------------
 drivers/acpi/resources/rscalc.c     |    4 
 drivers/acpi/resources/rscreate.c   |    2 
 drivers/acpi/resources/rsdump.c     |   18 +--
 drivers/acpi/resources/rsirq.c      |   38 +++----
 drivers/acpi/resources/rslist.c     |    4 
 drivers/acpi/scan.c                 |    3 
 drivers/acpi/sleep/proc.c           |    3 
 drivers/acpi/tables.c               |   30 ++++-
 drivers/acpi/tables/tbget.c         |   10 -
 drivers/acpi/tables/tbgetall.c      |    3 
 drivers/acpi/tables/tbrsdt.c        |    3 
 drivers/acpi/tables/tbxface.c       |    2 
 drivers/acpi/tables/tbxfroot.c      |    3 
 drivers/acpi/thermal.c              |    1 
 drivers/acpi/utilities/utalloc.c    |   55 +---------
 drivers/acpi/utilities/utdebug.c    |    2 
 drivers/acpi/utilities/utdelete.c   |    4 
 drivers/acpi/utilities/uteval.c     |    4 
 drivers/acpi/utilities/utglobal.c   |   95 ++++++++++++++++++
 drivers/acpi/utilities/utobject.c   |   28 -----
 include/acpi/acconfig.h             |    2 
 include/acpi/acevents.h             |   11 ++
 include/acpi/acglobal.h             |    3 
 include/acpi/acmacros.h             |   27 ++---
 include/acpi/acobject.h             |   35 +++---
 include/acpi/acpi_drivers.h         |    4 
 include/acpi/acutils.h              |    8 +
 include/acpi/processor.h            |    2 
 include/asm-i386/acpi.h             |   10 +
 include/asm-i386/system.h           |    1 
 include/asm-x86_64/acpi.h           |   27 ++---
 89 files changed, 1223 insertions(+), 770 deletions(-)

diff -puN arch/i386/kernel/acpi/boot.c~acpi arch/i386/kernel/acpi/boot.c
--- 25/arch/i386/kernel/acpi/boot.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/kernel/acpi/boot.c	2004-01-22 22:42:00.000000000 -0800
@@ -41,9 +41,8 @@
 
 #define PREFIX			"ACPI: "
 
-extern int acpi_disabled;
-extern int acpi_irq;
-extern int acpi_ht;
+int acpi_noirq __initdata = 0;	/* skip ACPI IRQ initialization */
+int acpi_ht __initdata = 1;	/* enable HT */
 
 int acpi_lapic = 0;
 int acpi_ioapic = 0;
@@ -250,29 +249,66 @@ acpi_parse_nmi_src (
 
 #ifdef	CONFIG_ACPI_BUS
 /*
- * Set specified PIC IRQ to level triggered mode.
+ * "acpi_pic_sci=level" (current default)
+ * programs the PIC-mode SCI to Level Trigger.
+ * (NO-OP if the BIOS set Level Trigger already)
+ *
+ * If a PIC-mode SCI is not recogznied or gives spurious IRQ7's
+ * it may require Edge Trigger -- use "acpi_pic_sci=edge"
+ * (NO-OP if the BIOS set Edge Trigger already)
  *
  * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
  * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
  * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
  * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
- *
- * As the BIOS should have done this for us,
- * print a warning if the IRQ wasn't already set to level.
  */
 
-void acpi_pic_set_level_irq(unsigned int irq)
+static int __initdata	acpi_pic_sci_trigger;	/* 0: level, 1: edge */
+
+void __init
+acpi_pic_sci_set_trigger(unsigned int irq)
 {
 	unsigned char mask = 1 << (irq & 7);
 	unsigned int port = 0x4d0 + (irq >> 3);
 	unsigned char val = inb(port);
 
+	
+	printk(PREFIX "IRQ%d SCI:", irq);
 	if (!(val & mask)) {
-		printk(KERN_WARNING PREFIX "IRQ %d was Edge Triggered, "
-			"setting to Level Triggerd\n", irq);
-		outb(val | mask, port);
+		printk(" Edge");
+
+		if (!acpi_pic_sci_trigger) {
+			printk(" set to Level");
+			outb(val | mask, port);
+		}
+	} else {
+		printk(" Level");
+
+		if (acpi_pic_sci_trigger) {
+			printk(" set to Edge");
+			outb(val | mask, port);
+		}
+	}
+	printk(" Trigger.\n");
+}
+
+int __init
+acpi_pic_sci_setup(char *str)
+{
+	while (str && *str) {
+		if (strncmp(str, "level", 5) == 0)
+			acpi_pic_sci_trigger = 0;	/* force level trigger */
+		if (strncmp(str, "edge", 4) == 0)
+			acpi_pic_sci_trigger = 1;	/* force edge trigger */
+		str = strchr(str, ',');
+		if (str)
+			str += strspn(str, ", \t");
 	}
+	return 1;
 }
+
+__setup("acpi_pic_sci=", acpi_pic_sci_setup);
+
 #endif /* CONFIG_ACPI_BUS */
 
 
@@ -387,8 +423,10 @@ acpi_boot_init (void)
 	 * Initialize the ACPI boot-time table parser.
 	 */
 	result = acpi_table_init();
-	if (result)
+	if (result) {
+		acpi_disabled = 1;
 		return result;
+	}
 
 	result = acpi_blacklisted();
 	if (result) {
@@ -469,7 +507,7 @@ acpi_boot_init (void)
 	 * If MPS is present, it will handle them,
 	 * otherwise the system will stay in PIC mode
 	 */
-	if (acpi_disabled || !acpi_irq) {
+	if (acpi_disabled || acpi_noirq) {
 		return 1;
         }
 
@@ -511,6 +549,8 @@ acpi_boot_init (void)
 
 	acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
 
+	acpi_irq_balance_set(NULL);
+
 	acpi_ioapic = 1;
 
 #endif /* CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER */
diff -puN arch/i386/kernel/cpu/cpufreq/acpi.c~acpi arch/i386/kernel/cpu/cpufreq/acpi.c
--- 25/arch/i386/kernel/cpu/cpufreq/acpi.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/kernel/cpu/cpufreq/acpi.c	2004-01-22 22:42:00.000000000 -0800
@@ -108,7 +108,7 @@ acpi_processor_get_performance_control (
 	}
 
 	perf->control_register = (u16) reg->address;
-
+	perf->control_register_bit_width = reg->bit_width;
 	/*
 	 * status_register
 	 */
@@ -135,6 +135,7 @@ acpi_processor_get_performance_control (
 	}
 
 	perf->status_register = (u16) reg->address;
+	perf->status_register_bit_width = reg->bit_width;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
 		"control_register[0x%04x] status_register[0x%04x]\n",
@@ -224,6 +225,42 @@ end:
 	return_VALUE(result);
 }
 
+static int
+acpi_processor_write_port(
+	u16	port,
+	u8	bit_width,
+	u32	value)
+{
+	if (bit_width <= 8) {
+		outb(value, port);
+	} else if (bit_width <= 16) {
+		outw(value, port);
+	} else if (bit_width <= 32) {
+		outl(value, port);
+	} else {
+		return -ENODEV;
+	}
+	return 0;
+}
+
+static int
+acpi_processor_read_port(
+	u16	port,
+	u8	bit_width,
+	u32	*ret)
+{
+	*ret = 0;
+	if (bit_width <= 8) {
+		*ret = inb(port);
+	} else if (bit_width <= 16) {
+		*ret = inw(port);
+	} else if (bit_width <= 32) {
+		*ret = inl(port);
+	} else {
+		return -ENODEV;
+	}
+	return 0;
+}
 
 static int
 acpi_processor_set_performance (
@@ -231,7 +268,9 @@ acpi_processor_set_performance (
 	int			state)
 {
 	u16			port = 0;
-	u16			value = 0;
+	u8			bit_width = 0;
+	int			ret = 0;
+	u32			value = 0;
 	int			i = 0;
 	struct cpufreq_freqs    cpufreq_freqs;
 
@@ -279,12 +318,18 @@ acpi_processor_set_performance (
 	 */
 
 	port = perf->control_register;
-	value = (u16) perf->states[state].control;
+	bit_width = perf->control_register_bit_width;
+	value = (u32) perf->states[state].control;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
-		"Writing 0x%04x to port 0x%04x\n", value, port));
+		"Writing 0x%08x to port 0x%04x\n", value, port));
 
-	outw(value, port); 
+	ret = acpi_processor_write_port(port, bit_width, value);
+	if (ret) {
+		ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+			"Invalid port width 0x%04x\n", bit_width));
+		return_VALUE(ret);
+	}
 
 	/*
 	 * Then we read the 'status_register' and compare the value with the
@@ -294,14 +339,20 @@ acpi_processor_set_performance (
 	 */
 
 	port = perf->status_register;
+	bit_width = perf->status_register_bit_width;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, 
-		"Looking for 0x%04x from port 0x%04x\n",
-		(u16) perf->states[state].status, port));
+		"Looking for 0x%08x from port 0x%04x\n",
+		(u32) perf->states[state].status, port));
 
 	for (i=0; i<100; i++) {
-		value = inw(port);
-		if (value == (u16) perf->states[state].status)
+		ret = acpi_processor_read_port(port, bit_width, &value);
+		if (ret) {	
+			ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+				"Invalid port width 0x%04x\n", bit_width));
+			return_VALUE(ret);
+		}
+		if (value == (u32) perf->states[state].status)
 			break;
 		udelay(10);
 	}
@@ -309,7 +360,7 @@ acpi_processor_set_performance (
 	/* notify cpufreq */
 	cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
 
-	if (value != (u16) perf->states[state].status) {
+	if (value != (u32) perf->states[state].status) {
 		unsigned int tmp = cpufreq_freqs.new;
 		cpufreq_freqs.new = cpufreq_freqs.old;
 		cpufreq_freqs.old = tmp;
diff -puN arch/i386/kernel/dmi_scan.c~acpi arch/i386/kernel/dmi_scan.c
--- 25/arch/i386/kernel/dmi_scan.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/kernel/dmi_scan.c	2004-01-22 22:42:00.000000000 -0800
@@ -6,6 +6,7 @@
 #include <linux/module.h>
 #include <linux/apm_bios.h>
 #include <linux/slab.h>
+#include <asm/acpi.h>
 #include <asm/io.h>
 #include <linux/pm.h>
 #include <asm/system.h>
@@ -16,6 +17,7 @@ EXPORT_SYMBOL(dmi_broken);
 
 int is_sony_vaio_laptop;
 int is_unsafe_smbus;
+int es7000_plat = 0;
 
 struct dmi_header
 {
@@ -496,6 +498,7 @@ static __init int print_if_true(struct d
 }
 
 
+#ifdef	CONFIG_ACPI_BOOT
 extern int acpi_disabled, acpi_force;
 
 static __init __attribute__((unused)) int acpi_disable(struct dmi_blacklist *d) 
@@ -510,8 +513,6 @@ static __init __attribute__((unused)) in
 	return 0;
 } 
 
-
-#ifdef	CONFIG_ACPI_BOOT
 extern int acpi_ht;
 
 /*
@@ -534,10 +535,8 @@ static __init __attribute__((unused)) in
 #ifdef	CONFIG_ACPI_PCI
 static __init int disable_acpi_pci(struct dmi_blacklist *d) 
 { 
-	extern __init void pci_disable_acpi(void) ;
-
 	printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", d->ident); 	
-	pci_disable_acpi();
+	acpi_noirq_set();
 	return 0;
 } 
 #endif
@@ -1003,6 +1002,7 @@ static __init void dmi_check_blacklist(v
 				printk(KERN_NOTICE "ACPI disabled because your bios is from %s and too old\n", s);
 				printk(KERN_NOTICE "You can enable it with acpi=force\n");
 				acpi_disabled = 1; 
+				acpi_ht = 0;
 			} 
 		}
 	}
diff -puN arch/i386/kernel/io_apic.c~acpi arch/i386/kernel/io_apic.c
--- 25/arch/i386/kernel/io_apic.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/kernel/io_apic.c	2004-01-22 22:42:00.000000000 -0800
@@ -1650,10 +1650,6 @@ static void __init setup_ioapic_ids_from
 	unsigned char old_id;
 	unsigned long flags;
 
-	if (acpi_ioapic)
-		/* This gets done during IOAPIC enumeration for ACPI. */
-		return;
-
 	/*
 	 * This is broken; anything with a real cpu count has to
 	 * circumvent this idiocy regardless.
@@ -2286,12 +2282,14 @@ void __init setup_IO_APIC(void)
 	/*
 	 * Set up IO-APIC IRQ routing.
 	 */
-	setup_ioapic_ids_from_mpc();
+	if (!acpi_ioapic)
+		setup_ioapic_ids_from_mpc();
 	sync_Arb_IDs();
 	setup_IO_APIC_irqs();
 	init_IO_APIC_traps();
 	check_timer();
-	print_IO_APIC();
+	if (!acpi_ioapic)
+		print_IO_APIC();
 }
 
 /*
diff -puN arch/i386/kernel/mpparse.c~acpi arch/i386/kernel/mpparse.c
--- 25/arch/i386/kernel/mpparse.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/kernel/mpparse.c	2004-01-22 22:42:00.000000000 -0800
@@ -1081,8 +1081,14 @@ found:
 
 	ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
 
+	/*
+	 * MPS INTI flags:
+	 *  trigger: 0=default, 1=edge, 3=level
+	 *  polarity: 0=default, 1=high, 3=low
+	 * Per ACPI spec, default for SCI means level/low.
+	 */
 	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 
-				(flags.trigger >> 1) , (flags.polarity >> 1));
+		(flags.trigger == 1 ? 0 : 1), (flags.polarity == 1 ? 0 : 1));
 }
 
 #ifdef CONFIG_ACPI_PCI
@@ -1129,8 +1135,11 @@ void __init mp_parse_prt (void)
 			continue;
 		ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
 
-		if (!ioapic && (irq < 16))
-			irq += 16;
+		if (es7000_plat) {
+			if (!ioapic && (irq < 16))
+				irq += 16;
+		}
+
 		/* 
 		 * Avoid pin reprogramming.  PRTs typically include entries  
 		 * with redundant pin->irq mappings (but unique PCI devices);
@@ -1166,6 +1175,10 @@ void __init mp_parse_prt (void)
 			mp_ioapic_routing[ioapic].apic_id, ioapic_pin, 
 			entry->irq);
 	}
+
+	print_IO_APIC();
+
+	return;
 }
 
 #endif /*CONFIG_ACPI_PCI*/
diff -puN arch/i386/kernel/setup.c~acpi arch/i386/kernel/setup.c
--- 25/arch/i386/kernel/setup.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/kernel/setup.c	2004-01-22 22:42:00.000000000 -0800
@@ -78,13 +78,10 @@ EXPORT_SYMBOL_GPL(mmu_cr4_features);
 EXPORT_SYMBOL(acpi_disabled);
 
 #ifdef	CONFIG_ACPI_BOOT
-	int acpi_irq __initdata = 1;	/* enable IRQ */
-	int acpi_ht __initdata = 1;	/* enable HT */
+extern int __initdata acpi_ht;
+int __initdata acpi_force = 0;
 #endif
 
-int acpi_force __initdata = 0;
-
-
 int MCA_bus;
 /* for MCA, but anyone else can use it if they want */
 unsigned int machine_id;
@@ -573,7 +570,7 @@ static void __init parse_cmdline_early (
 
 		/* "pci=noacpi" disables ACPI interrupt routing */
 		else if (!memcmp(from, "pci=noacpi", 10)) {
-			acpi_irq = 0;
+			acpi_noirq_set();
 		}
 
 #ifdef CONFIG_X86_LOCAL_APIC
diff -puN arch/i386/mach-es7000/es7000.c~acpi arch/i386/mach-es7000/es7000.c
--- 25/arch/i386/mach-es7000/es7000.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/mach-es7000/es7000.c	2004-01-22 22:42:00.000000000 -0800
@@ -51,8 +51,6 @@ struct mip_reg		*host_reg;
 int 			mip_port;
 unsigned long		mip_addr, host_addr;
 
-static int		es7000_plat;
-
 /*
  * Parse the OEM Table
  */
diff -puN arch/i386/pci/acpi.c~acpi arch/i386/pci/acpi.c
--- 25/arch/i386/pci/acpi.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/pci/acpi.c	2004-01-22 22:42:00.000000000 -0800
@@ -18,7 +18,7 @@ static int __init pci_acpi_init(void)
 	if (pcibios_scanned)
 		return 0;
 
-	if (!(pci_probe & PCI_NO_ACPI_ROUTING)) {
+	if (!acpi_noirq) {
 		if (!acpi_pci_irq_init()) {
 			printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
 			printk(KERN_INFO "PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'\n");
@@ -31,15 +31,4 @@ static int __init pci_acpi_init(void)
 
 	return 0;
 }
-
-/*
- * pci_disable_acpi()
- * act like pci=noacpi seen on command line
- * called by DMI blacklist code
- */
-__init void pci_disable_acpi(void)
-{
-        pci_probe |= PCI_NO_ACPI_ROUTING;
-}
-
 subsys_initcall(pci_acpi_init);
diff -puN arch/i386/pci/common.c~acpi arch/i386/pci/common.c
--- 25/arch/i386/pci/common.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/pci/common.c	2004-01-22 22:42:00.000000000 -0800
@@ -9,6 +9,7 @@
 #include <linux/ioport.h>
 #include <linux/init.h>
 
+#include <asm/acpi.h>
 #include <asm/segment.h>
 #include <asm/io.h>
 #include <asm/smp.h>
@@ -197,12 +198,10 @@ char * __devinit  pcibios_setup(char *st
 		return NULL;
 	}
 #endif
-#ifdef CONFIG_ACPI_PCI
 	else if (!strcmp(str, "noacpi")) {
-		pci_probe |= PCI_NO_ACPI_ROUTING;
+		acpi_noirq_set();
 		return NULL;
 	}
-#endif
 #ifndef CONFIG_X86_VISWS
 	else if (!strcmp(str, "usepirqmask")) {
 		pci_probe |= PCI_USE_PIRQ_MASK;
diff -puN arch/i386/pci/pci.h~acpi arch/i386/pci/pci.h
--- 25/arch/i386/pci/pci.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/i386/pci/pci.h	2004-01-22 22:42:00.000000000 -0800
@@ -22,7 +22,6 @@
 #define PCI_ASSIGN_ROMS		0x1000
 #define PCI_BIOS_IRQ_SCAN	0x2000
 #define PCI_ASSIGN_ALL_BUSSES	0x4000
-#define PCI_NO_ACPI_ROUTING	0x8000
 
 extern unsigned int pci_probe;
 
diff -puN arch/x86_64/kernel/acpi/boot.c~acpi arch/x86_64/kernel/acpi/boot.c
--- 25/arch/x86_64/kernel/acpi/boot.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/x86_64/kernel/acpi/boot.c	2004-01-22 22:42:00.000000000 -0800
@@ -46,11 +46,13 @@
 #include <asm/proto.h>
 #include <asm/tlbflush.h>
 
-int acpi_lapic = 0;
-int acpi_ioapic = 0;
-
 #define PREFIX			"ACPI: "
 
+int acpi_noirq __initdata = 0;	/* skip ACPI IRQ initialization */
+int acpi_ht __initdata = 1;	/* enable HT */
+
+int acpi_lapic = 0;
+int acpi_ioapic = 0;
 
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
@@ -253,29 +255,66 @@ acpi_parse_hpet (
 
 #ifdef CONFIG_ACPI_BUS
 /*
- * Set specified PIC IRQ to level triggered mode.
+ * "acpi_pic_sci=level" (current default)
+ * programs the PIC-mode SCI to Level Trigger.
+ * (NO-OP if the BIOS set Level Trigger already)
+ *
+ * If a PIC-mode SCI is not recogznied or gives spurious IRQ7's
+ * it may require Edge Trigger -- use "acpi_pic_sci=edge"
+ * (NO-OP if the BIOS set Edge Trigger already)
  *
  * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
  * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
  * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
  * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
- *
- * As the BIOS should have done this for us,
- * print a warning if the IRQ wasn't already set to level.
  */
 
-void acpi_pic_set_level_irq(unsigned int irq)
+static int __initdata	acpi_pic_sci_trigger;	/* 0: level, 1: edge */
+
+void __init
+acpi_pic_sci_set_trigger(unsigned int irq)
 {
 	unsigned char mask = 1 << (irq & 7);
 	unsigned int port = 0x4d0 + (irq >> 3);
 	unsigned char val = inb(port);
 
+	
+	printk(PREFIX "IRQ%d SCI:", irq);
 	if (!(val & mask)) {
-		printk(KERN_WARNING PREFIX "IRQ %d was Edge Triggered, "
-			"setting to Level Triggerd\n", irq);
-		outb(val | mask, port);
+		printk(" Edge");
+
+		if (!acpi_pic_sci_trigger) {
+			printk(" set to Level");
+			outb(val | mask, port);
+		}
+	} else {
+		printk(" Level");
+
+		if (acpi_pic_sci_trigger) {
+			printk(" set to Edge");
+			outb(val | mask, port);
+		}
 	}
+	printk(" Trigger.\n");
 }
+
+int __init
+acpi_pic_sci_setup(char *str)
+{
+	while (str && *str) {
+		if (strncmp(str, "level", 5) == 0)
+			acpi_pic_sci_trigger = 0;	/* force level trigger */
+		if (strncmp(str, "edge", 4) == 0)
+			acpi_pic_sci_trigger = 1;	/* force edge trigger */
+		str = strchr(str, ',');
+		if (str)
+			str += strspn(str, ", \t");
+	}
+	return 1;
+}
+
+__setup("acpi_pic_sci=", acpi_pic_sci_setup);
+
 #endif /* CONFIG_ACPI_BUS */
 
 static unsigned long __init
@@ -354,8 +393,10 @@ acpi_boot_init (void)
 	 * Initialize the ACPI boot-time table parser.
 	 */
 	result = acpi_table_init();
-	if (result)
+	if (result) {
+		acpi_disabled = 1;
 		return result;
+	}
 
 	result = acpi_blacklisted();
 	if (result) {
@@ -442,7 +483,7 @@ acpi_boot_init (void)
         * If MPS is present, it will handle them,
         * otherwise the system will stay in PIC mode
         */
-        if (acpi_disabled) {
+        if (acpi_disabled || acpi_noirq) {
                return 1;
 	}
 
@@ -484,6 +525,8 @@ acpi_boot_init (void)
 
 	acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
 
+	acpi_irq_balance_set(NULL);
+
 	acpi_ioapic = 1;
 
 #endif /*CONFIG_X86_IO_APIC*/
diff -puN arch/x86_64/kernel/io_apic.c~acpi arch/x86_64/kernel/io_apic.c
--- 25/arch/x86_64/kernel/io_apic.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/x86_64/kernel/io_apic.c	2004-01-22 22:42:00.000000000 -0800
@@ -1121,8 +1121,6 @@ static void __init setup_ioapic_ids_from
 	unsigned char old_id;
 	unsigned long flags;
 
-	if (acpi_ioapic) return; /* ACPI does that already */
-
 	/*
 	 * Set the IOAPIC ID to the value stored in the MPC table.
 	 */
@@ -1751,12 +1749,14 @@ void __init setup_IO_APIC(void)
 	/*
 	 * Set up the IO-APIC IRQ routing table.
 	 */
-	setup_ioapic_ids_from_mpc();
+	if (!acpi_ioapic)
+		setup_ioapic_ids_from_mpc();
 	sync_Arb_IDs();
 	setup_IO_APIC_irqs();
 	init_IO_APIC_traps();
 	check_timer();
-	print_IO_APIC();
+	if (!acpi_ioapic)
+		print_IO_APIC();
 }
 
 /* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
diff -puN arch/x86_64/kernel/mpparse.c~acpi arch/x86_64/kernel/mpparse.c
--- 25/arch/x86_64/kernel/mpparse.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/x86_64/kernel/mpparse.c	2004-01-22 22:42:00.000000000 -0800
@@ -951,6 +951,8 @@ void __init mp_parse_prt (void)
 			entry->irq);
 	}
 	
+	print_IO_APIC();
+
 	return;
 }
 
diff -puN arch/x86_64/kernel/setup.c~acpi arch/x86_64/kernel/setup.c
--- 25/arch/x86_64/kernel/setup.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/arch/x86_64/kernel/setup.c	2004-01-22 22:42:00.000000000 -0800
@@ -65,7 +65,11 @@ unsigned long mmu_cr4_features;
 EXPORT_SYMBOL_GPL(mmu_cr4_features);
 
 int acpi_disabled = 0;
-int acpi_ht = 0;
+
+#ifdef	CONFIG_ACPI_BOOT
+extern int __initdata acpi_ht;
+/* int __initdata acpi_force = 0; */
+#endif
 
 /* For PCI or other memory-mapped resources */
 unsigned long pci_mem_start = 0x10000000;
@@ -195,6 +199,7 @@ static __init void parse_cmdline_early (
 		if (c != ' ') 
 			goto next_char; 
  
+#ifdef CONFIG_ACPI_BOOT
 		/* "acpi=off" disables both ACPI table parsing and interpreter init */
 		if (!memcmp(from, "acpi=off", 8))
 			acpi_disabled = 1;
@@ -210,6 +215,7 @@ static __init void parse_cmdline_early (
 		if (!memcmp(from, "acpi=ht", 7)) { 
 			acpi_ht = 1; 
 		}
+#endif
 
 		if (!memcmp(from, "nolapic", 7) ||
 		    !memcmp(from, "disableapic", 11))
diff -puN Documentation/kernel-parameters.txt~acpi Documentation/kernel-parameters.txt
--- 25/Documentation/kernel-parameters.txt~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/Documentation/kernel-parameters.txt	2004-01-22 22:42:00.000000000 -0800
@@ -96,6 +96,23 @@ running once the system is up.
 			ht -- run only enough ACPI to enable Hyper Threading
 			See also Documentation/pm.txt.
  
+	acpi_pic_sci=	[HW,ACPI] ACPI System Control Interrupt trigger mode
+			Format: { level | edge }
+			level   Force PIC-mode SCI to Level Trigger (default)
+			edge    Force PIC-mode SCI to Edge Trigge
+
+	acpi_irq_balance	[HW,ACPI] ACPI will balance active IRQs
+				default in APIC mode
+
+	acpi_irq_nobalance	[HW,ACPI] ACPI will not move active IRQs (default)
+				default in PIC mode
+
+	acpi_irq_pci=	[HW,ACPI] If irq_balance, Clear listed IRQs for use by PCI
+			Format: <irq>,<irq>...
+
+	acpi_irq_isa=	[HW,ACPI] If irq_balance, Mark listed IRQs used by ISA
+			Format: <irq>,<irq>...
+
 	ad1816=		[HW,OSS]
 			Format: <io>,<irq>,<dma>,<dma2>
 			See also Documentation/sound/oss/AD1816.
diff -puN drivers/acpi/bus.c~acpi drivers/acpi/bus.c
--- 25/drivers/acpi/bus.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/bus.c	2004-01-22 22:42:00.000000000 -0800
@@ -39,7 +39,7 @@
 #define _COMPONENT		ACPI_BUS_COMPONENT
 ACPI_MODULE_NAME		("acpi_bus")
 
-extern void acpi_pic_set_level_irq(unsigned int irq);
+extern void __init acpi_pic_sci_set_trigger(unsigned int irq);
 
 FADT_DESCRIPTOR			acpi_fadt;
 struct acpi_device		*acpi_root;
@@ -615,7 +615,7 @@ acpi_bus_init (void)
 	if (acpi_ioapic)
 		mp_config_ioapic_for_sci(acpi_fadt.sci_int);
 	else
-		acpi_pic_set_level_irq(acpi_fadt.sci_int);
+		acpi_pic_sci_set_trigger(acpi_fadt.sci_int);
 #endif
 
 	status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION);
diff -puN drivers/acpi/dispatcher/dsinit.c~acpi drivers/acpi/dispatcher/dsinit.c
--- 25/drivers/acpi/dispatcher/dsinit.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/dispatcher/dsinit.c	2004-01-22 22:42:00.000000000 -0800
@@ -106,7 +106,7 @@ acpi_ds_init_one_object (
 		status = acpi_ds_initialize_region (obj_handle);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %p [%4.4s] - Init failure, %s\n",
-				obj_handle, ((struct acpi_namespace_node *) obj_handle)->name.ascii,
+				obj_handle, acpi_ut_get_node_name (obj_handle),
 				acpi_format_exception (status)));
 		}
 
@@ -141,7 +141,7 @@ acpi_ds_init_one_object (
 		status = acpi_ds_parse_method (obj_handle);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n",
-				obj_handle, ((struct acpi_namespace_node *) obj_handle)->name.ascii,
+				obj_handle, acpi_ut_get_node_name (obj_handle),
 				acpi_format_exception (status)));
 
 			/* This parse failed, but we will continue parsing more methods */
diff -puN drivers/acpi/dispatcher/dsmethod.c~acpi drivers/acpi/dispatcher/dsmethod.c
--- 25/drivers/acpi/dispatcher/dsmethod.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/dispatcher/dsmethod.c	2004-01-22 22:42:01.000000000 -0800
@@ -94,7 +94,7 @@ acpi_ds_parse_method (
 	}
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
-		((struct acpi_namespace_node *) obj_handle)->name.ascii, obj_handle));
+		acpi_ut_get_node_name (obj_handle), obj_handle));
 
 	/* Extract the method object from the method Node */
 
@@ -169,7 +169,7 @@ acpi_ds_parse_method (
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
 		"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
-		((struct acpi_namespace_node *) obj_handle)->name.ascii, obj_handle, op));
+		acpi_ut_get_node_name (obj_handle), obj_handle, op));
 
 	acpi_ps_delete_parse_tree (op);
 	return_ACPI_STATUS (status);
diff -puN drivers/acpi/dispatcher/dsmthdat.c~acpi drivers/acpi/dispatcher/dsmthdat.c
--- 25/drivers/acpi/dispatcher/dsmthdat.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/dispatcher/dsmthdat.c	2004-01-22 22:42:01.000000000 -0800
@@ -567,13 +567,13 @@ acpi_ds_store_object_to_local (
 	acpi_status                     status;
 	struct acpi_namespace_node      *node;
 	union acpi_operand_object       *current_obj_desc;
+	union acpi_operand_object       *new_obj_desc;
 
 
 	ACPI_FUNCTION_TRACE ("ds_store_object_to_local");
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n",
 		opcode, index, obj_desc));
 
-
 	/* Parameter validation */
 
 	if (!obj_desc) {
@@ -595,6 +595,19 @@ acpi_ds_store_object_to_local (
 	}
 
 	/*
+	 * If the reference count on the object is more than one, we must
+	 * take a copy of the object before we store.
+	 */
+	new_obj_desc = obj_desc;
+	if (obj_desc->common.reference_count > 1) {
+		status = acpi_ut_copy_iobject_to_iobject (obj_desc, &new_obj_desc, walk_state);
+		new_obj_desc;
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
+	}
+
+	/*
 	 * If there is an object already in this slot, we either
 	 * have to delete it, or if this is an argument and there
 	 * is an object reference stored there, we have to do
@@ -624,8 +637,8 @@ acpi_ds_store_object_to_local (
 			 * operand objects of type Reference.
 			 */
 			if (ACPI_GET_DESCRIPTOR_TYPE (current_obj_desc) != ACPI_DESC_TYPE_OPERAND) {
-				ACPI_REPORT_ERROR (("Invalid descriptor type while storing to method arg: %X\n",
-					current_obj_desc->common.type));
+				ACPI_REPORT_ERROR (("Invalid descriptor type while storing to method arg: [%s]\n",
+						acpi_ut_get_descriptor_name (current_obj_desc)));
 				return_ACPI_STATUS (AE_AML_INTERNAL);
 			}
 
@@ -636,15 +649,21 @@ acpi_ds_store_object_to_local (
 			if ((current_obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
 				(current_obj_desc->reference.opcode == AML_REF_OF_OP)) {
 				ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-					"Arg (%p) is an obj_ref(Node), storing in node %p\n",
-					obj_desc, current_obj_desc));
+						"Arg (%p) is an obj_ref(Node), storing in node %p\n",
+						new_obj_desc, current_obj_desc));
 
 				/*
 				 * Store this object to the Node
 				 * (perform the indirect store)
 				 */
-				status = acpi_ex_store_object_to_node (obj_desc,
+				status = acpi_ex_store_object_to_node (new_obj_desc,
 						 current_obj_desc->reference.object, walk_state);
+
+				/* Remove local reference if we copied the object above */
+
+				if (new_obj_desc != obj_desc) {
+					acpi_ut_remove_reference (new_obj_desc);
+				}
 				return_ACPI_STATUS (status);
 			}
 		}
@@ -657,12 +676,18 @@ acpi_ds_store_object_to_local (
 	}
 
 	/*
-	 * Install the obj_stack descriptor (*obj_desc) into
+	 * Install the Obj descriptor (*new_obj_desc) into
 	 * the descriptor for the Arg or Local.
-	 * Install the new object in the stack entry
 	 * (increments the object reference count by one)
 	 */
-	status = acpi_ds_method_data_set_value (opcode, index, obj_desc, walk_state);
+	status = acpi_ds_method_data_set_value (opcode, index, new_obj_desc, walk_state);
+
+	/* Remove local reference if we copied the object above */
+
+	if (new_obj_desc != obj_desc) {
+		acpi_ut_remove_reference (new_obj_desc);
+	}
+
 	return_ACPI_STATUS (status);
 }
 
diff -puN drivers/acpi/dispatcher/dsopcode.c~acpi drivers/acpi/dispatcher/dsopcode.c
--- 25/drivers/acpi/dispatcher/dsopcode.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/dispatcher/dsopcode.c	2004-01-22 22:42:01.000000000 -0800
@@ -201,7 +201,7 @@ acpi_ds_get_buffer_field_arguments (
 
 	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_BUFFER_FIELD, node, NULL));
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] buffer_field Arg Init\n",
-		node->name.ascii));
+		acpi_ut_get_node_name (node)));
 
 	/* Execute the AML code for the term_arg arguments */
 
@@ -346,7 +346,7 @@ acpi_ds_get_region_arguments (
 	ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (ACPI_TYPE_REGION, node, NULL));
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] op_region Arg Init at AML %p\n",
-		node->name.ascii, extra_desc->extra.aml_start));
+		acpi_ut_get_node_name (node), extra_desc->extra.aml_start));
 
 	/* Execute the argument AML */
 
@@ -438,8 +438,8 @@ acpi_ds_init_buffer_field (
 	 * after resolution in acpi_ex_resolve_operands().
 	 */
 	if (ACPI_GET_DESCRIPTOR_TYPE (result_desc) != ACPI_DESC_TYPE_NAMED) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a NS Node\n",
-			acpi_ps_get_opcode_name (aml_opcode)));
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination not a NS Node [%s]\n",
+				acpi_ps_get_opcode_name (aml_opcode), acpi_ut_get_descriptor_name (result_desc)));
 
 		status = AE_AML_OPERAND_TYPE;
 		goto cleanup;
@@ -514,14 +514,16 @@ acpi_ds_init_buffer_field (
 		goto cleanup;
 	}
 
-
 	/* Entire field must fit within the current length of the buffer */
 
 	if ((bit_offset + bit_count) >
 		(8 * (u32) buffer_desc->buffer.length)) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"Field size %d exceeds Buffer size %d (bits)\n",
-			 bit_offset + bit_count, 8 * (u32) buffer_desc->buffer.length));
+			"Field [%4.4s] size %d exceeds Buffer [%4.4s] size %d (bits)\n",
+			 acpi_ut_get_node_name (result_desc),
+			 bit_offset + bit_count,
+			 acpi_ut_get_node_name (buffer_desc->buffer.node),
+			 8 * (u32) buffer_desc->buffer.length));
 		status = AE_AML_BUFFER_LIMIT;
 		goto cleanup;
 	}
@@ -742,7 +744,7 @@ acpi_ds_eval_region_operands (
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "rgn_obj %p Addr %8.8X%8.8X Len %X\n",
 		obj_desc,
-		ACPI_HIDWORD (obj_desc->region.address), ACPI_LODWORD (obj_desc->region.address),
+		ACPI_FORMAT_UINT64 (obj_desc->region.address),
 		obj_desc->region.length));
 
 	/* Now the address and length are valid for this opregion */
diff -puN drivers/acpi/dispatcher/dswexec.c~acpi drivers/acpi/dispatcher/dswexec.c
--- 25/drivers/acpi/dispatcher/dswexec.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/dispatcher/dswexec.c	2004-01-22 22:42:01.000000000 -0800
@@ -416,10 +416,24 @@ acpi_ds_exec_end_op (
 			status = acpi_gbl_op_type_dispatch [op_type] (walk_state);
 		}
 		else {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"[%s]: Could not resolve operands, %s\n",
-				acpi_ps_get_opcode_name (walk_state->opcode),
-				acpi_format_exception (status)));
+			/*
+			 * Treat constructs of the form "Store(local_x,local_x)" as noops when the
+			 * Local is uninitialized.
+			 */
+			if  ((status == AE_AML_UNINITIALIZED_LOCAL) &&
+				(walk_state->opcode == AML_STORE_OP) &&
+				(walk_state->operands[0]->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
+				(walk_state->operands[1]->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
+				(walk_state->operands[0]->reference.opcode ==
+				 walk_state->operands[1]->reference.opcode)) {
+				status = AE_OK;
+			}
+			else {
+				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+					"[%s]: Could not resolve operands, %s\n",
+					acpi_ps_get_opcode_name (walk_state->opcode),
+					acpi_format_exception (status)));
+			}
 		}
 
 		/* Always delete the argument objects and clear the operand stack */
diff -puN drivers/acpi/dispatcher/dswload.c~acpi drivers/acpi/dispatcher/dswload.c
--- 25/drivers/acpi/dispatcher/dswload.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/dispatcher/dswload.c	2004-01-22 22:42:01.000000000 -0800
@@ -167,7 +167,7 @@ acpi_ds_load1_begin_op (
 	object_type = walk_state->op_info->object_type;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-		"State=%p Op=%p [%s] ", walk_state, op, acpi_ut_get_type_name (object_type)));
+		"State=%p Op=%p [%s]\n", walk_state, op, acpi_ut_get_type_name (object_type)));
 
 	switch (walk_state->opcode) {
 	case AML_SCOPE_OP:
@@ -260,10 +260,12 @@ acpi_ds_load1_begin_op (
 		if ((walk_state->opcode != AML_SCOPE_OP) &&
 			(!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
 			flags |= ACPI_NS_ERROR_IF_FOUND;
-			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n"));
+			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
+					acpi_ut_get_type_name (object_type)));
 		}
 		else {
-			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n"));
+			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Both Find or Create allowed\n",
+					acpi_ut_get_type_name (object_type)));
 		}
 
 		/*
diff -puN drivers/acpi/dispatcher/dswscope.c~acpi drivers/acpi/dispatcher/dswscope.c
--- 25/drivers/acpi/dispatcher/dswscope.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/dispatcher/dswscope.c	2004-01-22 22:42:01.000000000 -0800
@@ -146,7 +146,7 @@ acpi_ds_scope_stack_push (
 	if (old_scope_info) {
 		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
 			"[%4.4s] (%s)",
-			old_scope_info->scope.node->name.ascii,
+			acpi_ut_get_node_name (old_scope_info->scope.node),
 			acpi_ut_get_type_name (old_scope_info->common.value)));
 	}
 	else {
@@ -156,7 +156,7 @@ acpi_ds_scope_stack_push (
 
 	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
 		", New scope -> [%4.4s] (%s)\n",
-		scope_info->scope.node->name.ascii,
+		acpi_ut_get_node_name (scope_info->scope.node),
 		acpi_ut_get_type_name (scope_info->common.value)));
 
 	/* Push new scope object onto stack */
@@ -207,14 +207,14 @@ acpi_ds_scope_stack_pop (
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
 		"[%.2d] Popped scope [%4.4s] (%s), New scope -> ",
 		(u32) walk_state->scope_depth,
-		scope_info->scope.node->name.ascii,
+		acpi_ut_get_node_name (scope_info->scope.node),
 		acpi_ut_get_type_name (scope_info->common.value)));
 
 	new_scope_info = walk_state->scope_info;
 	if (new_scope_info) {
 		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
 			"[%4.4s] (%s)\n",
-			new_scope_info->scope.node->name.ascii,
+			acpi_ut_get_node_name (new_scope_info->scope.node),
 			acpi_ut_get_type_name (new_scope_info->common.value)));
 	}
 	else {
diff -puN drivers/acpi/events/evgpeblk.c~acpi drivers/acpi/events/evgpeblk.c
--- 25/drivers/acpi/events/evgpeblk.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/events/evgpeblk.c	2004-01-22 22:42:01.000000000 -0800
@@ -477,7 +477,7 @@ unlock_and_exit:
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Install new GPE block with mutex support
+ * DESCRIPTION: Remove a GPE block
  *
  ******************************************************************************/
 
@@ -743,8 +743,7 @@ acpi_ev_create_gpe_block (
 				((gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) -1)),
 		gpe_device->name.ascii,
 		gpe_block->register_count,
-		ACPI_HIDWORD (gpe_block->block_address.address),
-		ACPI_LODWORD (gpe_block->block_address.address),
+		ACPI_FORMAT_UINT64 (gpe_block->block_address.address),
 		interrupt_level));
 
 	/* Find all GPE methods (_Lxx, _Exx) for this block */
diff -puN drivers/acpi/events/evgpe.c~acpi drivers/acpi/events/evgpe.c
--- 25/drivers/acpi/events/evgpe.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/events/evgpe.c	2004-01-22 22:42:01.000000000 -0800
@@ -139,12 +139,10 @@ acpi_ev_gpe_detect (
 {
 	u32                             int_status = ACPI_INTERRUPT_NOT_HANDLED;
 	u8                              enabled_status_byte;
-	u8                              bit_mask;
 	struct acpi_gpe_register_info   *gpe_register_info;
 	u32                             in_value;
 	acpi_status                     status;
 	struct acpi_gpe_block_info      *gpe_block;
-	u32                             gpe_number;
 	u32                             i;
 	u32                             j;
 
@@ -187,11 +185,9 @@ acpi_ev_gpe_detect (
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
 				"GPE pair: Status %8.8X%8.8X = %02X, Enable %8.8X%8.8X = %02X\n",
-				ACPI_HIDWORD (gpe_register_info->status_address.address),
-				ACPI_LODWORD (gpe_register_info->status_address.address),
+				ACPI_FORMAT_UINT64 (gpe_register_info->status_address.address),
 				gpe_register_info->status,
-				ACPI_HIDWORD (gpe_register_info->enable_address.address),
-				ACPI_LODWORD (gpe_register_info->enable_address.address),
+				ACPI_FORMAT_UINT64 (gpe_register_info->enable_address.address),
 				gpe_register_info->enable));
 
 			/* First check if there is anything active at all in this register */
@@ -206,19 +202,17 @@ acpi_ev_gpe_detect (
 
 			/* Now look at the individual GPEs in this byte register */
 
-			for (j = 0, bit_mask = 1; j < ACPI_GPE_REGISTER_WIDTH; j++, bit_mask <<= 1) {
+			for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
 				/* Examine one GPE bit */
 
-				if (enabled_status_byte & bit_mask) {
+				if (enabled_status_byte & acpi_gbl_decode_to8bit[j]) {
 					/*
 					 * Found an active GPE. Dispatch the event to a handler
 					 * or method.
 					 */
-					gpe_number = (i * ACPI_GPE_REGISTER_WIDTH) + j;
-
 					int_status |= acpi_ev_gpe_dispatch (
-							&gpe_block->event_info[gpe_number],
-							j + gpe_register_info->base_gpe_number);
+							  &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j],
+							  j + gpe_register_info->base_gpe_number);
 				}
 			}
 		}
@@ -294,7 +288,7 @@ acpi_ev_asynch_execute_gpe_method (
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR (("%s while evaluating method [%4.4s] for GPE[%2X]\n",
 				acpi_format_exception (status),
-				local_gpe_event_info.method_node->name.ascii, gpe_number));
+				acpi_ut_get_node_name (local_gpe_event_info.method_node), gpe_number));
 		}
 	}
 
@@ -367,6 +361,18 @@ acpi_ev_gpe_dispatch (
 		/* Invoke the installed handler (at interrupt level) */
 
 		gpe_event_info->handler (gpe_event_info->context);
+
+		/* It is now safe to clear level-triggered events. */
+
+		if (gpe_event_info->flags & ACPI_EVENT_LEVEL_TRIGGERED) {
+			status = acpi_hw_clear_gpe (gpe_event_info);
+			if (ACPI_FAILURE (status)) {
+				ACPI_REPORT_ERROR ((
+					"acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n",
+					gpe_number));
+				return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
+			}
+		}
 	}
 	else if (gpe_event_info->method_node) {
 		/*
@@ -375,13 +381,16 @@ acpi_ev_gpe_dispatch (
 		 */
 		status = acpi_hw_disable_gpe (gpe_event_info);
 		if (ACPI_FAILURE (status)) {
-			ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
+			ACPI_REPORT_ERROR ((
+				"acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
 				gpe_number));
 			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
 		}
 
-		/* Execute the method associated with the GPE. */
-
+		/*
+		 * Execute the method associated with the GPE
+		 * NOTE: Level-triggered GPEs are cleared after the method completes.
+		 */
 		if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
 				 acpi_ev_asynch_execute_gpe_method,
 				 gpe_event_info))) {
@@ -399,22 +408,12 @@ acpi_ev_gpe_dispatch (
 
 		/*
 		 * Disable the GPE.  The GPE will remain disabled until the ACPI
-		 * Core Subsystem is restarted, or the handler is reinstalled.
+		 * Core Subsystem is restarted, or a handler is installed.
 		 */
 		status = acpi_hw_disable_gpe (gpe_event_info);
 		if (ACPI_FAILURE (status)) {
-			ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
-				gpe_number));
-			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
-		}
-	}
-
-	/* It is now safe to clear level-triggered events. */
-
-	if (gpe_event_info->flags & ACPI_EVENT_LEVEL_TRIGGERED) {
-		status = acpi_hw_clear_gpe (gpe_event_info);
-		if (ACPI_FAILURE (status)) {
-			ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n",
+			ACPI_REPORT_ERROR ((
+				"acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
 				gpe_number));
 			return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
 		}
diff -puN drivers/acpi/events/evmisc.c~acpi drivers/acpi/events/evmisc.c
--- 25/drivers/acpi/events/evmisc.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/events/evmisc.c	2004-01-22 22:42:01.000000000 -0800
@@ -195,7 +195,8 @@ acpi_ev_queue_notify_request (
 		/* There is no per-device notify handler for this device */
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-			"No notify handler for [%4.4s] node %p\n", node->name.ascii, node));
+			"No notify handler for [%4.4s] node %p\n",
+			acpi_ut_get_node_name (node), node));
 	}
 
 	return (status);
diff -puN drivers/acpi/events/evregion.c~acpi drivers/acpi/events/evregion.c
--- 25/drivers/acpi/events/evregion.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/events/evregion.c	2004-01-22 22:42:01.000000000 -0800
@@ -136,7 +136,7 @@ acpi_ev_init_address_spaces (
  *
  ******************************************************************************/
 
-static acpi_status
+acpi_status
 acpi_ev_execute_reg_method (
 	union acpi_operand_object      *region_obj,
 	u32                             function)
@@ -202,7 +202,7 @@ cleanup:
  *
  * FUNCTION:    acpi_ev_address_space_dispatch
  *
- * PARAMETERS:  region_obj          - internal region object
+ * PARAMETERS:  region_obj          - Internal region object
  *              space_id            - ID of the address space (0-255)
  *              Function            - Read or Write operation
  *              Address             - Where in the space to read or write
@@ -243,9 +243,11 @@ acpi_ev_address_space_dispatch (
 
 	/* Ensure that there is a handler associated with this region */
 
-	handler_desc = region_obj->region.address_space;
+	handler_desc = region_obj->region.handler;
 	if (!handler_desc) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "no handler for region(%p) [%s]\n",
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"No handler for Region [%4.4s] (%p) [%s]\n",
+			acpi_ut_get_node_name (region_obj->region.node),
 			region_obj, acpi_ut_get_region_name (region_obj->region.space_id)));
 
 		return_ACPI_STATUS (AE_NOT_EXIST);
@@ -320,8 +322,8 @@ acpi_ev_address_space_dispatch (
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
 		"Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
-		&region_obj->region.address_space->address_space, handler,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address),
+		&region_obj->region.handler->address_space, handler,
+		ACPI_FORMAT_UINT64 (address),
 		acpi_ut_get_region_name (region_obj->region.space_id)));
 
 	if (!(handler_desc->address_space.flags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
@@ -359,6 +361,7 @@ acpi_ev_address_space_dispatch (
 	return_ACPI_STATUS (status);
 }
 
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ev_detach_region
@@ -398,7 +401,7 @@ acpi_ev_detach_region(
 
 	/* Get the address handler from the region object */
 
-	handler_obj = region_obj->region.address_space;
+	handler_obj = region_obj->region.handler;
 	if (!handler_obj) {
 		/* This region has no handler, all done */
 
@@ -472,7 +475,7 @@ acpi_ev_detach_region(
 			 * If the region is on the handler's list
 			 * this better be the region's handler
 			 */
-			region_obj->region.address_space = NULL;
+			region_obj->region.handler = NULL;
 			acpi_ut_remove_reference (handler_obj);
 
 			return_VOID;
@@ -515,17 +518,15 @@ acpi_ev_attach_region (
 	union acpi_operand_object       *region_obj,
 	u8                              acpi_ns_is_locked)
 {
-	acpi_status                     status;
-	acpi_status                     status2;
-
 
 	ACPI_FUNCTION_TRACE ("ev_attach_region");
 
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
-		"Adding Region %p to address handler %p [%s]\n",
-		region_obj, handler_obj, acpi_ut_get_region_name (region_obj->region.space_id)));
-
+		"Adding Region [%4.4s] %p to address handler %p [%s]\n",
+		acpi_ut_get_node_name (region_obj->region.node),
+		region_obj, handler_obj,
+		acpi_ut_get_region_name (region_obj->region.space_id)));
 
 	/* Link this region to the front of the handler's list */
 
@@ -534,34 +535,14 @@ acpi_ev_attach_region (
 
 	/* Install the region's handler */
 
-	if (region_obj->region.address_space) {
+	if (region_obj->region.handler) {
 		return_ACPI_STATUS (AE_ALREADY_EXISTS);
 	}
 
-	region_obj->region.address_space = handler_obj;
+	region_obj->region.handler = handler_obj;
 	acpi_ut_add_reference (handler_obj);
 
-	/*
-	 * Tell all users that this region is usable by running the _REG
-	 * method
-	 */
-	if (acpi_ns_is_locked) {
-		status2 = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
-		if (ACPI_FAILURE (status2)) {
-			return_ACPI_STATUS (status2);
-		}
-	}
-
-	status = acpi_ev_execute_reg_method (region_obj, 1);
-
-	if (acpi_ns_is_locked) {
-		status2 = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
-		if (ACPI_FAILURE (status2)) {
-			return_ACPI_STATUS (status2);
-		}
-	}
-
-	return_ACPI_STATUS (status);
+	return_ACPI_STATUS (AE_OK);
 }
 
 
@@ -569,9 +550,7 @@ acpi_ev_attach_region (
  *
  * FUNCTION:    acpi_ev_install_handler
  *
- * PARAMETERS:  Handle              - Node to be dumped
- *              Level               - Nesting level of the handle
- *              Context             - Passed into acpi_ns_walk_namespace
+ * PARAMETERS:  walk_namespace callback
  *
  * DESCRIPTION: This routine installs an address handler into objects that are
  *              of type Region or Device.
@@ -640,7 +619,7 @@ acpi_ev_install_handler (
 	if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_DEVICE) {
 		/* Check if this Device already has a handler for this address space */
 
-		next_handler_obj = obj_desc->device.address_space;
+		next_handler_obj = obj_desc->device.handler;
 		while (next_handler_obj) {
 			/* Found a handler, is it for the same address space? */
 
@@ -697,4 +676,77 @@ acpi_ev_install_handler (
 	return (status);
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ev_reg_run
+ *
+ * PARAMETERS:  walk_namespace callback
+ *
+ * DESCRIPTION: Run _REg method for region objects of the requested space_iD
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ev_reg_run (
+	acpi_handle                     obj_handle,
+	u32                             level,
+	void                            *context,
+	void                            **return_value)
+{
+	union acpi_operand_object       *handler_obj;
+	union acpi_operand_object       *obj_desc;
+	struct acpi_namespace_node      *node;
+	acpi_status                     status;
+
+
+	ACPI_FUNCTION_NAME ("ev_reg_run");
+
+
+	handler_obj = (union acpi_operand_object   *) context;
+
+	/* Parameter validation */
+
+	if (!handler_obj) {
+		return (AE_OK);
+	}
+
+	/* Convert and validate the device handle */
+
+	node = acpi_ns_map_handle_to_node (obj_handle);
+	if (!node) {
+		return (AE_BAD_PARAMETER);
+	}
+
+	/*
+	 * We only care about regions.and objects
+	 * that are allowed to have address space handlers
+	 */
+	if ((node->type != ACPI_TYPE_REGION) &&
+		(node != acpi_gbl_root_node)) {
+		return (AE_OK);
+	}
+
+	/* Check for an existing internal object */
+
+	obj_desc = acpi_ns_get_attached_object (node);
+	if (!obj_desc) {
+		/* No object, just exit */
+
+		return (AE_OK);
+	}
+
+
+	/* Object is a Region */
+
+	if (obj_desc->region.space_id != handler_obj->address_space.space_id) {
+		/*
+		 * This region is for a different address space
+		 * -- just ignore it
+		 */
+		return (AE_OK);
+	}
+
+	status = acpi_ev_execute_reg_method (obj_desc, 1);
+	return (status);
+}
 
diff -puN drivers/acpi/events/evrgnini.c~acpi drivers/acpi/events/evrgnini.c
--- 25/drivers/acpi/events/evrgnini.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/events/evrgnini.c	2004-01-22 22:42:01.000000000 -0800
@@ -177,7 +177,7 @@ acpi_ev_pci_config_region_setup (
 	ACPI_FUNCTION_TRACE ("ev_pci_config_region_setup");
 
 
-	handler_obj = region_obj->region.address_space;
+	handler_obj = region_obj->region.handler;
 	if (!handler_obj) {
 		/*
 		 * No installed handler. This shouldn't happen because the dispatch
@@ -239,7 +239,7 @@ acpi_ev_pci_config_region_setup (
 						else {
 							ACPI_REPORT_ERROR ((
 								"Could not install pci_config handler for Root Bridge %4.4s, %s\n",
-								pci_root_node->name.ascii, acpi_format_exception (status)));
+								acpi_ut_get_node_name (pci_root_node), acpi_format_exception (status)));
 						}
 					}
 					break;
@@ -469,7 +469,7 @@ acpi_ev_initialize_region (
 
 	/* Setup defaults */
 
-	region_obj->region.address_space = NULL;
+	region_obj->region.handler = NULL;
 	region_obj2->extra.method_REG = NULL;
 	region_obj->common.flags &= ~(AOPOBJ_SETUP_COMPLETE);
 	region_obj->common.flags |= AOPOBJ_OBJECT_INITIALIZED;
@@ -502,17 +502,17 @@ acpi_ev_initialize_region (
 			switch (node->type) {
 			case ACPI_TYPE_DEVICE:
 
-				handler_obj = obj_desc->device.address_space;
+				handler_obj = obj_desc->device.handler;
 				break;
 
 			case ACPI_TYPE_PROCESSOR:
 
-				handler_obj = obj_desc->processor.address_space;
+				handler_obj = obj_desc->processor.handler;
 				break;
 
 			case ACPI_TYPE_THERMAL:
 
-				handler_obj = obj_desc->thermal_zone.address_space;
+				handler_obj = obj_desc->thermal_zone.handler;
 				break;
 
 			default:
@@ -533,6 +533,26 @@ acpi_ev_initialize_region (
 					status = acpi_ev_attach_region (handler_obj, region_obj,
 							 acpi_ns_locked);
 
+					/*
+					 * Tell all users that this region is usable by running the _REG
+					 * method
+					 */
+					if (acpi_ns_locked) {
+						status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+						if (ACPI_FAILURE (status)) {
+							return_ACPI_STATUS (status);
+						}
+					}
+
+					status = acpi_ev_execute_reg_method (region_obj, 1);
+
+					if (acpi_ns_locked) {
+						status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
+						if (ACPI_FAILURE (status)) {
+							return_ACPI_STATUS (status);
+						}
+					}
+
 					return_ACPI_STATUS (AE_OK);
 				}
 
diff -puN drivers/acpi/events/evxfregn.c~acpi drivers/acpi/events/evxfregn.c
--- 25/drivers/acpi/events/evxfregn.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/events/evxfregn.c	2004-01-22 22:42:01.000000000 -0800
@@ -173,7 +173,7 @@ acpi_install_address_space_handler (
 		 * The attached device object already exists.
 		 * Make sure the handler is not already installed.
 		 */
-		handler_obj = obj_desc->device.address_space;
+		handler_obj = obj_desc->device.handler;
 
 		/* Walk the handler list for this device */
 
@@ -240,7 +240,8 @@ acpi_install_address_space_handler (
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
 		"Installing address handler for region %s(%X) on Device %4.4s %p(%p)\n",
-		acpi_ut_get_region_name (space_id), space_id, node->name.ascii, node, obj_desc));
+		acpi_ut_get_region_name (space_id), space_id,
+		acpi_ut_get_node_name (node), node, obj_desc));
 
 	/*
 	 * Install the handler
@@ -267,13 +268,13 @@ acpi_install_address_space_handler (
 
 	/* Install at head of Device.address_space list */
 
-	handler_obj->address_space.next      = obj_desc->device.address_space;
+	handler_obj->address_space.next      = obj_desc->device.handler;
 
 	/*
 	 * The Device object is the first reference on the handler_obj.
 	 * Each region that uses the handler adds a reference.
 	 */
-	obj_desc->device.address_space = handler_obj;
+	obj_desc->device.handler = handler_obj;
 
 	/*
 	 * Walk the namespace finding all of the regions this
@@ -291,6 +292,17 @@ acpi_install_address_space_handler (
 			  ACPI_NS_WALK_UNLOCK, acpi_ev_install_handler,
 			  handler_obj, NULL);
 
+	/*
+	 * Now we can run the _REG methods for all Regions for this
+	 * space ID.  This is a separate walk in order to handle any
+	 * interdependencies between regions and _REG methods.  (i.e. handlers
+	 * must be installed for all regions of this Space ID before we
+	 * can run any _REG methods.
+	 */
+	status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, device, ACPI_UINT32_MAX,
+			  ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run,
+			  handler_obj, NULL);
+
 unlock_and_exit:
 	(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
 	return_ACPI_STATUS (status);
@@ -357,8 +369,8 @@ acpi_remove_address_space_handler (
 
 	/* Find the address handler the user requested */
 
-	handler_obj = obj_desc->device.address_space;
-	last_obj_ptr = &obj_desc->device.address_space;
+	handler_obj = obj_desc->device.handler;
+	last_obj_ptr = &obj_desc->device.handler;
 	while (handler_obj) {
 		/* We have a handler, see if user requested this one */
 
diff -puN drivers/acpi/executer/exdump.c~acpi drivers/acpi/executer/exdump.c
--- 25/drivers/acpi/executer/exdump.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exdump.c	2004-01-22 22:42:01.000000000 -0800
@@ -89,27 +89,27 @@ acpi_ex_dump_operand (
 
 	if (!obj_desc) {
 		/*
-		 * This usually indicates that something serious is wrong --
-		 * since most (if not all)
-		 * code that dumps the stack expects something to be there!
+		 * This usually indicates that something serious is wrong
 		 */
-		acpi_os_printf ("Null stack entry ptr\n");
+		acpi_os_printf ("Null Object Descriptor\n");
 		return;
 	}
 
 	if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p NS Node: ", obj_desc));
+		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is a NS Node: ", obj_desc));
 		ACPI_DUMP_ENTRY (obj_desc, ACPI_LV_EXEC);
 		return;
 	}
 
 	if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is not a local object\n", obj_desc));
+		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+				"%p is not a node or operand object: [%s]\n",
+				obj_desc, acpi_ut_get_descriptor_name (obj_desc)));
 		ACPI_DUMP_BUFFER (obj_desc, sizeof (union acpi_operand_object));
 		return;
 	}
 
-	/*  obj_desc is a valid object */
+	/* obj_desc is a valid object */
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
 
@@ -151,11 +151,10 @@ acpi_ex_dump_operand (
 					 obj_desc->reference.offset);
 
 			if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
-				/* Value is a Number */
+				/* Value is an Integer */
 
 				acpi_os_printf (" value is [%8.8X%8.8x]",
-						 ACPI_HIDWORD(obj_desc->integer.value),
-						 ACPI_LODWORD(obj_desc->integer.value));
+						 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 			}
 
 			acpi_os_printf ("\n");
@@ -169,11 +168,10 @@ acpi_ex_dump_operand (
 
 			if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
 
-				/* Value is a Number */
+				/* Value is an Integer */
 
 				acpi_os_printf (" value is [%8.8X%8.8x]",
-						 ACPI_HIDWORD(obj_desc->integer.value),
-						 ACPI_LODWORD(obj_desc->integer.value));
+						 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 			}
 
 			acpi_os_printf ("\n");
@@ -189,7 +187,7 @@ acpi_ex_dump_operand (
 
 		default:
 
-			/*  unknown opcode  */
+			/* Unknown opcode */
 
 			acpi_os_printf ("Unknown Reference opcode=%X\n",
 				obj_desc->reference.opcode);
@@ -229,8 +227,7 @@ acpi_ex_dump_operand (
 	case ACPI_TYPE_INTEGER:
 
 		acpi_os_printf ("Integer %8.8X%8.8X\n",
-				 ACPI_HIDWORD (obj_desc->integer.value),
-				 ACPI_LODWORD (obj_desc->integer.value));
+				 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 		break;
 
 
@@ -271,8 +268,7 @@ acpi_ex_dump_operand (
 		}
 		else {
 			acpi_os_printf (" base %8.8X%8.8X Length %X\n",
-				ACPI_HIDWORD (obj_desc->region.address),
-				ACPI_LODWORD (obj_desc->region.address),
+				ACPI_FORMAT_UINT64 (obj_desc->region.address),
 				obj_desc->region.length);
 		}
 		break;
@@ -494,7 +490,7 @@ acpi_ex_out_address (
 	acpi_os_printf ("%20s : %p\n", title, value);
 #else
 	acpi_os_printf ("%20s : %8.8X%8.8X\n", title,
-			 ACPI_HIDWORD (value), ACPI_LODWORD (value));
+			 ACPI_FORMAT_UINT64 (value));
 #endif
 }
 
@@ -525,7 +521,7 @@ acpi_ex_dump_node (
 		}
 	}
 
-	acpi_os_printf ("%20s : %4.4s\n",     "Name", node->name.ascii);
+	acpi_os_printf ("%20s : %4.4s\n",     "Name", acpi_ut_get_node_name (node));
 	acpi_ex_out_string ("Type",           acpi_ut_get_type_name (node->type));
 	acpi_ex_out_integer ("Flags",         node->flags);
 	acpi_ex_out_integer ("Owner Id",      node->owner_id);
@@ -573,7 +569,8 @@ acpi_ex_dump_object_descriptor (
 	}
 
 	if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
-		acpi_os_printf ("ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc);
+		acpi_os_printf ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n",
+				obj_desc, acpi_ut_get_descriptor_name (obj_desc));
 		return_VOID;
 	}
 
@@ -589,8 +586,7 @@ acpi_ex_dump_object_descriptor (
 	case ACPI_TYPE_INTEGER:
 
 		acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value",
-				  ACPI_HIDWORD (obj_desc->integer.value),
-				  ACPI_LODWORD (obj_desc->integer.value));
+				ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 		break;
 
 
@@ -635,7 +631,7 @@ acpi_ex_dump_object_descriptor (
 
 	case ACPI_TYPE_DEVICE:
 
-		acpi_ex_out_pointer ("address_space", obj_desc->device.address_space);
+		acpi_ex_out_pointer ("Handler",     obj_desc->device.handler);
 		acpi_ex_out_pointer ("system_notify", obj_desc->device.system_notify);
 		acpi_ex_out_pointer ("device_notify", obj_desc->device.device_notify);
 		break;
@@ -673,7 +669,7 @@ acpi_ex_dump_object_descriptor (
 		acpi_ex_out_integer ("Flags",        obj_desc->region.flags);
 		acpi_ex_out_address ("Address",      obj_desc->region.address);
 		acpi_ex_out_integer ("Length",       obj_desc->region.length);
-		acpi_ex_out_pointer ("address_space", obj_desc->region.address_space);
+		acpi_ex_out_pointer ("Handler",      obj_desc->region.handler);
 		acpi_ex_out_pointer ("Next",         obj_desc->region.next);
 		break;
 
@@ -694,7 +690,7 @@ acpi_ex_dump_object_descriptor (
 		acpi_ex_out_address ("Address",      (acpi_physical_address) obj_desc->processor.address);
 		acpi_ex_out_pointer ("system_notify", obj_desc->processor.system_notify);
 		acpi_ex_out_pointer ("device_notify", obj_desc->processor.device_notify);
-		acpi_ex_out_pointer ("address_space", obj_desc->processor.address_space);
+		acpi_ex_out_pointer ("Handler",      obj_desc->processor.handler);
 		break;
 
 
@@ -702,7 +698,7 @@ acpi_ex_dump_object_descriptor (
 
 		acpi_ex_out_pointer ("system_notify", obj_desc->thermal_zone.system_notify);
 		acpi_ex_out_pointer ("device_notify", obj_desc->thermal_zone.device_notify);
-		acpi_ex_out_pointer ("address_space", obj_desc->thermal_zone.address_space);
+		acpi_ex_out_pointer ("Handler",      obj_desc->thermal_zone.handler);
 		break;
 
 
diff -puN drivers/acpi/executer/exfldio.c~acpi drivers/acpi/executer/exfldio.c
--- 25/drivers/acpi/executer/exfldio.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exfldio.c	2004-01-22 22:42:01.000000000 -0800
@@ -138,8 +138,9 @@ acpi_ex_setup_region (
 			 */
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 				"Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n",
-				obj_desc->common_field.node->name.ascii, obj_desc->common_field.access_byte_width,
-				rgn_desc->region.node->name.ascii, rgn_desc->region.length));
+				acpi_ut_get_node_name (obj_desc->common_field.node),
+				obj_desc->common_field.access_byte_width,
+				acpi_ut_get_node_name (rgn_desc->region.node), rgn_desc->region.length));
 		}
 
 		/*
@@ -148,9 +149,10 @@ acpi_ex_setup_region (
 		 */
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 			"Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n",
-			obj_desc->common_field.node->name.ascii, obj_desc->common_field.base_byte_offset,
+			acpi_ut_get_node_name (obj_desc->common_field.node),
+			obj_desc->common_field.base_byte_offset,
 			field_datum_byte_offset, obj_desc->common_field.access_byte_width,
-			rgn_desc->region.node->name.ascii, rgn_desc->region.length));
+			acpi_ut_get_node_name (rgn_desc->region.node), rgn_desc->region.length));
 
 		#ifdef CONFIG_ACPI_RELAXED_AML
 		{
@@ -261,7 +263,7 @@ acpi_ex_access_region (
 		obj_desc->common_field.access_byte_width,
 		obj_desc->common_field.base_byte_offset,
 		field_datum_byte_offset,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address)));
+		ACPI_FORMAT_UINT64 (address)));
 
 	/* Invoke the appropriate address_space/op_region handler */
 
@@ -514,12 +516,12 @@ acpi_ex_field_datum_io (
 	if (ACPI_SUCCESS (status)) {
 		if (read_write == ACPI_READ) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Read %8.8X%8.8X, Width %d\n",
-					   ACPI_HIDWORD (*value), ACPI_LODWORD (*value),
+					   ACPI_FORMAT_UINT64 (*value),
 					   obj_desc->common_field.access_byte_width));
 		}
 		else {
 			ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Written %8.8X%8.8X, Width %d\n",
-					   ACPI_HIDWORD (*value), ACPI_LODWORD (*value),
+					   ACPI_FORMAT_UINT64 (*value),
 					   obj_desc->common_field.access_byte_width));
 		}
 	}
@@ -612,11 +614,11 @@ acpi_ex_write_with_update_rule (
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
 		"Mask %8.8X%8.8X, datum_offset %X, Width %X, Value %8.8X%8.8X, merged_value %8.8X%8.8X\n",
-		ACPI_HIDWORD (mask), ACPI_LODWORD (mask),
+		ACPI_FORMAT_UINT64 (mask),
 		field_datum_byte_offset,
 		obj_desc->common_field.access_byte_width,
-		ACPI_HIDWORD (field_value), ACPI_LODWORD (field_value),
-		ACPI_HIDWORD (merged_value),ACPI_LODWORD (merged_value)));
+		ACPI_FORMAT_UINT64 (field_value),
+		ACPI_FORMAT_UINT64 (merged_value)));
 
 	/* Write the merged value */
 
@@ -784,12 +786,13 @@ acpi_ex_extract_from_field (
 {
 	acpi_status                     status;
 	u32                             field_datum_byte_offset;
-	u32                             datum_offset;
-	acpi_integer                    previous_raw_datum;
+	u32                             buffer_datum_offset;
+	acpi_integer                    previous_raw_datum = 0;
 	acpi_integer                    this_raw_datum = 0;
 	acpi_integer                    merged_datum = 0;
 	u32                             byte_field_length;
 	u32                             datum_count;
+	u32                             i;
 
 
 	ACPI_FUNCTION_TRACE ("ex_extract_from_field");
@@ -812,77 +815,74 @@ acpi_ex_extract_from_field (
 	datum_count = ACPI_ROUND_UP_TO (byte_field_length,
 			   obj_desc->common_field.access_byte_width);
 
+	/*
+	 * If the field is not aligned on a datum boundary and does not
+	 * fit within a single datum, we must read an extra datum.
+	 *
+	 * We could just split the aligned and non-aligned cases since the
+	 * aligned case is so very simple, but this would require more code.
+	 */
+	if ((obj_desc->common_field.end_field_valid_bits != 0)    &&
+		(!(obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM))) {
+		datum_count++;
+	}
+
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
 		"byte_len %X, datum_len %X, byte_gran %X\n",
 		byte_field_length, datum_count,obj_desc->common_field.access_byte_width));
 
 	/*
 	 * Clear the caller's buffer (the whole buffer length as given)
-	 * This is very important, especially in the cases where a byte is read,
-	 * but the buffer is really a u32 (4 bytes).
+	 * This is very important, especially in the cases where the buffer
+	 * is longer than the size of the field.
 	 */
 	ACPI_MEMSET (buffer, 0, buffer_length);
 
-	/* Read the first raw datum to prime the loop */
-
 	field_datum_byte_offset = 0;
-	datum_offset= 0;
-
-	status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
-			  &previous_raw_datum, ACPI_READ);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
-
+	buffer_datum_offset= 0;
 
-	/* We might actually be done if the request fits in one datum */
+	/* Read the entire field */
 
-	if ((datum_count == 1) &&
-		(obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) {
-		/* 1) Shift the valid data bits down to start at bit 0 */
+	for (i = 0; i < datum_count; i++) {
+		status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
+				  &this_raw_datum, ACPI_READ);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-		merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset);
+		/* We might actually be done if the request fits in one datum */
 
-		/* 2) Mask off any upper unused bits (bits not part of the field) */
+		if ((datum_count == 1) &&
+			(obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) {
+			/* 1) Shift the valid data bits down to start at bit 0 */
 
-		if (obj_desc->common_field.end_buffer_valid_bits) {
-			merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits);
-		}
+			merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset);
 
-		/* Store the datum to the caller buffer */
+			/* 2) Mask off any upper unused bits (bits not part of the field) */
 
-		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
-				obj_desc->common_field.access_byte_width, datum_offset);
+			if (obj_desc->common_field.end_buffer_valid_bits) {
+				merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits);
+			}
 
-		return_ACPI_STATUS (AE_OK);
-	}
+			/* Store the datum to the caller buffer */
 
+			acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
+					obj_desc->common_field.access_byte_width, buffer_datum_offset);
 
-	/* We need to get more raw data to complete one or more field data */
+			return_ACPI_STATUS (AE_OK);
+		}
 
-	while (datum_offset < datum_count) {
-		field_datum_byte_offset += obj_desc->common_field.access_byte_width;
+		/* Special handling for the last datum to ignore extra bits */
 
-		/*
-		 * If the field is aligned on a byte boundary, we don't want
-		 * to perform a final read, since this would potentially read
-		 * past the end of the region.
-		 *
-		 * We could just split the aligned and non-aligned cases since the
-		 * aligned case is so very simple, but this would require more code.
-		 */
-		if ((obj_desc->common_field.start_field_bit_offset != 0) ||
-			((obj_desc->common_field.start_field_bit_offset == 0) &&
-			(datum_offset < (datum_count -1)))) {
+		if ((i >= (datum_count -1))          &&
+			(obj_desc->common_field.end_field_valid_bits)) {
 			/*
-			 * Get the next raw datum, it contains some or all bits
-			 * of the current field datum
+			 * This is the last iteration of the loop.  We need to clear
+			 * any unused bits (bits that are not part of this field) before
+			 * we store the final merged datum into the caller buffer.
 			 */
-			status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset,
-					  &this_raw_datum, ACPI_READ);
-			if (ACPI_FAILURE (status)) {
-				return_ACPI_STATUS (status);
-			}
+			this_raw_datum &=
+				ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits);
 		}
 
 		/*
@@ -891,48 +891,48 @@ acpi_ex_extract_from_field (
 		if (obj_desc->common_field.start_field_bit_offset == 0) {
 			/* Field is not skewed and we can just copy the datum */
 
-			merged_datum = previous_raw_datum;
+			acpi_ex_set_buffer_datum (this_raw_datum, buffer, buffer_length,
+					obj_desc->common_field.access_byte_width, buffer_datum_offset);
+			buffer_datum_offset++;
 		}
 		else {
-			/*
-			 * Put together the appropriate bits of the two raw data to make a
-			 * single complete field datum
-			 *
-			 * 1) Normalize the first datum down to bit 0
-			 */
-			merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset);
-
-			/* 2) Insert the second datum "above" the first datum */
+			/* Not aligned -- on the first iteration, just save the datum */
 
-			merged_datum |= (this_raw_datum << obj_desc->common_field.datum_valid_bits);
-
-			if ((datum_offset >= (datum_count -1))) {
+			if (i != 0) {
 				/*
-				 * This is the last iteration of the loop.  We need to clear
-				 * any unused bits (bits that are not part of this field) that
-				 * came from the last raw datum before we store the final
-				 * merged datum into the caller buffer.
+				 * Put together the appropriate bits of the two raw data to make a
+				 * single complete field datum
+				 *
+				 * 1) Normalize the first datum down to bit 0
 				 */
-				if (obj_desc->common_field.end_buffer_valid_bits) {
-					merged_datum &=
-						ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits);
-				}
+				merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset);
+
+				/* 2) Insert the second datum "above" the first datum */
+
+				merged_datum |= (this_raw_datum << obj_desc->common_field.datum_valid_bits);
+
+				acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
+						obj_desc->common_field.access_byte_width, buffer_datum_offset);
+				buffer_datum_offset++;
 			}
+
+			/*
+			 * Save the raw datum that was just acquired since it may contain bits
+			 * of the *next* field datum
+			 */
+			previous_raw_datum = this_raw_datum;
 		}
 
-		/*
-		 * Store the merged field datum in the caller's buffer, according to
-		 * the granularity of the field (size of each datum).
-		 */
-		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
-				obj_desc->common_field.access_byte_width, datum_offset);
+		field_datum_byte_offset += obj_desc->common_field.access_byte_width;
+	}
 
-		/*
-		 * Save the raw datum that was just acquired since it may contain bits
-		 * of the *next* field datum.  Update offsets
-		 */
-		previous_raw_datum = this_raw_datum;
-		datum_offset++;
+	/* For non-aligned case, there is one last datum to insert */
+
+	if (obj_desc->common_field.start_field_bit_offset != 0) {
+		merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset);
+
+		acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length,
+				obj_desc->common_field.access_byte_width, buffer_datum_offset);
 	}
 
 	return_ACPI_STATUS (AE_OK);
diff -puN drivers/acpi/executer/exmisc.c~acpi drivers/acpi/executer/exmisc.c
--- 25/drivers/acpi/executer/exmisc.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exmisc.c	2004-01-22 22:42:01.000000000 -0800
@@ -121,8 +121,8 @@ acpi_ex_get_object_reference (
 
 	default:
 
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid descriptor type %X in %p\n",
-			ACPI_GET_DESCRIPTOR_TYPE (obj_desc), obj_desc));
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p has invalid descriptor [%s]\n",
+				obj_desc, acpi_ut_get_descriptor_name (obj_desc)));
 		return_ACPI_STATUS (AE_TYPE);
 	}
 
@@ -139,7 +139,7 @@ acpi_ex_get_object_reference (
 	*return_desc = reference_obj;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p Type [%s], returning Reference %p\n",
-		obj_desc, acpi_ut_get_object_type_name (obj_desc), *return_desc));
+			obj_desc, acpi_ut_get_object_type_name (obj_desc), *return_desc));
 
 	return_ACPI_STATUS (AE_OK);
 }
diff -puN drivers/acpi/executer/exmutex.c~acpi drivers/acpi/executer/exmutex.c
--- 25/drivers/acpi/executer/exmutex.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exmutex.c	2004-01-22 22:42:01.000000000 -0800
@@ -159,7 +159,7 @@ acpi_ex_acquire_mutex (
 
 	if (!walk_state->thread) {
 		ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], null thread info\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_INTERNAL);
 	}
 
@@ -169,7 +169,7 @@ acpi_ex_acquire_mutex (
 	 */
 	if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
 		ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect sync_level\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
 	}
 
@@ -242,7 +242,7 @@ acpi_ex_release_mutex (
 
 	if (!obj_desc->mutex.owner_thread) {
 		ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], not acquired\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED);
 	}
 
@@ -250,7 +250,7 @@ acpi_ex_release_mutex (
 
 	if (!walk_state->thread) {
 		ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], null thread info\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_INTERNAL);
 	}
 
@@ -260,7 +260,7 @@ acpi_ex_release_mutex (
 		ACPI_REPORT_ERROR ((
 			"Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n",
 			walk_state->thread->thread_id,
-			obj_desc->mutex.node->name.ascii,
+			acpi_ut_get_node_name (obj_desc->mutex.node),
 			obj_desc->mutex.owner_thread->thread_id));
 		return_ACPI_STATUS (AE_AML_NOT_OWNER);
 	}
@@ -271,7 +271,7 @@ acpi_ex_release_mutex (
 	 */
 	if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
 		ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], incorrect sync_level\n",
-				obj_desc->mutex.node->name.ascii));
+				acpi_ut_get_node_name (obj_desc->mutex.node)));
 		return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
 	}
 
diff -puN drivers/acpi/executer/exoparg1.c~acpi drivers/acpi/executer/exoparg1.c
--- 25/drivers/acpi/executer/exoparg1.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exoparg1.c	2004-01-22 22:42:01.000000000 -0800
@@ -351,8 +351,7 @@ acpi_ex_opcode_1A_1T_1R (
 
 			if (digit > 0) {
 				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Integer too large to convert to BCD: %8.8X%8.8X\n",
-					ACPI_HIDWORD(operand[0]->integer.value),
-					ACPI_LODWORD(operand[0]->integer.value)));
+						ACPI_FORMAT_UINT64 (operand[0]->integer.value)));
 				status = AE_AML_NUMERIC_OVERFLOW;
 				goto cleanup;
 			}
diff -puN drivers/acpi/executer/exoparg3.c~acpi drivers/acpi/executer/exoparg3.c
--- 25/drivers/acpi/executer/exoparg3.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exoparg3.c	2004-01-22 22:42:01.000000000 -0800
@@ -101,15 +101,14 @@ acpi_ex_opcode_3A_0T_0R (
 
 
 	switch (walk_state->opcode) {
-
 	case AML_FATAL_OP:          /* Fatal (fatal_type fatal_code fatal_arg)   */
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 			"fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
-			(u32) operand[0]->integer.value, (u32) operand[1]->integer.value,
+			(u32) operand[0]->integer.value,
+			(u32) operand[1]->integer.value,
 			(u32) operand[2]->integer.value));
 
-
 		fatal = ACPI_MEM_ALLOCATE (sizeof (struct acpi_signal_fatal_info));
 		if (fatal) {
 			fatal->type     = (u32) operand[0]->integer.value;
diff -puN drivers/acpi/executer/exprep.c~acpi drivers/acpi/executer/exprep.c
--- 25/drivers/acpi/executer/exprep.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exprep.c	2004-01-22 22:42:01.000000000 -0800
@@ -351,7 +351,7 @@ acpi_ex_prep_common_field_object (
 	 */
 	nearest_byte_address =
 			ACPI_ROUND_BITS_DOWN_TO_BYTES (field_bit_position);
-	obj_desc->common_field.base_byte_offset =
+	obj_desc->common_field.base_byte_offset = (u32)
 			ACPI_ROUND_DOWN (nearest_byte_address, byte_alignment);
 
 	/*
@@ -539,7 +539,7 @@ acpi_ex_prep_field_value (
 			  acpi_ns_get_type (info->field_node));
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set named_obj %p [%4.4s], obj_desc %p\n",
-			info->field_node, info->field_node->name.ascii, obj_desc));
+			info->field_node, acpi_ut_get_node_name (info->field_node), obj_desc));
 
 	/* Remove local reference to the object */
 
diff -puN drivers/acpi/executer/exregion.c~acpi drivers/acpi/executer/exregion.c
--- 25/drivers/acpi/executer/exregion.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exregion.c	2004-01-22 22:42:01.000000000 -0800
@@ -161,7 +161,7 @@ acpi_ex_system_memory_space_handler (
 				  (void **) &mem_info->mapped_logical_address);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X%8.8X, size %X\n",
-				ACPI_HIDWORD (address), ACPI_LODWORD (address), (u32) window_size));
+					ACPI_FORMAT_UINT64 (address), (u32) window_size));
 			mem_info->mapped_length = 0;
 			return_ACPI_STATUS (status);
 		}
@@ -180,8 +180,8 @@ acpi_ex_system_memory_space_handler (
 			  ((acpi_integer) address - (acpi_integer) mem_info->mapped_physical_address);
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-		"system_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address)));
+			"system_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
+			ACPI_FORMAT_UINT64 (address)));
 
    /*
 	* Perform the memory read or write
@@ -290,8 +290,8 @@ acpi_ex_system_io_space_handler (
 
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-		"system_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
-		ACPI_HIDWORD (address), ACPI_LODWORD (address)));
+			"system_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width,
+			ACPI_FORMAT_UINT64 (address)));
 
 	/* Decode the function parameter */
 
diff -puN drivers/acpi/executer/exresolv.c~acpi drivers/acpi/executer/exresolv.c
--- 25/drivers/acpi/executer/exresolv.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exresolv.c	2004-01-22 22:42:01.000000000 -0800
@@ -349,6 +349,8 @@ acpi_ex_resolve_multiple (
 			/* All "References" point to a NS node */
 
 			if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
+				ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n",
+						node, acpi_ut_get_descriptor_name (node)));
 				return_ACPI_STATUS (AE_AML_INTERNAL);
 			}
 
@@ -399,7 +401,9 @@ acpi_ex_resolve_multiple (
 			/* All "References" point to a NS node */
 
 			if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
-				return_ACPI_STATUS (AE_AML_INTERNAL);
+				ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n",
+						node, acpi_ut_get_descriptor_name (node)));
+			   return_ACPI_STATUS (AE_AML_INTERNAL);
 			}
 
 			/* Get the attached object */
diff -puN drivers/acpi/executer/exresop.c~acpi drivers/acpi/executer/exresop.c
--- 25/drivers/acpi/executer/exresop.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exresop.c	2004-01-22 22:42:01.000000000 -0800
@@ -247,8 +247,8 @@ acpi_ex_resolve_operands (
 			/* Invalid descriptor */
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Bad descriptor type %X in Obj %p\n",
-				ACPI_GET_DESCRIPTOR_TYPE (obj_desc), obj_desc));
+					"Invalid descriptor %p [%s]\n",
+					obj_desc, acpi_ut_get_descriptor_name (obj_desc)));
 
 			return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 		}
diff -puN drivers/acpi/executer/exstore.c~acpi drivers/acpi/executer/exstore.c
--- 25/drivers/acpi/executer/exstore.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exstore.c	2004-01-22 22:42:01.000000000 -0800
@@ -190,8 +190,7 @@ acpi_ex_store (
 		case ACPI_TYPE_INTEGER:
 
 			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n",
-					ACPI_HIDWORD (source_desc->integer.value),
-					ACPI_LODWORD (source_desc->integer.value)));
+					ACPI_FORMAT_UINT64 (source_desc->integer.value)));
 			break;
 
 
diff -puN drivers/acpi/executer/exsystem.c~acpi drivers/acpi/executer/exsystem.c
--- 25/drivers/acpi/executer/exsystem.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/executer/exsystem.c	2004-01-22 22:42:01.000000000 -0800
@@ -111,11 +111,16 @@ acpi_ex_system_wait_semaphore (
  *
  * FUNCTION:    acpi_ex_system_do_stall
  *
- * PARAMETERS:  how_long            - The amount of time to stall
+ * PARAMETERS:  how_long            - The amount of time to stall,
+ *                                    in microseconds
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Suspend running thread for specified amount of time.
+ *              Note: ACPI specification requires that Stall() does not
+ *              relinquish the processor, and delays longer than 100 usec
+ *              should use Sleep() instead.  We allow stalls up to 255 usec
+ *              for compatibility with other interpreters and existing BIOSs.
  *
  ******************************************************************************/
 
@@ -129,12 +134,15 @@ acpi_ex_system_do_stall (
 	ACPI_FUNCTION_ENTRY ();
 
 
-	if (how_long > 100) /* 100 microseconds */ {
+	if (how_long > 255) /* 255 microseconds */ {
 		/*
-		 * Longer than 100 usec, use sleep instead
-		 * (according to ACPI specification)
+		 * Longer than 255 usec, this is an error
+		 *
+		 * (ACPI specifies 100 usec as max, but this gives some slack in
+		 * order to support existing BIOSs)
 		 */
-		status = acpi_ex_system_do_suspend ((how_long / 1000) + 1);
+		ACPI_REPORT_ERROR (("Stall: Time parameter is too large (%d)\n", how_long));
+		status = AE_AML_OPERAND_VALUE;
 	}
 	else {
 		acpi_os_stall (how_long);
@@ -148,7 +156,8 @@ acpi_ex_system_do_stall (
  *
  * FUNCTION:    acpi_ex_system_do_suspend
  *
- * PARAMETERS:  how_long            - The amount of time to suspend
+ * PARAMETERS:  how_long            - The amount of time to suspend,
+ *                                    in milliseconds
  *
  * RETURN:      None
  *
diff -puN drivers/acpi/hardware/hwacpi.c~acpi drivers/acpi/hardware/hwacpi.c
--- 25/drivers/acpi/hardware/hwacpi.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/hardware/hwacpi.c	2004-01-22 22:42:01.000000000 -0800
@@ -119,7 +119,7 @@ acpi_hw_set_mode (
 	 * system does not support mode transition.
 	 */
 	if (!acpi_gbl_FADT->smi_cmd) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No SMI_CMD in FADT, mode transition failed.\n"));
+		ACPI_REPORT_ERROR (("No SMI_CMD in FADT, mode transition failed.\n"));
 		return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
 	}
 
@@ -131,7 +131,7 @@ acpi_hw_set_mode (
 	 * transitions are not supported.
 	 */
 	if (!acpi_gbl_FADT->acpi_enable && !acpi_gbl_FADT->acpi_disable) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "No mode transition supported in this system.\n"));
+		ACPI_REPORT_ERROR (("No ACPI mode transition supported in this system (enable/disable both zero)\n"));
 		return_ACPI_STATUS (AE_OK);
 	}
 
@@ -162,6 +162,7 @@ acpi_hw_set_mode (
 	}
 
 	if (ACPI_FAILURE (status)) {
+		ACPI_REPORT_ERROR (("Could not write mode change, %s\n", acpi_format_exception (status)));
 		return_ACPI_STATUS (status);
 	}
 
@@ -171,18 +172,16 @@ acpi_hw_set_mode (
 	 */
 	retry = 3000;
 	while (retry) {
-		status = AE_NO_HARDWARE_RESPONSE;
-
 		if (acpi_hw_get_mode() == mode) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", mode));
-			status = AE_OK;
-			break;
+			return_ACPI_STATUS (AE_OK);
 		}
 		acpi_os_stall(1000);
 		retry--;
 	}
 
-	return_ACPI_STATUS (status);
+	ACPI_REPORT_ERROR (("Hardware never changed modes\n"));
+	return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
 }
 
 
diff -puN drivers/acpi/hardware/hwregs.c~acpi drivers/acpi/hardware/hwregs.c
--- 25/drivers/acpi/hardware/hwregs.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/hardware/hwregs.c	2004-01-22 22:42:01.000000000 -0800
@@ -418,16 +418,14 @@ acpi_set_register (
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n",
 			register_value,
-			ACPI_HIDWORD (acpi_gbl_FADT->xpm2_cnt_blk.address),
-			ACPI_LODWORD (acpi_gbl_FADT->xpm2_cnt_blk.address)));
+			ACPI_FORMAT_UINT64 (acpi_gbl_FADT->xpm2_cnt_blk.address)));
 
 		ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position,
 				bit_reg_info->access_bit_mask, value);
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %4.4X to %8.8X%8.8X\n",
 			register_value,
-			ACPI_HIDWORD (acpi_gbl_FADT->xpm2_cnt_blk.address),
-			ACPI_LODWORD (acpi_gbl_FADT->xpm2_cnt_blk.address)));
+			ACPI_FORMAT_UINT64 (acpi_gbl_FADT->xpm2_cnt_blk.address)));
 
 		status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
 				   ACPI_REGISTER_PM2_CONTROL, (u8) (register_value));
@@ -763,8 +761,7 @@ acpi_hw_low_level_read (
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read:  %8.8X width %2d from %8.8X%8.8X (%s)\n",
 			*value, width,
-			ACPI_HIDWORD (reg->address),
-			ACPI_LODWORD (reg->address),
+			ACPI_FORMAT_UINT64 (reg->address),
 			acpi_ut_get_region_name (reg->address_space_id)));
 
 	return (status);
@@ -850,8 +847,7 @@ acpi_hw_low_level_write (
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d   to %8.8X%8.8X (%s)\n",
 			value, width,
-			ACPI_HIDWORD (reg->address),
-			ACPI_LODWORD (reg->address),
+			ACPI_FORMAT_UINT64 (reg->address),
 			acpi_ut_get_region_name (reg->address_space_id)));
 
 	return (status);
diff -puN drivers/acpi/hardware/hwsleep.c~acpi drivers/acpi/hardware/hwsleep.c
--- 25/drivers/acpi/hardware/hwsleep.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/hardware/hwsleep.c	2004-01-22 22:42:01.000000000 -0800
@@ -181,6 +181,13 @@ acpi_enter_sleep_state_prep (
 		return_ACPI_STATUS (status);
 	}
 
+	/* Set the system indicators to show the desired sleep state. */
+
+	status = acpi_evaluate_object (NULL, "\\_SI._SST", &arg_list, NULL);
+	if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) {
+		 ACPI_REPORT_ERROR (("Method _SST failed, %s\n", acpi_format_exception (status)));
+	}
+
 	return_ACPI_STATUS (AE_OK);
 }
 
@@ -220,27 +227,28 @@ acpi_enter_sleep_state (
 		return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
 	}
 
-
 	sleep_type_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_TYPE_A);
 	sleep_enable_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_ENABLE);
 
-	/* Clear wake status */
+	if (sleep_state != ACPI_STATE_S5) {
+		/* Clear wake status */
 
-	status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+		status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-	status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+		status = acpi_hw_clear_acpi_status (ACPI_MTX_DO_NOT_LOCK);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-	/* Disable BM arbitration */
+		/* Disable BM arbitration */
 
-	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+		status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 	}
 
 	status = acpi_hw_disable_non_wakeup_gpes();
@@ -297,11 +305,13 @@ acpi_enter_sleep_state (
 		return_ACPI_STATUS (status);
 	}
 
-	/*
-	 * Wait a second, then try again. This is to get S4/5 to work on all machines.
-	 */
 	if (sleep_state > ACPI_STATE_S3) {
 		/*
+		 * We wanted to sleep > S3, but it didn't happen (by virtue of the fact that
+		 * we are still executing!)
+		 *
+		 * Wait ten seconds, then try again. This is to get S4/S5 to work on all machines.
+		 *
 		 * We wait so long to allow chipsets that poll this reg very slowly to
 		 * still read the right value. Ideally, this entire block would go
 		 * away entirely.
@@ -354,6 +364,7 @@ acpi_enter_sleep_state_s4bios (
 
 	ACPI_FUNCTION_TRACE ("acpi_enter_sleep_state_s4bios");
 
+
 	acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK);
 	acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK);
 
@@ -389,15 +400,38 @@ acpi_enter_sleep_state_s4bios (
 
 acpi_status
 acpi_leave_sleep_state (
-	u8                          sleep_state)
+	u8                              sleep_state)
 {
-	struct acpi_object_list     arg_list;
-	union acpi_object           arg;
-	acpi_status                 status;
+	struct acpi_object_list         arg_list;
+	union acpi_object               arg;
+	acpi_status                     status;
+	struct acpi_bit_register_info   *sleep_type_reg_info;
+	struct acpi_bit_register_info   *sleep_enable_reg_info;
+	u32                             pm1x_control;
 
 
 	ACPI_FUNCTION_TRACE ("acpi_leave_sleep_state");
 
+	/* Some machines require SLP_TYPE and SLP_EN to be cleared */
+
+	sleep_type_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_TYPE_A);
+	sleep_enable_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_ENABLE);
+
+	/* Get current value of PM1A control */
+
+	status = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK,
+			 ACPI_REGISTER_PM1_CONTROL, &pm1x_control);
+	if (ACPI_SUCCESS (status)) {
+		/* Clear SLP_TYP and SLP_EN */
+
+		pm1x_control &= ~(sleep_type_reg_info->access_bit_mask |
+				   sleep_enable_reg_info->access_bit_mask);
+
+		acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
+				ACPI_REGISTER_PM1A_CONTROL, pm1x_control);
+		acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
+				ACPI_REGISTER_PM1B_CONTROL, pm1x_control);
+	}
 
 	/* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */
 
@@ -407,12 +441,17 @@ acpi_leave_sleep_state (
 
 	arg_list.count = 1;
 	arg_list.pointer = &arg;
-
 	arg.type = ACPI_TYPE_INTEGER;
-	arg.integer.value = sleep_state;
 
 	/* Ignore any errors from these methods */
 
+	arg.integer.value = 0;
+	status = acpi_evaluate_object (NULL, "\\_SI._SST", &arg_list, NULL);
+	if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) {
+		ACPI_REPORT_ERROR (("Method _SST failed, %s\n", acpi_format_exception (status)));
+	}
+
+	arg.integer.value = sleep_state;
 	status = acpi_evaluate_object (NULL, "\\_BFS", &arg_list, NULL);
 	if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) {
 		ACPI_REPORT_ERROR (("Method _BFS failed, %s\n", acpi_format_exception (status)));
@@ -430,8 +469,8 @@ acpi_leave_sleep_state (
 		return_ACPI_STATUS (status);
 	}
 
-	/* Disable BM arbitration */
-	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK);
+	/* Enable BM arbitration */
 
+	status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK);
 	return_ACPI_STATUS (status);
 }
diff -puN drivers/acpi/namespace/nsaccess.c~acpi drivers/acpi/namespace/nsaccess.c
--- 25/drivers/acpi/namespace/nsaccess.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nsaccess.c	2004-01-22 22:42:01.000000000 -0800
@@ -314,8 +314,8 @@ acpi_ns_lookup (
 	else {
 		prefix_node = scope_info->scope.node;
 		if (ACPI_GET_DESCRIPTOR_TYPE (prefix_node) != ACPI_DESC_TYPE_NAMED) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%p] Not a namespace node\n",
-				prefix_node));
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p Not a namespace node [%s]\n",
+					prefix_node, acpi_ut_get_descriptor_name (prefix_node)));
 			return_ACPI_STATUS (AE_AML_INTERNAL);
 		}
 
@@ -379,7 +379,7 @@ acpi_ns_lookup (
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
 				"Searching relative to prefix scope [%4.4s] (%p)\n",
-				prefix_node->name.ascii, prefix_node));
+				acpi_ut_get_node_name (prefix_node), prefix_node));
 
 			/*
 			 * Handle multiple Parent Prefixes (carat) by just getting
@@ -413,7 +413,7 @@ acpi_ns_lookup (
 			if (search_parent_flag == ACPI_NS_NO_UPSEARCH) {
 				ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
 					"Search scope is [%4.4s], path has %d carat(s)\n",
-					this_node->name.ascii, num_carats));
+					acpi_ut_get_node_name (this_node), num_carats));
 			}
 		}
 
diff -puN drivers/acpi/namespace/nsalloc.c~acpi drivers/acpi/namespace/nsalloc.c
--- 25/drivers/acpi/namespace/nsalloc.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nsalloc.c	2004-01-22 22:42:01.000000000 -0800
@@ -271,7 +271,7 @@ acpi_ns_install_node (
 		 * alphabetic placement.
 		 */
 		previous_child_node = NULL;
-		while (acpi_ns_compare_names (child_node->name.ascii, node->name.ascii) < 0) {
+		while (acpi_ns_compare_names (acpi_ut_get_node_name (child_node), acpi_ut_get_node_name (node)) < 0) {
 			if (child_node->flags & ANOBJ_END_OF_PEER_LIST) {
 				/* Last peer;  Clear end-of-list flag */
 
@@ -335,8 +335,9 @@ acpi_ns_install_node (
 	node->type = (u8) type;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s (%s) added to %4.4s (%s) %p at %p\n",
-		node->name.ascii, acpi_ut_get_type_name (node->type),
-		parent_node->name.ascii, acpi_ut_get_type_name (parent_node->type), parent_node, node));
+		acpi_ut_get_node_name (node), acpi_ut_get_type_name (node->type),
+		acpi_ut_get_node_name (parent_node), acpi_ut_get_type_name (parent_node->type),
+		parent_node, node));
 
 	/*
 	 * Increment the reference count(s) of all parents up to
diff -puN drivers/acpi/namespace/nsdump.c~acpi drivers/acpi/namespace/nsdump.c
--- 25/drivers/acpi/namespace/nsdump.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nsdump.c	2004-01-22 22:42:01.000000000 -0800
@@ -50,8 +50,8 @@
 #define _COMPONENT          ACPI_NAMESPACE
 	 ACPI_MODULE_NAME    ("nsdump")
 
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 
 /*******************************************************************************
  *
@@ -76,7 +76,7 @@ acpi_ns_print_pathname (
 		return;
 	}
 
-		/* Print the entire name */
+	/* Print the entire name */
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
 
@@ -205,7 +205,7 @@ acpi_ns_dump_one_object (
 	 * Now we can print out the pertinent information
 	 */
 	acpi_os_printf ("%4.4s %-12s %p ",
-			this_node->name.ascii, acpi_ut_get_type_name (type), this_node);
+			acpi_ut_get_node_name (this_node), acpi_ut_get_type_name (type), this_node);
 
 	dbg_level = acpi_dbg_level;
 	acpi_dbg_level = 0;
@@ -250,8 +250,7 @@ acpi_ns_dump_one_object (
 		case ACPI_TYPE_INTEGER:
 
 			acpi_os_printf ("= %8.8X%8.8X\n",
-					 ACPI_HIDWORD (obj_desc->integer.value),
-					 ACPI_LODWORD (obj_desc->integer.value));
+					 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 			break;
 
 
@@ -302,8 +301,7 @@ acpi_ns_dump_one_object (
 			acpi_os_printf ("[%s]", acpi_ut_get_region_name (obj_desc->region.space_id));
 			if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
 				acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n",
-						 ACPI_HIDWORD (obj_desc->region.address),
-						 ACPI_LODWORD (obj_desc->region.address),
+						 ACPI_FORMAT_UINT64 (obj_desc->region.address),
 						 obj_desc->region.length);
 			}
 			else {
@@ -324,7 +322,7 @@ acpi_ns_dump_one_object (
 			if (obj_desc->buffer_field.buffer_obj &&
 				obj_desc->buffer_field.buffer_obj->buffer.node) {
 				acpi_os_printf ("Buf [%4.4s]",
-						obj_desc->buffer_field.buffer_obj->buffer.node->name.ascii);
+						acpi_ut_get_node_name (obj_desc->buffer_field.buffer_obj->buffer.node));
 			}
 			break;
 
@@ -332,29 +330,29 @@ acpi_ns_dump_one_object (
 		case ACPI_TYPE_LOCAL_REGION_FIELD:
 
 			acpi_os_printf ("Rgn [%4.4s]",
-					obj_desc->common_field.region_obj->region.node->name.ascii);
+					acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node));
 			break;
 
 
 		case ACPI_TYPE_LOCAL_BANK_FIELD:
 
 			acpi_os_printf ("Rgn [%4.4s] Bnk [%4.4s]",
-					obj_desc->common_field.region_obj->region.node->name.ascii,
-					obj_desc->bank_field.bank_obj->common_field.node->name.ascii);
+					acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node),
+					acpi_ut_get_node_name (obj_desc->bank_field.bank_obj->common_field.node));
 			break;
 
 
 		case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
 			acpi_os_printf ("Idx [%4.4s] Dat [%4.4s]",
-					obj_desc->index_field.index_obj->common_field.node->name.ascii,
-					obj_desc->index_field.data_obj->common_field.node->name.ascii);
+					acpi_ut_get_node_name (obj_desc->index_field.index_obj->common_field.node),
+					acpi_ut_get_node_name (obj_desc->index_field.data_obj->common_field.node));
 			break;
 
 
 		case ACPI_TYPE_LOCAL_ALIAS:
 
-			acpi_os_printf ("Target %4.4s (%p)\n", ((struct acpi_namespace_node *) obj_desc)->name.ascii, obj_desc);
+			acpi_os_printf ("Target %4.4s (%p)\n", acpi_ut_get_node_name (obj_desc), obj_desc);
 			break;
 
 		default:
@@ -371,7 +369,7 @@ acpi_ns_dump_one_object (
 		case ACPI_TYPE_LOCAL_BANK_FIELD:
 		case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
-			acpi_os_printf ("Off %.2X Len %.2X Acc %.2hd\n",
+			acpi_os_printf (" Off %.3X Len %.2X Acc %.2hd\n",
 					(obj_desc->common_field.base_byte_offset * 8)
 						+ obj_desc->common_field.start_field_bit_offset,
 					obj_desc->common_field.bit_length,
@@ -408,8 +406,8 @@ acpi_ns_dump_one_object (
 
 		case ACPI_TYPE_INTEGER:
 
-			acpi_os_printf (" N:%X%X\n", ACPI_HIDWORD(obj_desc->integer.value),
-					 ACPI_LODWORD(obj_desc->integer.value));
+			acpi_os_printf (" I:%8.8X8.8%X\n",
+					ACPI_FORMAT_UINT64 (obj_desc->integer.value));
 			break;
 
 		case ACPI_TYPE_STRING:
@@ -485,7 +483,8 @@ acpi_ns_dump_one_object (
 
 		default:
 
-			acpi_os_printf ("(String or Buffer ptr - not an object descriptor)\n");
+			acpi_os_printf ("(String or Buffer ptr - not an object descriptor) [%s]\n",
+					acpi_ut_get_descriptor_name (obj_desc));
 			bytes_to_dump = 16;
 			break;
 		}
@@ -581,7 +580,6 @@ acpi_ns_dump_objects (
 	info.owner_id = owner_id;
 	info.display_type = display_type;
 
-
 	(void) acpi_ns_walk_namespace (type, start_handle, max_depth,
 			 ACPI_NS_WALK_NO_UNLOCK, acpi_ns_dump_one_object,
 			 (void *) &info, NULL);
@@ -628,7 +626,6 @@ acpi_ns_dump_tables (
 		ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
 	}
 
-
 	acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
 			ACPI_UINT32_MAX, search_handle);
 	return_VOID;
diff -puN drivers/acpi/namespace/nsdumpdv.c~acpi drivers/acpi/namespace/nsdumpdv.c
--- 25/drivers/acpi/namespace/nsdumpdv.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nsdumpdv.c	2004-01-22 22:42:01.000000000 -0800
@@ -93,7 +93,7 @@ acpi_ns_dump_one_device (
 
 		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "    HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
 				  info->hardware_id.value,
-				  ACPI_HIDWORD (info->address), ACPI_LODWORD (info->address),
+				  ACPI_FORMAT_UINT64 (info->address),
 				  info->current_status));
 		ACPI_MEM_FREE (info);
 	}
diff -puN drivers/acpi/namespace/nsinit.c~acpi drivers/acpi/namespace/nsinit.c
--- 25/drivers/acpi/namespace/nsinit.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nsinit.c	2004-01-22 22:42:01.000000000 -0800
@@ -144,10 +144,17 @@ acpi_ns_initialize_devices (
 
 	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Executing all Device _STA and_INI methods:"));
 
-	/* Walk namespace for all objects of type Device */
+	status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
+
+	/* Walk namespace for all objects of type Device or Processor */
 
-	status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-			  ACPI_UINT32_MAX, FALSE, acpi_ns_init_one_device, &info, NULL);
+	status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+			  ACPI_UINT32_MAX, TRUE, acpi_ns_init_one_device, &info, NULL);
+
+	(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
 
 	if (ACPI_FAILURE (status)) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed! %s\n",
@@ -290,7 +297,8 @@ acpi_ns_init_one_object (
 		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 				"Could not execute arguments for [%4.4s] (%s), %s\n",
-				node->name.ascii, acpi_ut_get_type_name (type), acpi_format_exception (status)));
+				acpi_ut_get_node_name (node), acpi_ut_get_type_name (type),
+				acpi_format_exception (status)));
 	}
 
 	/* Print a dot for each object unless we are going to print the entire pathname */
@@ -338,45 +346,48 @@ acpi_ns_init_one_device (
 	ACPI_FUNCTION_TRACE ("ns_init_one_device");
 
 
-	if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) {
-		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
-	}
-
-	info->device_count++;
-
-	status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
-
 	node = acpi_ns_map_handle_to_node (obj_handle);
 	if (!node) {
-		(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
-	status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+	/*
+	 * We will run _STA/_INI on Devices and Processors only
+	 */
+	if ((node->type != ACPI_TYPE_DEVICE) &&
+		(node->type != ACPI_TYPE_PROCESSOR)) {
+		return_ACPI_STATUS (AE_OK);
 	}
 
+	if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) {
+		ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
+	}
+
+	info->device_count++;
+
 	/*
 	 * Run _STA to determine if we can run _INI on the device.
 	 */
 	ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (ACPI_TYPE_METHOD, node, "_STA"));
 	status = acpi_ut_execute_STA (node, &flags);
+
 	if (ACPI_FAILURE (status)) {
-		/* Ignore error and move on to next device */
+		if (node->type == ACPI_TYPE_DEVICE) {
+			/* Ignore error and move on to next device */
 
-		return_ACPI_STATUS (AE_OK);
-	}
+			return_ACPI_STATUS (AE_OK);
+		}
 
-	info->num_STA++;
+		/* _STA is not required for Processor objects */
+	}
+	else {
+		info->num_STA++;
 
-	if (!(flags & 0x01)) {
-		/* don't look at children of a not present device */
+		if (!(flags & 0x01)) {
+			/* Don't look at children of a not present device */
 
-		return_ACPI_STATUS(AE_CTRL_DEPTH);
+			return_ACPI_STATUS(AE_CTRL_DEPTH);
+		}
 	}
 
 	/*
diff -puN drivers/acpi/namespace/nsobject.c~acpi drivers/acpi/namespace/nsobject.c
--- 25/drivers/acpi/namespace/nsobject.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nsobject.c	2004-01-22 22:42:01.000000000 -0800
@@ -104,7 +104,8 @@ acpi_ns_attach_object (
 	if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) {
 		/* Not a name handle */
 
-		ACPI_REPORT_ERROR (("ns_attach_object: Invalid handle\n"));
+		ACPI_REPORT_ERROR (("ns_attach_object: Invalid handle %p [%s]\n",
+				node, acpi_ut_get_descriptor_name (node)));
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
@@ -151,7 +152,7 @@ acpi_ns_attach_object (
 	}
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n",
-		obj_desc, node, node->name.ascii));
+		obj_desc, node, acpi_ut_get_node_name (node)));
 
 	/* Detach an existing attached object if present */
 
@@ -234,7 +235,7 @@ acpi_ns_detach_object (
 	node->type = ACPI_TYPE_ANY;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Node %p [%4.4s] Object %p\n",
-		node, node->name.ascii, obj_desc));
+		node, acpi_ut_get_node_name (node), obj_desc));
 
 	/* Remove one reference on the object (and all subobjects) */
 
diff -puN drivers/acpi/namespace/nssearch.c~acpi drivers/acpi/namespace/nssearch.c
--- 25/drivers/acpi/namespace/nssearch.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nssearch.c	2004-01-22 22:42:01.000000000 -0800
@@ -119,7 +119,7 @@ acpi_ns_search_node (
 			ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
 				"Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n",
 				(char *) &target_name, acpi_ut_get_type_name (next_node->type),
-				next_node, node->name.ascii, node));
+				next_node, acpi_ut_get_node_name (node), node));
 
 			*return_node = next_node;
 			return_ACPI_STATUS (AE_OK);
@@ -145,7 +145,7 @@ acpi_ns_search_node (
 	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
 		"Name [%4.4s] (%s) not found in search in scope [%4.4s] %p first child %p\n",
 		(char *) &target_name, acpi_ut_get_type_name (type),
-		node->name.ascii, node, node->child));
+		acpi_ut_get_node_name (node), node, node->child));
 
 	return_ACPI_STATUS (AE_NOT_FOUND);
 }
diff -puN drivers/acpi/namespace/nsutils.c~acpi drivers/acpi/namespace/nsutils.c
--- 25/drivers/acpi/namespace/nsutils.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nsutils.c	2004-01-22 22:42:01.000000000 -0800
@@ -977,8 +977,8 @@ acpi_ns_find_parent_name (
 		parent_node = acpi_ns_get_parent_node (child_node);
 		if (parent_node) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n",
-				child_node, child_node->name.ascii,
-				parent_node, parent_node->name.ascii));
+				child_node, acpi_ut_get_node_name (child_node),
+				parent_node, acpi_ut_get_node_name (parent_node)));
 
 			if (parent_node->name.integer) {
 				return_VALUE ((acpi_name) parent_node->name.integer);
@@ -986,7 +986,7 @@ acpi_ns_find_parent_name (
 		}
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n",
-			child_node, child_node->name.ascii));
+			child_node, acpi_ut_get_node_name (child_node)));
 	}
 
 	return_VALUE (ACPI_UNKNOWN_NAME);
diff -puN drivers/acpi/namespace/nsxfname.c~acpi drivers/acpi/namespace/nsxfname.c
--- 25/drivers/acpi/namespace/nsxfname.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/namespace/nsxfname.c	2004-01-22 22:42:01.000000000 -0800
@@ -199,7 +199,7 @@ acpi_get_name (
 
 	/* Just copy the ACPI name from the Node and zero terminate it */
 
-	ACPI_STRNCPY (buffer->pointer, node->name.ascii,
+	ACPI_STRNCPY (buffer->pointer, acpi_ut_get_node_name (node),
 			 ACPI_NAME_SIZE);
 	((char *) buffer->pointer) [ACPI_NAME_SIZE] = 0;
 	status = AE_OK;
diff -puN drivers/acpi/parser/psargs.c~acpi drivers/acpi/parser/psargs.c
--- 25/drivers/acpi/parser/psargs.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/parser/psargs.c	2004-01-22 22:42:01.000000000 -0800
@@ -490,7 +490,7 @@ union acpi_parse_object *
 acpi_ps_get_next_field (
 	struct acpi_parse_state         *parser_state)
 {
-	u32                             aml_offset = ACPI_PTR_DIFF (parser_state->aml,
+	u32                             aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml,
 			 parser_state->aml_start);
 	union acpi_parse_object         *field;
 	u16                             opcode;
@@ -677,7 +677,7 @@ acpi_ps_get_next_arg (
 
 			/* Fill in bytelist data */
 
-			arg->common.value.size = ACPI_PTR_DIFF (parser_state->pkg_end,
+			arg->common.value.size = (u32) ACPI_PTR_DIFF (parser_state->pkg_end,
 					  parser_state->aml);
 			arg->named.data = parser_state->aml;
 
diff -puN drivers/acpi/parser/psparse.c~acpi drivers/acpi/parser/psparse.c
--- 25/drivers/acpi/parser/psparse.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/parser/psparse.c	2004-01-22 22:42:01.000000000 -0800
@@ -498,7 +498,7 @@ acpi_ps_parse_loop (
 		if (!op) {
 			/* Get the next opcode from the AML stream */
 
-			walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml,
+			walk_state->aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml,
 					   parser_state->aml_start);
 			walk_state->opcode   = acpi_ps_peek_opcode (parser_state);
 
@@ -710,7 +710,7 @@ acpi_ps_parse_loop (
 
 				while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) &&
 						!walk_state->arg_count) {
-					walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml,
+					walk_state->aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml,
 							   parser_state->aml_start);
 					status = acpi_ps_get_next_arg (walk_state, parser_state,
 							 GET_CURRENT_ARG_TYPE (walk_state->arg_types), &arg);
diff -puN drivers/acpi/parser/psxface.c~acpi drivers/acpi/parser/psxface.c
--- 25/drivers/acpi/parser/psxface.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/parser/psxface.c	2004-01-22 22:42:01.000000000 -0800
@@ -127,7 +127,8 @@ acpi_psx_execute (
 
 	op = acpi_ps_create_scope_op ();
 	if (!op) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup1;
 	}
 
 	/*
@@ -142,20 +143,24 @@ acpi_psx_execute (
 	walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
 			   NULL, NULL, NULL);
 	if (!walk_state) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup2;
 	}
 
 	status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start,
 			  obj_desc->method.aml_length, NULL, NULL, 1);
 	if (ACPI_FAILURE (status)) {
-		acpi_ds_delete_walk_state (walk_state);
-		return_ACPI_STATUS (status);
+		goto cleanup3;
 	}
 
 	/* Parse the AML */
 
 	status = acpi_ps_parse_aml (walk_state);
 	acpi_ps_delete_parse_tree (op);
+	if (ACPI_FAILURE (status)) {
+		goto cleanup1; /* Walk state is already deleted */
+
+	}
 
 	/*
 	 * 2) Execute the method.  Performs second pass parse simultaneously
@@ -168,7 +173,8 @@ acpi_psx_execute (
 
 	op = acpi_ps_create_scope_op ();
 	if (!op) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup1;
 	}
 
 	/* Init new op with the method name and pointer back to the NS node */
@@ -180,22 +186,30 @@ acpi_psx_execute (
 
 	walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL);
 	if (!walk_state) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup2;
 	}
 
 	status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start,
 			  obj_desc->method.aml_length, params, return_obj_desc, 3);
 	if (ACPI_FAILURE (status)) {
-		acpi_ds_delete_walk_state (walk_state);
-		return_ACPI_STATUS (status);
+		goto cleanup3;
 	}
 
 	/*
 	 * The walk of the parse tree is where we actually execute the method
 	 */
 	status = acpi_ps_parse_aml (walk_state);
+	goto cleanup2; /* Walk state already deleted */
+
+
+cleanup3:
+	acpi_ds_delete_walk_state (walk_state);
+
+cleanup2:
 	acpi_ps_delete_parse_tree (op);
 
+cleanup1:
 	if (params) {
 		/* Take away the extra reference that we gave the parameters above */
 
@@ -206,6 +220,10 @@ acpi_psx_execute (
 		}
 	}
 
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
+
 	/*
 	 * If the method has returned an object, signal this to the caller with
 	 * a control exception code
diff -puN drivers/acpi/pci_link.c~acpi drivers/acpi/pci_link.c
--- 25/drivers/acpi/pci_link.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/pci_link.c	2004-01-22 22:42:01.000000000 -0800
@@ -99,7 +99,7 @@ acpi_pci_link_check_possible (
 	void			*context)
 {
 	struct acpi_pci_link	*link = (struct acpi_pci_link *) context;
-	int			i = 0;
+	u32			i = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");
 
@@ -294,7 +294,10 @@ acpi_pci_link_try_get_current (
 
 	if (!link->irq.active) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No active IRQ resource found\n"));
-		printk(KERN_WARNING "_CRS returns NULL! Using IRQ %d for device (%s [%s]).\n", irq, acpi_device_name(link->device), acpi_device_bid(link->device));
+		printk(KERN_WARNING "_CRS returns NULL! Using IRQ %d for"
+			"device (%s [%s]).\n", irq,
+			acpi_device_name(link->device),
+			acpi_device_bid(link->device));
 		link->irq.active = irq;
 	}
 	
@@ -429,30 +432,67 @@ retry_programming:
                             PCI Link IRQ Management
    -------------------------------------------------------------------------- */
 
-#define ACPI_MAX_IRQS		256
-#define ACPI_MAX_ISA_IRQ	16
-
 /*
- * IRQ penalties are used to promote PCI IRQ balancing.  We set each ISA-
- * possible IRQ (0-15) with a default penalty relative to its feasibility
- * for PCI's use:
+ * "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt
+ * Link Devices to move the PIRQs around to minimize sharing.
+ * 
+ * "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs
+ * that the BIOS has already set to active.  This is necessary because
+ * ACPI has no automatic means of knowing what ISA IRQs are used.  Note that
+ * if the BIOS doesn't set a Link Device active, ACPI needs to program it
+ * even if acpi_irq_nobalance is set.
+ *
+ * A tables of penalties avoids directing PCI interrupts to well known
+ * ISA IRQs. Boot params are available to over-ride the default table:
  *
- *   Never use:		0, 1, 2 (timer, keyboard, and cascade)
- *   Avoid using:	13, 14, and 15 (FP error and IDE)
- *   Penalize:		3, 4, 6, 7, 12 (known ISA uses)
+ * List interrupts that are free for PCI use.
+ * acpi_irq_pci=n[,m]
  *
- * Thus we're left with IRQs 5, 9, 10, 11, and everything above 15 (IO[S]APIC)
- * as 'best bets' for PCI use.
+ * List interrupts that should not be used for PCI:
+ * acpi_irq_isa=n[,m]
+ *
+ * Note that PCI IRQ routers have a list of possible IRQs,
+ * which may not include the IRQs this table says are available.
+ * 
+ * Since this heuristic can't tell the difference between a link
+ * that no device will attach to, vs. a link which may be shared
+ * by multiple active devices -- it is not optimal.
+ *
+ * If interrupt performance is that important, get an IO-APIC system
+ * with a pin dedicated to each device.  Or for that matter, an MSI
+ * enabled system.
  */
 
+#define ACPI_MAX_IRQS		256
+#define ACPI_MAX_ISA_IRQ	16
+
+#define PIRQ_PENALTY_PCI_AVAILABLE	(0)
+#define PIRQ_PENALTY_PCI_POSSIBLE	(16*16)
+#define PIRQ_PENALTY_PCI_USING		(16*16*16)
+#define PIRQ_PENALTY_ISA_TYPICAL	(16*16*16*16)
+#define PIRQ_PENALTY_ISA_USED		(16*16*16*16*16)
+#define PIRQ_PENALTY_ISA_ALWAYS		(16*16*16*16*16*16)
+
 static int acpi_irq_penalty[ACPI_MAX_IRQS] = {
-	1000000,  1000000,  1000000,    10000, 
-	  10000,        0,    10000,    10000,
-	  10000,        0,        0,        0, 
-	  10000,   100000,   100000,   100000,
+	PIRQ_PENALTY_ISA_ALWAYS,	/* IRQ0 timer */
+	PIRQ_PENALTY_ISA_ALWAYS,	/* IRQ1 keyboard */
+	PIRQ_PENALTY_ISA_ALWAYS,	/* IRQ2 cascade */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ3	serial */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ4	serial */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ5 sometimes SoundBlaster */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ6 */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ7 parallel, spurious */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ8 rtc, sometimes */
+	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ9  PCI, often acpi */
+	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ10 PCI */
+	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ11 PCI */
+	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ12 mouse */
+	PIRQ_PENALTY_ISA_USED,	/* IRQ13 fpe, sometimes */
+	PIRQ_PENALTY_ISA_USED,	/* IRQ14 ide0 */
+	PIRQ_PENALTY_ISA_USED,	/* IRQ15 ide1 */
+			/* >IRQ15 */
 };
 
-
 int
 acpi_pci_link_check (void)
 {
@@ -473,20 +513,30 @@ acpi_pci_link_check (void)
 			continue;
 		}
 
-		if (link->irq.active)
-			acpi_irq_penalty[link->irq.active] += 100;
-		else if (link->irq.possible_count) {
-			int penalty = 100 / link->irq.possible_count;
-			for (i=0; i<link->irq.possible_count; i++) {
+		/*
+		 * reflect the possible and active irqs in the penalty table --
+		 * useful for breaking ties.
+		 */
+		if (link->irq.possible_count) {
+			int penalty = PIRQ_PENALTY_PCI_POSSIBLE / link->irq.possible_count;
+
+			for (i = 0; i < link->irq.possible_count; i++) {
 				if (link->irq.possible[i] < ACPI_MAX_ISA_IRQ)
 					acpi_irq_penalty[link->irq.possible[i]] += penalty;
 			}
+
+		} else if (link->irq.active) {
+			acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_POSSIBLE;
 		}
 	}
+	/* Add a penalty for the SCI */
+	acpi_irq_penalty[acpi_fadt.sci_int] += PIRQ_PENALTY_PCI_USING;
 
 	return_VALUE(0);
 }
 
+static int acpi_irq_balance;	/* 0: static, 1: balance */
+
 static int acpi_pci_link_allocate(struct acpi_pci_link* link) {
 	int irq;
 	int i;
@@ -500,12 +550,14 @@ static int acpi_pci_link_allocate(struct
 		irq = link->irq.active;
 	} else {
 		irq = link->irq.possible[0];
+	}
 
+	if (acpi_irq_balance || !link->irq.active) {
 		/*
 		 * Select the best IRQ.  This is done in reverse to promote
 		 * the use of IRQs 9, 10, 11, and >15.
 		 */
-		for (i=(link->irq.possible_count-1); i>0; i--) {
+		for (i = (link->irq.possible_count - 1); i >= 0; i--) {
 			if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
 				irq = link->irq.possible[i];
 		}
@@ -518,13 +570,14 @@ static int acpi_pci_link_allocate(struct
 			acpi_device_bid(link->device));
 		return_VALUE(-ENODEV);
 	} else {
-		acpi_irq_penalty[link->irq.active] += 100;
+		acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
 		printk(PREFIX "%s [%s] enabled at IRQ %d\n", 
 			acpi_device_name(link->device),
 			acpi_device_bid(link->device), link->irq.active);
 	}
 
 	link->irq.setonboot = 1;
+
 	return_VALUE(0);
 }
 
@@ -607,9 +660,12 @@ acpi_pci_link_add (
 	if (result)
 		goto end;
 
+	/* query and set link->irq.active */
 	acpi_pci_link_get_current(link);
 
-	printk(PREFIX "%s [%s] (IRQs", acpi_device_name(device), acpi_device_bid(device));
+//#ifdef CONFIG_ACPI_DEBUG
+	printk(PREFIX "%s [%s] (IRQs", acpi_device_name(device),
+		acpi_device_bid(device));
 	for (i = 0; i < link->irq.possible_count; i++) {
 		if (link->irq.active == link->irq.possible[i]) {
 			printk(" *%d", link->irq.possible[i]);
@@ -619,6 +675,7 @@ acpi_pci_link_add (
 			printk(" %d", link->irq.possible[i]);
 	}
 	printk(")\n");
+//#endif /* CONFIG_ACPI_DEBUG */
 
 	/* TBD: Acquire/release lock */
 	list_add_tail(&link->node, &acpi_link.entries);
@@ -654,6 +711,77 @@ acpi_pci_link_remove (
 	return_VALUE(0);
 }
 
+/*
+ * modify acpi_irq_penalty[] from cmdline
+ */
+static int __init acpi_irq_penalty_update(char *str, int used)
+{
+	int i;
+
+	for (i = 0; i < 16; i++) {
+		int retval;
+		int irq;
+
+		retval = get_option(&str,&irq);
+
+		if (!retval)
+			break;	/* no number found */
+
+		if (irq < 0)
+			continue;
+		
+		if (irq >= ACPI_MAX_IRQS)
+			continue;
+
+		if (used)
+			acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
+		else
+			acpi_irq_penalty[irq] = PIRQ_PENALTY_PCI_AVAILABLE;
+
+		if (retval != 2)	/* no next number */
+			break;
+	}
+	return 1;
+}
+
+/*
+ * Over-ride default table to reserve additional IRQs for use by ISA
+ * e.g. acpi_irq_isa=5
+ * Useful for telling ACPI how not to interfere with your ISA sound card.
+ */
+static int __init acpi_irq_isa(char *str)
+{
+	return(acpi_irq_penalty_update(str, 1));
+}
+__setup("acpi_irq_isa=", acpi_irq_isa);
+
+/*
+ * Over-ride default table to free additional IRQs for use by PCI
+ * e.g. acpi_irq_pci=7,15
+ * Used for acpi_irq_balance to free up IRQs to reduce PCI IRQ sharing.
+ */
+static int __init acpi_irq_pci(char *str)
+{
+	return(acpi_irq_penalty_update(str, 0));
+}
+__setup("acpi_irq_pci=", acpi_irq_pci);
+
+static int __init acpi_irq_nobalance_set(char *str)
+{
+printk("ACPI STATIC SET\n");
+	acpi_irq_balance = 0;
+	return(1);
+}
+__setup("acpi_irq_nobalance", acpi_irq_nobalance_set);
+
+int __init acpi_irq_balance_set(char *str)
+{
+printk("ACPI BALANCE SET\n");
+	acpi_irq_balance = 1;
+	return(1);
+}
+__setup("acpi_irq_balance", acpi_irq_balance_set);
+
 
 static int __init acpi_pci_link_init (void)
 {
diff -puN drivers/acpi/pci_root.c~acpi drivers/acpi/pci_root.c
--- 25/drivers/acpi/pci_root.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/pci_root.c	2004-01-22 22:42:01.000000000 -0800
@@ -62,8 +62,6 @@ struct acpi_pci_root {
 	acpi_handle		handle;
 	struct acpi_pci_id	id;
 	struct pci_bus		*bus;
-	u64			mem_tra;
-	u64			io_tra;
 };
 
 static LIST_HEAD(acpi_pci_roots);
@@ -115,97 +113,6 @@ void acpi_pci_unregister_driver(struct a
 	}
 }
 
-void
-acpi_pci_get_translations (
-	struct acpi_pci_id	*id,
-	u64			*mem_tra,
-	u64			*io_tra)
-{
-	struct list_head	*node = NULL;
-	struct acpi_pci_root	*entry;
-
-	/* TBD: Locking */
-	list_for_each(node, &acpi_pci_roots) {
-		entry = list_entry(node, struct acpi_pci_root, node);
-		if ((id->segment == entry->id.segment)
-			&& (id->bus == entry->id.bus)) {
-			*mem_tra = entry->mem_tra;
-			*io_tra = entry->io_tra;
-			return;
-		}
-	}
-
-	*mem_tra = 0;
-	*io_tra = 0;
-}
-
-
-static u64
-acpi_pci_root_bus_tra (
-       struct acpi_resource	*resource,
-       int			type)
-{
-	struct acpi_resource_address16 *address16;
-	struct acpi_resource_address32 *address32;
-	struct acpi_resource_address64 *address64;
-
-	while (1) {
-		switch (resource->id) {
-		case ACPI_RSTYPE_END_TAG:
-			return 0;
-
-		case ACPI_RSTYPE_ADDRESS16:
-			address16 = (struct acpi_resource_address16 *) &resource->data;
-			if (type == address16->resource_type) {
-				return address16->address_translation_offset;
-			}
-			break;
-
-		case ACPI_RSTYPE_ADDRESS32:
-			address32 = (struct acpi_resource_address32 *) &resource->data;
-			if (type == address32->resource_type) {
-				return address32->address_translation_offset;
-			}
-			break;
-
-		case ACPI_RSTYPE_ADDRESS64:
-			address64 = (struct acpi_resource_address64 *) &resource->data;
-			if (type == address64->resource_type) {
-				return address64->address_translation_offset;
-			}
-			break;
-		}
-		resource = ACPI_PTR_ADD (struct acpi_resource,
-				resource, resource->length);
-	}
-
-	return 0;
-}
-
-
-static int
-acpi_pci_evaluate_crs (
-	struct acpi_pci_root	*root)
-{
-	acpi_status		status;
-	struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-
-	ACPI_FUNCTION_TRACE("acpi_pci_evaluate_crs");
-
-	status = acpi_get_current_resources (root->handle, &buffer);
-	if (ACPI_FAILURE(status))
-		return_VALUE(-ENODEV);
-
-	root->io_tra = acpi_pci_root_bus_tra ((struct acpi_resource *)
-			buffer.pointer, ACPI_IO_RANGE);
-	root->mem_tra = acpi_pci_root_bus_tra ((struct acpi_resource *)
-			buffer.pointer, ACPI_MEMORY_RANGE);
-
-	acpi_os_free(buffer.pointer);
-	return_VALUE(0);
-}
-
-
 static int
 acpi_pci_root_add (
 	struct acpi_device	*device)
@@ -288,10 +195,8 @@ acpi_pci_root_add (
 	root->id.function = device->pnp.bus_address & 0xFFFF;
 
 	/*
-	 * Evaluate _CRS to get root bridge resources
 	 * TBD: Need PCI interface for enumeration/configuration of roots.
 	 */
- 	acpi_pci_evaluate_crs(root);
 
  	/* TBD: Locking */
  	list_add_tail(&root->node, &acpi_pci_roots);
diff -puN drivers/acpi/resources/rscalc.c~acpi drivers/acpi/resources/rscalc.c
--- 25/drivers/acpi/resources/rscalc.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/resources/rscalc.c	2004-01-22 22:42:01.000000000 -0800
@@ -696,7 +696,7 @@ acpi_rs_get_list_length (
 		default:
 			/*
 			 * If we get here, everything is out of sync,
-			 *  so exit with an error
+			 * exit with an error
 			 */
 			return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
 		}
@@ -704,7 +704,7 @@ acpi_rs_get_list_length (
 		/*
 		 * Update the return value and counter
 		 */
-		buffer_size += ACPI_ALIGN_RESOURCE_SIZE(structure_size);
+		buffer_size += (u32) ACPI_ALIGN_RESOURCE_SIZE (structure_size);
 		bytes_parsed += bytes_consumed;
 
 		/*
diff -puN drivers/acpi/resources/rscreate.c~acpi drivers/acpi/resources/rscreate.c
--- 25/drivers/acpi/resources/rscreate.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/resources/rscreate.c	2004-01-22 22:42:01.000000000 -0800
@@ -331,7 +331,7 @@ acpi_rs_create_pci_routing_table (
 
 		/* Now align the current length */
 
-		user_prt->length = ACPI_ROUND_UP_to_64_bITS (user_prt->length);
+		user_prt->length = (u32) ACPI_ROUND_UP_to_64_bITS (user_prt->length);
 
 		/*
 		 * 4) Fourth subobject: Dereference the PRT.source_index
diff -puN drivers/acpi/resources/rsdump.c~acpi drivers/acpi/resources/rsdump.c
--- 25/drivers/acpi/resources/rsdump.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/resources/rsdump.c	2004-01-22 22:42:01.000000000 -0800
@@ -899,24 +899,19 @@ acpi_rs_dump_address64 (
 			 "" : "not ");
 
 	acpi_os_printf ("  Granularity: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->granularity),
-			 ACPI_LODWORD (address64_data->granularity));
+			 ACPI_FORMAT_UINT64 (address64_data->granularity));
 
 	acpi_os_printf ("  Address range min: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->min_address_range),
-			 ACPI_HIDWORD (address64_data->min_address_range));
+			 ACPI_FORMAT_UINT64 (address64_data->min_address_range));
 
 	acpi_os_printf ("  Address range max: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->max_address_range),
-			 ACPI_HIDWORD (address64_data->max_address_range));
+			 ACPI_FORMAT_UINT64 (address64_data->max_address_range));
 
 	acpi_os_printf ("  Address translation offset: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->address_translation_offset),
-			 ACPI_HIDWORD (address64_data->address_translation_offset));
+			 ACPI_FORMAT_UINT64 (address64_data->address_translation_offset));
 
 	acpi_os_printf ("  Address Length: %8.8X%8.8X\n",
-			 ACPI_HIDWORD (address64_data->address_length),
-			 ACPI_HIDWORD (address64_data->address_length));
+			 ACPI_FORMAT_UINT64 (address64_data->address_length));
 
 	if(0xFF != address64_data->resource_source.index) {
 		acpi_os_printf ("  Resource Source Index: %X\n",
@@ -1126,8 +1121,7 @@ acpi_rs_dump_irq_list (
 			acpi_os_printf ("PCI IRQ Routing Table structure %X.\n", count++);
 
 			acpi_os_printf ("  Address: %8.8X%8.8X\n",
-					 ACPI_HIDWORD (prt_element->address),
-					 ACPI_LODWORD (prt_element->address));
+					 ACPI_FORMAT_UINT64 (prt_element->address));
 
 			acpi_os_printf ("  Pin: %X\n", prt_element->pin);
 
diff -puN drivers/acpi/resources/rsirq.c~acpi drivers/acpi/resources/rsirq.c
--- 25/drivers/acpi/resources/rsirq.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/resources/rsirq.c	2004-01-22 22:42:01.000000000 -0800
@@ -132,26 +132,28 @@ acpi_rs_irq_resource (
 		temp8 = *buffer;
 
 		/*
-		 * Check for HE, LL or HL
+		 * Check for HE, LL interrupts
 		 */
-		if (temp8 & 0x01) {
+		switch (temp8 & 0x09) {
+		case 0x01: /* HE */
 			output_struct->data.irq.edge_level = ACPI_EDGE_SENSITIVE;
 			output_struct->data.irq.active_high_low = ACPI_ACTIVE_HIGH;
-		}
-		else {
-			if (temp8 & 0x8) {
-				output_struct->data.irq.edge_level = ACPI_LEVEL_SENSITIVE;
-				output_struct->data.irq.active_high_low = ACPI_ACTIVE_LOW;
-			}
-			else {
-				/*
-				 * Only _LL and _HE polarity/trigger interrupts
-				 * are allowed (ACPI spec v1.0b ection 6.4.2.1),
-				 * so an error will occur if we reach this point
-				 */
-				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid interrupt polarity/trigger in resource list\n"));
-				return_ACPI_STATUS (AE_BAD_DATA);
-			}
+			break;
+
+		case 0x08: /* LL */
+			output_struct->data.irq.edge_level = ACPI_LEVEL_SENSITIVE;
+			output_struct->data.irq.active_high_low = ACPI_ACTIVE_LOW;
+			break;
+
+		default:
+			/*
+			 * Only _LL and _HE polarity/trigger interrupts
+			 * are allowed (ACPI spec, section "IRQ Format")
+			 * so 0x00 and 0x09 are illegal.
+			 */
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+				"Invalid interrupt polarity/trigger in resource list, %X\n", temp8));
+			return_ACPI_STATUS (AE_BAD_DATA);
 		}
 
 		/*
@@ -419,7 +421,7 @@ acpi_rs_extended_irq_resource (
 		 * Point the String pointer to the end of this structure.
 		 */
 		output_struct->data.extended_irq.resource_source.string_ptr =
-				(char *)(output_struct + struct_size);
+				(char *)((char *) output_struct + struct_size);
 
 		temp_ptr = (u8 *) output_struct->data.extended_irq.resource_source.string_ptr;
 
diff -puN drivers/acpi/resources/rslist.c~acpi drivers/acpi/resources/rslist.c
--- 25/drivers/acpi/resources/rslist.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/resources/rslist.c	2004-01-22 22:42:01.000000000 -0800
@@ -312,8 +312,8 @@ acpi_rs_byte_stream_to_list (
 		 * Set the Buffer to the next structure
 		 */
 		resource = ACPI_CAST_PTR (struct acpi_resource, buffer);
-		resource->length = ACPI_ALIGN_RESOURCE_SIZE(resource->length);
-		buffer += ACPI_ALIGN_RESOURCE_SIZE(structure_size);
+		resource->length = (u32) ACPI_ALIGN_RESOURCE_SIZE (resource->length);
+		buffer += ACPI_ALIGN_RESOURCE_SIZE (structure_size);
 
 	} /*  end while */
 
diff -puN drivers/acpi/scan.c~acpi drivers/acpi/scan.c
--- 25/drivers/acpi/scan.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/scan.c	2004-01-22 22:42:01.000000000 -0800
@@ -336,6 +336,9 @@ acpi_bus_register_driver (
 
 	ACPI_FUNCTION_TRACE("acpi_bus_register_driver");
 
+	if (acpi_disabled)
+		return_VALUE(-ENODEV);
+
 	if (driver) {
 		spin_lock(&acpi_device_lock);
 		list_add_tail(&driver->node, &acpi_bus_drivers);
diff -puN drivers/acpi/sleep/proc.c~acpi drivers/acpi/sleep/proc.c
--- 25/drivers/acpi/sleep/proc.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/sleep/proc.c	2004-01-22 22:42:01.000000000 -0800
@@ -374,6 +374,9 @@ static int acpi_sleep_proc_init(void)
 {
 	struct proc_dir_entry	*entry = NULL;
 
+	if (acpi_disabled)
+		return 0;
+ 
 	/* 'sleep' [R/W]*/
 	entry = create_proc_entry(ACPI_SYSTEM_FILE_SLEEP,
 				  S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
diff -puN drivers/acpi/tables.c~acpi drivers/acpi/tables.c
--- 25/drivers/acpi/tables.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/tables.c	2004-01-22 22:42:01.000000000 -0800
@@ -60,6 +60,9 @@ static char *acpi_table_signatures[ACPI_
 	[ACPI_HPET]		= "HPET",
 };
 
+static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" };
+static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
+
 /* System Description Table (RSDT/XSDT) */
 struct acpi_table_sdt {
 	unsigned long		pa;
@@ -136,8 +139,14 @@ acpi_table_print_madt_entry (
 	{
 		struct acpi_table_int_src_ovr *p =
 			(struct acpi_table_int_src_ovr*) header;
-		printk(KERN_INFO PREFIX "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n",
-			p->bus, p->bus_irq, p->global_irq, p->flags.polarity, p->flags.trigger);
+		printk(KERN_INFO PREFIX "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n",
+			p->bus, p->bus_irq, p->global_irq,
+			mps_inti_flags_polarity[p->flags.polarity],
+			mps_inti_flags_trigger[p->flags.trigger]);
+		if(p->flags.reserved)
+			printk(KERN_INFO PREFIX "INT_SRC_OVR unexpected reserved flags: 0x%x\n",
+				p->flags.reserved);
+
 	}
 		break;
 
@@ -145,8 +154,9 @@ acpi_table_print_madt_entry (
 	{
 		struct acpi_table_nmi_src *p =
 			(struct acpi_table_nmi_src*) header;
-		printk(KERN_INFO PREFIX "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n",
-			p->flags.polarity, p->flags.trigger, p->global_irq);
+		printk(KERN_INFO PREFIX "NMI_SRC (%s %s global_irq %d)\n",
+			mps_inti_flags_polarity[p->flags.polarity],
+			mps_inti_flags_trigger[p->flags.trigger], p->global_irq);
 	}
 		break;
 
@@ -154,8 +164,10 @@ acpi_table_print_madt_entry (
 	{
 		struct acpi_table_lapic_nmi *p =
 			(struct acpi_table_lapic_nmi*) header;
-		printk(KERN_INFO PREFIX "LAPIC_NMI (acpi_id[0x%02x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n",
-			p->acpi_id, p->flags.polarity, p->flags.trigger, p->lint);
+		printk(KERN_INFO PREFIX "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n",
+			p->acpi_id,
+			mps_inti_flags_polarity[p->flags.polarity],
+			mps_inti_flags_trigger[p->flags.trigger], p->lint);
 	}
 		break;
 
@@ -190,8 +202,10 @@ acpi_table_print_madt_entry (
 	{
 		struct acpi_table_plat_int_src *p =
 			(struct acpi_table_plat_int_src*) header;
-		printk(KERN_INFO PREFIX "PLAT_INT_SRC (polarity[0x%x] trigger[0x%x] type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
-			p->flags.polarity, p->flags.trigger, p->type, p->id, p->eid, p->iosapic_vector, p->global_irq);
+		printk(KERN_INFO PREFIX "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
+			mps_inti_flags_polarity[p->flags.polarity],
+			mps_inti_flags_trigger[p->flags.trigger],
+			p->type, p->id, p->eid, p->iosapic_vector, p->global_irq);
 	}
 		break;
 
diff -puN drivers/acpi/tables/tbgetall.c~acpi drivers/acpi/tables/tbgetall.c
--- 25/drivers/acpi/tables/tbgetall.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/tables/tbgetall.c	2004-01-22 22:42:01.000000000 -0800
@@ -240,8 +240,7 @@ acpi_tb_get_required_tables (
 		if ((status != AE_OK) && (status != AE_TABLE_NOT_SUPPORTED)) {
 			ACPI_REPORT_WARNING (("%s, while getting table at %8.8X%8.8X\n",
 				acpi_format_exception (status),
-				ACPI_HIDWORD (address.pointer.value),
-				ACPI_LODWORD (address.pointer.value)));
+				ACPI_FORMAT_UINT64 (address.pointer.value)));
 		}
 	}
 
diff -puN drivers/acpi/tables/tbget.c~acpi drivers/acpi/tables/tbget.c
--- 25/drivers/acpi/tables/tbget.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/tables/tbget.c	2004-01-22 22:42:01.000000000 -0800
@@ -148,8 +148,7 @@ acpi_tb_get_table_header (
 				  (void *) &header);
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR (("Could not map memory at %8.8X%8.8X for length %X\n",
-				ACPI_HIDWORD (address->pointer.physical),
-				ACPI_LODWORD (address->pointer.physical),
+				ACPI_FORMAT_UINT64 (address->pointer.physical),
 				sizeof (struct acpi_table_header)));
 			return_ACPI_STATUS (status);
 		}
@@ -365,8 +364,7 @@ acpi_tb_get_this_table (
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n",
 				header->signature,
-				ACPI_HIDWORD (address->pointer.physical),
-				ACPI_LODWORD (address->pointer.physical), header->length));
+				ACPI_FORMAT_UINT64 (address->pointer.physical), header->length));
 			return (status);
 		}
 
@@ -408,8 +406,7 @@ acpi_tb_get_this_table (
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 		"Found table [%4.4s] at %8.8X%8.8X, mapped/copied to %p\n",
 		full_table->signature,
-		ACPI_HIDWORD (address->pointer.physical),
-		ACPI_LODWORD (address->pointer.physical), full_table));
+		ACPI_FORMAT_UINT64 (address->pointer.physical), full_table));
 
 	return_ACPI_STATUS (status);
 }
@@ -458,6 +455,7 @@ acpi_tb_get_table_ptr (
 	if (instance == 1) {
 		/* Get the first */
 
+		*table_ptr_loc = NULL;
 		if (acpi_gbl_table_lists[table_type].next) {
 			*table_ptr_loc = acpi_gbl_table_lists[table_type].next->pointer;
 		}
diff -puN drivers/acpi/tables/tbrsdt.c~acpi drivers/acpi/tables/tbrsdt.c
--- 25/drivers/acpi/tables/tbrsdt.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/tables/tbrsdt.c	2004-01-22 22:42:01.000000000 -0800
@@ -278,8 +278,7 @@ acpi_tb_get_table_rsdt (
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 		"RSDP located at %p, points to RSDT physical=%8.8X%8.8X \n",
 		acpi_gbl_RSDP,
-		ACPI_HIDWORD (address.pointer.value),
-		ACPI_LODWORD (address.pointer.value)));
+		ACPI_FORMAT_UINT64 (address.pointer.value)));
 
 	/* Check the RSDT or XSDT signature */
 
diff -puN drivers/acpi/tables/tbxface.c~acpi drivers/acpi/tables/tbxface.c
--- 25/drivers/acpi/tables/tbxface.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/tables/tbxface.c	2004-01-22 22:42:01.000000000 -0800
@@ -251,7 +251,7 @@ acpi_unload_table (
 	/* Find all tables of the requested type */
 
 	table_desc = acpi_gbl_table_lists[table_type].next;
-	while (table_desc); {
+	while (table_desc) {
 		/*
 		 * Delete all namespace entries owned by this table.  Note that these
 		 * entries can appear anywhere in the namespace by virtue of the AML
diff -puN drivers/acpi/tables/tbxfroot.c~acpi drivers/acpi/tables/tbxfroot.c
--- 25/drivers/acpi/tables/tbxfroot.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/tables/tbxfroot.c	2004-01-22 22:42:01.000000000 -0800
@@ -211,8 +211,7 @@ acpi_get_firmware_table (
 	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 		"RSDP located at %p, RSDT physical=%8.8X%8.8X \n",
 		acpi_gbl_RSDP,
-		ACPI_HIDWORD (address.pointer.value),
-		ACPI_LODWORD (address.pointer.value)));
+		ACPI_FORMAT_UINT64 (address.pointer.value)));
 
 	/* Insert processor_mode flags */
 
diff -puN drivers/acpi/thermal.c~acpi drivers/acpi/thermal.c
--- 25/drivers/acpi/thermal.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/thermal.c	2004-01-22 22:42:01.000000000 -0800
@@ -467,6 +467,7 @@ acpi_thermal_critical (
 	if (result)
 		return_VALUE(result);
 
+	printk(KERN_EMERG "Critical temperature reached (%ld C), shutting down.\n", KELVIN_TO_CELSIUS(tz->temperature));
 	acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL, tz->trips.critical.flags.enabled);
 
 	acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
diff -puN drivers/acpi/utilities/utalloc.c~acpi drivers/acpi/utilities/utalloc.c
--- 25/drivers/acpi/utilities/utalloc.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/utilities/utalloc.c	2004-01-22 22:42:01.000000000 -0800
@@ -902,71 +902,30 @@ acpi_ut_dump_allocations (
 
 			descriptor = ACPI_CAST_PTR (union acpi_descriptor, &element->user_space);
 			if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) {
-				acpi_os_printf ("%p Len %04X %9.9s-%d ",
+				acpi_os_printf ("%p Len %04X %9.9s-%d [%s] ",
 						 descriptor, element->size, element->module,
-						 element->line);
+						 element->line, acpi_ut_get_descriptor_name (descriptor));
 
-				/* Most of the elements will be internal objects. */
+				/* Most of the elements will be Operand objects. */
 
 				switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) {
 				case ACPI_DESC_TYPE_OPERAND:
-					acpi_os_printf ("obj_type %12.12s R%hd",
+					acpi_os_printf ("%12.12s R%hd",
 							acpi_ut_get_type_name (descriptor->object.common.type),
 							descriptor->object.common.reference_count);
 					break;
 
 				case ACPI_DESC_TYPE_PARSER:
-					acpi_os_printf ("parse_obj aml_opcode %04hX",
+					acpi_os_printf ("aml_opcode %04hX",
 							descriptor->op.asl.aml_opcode);
 					break;
 
 				case ACPI_DESC_TYPE_NAMED:
-					acpi_os_printf ("Node %4.4s",
-							descriptor->node.name.ascii);
-					break;
-
-				case ACPI_DESC_TYPE_STATE:
-					acpi_os_printf ("Untyped state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_UPDATE:
-					acpi_os_printf ("UPDATE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_PACKAGE:
-					acpi_os_printf ("PACKAGE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_CONTROL:
-					acpi_os_printf ("CONTROL state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_RPSCOPE:
-					acpi_os_printf ("ROOT-PARSE-SCOPE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_PSCOPE:
-					acpi_os_printf ("PARSE-SCOPE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_WSCOPE:
-					acpi_os_printf ("WALK-SCOPE state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_RESULT:
-					acpi_os_printf ("RESULT state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_NOTIFY:
-					acpi_os_printf ("NOTIFY state_obj");
-					break;
-
-				case ACPI_DESC_TYPE_STATE_THREAD:
-					acpi_os_printf ("THREAD state_obj");
+					acpi_os_printf ("%4.4s",
+							acpi_ut_get_node_name (&descriptor->node));
 					break;
 
 				default:
-					/* All types should appear above */
 					break;
 				}
 
diff -puN drivers/acpi/utilities/utdebug.c~acpi drivers/acpi/utilities/utdebug.c
--- 25/drivers/acpi/utilities/utdebug.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/utilities/utdebug.c	2004-01-22 22:42:01.000000000 -0800
@@ -447,7 +447,7 @@ acpi_ut_value_exit (
 
 	acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
 			"%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str,
-			ACPI_HIDWORD (value), ACPI_LODWORD (value));
+			ACPI_FORMAT_UINT64 (value));
 
 	acpi_gbl_nesting_level--;
 }
diff -puN drivers/acpi/utilities/utdelete.c~acpi drivers/acpi/utilities/utdelete.c
--- 25/drivers/acpi/utilities/utdelete.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/utilities/utdelete.c	2004-01-22 22:42:01.000000000 -0800
@@ -140,7 +140,7 @@ acpi_ut_delete_internal_obj (
 
 		/* Walk the handler list for this device */
 
-		handler_desc = object->device.address_space;
+		handler_desc = object->device.handler;
 		while (handler_desc) {
 			next_desc = handler_desc->address_space.next;
 			acpi_ut_remove_reference (handler_desc);
@@ -193,7 +193,7 @@ acpi_ut_delete_internal_obj (
 			 * default handlers -- and therefore, we created the context object
 			 * locally, it was not created by an external caller.
 			 */
-			handler_desc = object->region.address_space;
+			handler_desc = object->region.handler;
 			if (handler_desc) {
 				if (handler_desc->address_space.hflags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) {
 					obj_pointer = second_desc->extra.region_context;
diff -puN drivers/acpi/utilities/uteval.c~acpi drivers/acpi/utilities/uteval.c
--- 25/drivers/acpi/utilities/uteval.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/utilities/uteval.c	2004-01-22 22:42:01.000000000 -0800
@@ -91,7 +91,7 @@ acpi_ut_evaluate_object (
 	if (ACPI_FAILURE (status)) {
 		if (status == AE_NOT_FOUND) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s.%s] was not found\n",
-				prefix_node->name.ascii, path));
+				acpi_ut_get_node_name (prefix_node), path));
 		}
 		else {
 			ACPI_REPORT_METHOD_ERROR ("Method execution failed",
@@ -544,7 +544,7 @@ acpi_ut_execute_STA (
 		if (AE_NOT_FOUND == status) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
 				"_STA on %4.4s was not found, assuming device is present\n",
-				device_node->name.ascii));
+				acpi_ut_get_node_name (device_node)));
 
 			*flags = 0x0F;
 			status = AE_OK;
diff -puN drivers/acpi/utilities/utglobal.c~acpi drivers/acpi/utilities/utglobal.c
--- 25/drivers/acpi/utilities/utglobal.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/utilities/utglobal.c	2004-01-22 22:42:01.000000000 -0800
@@ -358,7 +358,7 @@ struct acpi_fixed_event_info        acpi
 	/* ACPI_EVENT_GLOBAL        */  {ACPI_BITREG_GLOBAL_LOCK_STATUS,    ACPI_BITREG_GLOBAL_LOCK_ENABLE,  ACPI_BITMASK_GLOBAL_LOCK_STATUS,    ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
 	/* ACPI_EVENT_POWER_BUTTON  */  {ACPI_BITREG_POWER_BUTTON_STATUS,   ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
 	/* ACPI_EVENT_SLEEP_BUTTON  */  {ACPI_BITREG_SLEEP_BUTTON_STATUS,   ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
-	/* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     0,                                  0},
+	/* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     ACPI_BITMASK_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_ENABLE},
 };
 
 /*****************************************************************************
@@ -534,6 +534,99 @@ acpi_ut_get_object_type_name (
 }
 
 
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ut_get_node_name
+ *
+ * PARAMETERS:  Object               - A namespace node
+ *
+ * RETURN:      Pointer to a string
+ *
+ * DESCRIPTION: Validate the node and return the node's ACPI name.
+ *
+ ****************************************************************************/
+
+char *
+acpi_ut_get_node_name (
+	void                            *object)
+{
+	struct acpi_namespace_node      *node;
+
+
+	if (!object)
+	{
+		return ("NULL NODE");
+	}
+
+	node = (struct acpi_namespace_node *) object;
+
+	if (node->descriptor != ACPI_DESC_TYPE_NAMED)
+	{
+		return ("****");
+	}
+
+	if (!acpi_ut_valid_acpi_name (* (u32 *) node->name.ascii))
+	{
+		return ("----");
+	}
+
+	return (node->name.ascii);
+}
+
+
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ut_get_descriptor_name
+ *
+ * PARAMETERS:  Object               - An ACPI object
+ *
+ * RETURN:      Pointer to a string
+ *
+ * DESCRIPTION: Validate object and return the descriptor type
+ *
+ ****************************************************************************/
+
+static const char                   *acpi_gbl_desc_type_names[] = /* printable names of descriptor types */
+{
+	/* 00 */ "Invalid",
+	/* 01 */ "Cached",
+	/* 02 */ "State-Generic",
+	/* 03 */ "State-Update",
+	/* 04 */ "State-Package",
+	/* 05 */ "State-Control",
+	/* 06 */ "State-root_parse_scope",
+	/* 07 */ "State-parse_scope",
+	/* 08 */ "State-walk_scope",
+	/* 09 */ "State-Result",
+	/* 10 */ "State-Notify",
+	/* 11 */ "State-Thread",
+	/* 12 */ "Walk",
+	/* 13 */ "Parser",
+	/* 14 */ "Operand",
+	/* 15 */ "Node"
+};
+
+
+char *
+acpi_ut_get_descriptor_name (
+	void                            *object)
+{
+
+	if (!object)
+	{
+		return ("NULL OBJECT");
+	}
+
+	if (ACPI_GET_DESCRIPTOR_TYPE (object) > ACPI_DESC_TYPE_MAX)
+	{
+		return ((char *) acpi_gbl_bad_type);
+	}
+
+	return ((char *) acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE (object)]);
+
+}
+
+
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 /*
  * Strings and procedures used for debug only
diff -puN drivers/acpi/utilities/utobject.c~acpi drivers/acpi/utilities/utobject.c
--- 25/drivers/acpi/utilities/utobject.c~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/drivers/acpi/utilities/utobject.c	2004-01-22 22:42:01.000000000 -0800
@@ -223,29 +223,10 @@ acpi_ut_valid_internal_object (
 
 		return (TRUE);
 
-	case ACPI_DESC_TYPE_NAMED:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-			"**** Obj %p is a named obj, not ACPI obj\n", object));
-		break;
-
-	case ACPI_DESC_TYPE_PARSER:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-			"**** Obj %p is a parser obj, not ACPI obj\n", object));
-		break;
-
-	case ACPI_DESC_TYPE_CACHED:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"**** Obj %p has already been released to internal cache\n", object));
-		break;
-
 	default:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"**** Obj %p has unknown descriptor type %X\n", object,
-			ACPI_GET_DESCRIPTOR_TYPE (object)));
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+				"%p is not not an ACPI operand obj [%s]\n",
+				object, acpi_ut_get_descriptor_name (object)));
 		break;
 	}
 
@@ -322,7 +303,8 @@ acpi_ut_delete_object_desc (
 
 	if (ACPI_GET_DESCRIPTOR_TYPE (object) != ACPI_DESC_TYPE_OPERAND) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"Obj %p is not an ACPI object\n", object));
+				"%p is not an ACPI Operand object [%s]\n", object,
+				acpi_ut_get_descriptor_name (object)));
 		return_VOID;
 	}
 
diff -puN include/acpi/acconfig.h~acpi include/acpi/acconfig.h
--- 25/include/acpi/acconfig.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/acpi/acconfig.h	2004-01-22 22:42:01.000000000 -0800
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20031002
+#define ACPI_CA_VERSION                 0x20031203
 
 /* Maximum objects in the various object caches */
 
diff -puN include/acpi/acevents.h~acpi include/acpi/acevents.h
--- 25/include/acpi/acevents.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/acpi/acevents.h	2004-01-22 22:42:01.000000000 -0800
@@ -182,6 +182,17 @@ acpi_ev_detach_region (
 	union acpi_operand_object      *region_obj,
 	u8                              acpi_ns_is_locked);
 
+acpi_status
+acpi_ev_execute_reg_method (
+	union acpi_operand_object      *region_obj,
+	u32                             function);
+
+acpi_status
+acpi_ev_reg_run (
+	acpi_handle                     obj_handle,
+	u32                             level,
+	void                            *context,
+	void                            **return_value);
 
 /*
  * Evregini - Region initialization and setup
diff -puN include/acpi/acglobal.h~acpi include/acpi/acglobal.h
--- 25/include/acpi/acglobal.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/acpi/acglobal.h	2004-01-22 22:42:01.000000000 -0800
@@ -106,6 +106,9 @@ ACPI_EXTERN struct acpi_common_facs     
 ACPI_EXTERN u8                                  acpi_gbl_integer_bit_width;
 ACPI_EXTERN u8                                  acpi_gbl_integer_byte_width;
 ACPI_EXTERN u8                                  acpi_gbl_integer_nybble_width;
+
+/* Keep local copies of these FADT-based registers */
+
 ACPI_EXTERN struct acpi_generic_address         acpi_gbl_xpm1a_enable;
 ACPI_EXTERN struct acpi_generic_address         acpi_gbl_xpm1b_enable;
 
diff -puN include/acpi/acmacros.h~acpi include/acpi/acmacros.h
--- 25/include/acpi/acmacros.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/acpi/acmacros.h	2004-01-22 22:42:01.000000000 -0800
@@ -48,7 +48,6 @@
 /*
  * Data manipulation macros
  */
-
 #define ACPI_LOWORD(l)                  ((u16)(u32)(l))
 #define ACPI_HIWORD(l)                  ((u16)((((u32)(l)) >> 16) & 0xFFFF))
 #define ACPI_LOBYTE(l)                  ((u8)(u16)(l))
@@ -94,10 +93,18 @@
 #endif
 #endif
 
- /*
-  * Extract a byte of data using a pointer.  Any more than a byte and we
-  * get into potential aligment issues -- see the STORE macros below
-  */
+/*
+ * printf() format helpers
+ */
+
+/* Split 64-bit integer into two 32-bit values. use with %8,8_x%8.8X */
+
+#define ACPI_FORMAT_UINT64(i)           ACPI_HIDWORD(i),ACPI_LODWORD(i)
+
+/*
+ * Extract a byte of data using a pointer.  Any more than a byte and we
+ * get into potential aligment issues -- see the STORE macros below
+ */
 #define ACPI_GET8(addr)                 (*(u8*)(addr))
 
 /* Pointer arithmetic */
@@ -129,7 +136,6 @@
  * If the hardware supports the transfer of unaligned data, just do the store.
  * Otherwise, we have to move one byte at a time.
  */
-
 #ifdef ACPI_BIG_ENDIAN
 /*
  * Macros for big-endian machines
@@ -299,7 +305,6 @@
 /*
  * Fast power-of-two math macros for non-optimized compilers
  */
-
 #define _ACPI_DIV(value,power_of2)      ((u32) ((value) >> (power_of2)))
 #define _ACPI_MUL(value,power_of2)      ((u32) ((value) << (power_of2)))
 #define _ACPI_MOD(value,divisor)        ((u32) ((value) & ((divisor) -1)))
@@ -443,7 +448,6 @@
 /*
  * Reporting macros that are never compiled out
  */
-
 #define ACPI_PARAM_LIST(pl)                 pl
 
 /*
@@ -451,7 +455,6 @@
  * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only
  * use it in debug mode.
  */
-
 #ifdef ACPI_DEBUG_OUTPUT
 
 #define ACPI_REPORT_INFO(fp)                {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \
@@ -490,7 +493,6 @@
 /*
  * Debug macros that are conditionally compiled
  */
-
 #ifdef ACPI_DEBUG_OUTPUT
 
 #define ACPI_MODULE_NAME(name)               static char ACPI_UNUSED_VAR *_THIS_MODULE = name;
@@ -500,7 +502,6 @@
  * The first parameter should be the procedure name as a quoted string.  This is declared
  * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
  */
-
 #define ACPI_FUNCTION_NAME(a)               struct acpi_debug_print_info _dbg; \
 												_dbg.component_id = _COMPONENT; \
 												_dbg.proc_name   = a; \
@@ -562,7 +563,6 @@
 /*
  * Generate INT3 on ACPI_ERROR (Debug only!)
  */
-
 #define ACPI_ERROR_BREAK
 #ifdef  ACPI_ERROR_BREAK
 #define ACPI_BREAK_ON_ERROR(lvl)        if ((lvl)&ACPI_ERROR) \
@@ -577,7 +577,6 @@
  *    1) Debug print for the current component is enabled
  *    2) Debug error level or trace level for the print statement is enabled
  */
-
 #define ACPI_DEBUG_PRINT(pl)            acpi_ut_debug_print ACPI_PARAM_LIST(pl)
 #define ACPI_DEBUG_PRINT_RAW(pl)        acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl)
 
@@ -587,7 +586,6 @@
  * This is the non-debug case -- make everything go away,
  * leaving no executable debug code!
  */
-
 #define ACPI_MODULE_NAME(name)
 #define _THIS_MODULE ""
 
@@ -662,7 +660,6 @@
 /*
  * Memory allocation tracking (DEBUG ONLY)
  */
-
 #ifndef ACPI_DBG_TRACK_ALLOCATIONS
 
 /* Memory allocation */
diff -puN include/acpi/acobject.h~acpi include/acpi/acobject.h
--- 25/include/acpi/acobject.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/acpi/acobject.h	2004-01-22 22:42:01.000000000 -0800
@@ -114,7 +114,7 @@
 #define ACPI_COMMON_NOTIFY_INFO \
 	union acpi_operand_object               *system_notify;     /* Handler for system notifies */\
 	union acpi_operand_object               *device_notify;     /* Handler for driver notifies */\
-	union acpi_operand_object               *address_space;     /* Handler for Address space */
+	union acpi_operand_object               *handler;           /* Handler for Address space */
 
 
 /******************************************************************************
@@ -214,7 +214,7 @@ struct acpi_object_region
 	ACPI_OBJECT_COMMON_HEADER
 
 	u8                                      space_id;
-	union acpi_operand_object               *address_space;     /* Handler for region access */
+	union acpi_operand_object               *handler;           /* Handler for region access */
 	struct acpi_namespace_node              *node;              /* containing object */
 	union acpi_operand_object               *next;
 	u32                                     length;
@@ -464,21 +464,22 @@ union acpi_operand_object
 
 /* Object descriptor types */
 
-#define ACPI_DESC_TYPE_CACHED           0x11        /* Used only when object is cached */
-#define ACPI_DESC_TYPE_STATE            0x20
-#define ACPI_DESC_TYPE_STATE_UPDATE     0x21
-#define ACPI_DESC_TYPE_STATE_PACKAGE    0x22
-#define ACPI_DESC_TYPE_STATE_CONTROL    0x23
-#define ACPI_DESC_TYPE_STATE_RPSCOPE    0x24
-#define ACPI_DESC_TYPE_STATE_PSCOPE     0x25
-#define ACPI_DESC_TYPE_STATE_WSCOPE     0x26
-#define ACPI_DESC_TYPE_STATE_RESULT     0x27
-#define ACPI_DESC_TYPE_STATE_NOTIFY     0x28
-#define ACPI_DESC_TYPE_STATE_THREAD     0x29
-#define ACPI_DESC_TYPE_WALK             0x44
-#define ACPI_DESC_TYPE_PARSER           0x66
-#define ACPI_DESC_TYPE_OPERAND          0x88
-#define ACPI_DESC_TYPE_NAMED            0xAA
+#define ACPI_DESC_TYPE_CACHED           0x01        /* Used only when object is cached */
+#define ACPI_DESC_TYPE_STATE            0x02
+#define ACPI_DESC_TYPE_STATE_UPDATE     0x03
+#define ACPI_DESC_TYPE_STATE_PACKAGE    0x04
+#define ACPI_DESC_TYPE_STATE_CONTROL    0x05
+#define ACPI_DESC_TYPE_STATE_RPSCOPE    0x06
+#define ACPI_DESC_TYPE_STATE_PSCOPE     0x07
+#define ACPI_DESC_TYPE_STATE_WSCOPE     0x08
+#define ACPI_DESC_TYPE_STATE_RESULT     0x09
+#define ACPI_DESC_TYPE_STATE_NOTIFY     0x0A
+#define ACPI_DESC_TYPE_STATE_THREAD     0x0B
+#define ACPI_DESC_TYPE_WALK             0x0C
+#define ACPI_DESC_TYPE_PARSER           0x0D
+#define ACPI_DESC_TYPE_OPERAND          0x0E
+#define ACPI_DESC_TYPE_NAMED            0x0F
+#define ACPI_DESC_TYPE_MAX              0x0F
 
 
 union acpi_descriptor
diff -puN include/acpi/acpi_drivers.h~acpi include/acpi/acpi_drivers.h
--- 25/include/acpi/acpi_drivers.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/acpi/acpi_drivers.h	2004-01-22 22:42:01.000000000 -0800
@@ -53,10 +53,6 @@
 
 #define ACPI_PCI_COMPONENT		0x00400000
 
-/* ACPI PCI Root Bridge (pci_root.c) */
-
-void acpi_pci_get_translations (struct acpi_pci_id* id, u64* mem_tra, u64* io_tra);
-
 /* ACPI PCI Interrupt Link (pci_link.c) */
 
 int acpi_pci_link_check (void);
diff -puN include/acpi/acutils.h~acpi include/acpi/acutils.h
--- 25/include/acpi/acutils.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/acpi/acutils.h	2004-01-22 22:42:01.000000000 -0800
@@ -125,6 +125,14 @@ acpi_ut_get_type_name (
 	acpi_object_type                type);
 
 char *
+acpi_ut_get_node_name (
+	void                            *object);
+
+char *
+acpi_ut_get_descriptor_name (
+	void                            *object);
+
+char *
 acpi_ut_get_object_type_name (
 	union acpi_operand_object       *obj_desc);
 
diff -puN include/acpi/processor.h~acpi include/acpi/processor.h
--- 25/include/acpi/processor.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/acpi/processor.h	2004-01-22 22:42:01.000000000 -0800
@@ -72,6 +72,8 @@ struct acpi_processor_performance {
 	int			platform_limit;
 	u16			control_register;
 	u16			status_register;
+	u8			control_register_bit_width;
+	u8			status_register_bit_width;
 	int			state_count;
 	struct acpi_processor_px states[ACPI_PROCESSOR_MAX_PERFORMANCE];
 	struct cpufreq_frequency_table freq_table[ACPI_PROCESSOR_MAX_PERFORMANCE];
diff -puN include/asm-i386/acpi.h~acpi include/asm-i386/acpi.h
--- 25/include/asm-i386/acpi.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/asm-i386/acpi.h	2004-01-22 22:42:01.000000000 -0800
@@ -109,7 +109,7 @@
 #ifdef CONFIG_ACPI_BOOT 
 extern int acpi_lapic;
 extern int acpi_ioapic;
-
+extern int acpi_noirq;
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
@@ -139,6 +139,14 @@ static inline void disable_ioapic_setup(
 
 #endif
 
+#ifdef CONFIG_ACPI_PCI
+static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
+extern int acpi_irq_balance_set(char *str);
+#else
+static inline void acpi_noirq_set(void) { }
+static inline int acpi_irq_balance_set(char *str) { return 0; }
+#endif
+
 #ifdef CONFIG_ACPI_SLEEP
 
 /* routines for saving/restoring kernel state */
diff -puN include/asm-i386/system.h~acpi include/asm-i386/system.h
--- 25/include/asm-i386/system.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/asm-i386/system.h	2004-01-22 22:42:01.000000000 -0800
@@ -470,6 +470,7 @@ void enable_hlt(void);
 
 extern unsigned long dmi_broken;
 extern int is_sony_vaio_laptop;
+extern int es7000_plat;
 
 #define BROKEN_ACPI_Sx		0x0001
 #define BROKEN_INIT_AFTER_S1	0x0002
diff -puN include/asm-x86_64/acpi.h~acpi include/asm-x86_64/acpi.h
--- 25/include/asm-x86_64/acpi.h~acpi	2004-01-22 22:42:00.000000000 -0800
+++ 25-akpm/include/asm-x86_64/acpi.h	2004-01-22 22:42:01.000000000 -0800
@@ -100,25 +100,26 @@ __acpi_release_global_lock (unsigned int
         :"0"(n_hi), "1"(n_lo))
 
 
-#ifndef CONFIG_ACPI_BOOT
-#define acpi_lapic 0
-#define acpi_ioapic 0
-#else
-#ifdef CONFIG_X86_LOCAL_APIC
+#ifdef CONFIG_ACPI_BOOT
 extern int acpi_lapic;
-#else
-#define acpi_lapic 0
-#endif
-#ifdef CONFIG_X86_IO_APIC
 extern int acpi_ioapic;
-#else
-#define acpi_ioapic 0
-#endif
+extern int acpi_noirq;
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
 
-#endif /*CONFIG_ACPI_BOOT*/
+#else	/* !CONFIG_ACPI_BOOT */
+#define acpi_lapic 0
+#define acpi_ioapic 0
+#endif /* !CONFIG_ACPI_BOOT */
+
+#ifdef CONFIG_ACPI_PCI
+static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
+extern int acpi_irq_balance_set(char *str);
+#else
+static inline void acpi_noirq_set(void) { }
+static inline int acpi_irq_balance_set(char *str) { return 0; }
+#endif
 
 #ifdef CONFIG_ACPI_SLEEP
 

_