diff -Naur -X /root/bin/dontdiff a/arch/i386/config.in b/arch/i386/config.in
--- a/arch/i386/config.in	2003-01-25 01:25:29.000000000 -0800
+++ b/arch/i386/config.in	2003-01-25 01:30:16.000000000 -0800
@@ -317,14 +317,6 @@
 
 bool 'Power Management support' CONFIG_PM
 
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-   dep_bool '  ACPI support' CONFIG_ACPI $CONFIG_PM
-   
-   if [ "$CONFIG_ACPI" != "n" ]; then
-      source drivers/acpi/Config.in
-   fi
-fi
-
 dep_tristate '  Advanced Power Management BIOS support' CONFIG_APM $CONFIG_PM
 if [ "$CONFIG_APM" != "n" ]; then
    bool '    Ignore USER SUSPEND' CONFIG_APM_IGNORE_USER_SUSPEND
@@ -336,6 +328,8 @@
    bool '    Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF
 fi
 
+source drivers/acpi/Config.in
+
 endmenu
 
 source drivers/mtd/Config.in
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c
--- a/arch/i386/kernel/acpi.c	1969-12-31 16:00:00.000000000 -0800
+++ b/arch/i386/kernel/acpi.c	2003-01-25 01:30:14.000000000 -0800
@@ -0,0 +1,578 @@
+/*
+ *  acpi.c - Architecture-Specific Low-Level ACPI Support
+ *
+ *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *  Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
+ *  Copyright (C) 2001 Patrick Mochel <mochel@osdl.org>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/stddef.h>
+#include <linux/slab.h>
+#include <linux/pci.h>
+#include <linux/bootmem.h>
+#include <linux/irq.h>
+#include <linux/acpi.h>
+#include <asm/mpspec.h>
+#include <asm/io.h>
+#include <asm/apic.h>
+#include <asm/apicdef.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
+#include <asm/io_apic.h>
+#include <asm/acpi.h>
+#include <asm/save_state.h>
+
+
+#define PREFIX			"ACPI: "
+
+extern int acpi_disabled;
+
+/* --------------------------------------------------------------------------
+                              Boot-time Configuration
+   -------------------------------------------------------------------------- */
+
+#ifdef CONFIG_ACPI_BOOT
+
+enum acpi_irq_model_id		acpi_irq_model;
+
+
+/*
+ * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
+ * to map the target physical address. The problem is that set_fixmap()
+ * provides a single page, and it is possible that the page is not
+ * sufficient.
+ * By using this area, we can map up to MAX_IO_APICS pages temporarily,
+ * i.e. until the next __va_range() call.
+ *
+ * Important Safety Note:  The fixed I/O APIC page numbers are *subtracted*
+ * from the fixed base.  That's why we start at FIX_IO_APIC_BASE_END and
+ * count idx down while incrementing the phys address.
+ */
+char *__acpi_map_table(unsigned long phys, unsigned long size)
+{
+	unsigned long base, offset, mapped_size;
+	int idx;
+
+	if (phys + size < 8*1024*1024) 
+		return __va(phys); 
+
+	offset = phys & (PAGE_SIZE - 1);
+	mapped_size = PAGE_SIZE - offset;
+	set_fixmap(FIX_ACPI_END, phys);
+	base = fix_to_virt(FIX_ACPI_END);
+
+	/*
+	 * Most cases can be covered by the below.
+	 */
+	idx = FIX_ACPI_END;
+	while (mapped_size < size) {
+		if (--idx < FIX_ACPI_BEGIN)
+			return 0;	/* cannot handle this */
+		phys += PAGE_SIZE;
+		set_fixmap(idx, phys);
+		mapped_size += PAGE_SIZE;
+	}
+
+	return ((unsigned char *) base + offset);
+}
+
+
+#ifdef CONFIG_X86_LOCAL_APIC
+
+int acpi_lapic;
+
+static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
+
+
+static int __init
+acpi_parse_madt (
+	unsigned long		phys_addr,
+	unsigned long		size)
+{
+	struct acpi_table_madt	*madt = NULL;
+
+	if (!phys_addr || !size)
+		return -EINVAL;
+
+	madt = (struct acpi_table_madt *) __acpi_map_table(phys_addr, size);
+	if (!madt) {
+		printk(KERN_WARNING PREFIX "Unable to map MADT\n");
+		return -ENODEV;
+	}
+
+	if (madt->lapic_address)
+		acpi_lapic_addr = (u64) madt->lapic_address;
+
+	printk(KERN_INFO PREFIX "Local APIC address 0x%08x\n",
+		madt->lapic_address);
+
+	return 0;
+}
+
+
+static int __init
+acpi_parse_lapic (
+	acpi_table_entry_header *header)
+{
+	struct acpi_table_lapic	*processor = NULL;
+
+	processor = (struct acpi_table_lapic*) header;
+	if (!processor)
+		return -EINVAL;
+
+	acpi_table_print_madt_entry(header);
+
+	mp_register_lapic (
+		processor->id,					   /* APIC ID */
+		processor->flags.enabled);			  /* Enabled? */
+
+	return 0;
+}
+
+
+static int __init
+acpi_parse_lapic_addr_ovr (
+	acpi_table_entry_header *header)
+{
+	struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL;
+
+	lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr*) header;
+	if (!lapic_addr_ovr)
+		return -EINVAL;
+
+	acpi_lapic_addr = lapic_addr_ovr->address;
+
+	return 0;
+}
+
+#ifndef CONFIG_ACPI_HT_ONLY
+
+static int __init
+acpi_parse_lapic_nmi (
+	acpi_table_entry_header *header)
+{
+	struct acpi_table_lapic_nmi *lapic_nmi = NULL;
+
+	lapic_nmi = (struct acpi_table_lapic_nmi*) header;
+	if (!lapic_nmi)
+		return -EINVAL;
+
+	acpi_table_print_madt_entry(header);
+
+	if (lapic_nmi->lint != 1)
+		printk(KERN_WARNING PREFIX "NMI not connected to LINT 1!\n");
+
+	return 0;
+}
+
+#endif /*CONFIG_ACPI_HT_ONLY*/
+
+#endif /*CONFIG_X86_LOCAL_APIC*/
+
+#ifdef CONFIG_X86_IO_APIC
+
+int acpi_ioapic;
+
+#ifndef CONFIG_ACPI_HT_ONLY
+
+static int __init
+acpi_parse_ioapic (
+	acpi_table_entry_header *header)
+{
+	struct acpi_table_ioapic *ioapic = NULL;
+
+	ioapic = (struct acpi_table_ioapic*) header;
+	if (!ioapic)
+		return -EINVAL;
+ 
+	acpi_table_print_madt_entry(header);
+
+	mp_register_ioapic (
+		ioapic->id,
+		ioapic->address,
+		ioapic->global_irq_base);
+ 
+	return 0;
+}
+
+
+static int __init
+acpi_parse_int_src_ovr (
+	acpi_table_entry_header *header)
+{
+	struct acpi_table_int_src_ovr *intsrc = NULL;
+
+	intsrc = (struct acpi_table_int_src_ovr*) header;
+	if (!intsrc)
+		return -EINVAL;
+
+	acpi_table_print_madt_entry(header);
+
+	mp_override_legacy_irq (
+		intsrc->bus_irq,
+		intsrc->flags.polarity,
+		intsrc->flags.trigger,
+		intsrc->global_irq);
+
+	return 0;
+}
+
+
+static int __init
+acpi_parse_nmi_src (
+	acpi_table_entry_header *header)
+{
+	struct acpi_table_nmi_src *nmi_src = NULL;
+
+	nmi_src = (struct acpi_table_nmi_src*) header;
+	if (!nmi_src)
+		return -EINVAL;
+
+	acpi_table_print_madt_entry(header);
+
+	/* TBD: Support nimsrc entries? */
+
+	return 0;
+}
+
+#endif /*!CONFIG_ACPI_HT_ONLY*/ 
+#endif /*CONFIG_X86_IO_APIC*/
+
+
+static unsigned long __init
+acpi_scan_rsdp (
+	unsigned long		start,
+	unsigned long		length)
+{
+	unsigned long		offset = 0;
+	unsigned long		sig_len = sizeof("RSD PTR ") - 1;
+
+	/*
+	 * Scan all 16-byte boundaries of the physical memory region for the
+	 * RSDP signature.
+	 */
+	for (offset = 0; offset < length; offset += 16) {
+		if (strncmp((char *) (start + offset), "RSD PTR ", sig_len))
+			continue;
+		return (start + offset);
+	}
+
+	return 0;
+}
+
+
+unsigned long __init
+acpi_find_rsdp (void)
+{
+	unsigned long		rsdp_phys = 0;
+
+	/*
+	 * Scan memory looking for the RSDP signature. First search EBDA (low
+	 * memory) paragraphs and then search upper memory (E0000-FFFFF).
+	 */
+	rsdp_phys = acpi_scan_rsdp (0, 0x400);
+	if (!rsdp_phys)
+		rsdp_phys = acpi_scan_rsdp (0xE0000, 0xFFFFF);
+
+	return rsdp_phys;
+}
+
+
+int __init
+acpi_boot_init (void)
+{
+	int			result = 0;
+
+	/*
+	 * The default interrupt routing model is PIC (8259).  This gets
+	 * overriden if IOAPICs are enumerated (below).
+	 */
+	acpi_irq_model = ACPI_IRQ_MODEL_PIC;
+
+	/* 
+	 * Initialize the ACPI boot-time table parser.
+	 */
+	result = acpi_table_init();
+	if (result)
+		return result;
+
+	result = acpi_blacklisted();
+	if (result) {
+		acpi_disabled = 1;
+		return result;
+	}
+	else
+		printk(KERN_NOTICE PREFIX "BIOS passes blacklist\n");
+
+#ifdef CONFIG_X86_LOCAL_APIC
+
+	/* 
+	 * MADT
+	 * ----
+	 * Parse the Multiple APIC Description Table (MADT), if exists.
+	 * Note that this table provides platform SMP configuration 
+	 * information -- the successor to MPS tables.
+	 */
+
+	result = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
+	if (!result) {
+		printk(KERN_WARNING PREFIX "MADT not present\n");
+		return 0;
+	}
+	else if (result < 0) {
+		printk(KERN_ERR PREFIX "Error parsing MADT\n");
+		return result;
+	}
+	else if (result > 1) 
+		printk(KERN_WARNING PREFIX "Multiple MADT tables exist\n");
+
+	/* 
+	 * Local APIC
+	 * ----------
+	 * Note that the LAPIC address is obtained from the MADT (32-bit value)
+	 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
+	 */
+
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr);
+	if (result < 0) {
+		printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
+		return result;
+	}
+
+	mp_register_lapic_address(acpi_lapic_addr);
+
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic);
+	if (!result) { 
+		printk(KERN_ERR PREFIX "No LAPIC entries present\n");
+		/* TBD: Cleanup to allow fallback to MPS */
+		return -ENODEV;
+	}
+	else if (result < 0) {
+		printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
+		/* TBD: Cleanup to allow fallback to MPS */
+		return result;
+	}
+
+#ifndef CONFIG_ACPI_HT_ONLY
+	result = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi);
+	if (result < 0) {
+		printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
+		/* TBD: Cleanup to allow fallback to MPS */
+		return result;
+	}
+#endif /*!CONFIG_ACPI_HT_ONLY*/
+
+	acpi_lapic = 1;
+
+#endif /*CONFIG_X86_LOCAL_APIC*/
+
+#ifdef CONFIG_X86_IO_APIC
+#ifndef CONFIG_ACPI_HT_ONLY
+
+	/* 
+	 * I/O APIC 
+	 * --------
+	 */
+
+	result = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic);
+	if (!result) { 
+		printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
+		return -ENODEV;
+	}
+	else if (result < 0) {
+		printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n");
+		return result;
+	}
+
+	/* Build a default routing table for legacy (ISA) interrupts. */
+	mp_config_acpi_legacy_irqs();
+
+	result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr);
+	if (result < 0) {
+		printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
+		/* TBD: Cleanup to allow fallback to MPS */
+		return result;
+	}
+
+	result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src);
+	if (result < 0) {
+		printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
+		/* TBD: Cleanup to allow fallback to MPS */
+		return result;
+	}
+
+	acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
+
+	acpi_ioapic = 1;
+
+#endif /*!CONFIG_ACPI_HT_ONLY*/
+#endif /*CONFIG_X86_IO_APIC*/
+
+#ifdef CONFIG_X86_LOCAL_APIC
+	if (acpi_lapic && acpi_ioapic)
+		smp_found_config = 1;
+#endif
+
+	return 0;
+}
+
+#endif /*CONFIG_ACPI_BOOT*/
+
+
+/* --------------------------------------------------------------------------
+                              Low-Level Sleep Support
+   -------------------------------------------------------------------------- */
+
+#ifdef CONFIG_ACPI_SLEEP
+
+#define DEBUG
+
+#ifdef DEBUG
+#include <linux/serial.h>
+#endif
+
+/* address in low memory of the wakeup routine. */
+unsigned long acpi_wakeup_address = 0;
+
+/* new page directory that we will be using */
+static pmd_t *pmd;
+
+/* saved page directory */
+static pmd_t saved_pmd;
+
+/* page which we'll use for the new page directory */
+static pte_t *ptep;
+
+extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
+
+/*
+ * acpi_create_identity_pmd
+ *
+ * Create a new, identity mapped pmd.
+ *
+ * Do this by creating new page directory, and marking all the pages as R/W
+ * Then set it as the new Page Middle Directory.
+ * And, of course, flush the TLB so it takes effect.
+ *
+ * We save the address of the old one, for later restoration.
+ */
+static void acpi_create_identity_pmd (void)
+{
+	pgd_t *pgd;
+	int i;
+
+	ptep = (pte_t*)__get_free_page(GFP_KERNEL);
+
+	/* fill page with low mapping */
+	for (i = 0; i < PTRS_PER_PTE; i++)
+		set_pte(ptep + i, mk_pte_phys(i << PAGE_SHIFT, PAGE_SHARED));
+
+	pgd = pgd_offset(current->active_mm, 0);
+	pmd = pmd_alloc(current->mm,pgd, 0);
+
+	/* save the old pmd */
+	saved_pmd = *pmd;
+
+	/* set the new one */
+	set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(ptep)));
+
+	/* flush the TLB */
+	local_flush_tlb();
+}
+
+/*
+ * acpi_restore_pmd
+ *
+ * Restore the old pmd saved by acpi_create_identity_pmd and
+ * free the page that said function alloc'd
+ */
+static void acpi_restore_pmd (void)
+{
+	set_pmd(pmd, saved_pmd);
+	local_flush_tlb();
+	free_page((unsigned long)ptep);
+}
+
+/**
+ * acpi_save_state_mem - save kernel state
+ *
+ * Create an identity mapped page table and copy the wakeup routine to
+ * low memory.
+ */
+int acpi_save_state_mem (void)
+{
+	acpi_create_identity_pmd();
+	acpi_copy_wakeup_routine(acpi_wakeup_address);
+
+	return 0;
+}
+
+/**
+ * acpi_save_state_disk - save kernel state to disk
+ *
+ */
+int acpi_save_state_disk (void)
+{
+	return 1;
+}
+
+/*
+ * acpi_restore_state
+ */
+void acpi_restore_state_mem (void)
+{
+	acpi_restore_pmd();
+}
+
+/**
+ * acpi_reserve_bootmem - do _very_ early ACPI initialisation
+ *
+ * We allocate a page in low memory for the wakeup
+ * routine for when we come back from a sleep state. The
+ * runtime allocator allows specification of <16M pages, but not
+ * <1M pages.
+ */
+void __init acpi_reserve_bootmem(void)
+{
+	acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
+	printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
+}
+
+void do_suspend_lowlevel_s4bios(int resume)
+{
+	if (!resume) {
+		save_processor_context();
+		acpi_save_register_state((unsigned long)&&acpi_sleep_done);
+		acpi_enter_sleep_state_s4bios();
+		return;
+	}
+acpi_sleep_done:
+	restore_processor_context();
+}
+
+
+#endif /*CONFIG_ACPI_SLEEP*/
+
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/acpitable.c b/arch/i386/kernel/acpitable.c
--- a/arch/i386/kernel/acpitable.c	2003-01-25 01:26:27.000000000 -0800
+++ b/arch/i386/kernel/acpitable.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,554 +0,0 @@
-/*
- *  acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
- *
- *  Copyright (C) 1999 Andrew Henroid
- *  Copyright (C) 2001 Richard Schaal
- *  Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
- *  Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
- *  Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * $Id: acpitable.c,v 1.7 2001/11/04 12:21:18 fenrus Exp $
- */
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/stddef.h>
-#include <linux/slab.h>
-#include <linux/pci.h>
-#include <asm/mpspec.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/apicdef.h>
-#include <asm/page.h>
-#include <asm/pgtable.h>
-
-#include "acpitable.h"
-
-static acpi_table_handler acpi_boot_ops[ACPI_TABLE_COUNT];
-
-
-static unsigned char __init
-acpi_checksum(void *buffer, int length)
-{
-	int i;
-	unsigned char *bytebuffer;
-	unsigned char sum = 0;
-
-	if (!buffer || length <= 0)
-		return 0;
-
-	bytebuffer = (unsigned char *) buffer;
-
-	for (i = 0; i < length; i++)
-		sum += *(bytebuffer++);
-
-	return sum;
-}
-
-static void __init
-acpi_print_table_header(acpi_table_header * header)
-{
-	if (!header)
-		return;
-
-	printk(KERN_INFO "ACPI table found: %.4s v%d [%.6s %.8s %d.%d]\n",
-	       header->signature, header->revision, header->oem_id,
-	       header->oem_table_id, header->oem_revision >> 16,
-	       header->oem_revision & 0xffff);
-
-	return;
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_tb_scan_memory_for_rsdp
- *
- * PARAMETERS:  address       - Starting pointer for search
- *              length        - Maximum length to search
- *
- * RETURN:      Pointer to the RSDP if found and valid, otherwise NULL.
- *
- * DESCRIPTION: Search a block of memory for the RSDP signature
- *
- ******************************************************************************/
-
-static void *__init
-acpi_tb_scan_memory_for_rsdp(void *address, int length)
-{
-	u32 offset;
-
-	if (length <= 0)
-		return NULL;
-
-	/* Search from given start addr for the requested length  */
-
-	offset = 0;
-
-	while (offset < length) {
-		/* The signature must match and the checksum must be correct */
-		if (strncmp(address, RSDP_SIG, sizeof(RSDP_SIG) - 1) == 0 &&
-		    acpi_checksum(address, RSDP_CHECKSUM_LENGTH) == 0) {
-			/* If so, we have found the RSDP */
-			printk(KERN_INFO "ACPI: RSDP located at physical address %p\n",
-			       address);
-			return address;
-		}
-		offset += RSDP_SCAN_STEP;
-		address += RSDP_SCAN_STEP;
-	}
-
-	/* Searched entire block, no RSDP was found */
-	printk(KERN_INFO "ACPI: Searched entire block, no RSDP was found.\n");
-	return NULL;
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_find_root_pointer
- *
- * PARAMETERS:  none
- *
- * RETURN:      physical address of the RSDP 
- *
- * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor
- *              pointer structure.  If it is found, set *RSDP to point to it.
- *
- *              NOTE: The RSDP must be either in the first 1_k of the Extended
- *              BIOS Data Area or between E0000 and FFFFF (ACPI 1.0 section
- *              5.2.2; assertion #421).
- *
- ******************************************************************************/
-
-static struct acpi_table_rsdp * __init
-acpi_find_root_pointer(void)
-{
-	struct acpi_table_rsdp * rsdp;
-
-	/*
-	 * Physical address is given
-	 */
-	/*
-	 * Region 1) Search EBDA (low memory) paragraphs
-	 */
-	rsdp = acpi_tb_scan_memory_for_rsdp(__va(LO_RSDP_WINDOW_BASE),
-					 LO_RSDP_WINDOW_SIZE);
-
-	if (rsdp)
-		return rsdp;
-
-	/*
-	 * Region 2) Search upper memory: 16-byte boundaries in E0000h-F0000h
-	 */
-	rsdp = acpi_tb_scan_memory_for_rsdp(__va(HI_RSDP_WINDOW_BASE),
-					       HI_RSDP_WINDOW_SIZE);
-
-	
-					     
-	if (rsdp)
-		return rsdp;
-
-	printk(KERN_ERR "ACPI: System description tables not found\n");
-	return NULL;
-}
-
-
-/*
- * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
- * to map the target physical address. The problem is that set_fixmap()
- * provides a single page, and it is possible that the page is not
- * sufficient.
- * By using this area, we can map up to MAX_IO_APICS pages temporarily,
- * i.e. until the next __va_range() call.
- *
- * Important Safety Note:  The fixed I/O APIC page numbers are *subtracted*
- * from the fixed base.  That's why we start at FIX_IO_APIC_BASE_END and
- * count idx down while incrementing the phys address.
- */
-static __init char *
-__va_range(unsigned long phys, unsigned long size)
-{
-	unsigned long base, offset, mapped_size;
-	int idx;
-
-	offset = phys & (PAGE_SIZE - 1);
-	mapped_size = PAGE_SIZE - offset;
-	set_fixmap(FIX_IO_APIC_BASE_END, phys);
-	base = fix_to_virt(FIX_IO_APIC_BASE_END);
-	dprintk("__va_range(0x%lx, 0x%lx): idx=%d mapped at %lx\n", phys, size,
-		FIX_IO_APIC_BASE_END, base);
-
-	/*
-	 * Most cases can be covered by the below.
-	 */
-	idx = FIX_IO_APIC_BASE_END;
-	while (mapped_size < size) {
-		if (--idx < FIX_IO_APIC_BASE_0)
-			return 0;	/* cannot handle this */
-		phys += PAGE_SIZE;
-		set_fixmap(idx, phys);
-		mapped_size += PAGE_SIZE;
-	}
-
-	return ((unsigned char *) base + offset);
-}
-
-static int __init acpi_tables_init(void)
-{
-	int result = -ENODEV;
-	acpi_table_header *header = NULL;
-	struct acpi_table_rsdp *rsdp = NULL;
-	struct acpi_table_rsdt *rsdt = NULL;
-	struct acpi_table_rsdt saved_rsdt;
-	int tables = 0;
-	int type = 0;
-	int i = 0;
-
-
-	rsdp = (struct acpi_table_rsdp *) acpi_find_root_pointer();
-
-	if (!rsdp)
-		return -ENODEV;
-		
-	printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision,
-	       rsdp->oem_id);
-	       
-	if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) {
-		printk(KERN_WARNING "RSDP table signature incorrect\n");
-		return -EINVAL;
-	}
-
-	rsdt = (struct acpi_table_rsdt *)
-	    __va_range(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt));
-
-	if (!rsdt) {
-		printk(KERN_WARNING "ACPI: Invalid root system description tables (RSDT)\n");
-		return -ENODEV;
-	}
-	
-	header = & rsdt->header;
-	acpi_print_table_header(header);
-	
-	if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) {
-		printk(KERN_WARNING "ACPI: RSDT signature incorrect\n");
-		return -ENODEV;
-	}
-		
-	/* 
-	 * The number of tables is computed by taking the 
-	 * size of all entries (header size minus total 
-	 * size of RSDT) divided by the size of each entry
-	 * (4-byte table pointers).
-	 */
-	tables = (header->length - sizeof(acpi_table_header)) / 4;
-		    
-	memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt));
-
-	if (saved_rsdt.header.length > sizeof(saved_rsdt)) {
-		printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", saved_rsdt.header.length);
-		return -ENODEV;
-	}
-
-	for (i = 0; i < tables; i++) {
-		/* Map in header, then map in full table length. */
-		header = (acpi_table_header *)
-			    __va_range(saved_rsdt.entry[i],
-				       sizeof(acpi_table_header));
-		if (!header)
-			break;
-		header = (acpi_table_header *)
-			    __va_range(saved_rsdt.entry[i], header->length);
-		if (!header)
-			break;
-
-		acpi_print_table_header(header);
-		
-		if (acpi_checksum(header,header->length)) {
-			printk(KERN_WARNING "ACPI %s has invalid checksum\n", 
-				acpi_table_signatures[i]);
-			continue;
-		}
-		
-		for (type = 0; type < ACPI_TABLE_COUNT; type++)
-			if (!strncmp((char *) &header->signature,
-			     acpi_table_signatures[type],strlen(acpi_table_signatures[type])))
-				break;
-
-		if (type >= ACPI_TABLE_COUNT) {
-			printk(KERN_WARNING "ACPI: Unsupported table %.4s\n",
-			       header->signature);
-			continue;
-		}
-
-
-		if (!acpi_boot_ops[type])
-			continue;
-			
-		result = acpi_boot_ops[type] (header,
-						 (unsigned long) saved_rsdt.
-						 entry[i]);
-	}
-
-	return result;
-}
-
-static int total_cpus __initdata = 0;
-int have_acpi_tables;
-
-extern void __init MP_processor_info(struct mpc_config_processor *);
-
-static void __init
-acpi_parse_lapic(struct acpi_table_lapic *local_apic)
-{
-	struct mpc_config_processor proc_entry;
-	int ix = 0;
-
-	if (!local_apic)
-		return;
-
-	printk(KERN_INFO "LAPIC (acpi_id[0x%04x] id[0x%x] enabled[%d])\n",
-		local_apic->acpi_id, local_apic->id, local_apic->flags.enabled);
-
-	printk(KERN_INFO "CPU %d (0x%02x00)", total_cpus, local_apic->id);
-
-	if (local_apic->flags.enabled) {
-		printk(" enabled");
-		ix = local_apic->id;
-		if (ix >= MAX_APICS) {
-			printk(KERN_WARNING
-			       "Processor #%d INVALID - (Max ID: %d).\n", ix,
-			       MAX_APICS);
-			return;
-		}
-		/* 
-		 * Fill in the info we want to save.  Not concerned about 
-		 * the processor ID.  Processor features aren't present in 
-		 * the table.
-		 */
-		proc_entry.mpc_type = MP_PROCESSOR;
-		proc_entry.mpc_apicid = local_apic->id;
-		proc_entry.mpc_cpuflag = CPU_ENABLED;
-		if (proc_entry.mpc_apicid == boot_cpu_physical_apicid) {
-			printk(" (BSP)");
-			proc_entry.mpc_cpuflag |= CPU_BOOTPROCESSOR;
-		}
-		proc_entry.mpc_cpufeature =
-		    (boot_cpu_data.x86 << 8) | 
-		    (boot_cpu_data.x86_model << 4) | 
-		     boot_cpu_data.x86_mask;
-		proc_entry.mpc_featureflag = boot_cpu_data.x86_capability[0];
-		proc_entry.mpc_reserved[0] = 0;
-		proc_entry.mpc_reserved[1] = 0;
-		proc_entry.mpc_apicver = 0x10;	/* integrated APIC */
-		MP_processor_info(&proc_entry);
-	} else {
-		printk(" disabled");
-	}
-	printk("\n");
-
-	total_cpus++;
-	return;
-}
-
-static void __init
-acpi_parse_ioapic(struct acpi_table_ioapic *ioapic)
-{
-
-	if (!ioapic)
-		return;
-
-	printk(KERN_INFO
-	       "IOAPIC (id[0x%x] address[0x%x] global_irq_base[0x%x])\n",
-	       ioapic->id, ioapic->address, ioapic->global_irq_base);
-
-	if (nr_ioapics >= MAX_IO_APICS) {
-		printk(KERN_WARNING
-		       "Max # of I/O APICs (%d) exceeded (found %d).\n",
-		       MAX_IO_APICS, nr_ioapics);
-/*		panic("Recompile kernel with bigger MAX_IO_APICS!\n");   */
-	}
-}
-
-
-/* Interrupt source overrides inform the machine about exceptions
-   to the normal "PIC" mode interrupt routing */
-   
-static void __init
-acpi_parse_int_src_ovr(struct acpi_table_int_src_ovr *intsrc)
-{
-	if (!intsrc)
-		return;
-
-	printk(KERN_INFO
-	       "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n",
-	       intsrc->bus, intsrc->bus_irq, intsrc->global_irq,
-	       intsrc->flags.polarity, intsrc->flags.trigger);
-}
-
-/*
- * At this point, we look at the interrupt assignment entries in the MPS
- * table.
- */ 
- 
-static void __init acpi_parse_nmi_src(struct acpi_table_nmi_src *nmisrc)
-{
-	if (!nmisrc)
-		return;
-
-	printk(KERN_INFO
-	       "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n",
-	       nmisrc->flags.polarity, nmisrc->flags.trigger,
-	       nmisrc->global_irq);
-
-}
-static void __init
-acpi_parse_lapic_nmi(struct acpi_table_lapic_nmi *localnmi)
-{
-	if (!localnmi)
-		return;
-
-	printk(KERN_INFO
-	       "LAPIC_NMI (acpi_id[0x%04x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n",
-	       localnmi->acpi_id, localnmi->flags.polarity,
-	       localnmi->flags.trigger, localnmi->lint);
-}
-static void __init
-acpi_parse_lapic_addr_ovr(struct acpi_table_lapic_addr_ovr *lapic_addr_ovr)
-{
-	if (!lapic_addr_ovr)
-		return;
-
-	printk(KERN_INFO "LAPIC_ADDR_OVR (address[0x%lx])\n",
-	       (unsigned long) lapic_addr_ovr->address);
-
-}
-
-static void __init
-acpi_parse_plat_int_src(struct acpi_table_plat_int_src *plintsrc)
-{
-	if (!plintsrc)
-		return;
-
-	printk(KERN_INFO
-	       "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",
-	       plintsrc->flags.polarity, plintsrc->flags.trigger,
-	       plintsrc->type, plintsrc->id, plintsrc->eid,
-	       plintsrc->iosapic_vector, plintsrc->global_irq);
-}
-static int __init
-acpi_parse_madt(acpi_table_header * header, unsigned long phys)
-{
-
-	struct acpi_table_madt *madt;	    
-	acpi_madt_entry_header *entry_header;
-	int table_size;
-	
-	madt = (struct acpi_table_madt *) __va_range(phys, header->length);
-
-	if (!madt)
-		return -EINVAL;
-
-	table_size = (int) (header->length - sizeof(*madt));
-	entry_header =
-	    (acpi_madt_entry_header *) ((void *) madt + sizeof(*madt));
-
-	while (entry_header && (table_size > 0)) {
-		switch (entry_header->type) {
-		case ACPI_MADT_LAPIC:
-			acpi_parse_lapic((struct acpi_table_lapic *)
-					 entry_header);
-			break;
-		case ACPI_MADT_IOAPIC:
-			acpi_parse_ioapic((struct acpi_table_ioapic *)
-					  entry_header);
-			break;
-		case ACPI_MADT_INT_SRC_OVR:
-			acpi_parse_int_src_ovr((struct acpi_table_int_src_ovr *)
-					       entry_header);
-			break;
-		case ACPI_MADT_NMI_SRC:
-			acpi_parse_nmi_src((struct acpi_table_nmi_src *)
-					   entry_header);
-			break;
-		case ACPI_MADT_LAPIC_NMI:
-			acpi_parse_lapic_nmi((struct acpi_table_lapic_nmi *)
-					     entry_header);
-			break;
-		case ACPI_MADT_LAPIC_ADDR_OVR:
-			acpi_parse_lapic_addr_ovr((struct
-						   acpi_table_lapic_addr_ovr *)
-						  entry_header);
-			break;
-		case ACPI_MADT_PLAT_INT_SRC:
-			acpi_parse_plat_int_src((struct acpi_table_plat_int_src
-						 *) entry_header);
-			break;
-		default:
-			printk(KERN_WARNING
-			       "Unsupported MADT entry type 0x%x\n",
-			       entry_header->type);
-			break;
-		}
-		table_size -= entry_header->length;
-		entry_header =
-		    (acpi_madt_entry_header *) ((void *) entry_header +
-						entry_header->length);
-	}
-
-	if (!total_cpus) {
-		printk("ACPI: No Processors found in the APCI table.\n");
-		return -EINVAL;
-	}
-
-	printk(KERN_INFO "%d CPUs total\n", total_cpus);
-
-	if (madt->lapic_address)
-		mp_lapic_addr = madt->lapic_address;
-	else
-		mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
-
-	printk(KERN_INFO "Local APIC address %x\n", madt->lapic_address);
-
-	return 0;
-}
-
-extern int enable_acpi_smp_table;
-
-/*
- * Configure the processor info using MADT in the ACPI tables. If we fail to
- * configure that, then we use the MPS tables.
- */
-void __init
-config_acpi_tables(void)
-{
-
-	memset(&acpi_boot_ops, 0, sizeof(acpi_boot_ops));
-	acpi_boot_ops[ACPI_APIC] = acpi_parse_madt;
-
-	/*
-	 * Only do this when requested, either because of CPU/Bios type or from the command line
-	 */
-
-	if (enable_acpi_smp_table && !acpi_tables_init()) {
-		have_acpi_tables = 1;
-		printk("Enabling the CPU's according to the ACPI table\n");
-	}
-}
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/acpitable.h b/arch/i386/kernel/acpitable.h
--- a/arch/i386/kernel/acpitable.h	2003-01-25 01:25:36.000000000 -0800
+++ b/arch/i386/kernel/acpitable.h	1969-12-31 16:00:00.000000000 -0800
@@ -1,260 +0,0 @@
-/*
- *  acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1)
- *
- *  Copyright (C) 1999 Andrew Henroid
- *  Copyright (C) 2001 Richard Schaal
- *  Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
- *  Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
- *  Copyright (C) 2001 Arjan van de Ven <arjanv@redhat.com>
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * $Id: acpitable.h,v 1.3 2001/11/03 22:41:34 fenrus Exp $
- */
-
-/*
- * The following codes are cut&pasted from drivers/acpi. Part of the code
- * there can be not updated or delivered yet.
- * To avoid conflicts when CONFIG_ACPI is defined, the following codes are
- * modified so that they are self-contained in this file.
- * -- jun
- */
- 
-#ifndef _HEADER_ACPITABLE_H_
-#define _HEADER_ACPITABLE_H_
-
-#define dprintk printk
-typedef unsigned int ACPI_TBLPTR;
-
-typedef struct {		/* ACPI common table header */
-	char signature[4];	/* identifies type of table */
-	u32 length;		/* length of table,
-				   in bytes, * including header */
-	u8 revision;		/* specification minor version # */
-	u8 checksum;		/* to make sum of entire table == 0 */
-	char oem_id[6];		/* OEM identification */
-	char oem_table_id[8];	/* OEM table identification */
-	u32 oem_revision;	/* OEM revision number */
-	char asl_compiler_id[4];	/* ASL compiler vendor ID */
-	u32 asl_compiler_revision;	/* ASL compiler revision number */
-} acpi_table_header __attribute__ ((packed));;
-
-enum {
-	ACPI_APIC = 0,
-	ACPI_BOOT,
-	ACPI_DBGP,
-	ACPI_DSDT,
-	ACPI_ECDT,
-	ACPI_ETDT,
-	ACPI_FACP,
-	ACPI_FACS,
-	ACPI_OEMX,
-	ACPI_PSDT,
-	ACPI_SBST,
-	ACPI_SLIT,
-	ACPI_SPCR,
-	ACPI_SRAT,
-	ACPI_SSDT,
-	ACPI_SPMI,
-	ACPI_XSDT,
-	ACPI_TABLE_COUNT
-};
-
-static char *acpi_table_signatures[ACPI_TABLE_COUNT] = {
-	"APIC",
-	"BOOT",
-	"DBGP",
-	"DSDT",
-	"ECDT",
-	"ETDT",
-	"FACP",
-	"FACS",
-	"OEM",
-	"PSDT",
-	"SBST",
-	"SLIT",
-	"SPCR",
-	"SRAT",
-	"SSDT",
-	"SPMI",
-	"XSDT"
-};
-
-struct acpi_table_madt {
-	acpi_table_header header;
-	u32 lapic_address;
-	struct {
-		u32 pcat_compat:1;
-		u32 reserved:31;
-	} flags __attribute__ ((packed));
-} __attribute__ ((packed));;
-
-enum {
-	ACPI_MADT_LAPIC = 0,
-	ACPI_MADT_IOAPIC,
-	ACPI_MADT_INT_SRC_OVR,
-	ACPI_MADT_NMI_SRC,
-	ACPI_MADT_LAPIC_NMI,
-	ACPI_MADT_LAPIC_ADDR_OVR,
-	ACPI_MADT_IOSAPIC,
-	ACPI_MADT_LSAPIC,
-	ACPI_MADT_PLAT_INT_SRC,
-	ACPI_MADT_ENTRY_COUNT
-};
-
-#define RSDP_SIG			"RSD PTR "
-#define RSDT_SIG 			"RSDT"
-
-#define ACPI_DEBUG_PRINT(pl)
-
-#define ACPI_MEMORY_MODE                0x01
-#define ACPI_LOGICAL_ADDRESSING         0x00
-#define ACPI_PHYSICAL_ADDRESSING        0x01
-
-#define LO_RSDP_WINDOW_BASE         	0	/* Physical Address */
-#define HI_RSDP_WINDOW_BASE         	0xE0000	/* Physical Address */
-#define LO_RSDP_WINDOW_SIZE         	0x400
-#define HI_RSDP_WINDOW_SIZE         	0x20000
-#define RSDP_SCAN_STEP			16
-#define RSDP_CHECKSUM_LENGTH		20
-
-typedef int (*acpi_table_handler) (acpi_table_header * header, unsigned long);
-
-struct acpi_table_rsdp {
-	char signature[8];
-	u8 checksum;
-	char oem_id[6];
-	u8 revision;
-	u32 rsdt_address;
-} __attribute__ ((packed));
-
-struct acpi_table_rsdt {
-	acpi_table_header header;
-	u32 entry[ACPI_TABLE_COUNT];
-} __attribute__ ((packed));
-
-typedef struct {
-	u8 type;
-	u8 length;
-} acpi_madt_entry_header __attribute__ ((packed));
-
-typedef struct {
-	u16 polarity:2;
-	u16 trigger:2;
-	u16 reserved:12;
-} acpi_madt_int_flags __attribute__ ((packed));
-
-struct acpi_table_lapic {
-	acpi_madt_entry_header header;
-	u8 acpi_id;
-	u8 id;
-	struct {
-		u32 enabled:1;
-		u32 reserved:31;
-	} flags __attribute__ ((packed));
-} __attribute__ ((packed));
-
-struct acpi_table_ioapic {
-	acpi_madt_entry_header header;
-	u8 id;
-	u8 reserved;
-	u32 address;
-	u32 global_irq_base;
-} __attribute__ ((packed));
-
-struct acpi_table_int_src_ovr {
-	acpi_madt_entry_header header;
-	u8 bus;
-	u8 bus_irq;
-	u32 global_irq;
-	acpi_madt_int_flags flags;
-} __attribute__ ((packed));
-
-struct acpi_table_nmi_src {
-	acpi_madt_entry_header header;
-	acpi_madt_int_flags flags;
-	u32 global_irq;
-} __attribute__ ((packed));
-
-struct acpi_table_lapic_nmi {
-	acpi_madt_entry_header header;
-	u8 acpi_id;
-	acpi_madt_int_flags flags;
-	u8 lint;
-} __attribute__ ((packed));
-
-struct acpi_table_lapic_addr_ovr {
-	acpi_madt_entry_header header;
-	u8 reserved[2];
-	u64 address;
-} __attribute__ ((packed));
-
-struct acpi_table_iosapic {
-	acpi_madt_entry_header header;
-	u8 id;
-	u8 reserved;
-	u32 global_irq_base;
-	u64 address;
-} __attribute__ ((packed));
-
-struct acpi_table_lsapic {
-	acpi_madt_entry_header header;
-	u8 acpi_id;
-	u8 id;
-	u8 eid;
-	u8 reserved[3];
-	struct {
-		u32 enabled:1;
-		u32 reserved:31;
-	} flags;
-} __attribute__ ((packed));
-
-struct acpi_table_plat_int_src {
-	acpi_madt_entry_header header;
-	acpi_madt_int_flags flags;
-	u8 type;
-	u8 id;
-	u8 eid;
-	u8 iosapic_vector;
-	u32 global_irq;
-	u32 reserved;
-} __attribute__ ((packed));
-
-/*
- * ACPI Table Descriptor.  One per ACPI table
- */
-typedef struct acpi_table_desc {
-	struct acpi_table_desc *prev;
-	struct acpi_table_desc *next;
-	struct acpi_table_desc *installed_desc;
-	acpi_table_header *pointer;
-	void *base_pointer;
-	u8 *aml_pointer;
-	u64 physical_address;
-	u32 aml_length;
-	u32 length;
-	u32 count;
-	u16 table_id;
-	u8 type;
-	u8 allocation;
-	u8 loaded_into_namespace;
-
-} acpi_table_desc __attribute__ ((packed));;
-
-#endif
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/acpi_wakeup.S b/arch/i386/kernel/acpi_wakeup.S
--- a/arch/i386/kernel/acpi_wakeup.S	1969-12-31 16:00:00.000000000 -0800
+++ b/arch/i386/kernel/acpi_wakeup.S	2003-01-25 01:30:25.000000000 -0800
@@ -0,0 +1,139 @@
+
+.text
+#include <linux/linkage.h>
+#include <asm/segment.h>
+
+
+ALIGN
+wakeup_start:
+wakeup_code:
+	wakeup_code_start = .
+	.code16
+
+	cli
+	cld
+
+	# setup data segment
+	movw	%cs, %ax
+
+	addw	$(wakeup_data - wakeup_code) >> 4, %ax
+	movw	%ax, %ds
+	movw	%ax, %ss
+	mov	$(wakeup_stack - wakeup_data), %sp		# Private stack is needed for ASUS board
+
+	# set up page table
+	movl	(real_save_cr3 - wakeup_data), %eax
+	movl	%eax, %cr3
+
+	# make sure %cr4 is set correctly (features, etc)
+	movl	(real_save_cr4 - wakeup_data), %eax
+	movl	%eax, %cr4
+
+	# need a gdt
+	lgdt	real_save_gdt - wakeup_data
+
+	movl	%cr0, %eax
+	orl     $0x80000001, %eax
+	movl	%eax, %cr0
+
+	ljmpl	$__KERNEL_CS,$SYMBOL_NAME(wakeup_pmode_return)
+
+	.code32
+	ALIGN
+
+.org	0x100
+wakeup_data:
+		.word 0
+real_save_gdt:	.word 0
+		.long 0
+real_save_cr3:	.long 0
+real_save_cr4:	.long 0
+
+.org	0x300
+wakeup_stack:
+wakeup_end:
+
+wakeup_pmode_return:
+	# restore data segment
+	movl	$__KERNEL_DS, %eax
+	movw	%ax, %ds
+	movw	%ax, %es
+
+	# and restore the stack
+	movw	%ax, %ss
+	movl	saved_esp, %esp
+
+	# restore other segment registers
+	xorl	%eax, %eax
+	movw	%ax, %fs
+	movw	%ax, %gs
+
+	# reload the gdt, as we need the full 32 bit address
+	lgdt	saved_gdt
+	lidt	saved_idt
+	lldt	saved_ldt
+
+	# restore the other general registers
+	movl	saved_ebx, %ebx
+	movl	saved_edi, %edi
+	movl	saved_esi, %esi
+	movl	saved_ebp, %ebp
+
+	# jump to place where we left off
+	movl	saved_eip,%eax
+	jmp	*%eax
+
+##
+# acpi_copy_wakeup_routine
+#
+# Copy the above routine to low memory.
+#
+# Parameters:
+# %eax:	place to copy wakeup routine to
+#
+# Returned address is location of code in low memory (past data and stack)
+#
+ENTRY(acpi_copy_wakeup_routine)
+
+	pushl	%esi
+	pushl	%edi
+
+	sgdt	saved_gdt
+	sidt	saved_idt
+	sldt	saved_ldt
+	str	saved_tss
+
+	movl	%eax, %edi
+	leal	wakeup_start, %esi
+	movl	$(wakeup_end - wakeup_start) >> 2, %ecx
+
+	rep ;  movsl
+
+	movl    %cr3, %edx
+	movl    %edx, real_save_cr3 - wakeup_start (%eax)
+	movl    %cr4, %edx
+	movl    %edx, real_save_cr4 - wakeup_start (%eax)
+	sgdt    real_save_gdt - wakeup_start (%eax)
+
+	# restore the regs we used
+	popl	%edi
+	popl	%esi
+	ret
+
+
+.data
+ALIGN
+# saved registers
+saved_gdt:	.long	0,0
+saved_idt:	.long	0,0
+saved_ldt:	.long	0
+saved_tss:	.long	0
+saved_cr0:	.long	0
+
+ENTRY(saved_ebp)	.long	0
+ENTRY(saved_esi)	.long	0
+ENTRY(saved_edi)	.long	0
+ENTRY(saved_ebx)	.long	0
+
+ENTRY(saved_eip)	.long	0
+ENTRY(saved_esp)	.long	0
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
--- a/arch/i386/kernel/io_apic.c	2003-01-25 01:25:30.000000000 -0800
+++ b/arch/i386/kernel/io_apic.c	2003-01-25 01:30:16.000000000 -0800
@@ -17,6 +17,7 @@
  *					thanks to Eric Gilmore
  *					and Rolf G. Tews
  *					for testing these extensively
+ *	Paul Diefenbaugh	:	Added full ACPI support
  */
 
 #include <linux/mm.h>
@@ -28,6 +29,7 @@
 #include <linux/config.h>
 #include <linux/smp_lock.h>
 #include <linux/mc146818rtc.h>
+#include <linux/acpi.h>
 
 #include <asm/io.h>
 #include <asm/smp.h>
@@ -1054,6 +1056,10 @@
 	unsigned char old_id;
 	unsigned long flags;
 
+	if (acpi_ioapic)
+		/* This gets done during IOAPIC enumeration for ACPI. */
+		return;
+
 	if (clustered_apic_mode)
 		/* We don't have a good way to do this yet - hack */
 		phys_id_present_map = (u_long) 0xf;
@@ -1654,8 +1660,7 @@
 	printk("ENABLING IO-APIC IRQs\n");
 
 	/*
-	 * Set up the IO-APIC IRQ routing table by parsing the MP-BIOS
-	 * mptable:
+	 * Set up IO-APIC IRQ routing.
 	 */
 	setup_ioapic_ids_from_mpc();
 	sync_Arb_IDs();
@@ -1664,3 +1669,159 @@
 	check_timer();
 	print_IO_APIC();
 }
+
+
+/* --------------------------------------------------------------------------
+                          ACPI-based IOAPIC Configuration
+   -------------------------------------------------------------------------- */
+
+#ifdef CONFIG_ACPI_BOOT
+
+#define IO_APIC_MAX_ID		15
+
+int __init io_apic_get_unique_id (int ioapic, int apic_id)
+{
+	struct IO_APIC_reg_00 reg_00;
+	static unsigned long apic_id_map = 0;
+	unsigned long flags;
+	int i = 0;
+
+	/*
+	 * The P4 platform supports up to 256 APIC IDs on two separate APIC 
+	 * buses (one for LAPICs, one for IOAPICs), where predecessors only 
+	 * supports up to 16 on one shared APIC bus.
+	 * 
+	 * TBD: Expand LAPIC/IOAPIC support on P4-class systems to take full
+	 *      advantage of new APIC bus architecture.
+	 */
+
+	if (!apic_id_map)
+		apic_id_map = phys_cpu_present_map;
+
+	spin_lock_irqsave(&ioapic_lock, flags);
+	*(int *)&reg_00 = io_apic_read(ioapic, 0);
+	spin_unlock_irqrestore(&ioapic_lock, flags);
+
+	if (apic_id >= IO_APIC_MAX_ID) {
+		printk(KERN_WARNING "IOAPIC[%d]: Invalid apic_id %d, trying "
+			"%d\n", ioapic, apic_id, reg_00.ID);
+		apic_id = reg_00.ID;
+	}
+
+	/*
+	 * Every APIC in a system must have a unique ID or we get lots of nice 
+	 * 'stuck on smp_invalidate_needed IPI wait' messages.
+	 */
+	if (apic_id_map & (1 << apic_id)) {
+
+		for (i = 0; i < IO_APIC_MAX_ID; i++) {
+			if (!(apic_id_map & (1 << i)))
+				break;
+		}
+
+		if (i == IO_APIC_MAX_ID)
+			panic("Max apic_id exceeded!\n");
+
+		printk(KERN_WARNING "IOAPIC[%d]: apic_id %d already used, "
+			"trying %d\n", ioapic, apic_id, i);
+
+		apic_id = i;
+	} 
+
+	apic_id_map |= (1 << apic_id);
+
+	if (reg_00.ID != apic_id) {
+		reg_00.ID = apic_id;
+
+		spin_lock_irqsave(&ioapic_lock, flags);
+		io_apic_write(ioapic, 0, *(int *)&reg_00);
+		*(int *)&reg_00 = io_apic_read(ioapic, 0);
+		spin_unlock_irqrestore(&ioapic_lock, flags);
+
+		/* Sanity check */
+		if (reg_00.ID != apic_id)
+			panic("IOAPIC[%d]: Unable change apic_id!\n", ioapic);
+	}
+
+	printk(KERN_INFO "IOAPIC[%d]: Assigned apic_id %d\n", ioapic, apic_id);
+
+	return apic_id;
+}
+
+
+int __init io_apic_get_version (int ioapic)
+{
+	struct IO_APIC_reg_01	reg_01;
+	unsigned long flags;
+
+	spin_lock_irqsave(&ioapic_lock, flags);
+	*(int *)&reg_01 = io_apic_read(ioapic, 1);
+	spin_unlock_irqrestore(&ioapic_lock, flags);
+
+	return reg_01.version;
+}
+
+
+int __init io_apic_get_redir_entries (int ioapic)
+{
+	struct IO_APIC_reg_01	reg_01;
+	unsigned long flags;
+
+	spin_lock_irqsave(&ioapic_lock, flags);
+	*(int *)&reg_01 = io_apic_read(ioapic, 1);
+	spin_unlock_irqrestore(&ioapic_lock, flags);
+
+	return reg_01.entries;
+}
+
+
+int io_apic_set_pci_routing (int ioapic, int pin, int irq)
+{
+	struct IO_APIC_route_entry entry;
+	unsigned long flags;
+
+	if (!IO_APIC_IRQ(irq)) {
+		printk(KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0/n", 
+			ioapic);
+		return -EINVAL;
+	}
+
+	/*
+	 * Generate a PCI IRQ routing entry and program the IOAPIC accordingly.
+	 * Note that we mask (disable) IRQs now -- these get enabled when the
+	 * corresponding device driver registers for this IRQ.
+	 */
+
+	memset(&entry,0,sizeof(entry));
+
+	entry.delivery_mode = dest_LowestPrio;
+	entry.dest_mode = INT_DELIVERY_MODE;
+	entry.dest.logical.logical_dest = target_cpus();
+	entry.mask = 1;					 /* Disabled (masked) */
+	entry.trigger = 1;				   /* Level sensitive */
+	entry.polarity = 1;					/* Low active */
+
+	add_pin_to_irq(irq, ioapic, pin);
+
+	entry.vector = assign_irq_vector(irq);
+
+	printk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> "
+		"IRQ %d)\n", ioapic, 
+		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq);
+
+	irq_desc[irq].handler = &ioapic_level_irq_type;
+
+	set_intr_gate(entry.vector, interrupt[irq]);
+
+	if (!ioapic && (irq < 16))
+		disable_8259A_irq(irq);
+
+	spin_lock_irqsave(&ioapic_lock, flags);
+	io_apic_write(ioapic, 0x11+2*pin, *(((int *)&entry)+1));
+	io_apic_write(ioapic, 0x10+2*pin, *(((int *)&entry)+0));
+	spin_unlock_irqrestore(&ioapic_lock, flags);
+
+	return 0;
+}
+
+#endif /*CONFIG_ACPI_BOOT*/
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
--- a/arch/i386/kernel/Makefile	2003-01-25 01:25:04.000000000 -0800
+++ b/arch/i386/kernel/Makefile	2003-01-25 01:30:11.000000000 -0800
@@ -36,9 +36,11 @@
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_APM)		+= apm.o
+obj-$(CONFIG_ACPI)		+= acpi.o
+obj-$(CONFIG_ACPI_SLEEP)	+= acpi_wakeup.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
 obj-$(CONFIG_X86_LOCAL_APIC)	+= mpparse.o apic.o nmi.o
-obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o acpitable.o
+obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o
 obj-$(CONFIG_X86_VISWS_APIC)	+= visws_apic.o
 
 include $(TOPDIR)/Rules.make
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
--- a/arch/i386/kernel/mpparse.c	2003-01-25 01:25:27.000000000 -0800
+++ b/arch/i386/kernel/mpparse.c	2003-01-25 01:30:16.000000000 -0800
@@ -9,12 +9,14 @@
  *		Erich Boleyn	:	MP v1.4 and additional changes.
  *		Alan Cox	:	Added EBDA scanning
  *		Ingo Molnar	:	various cleanups and rewrites
- *	Maciej W. Rozycki	:	Bits for default MP configurations
+ *		Maciej W. Rozycki:	Bits for default MP configurations
+ *		Paul Diefenbaugh:	Added full ACPI support
  */
 
 #include <linux/mm.h>
 #include <linux/irq.h>
 #include <linux/init.h>
+#include <linux/acpi.h>
 #include <linux/delay.h>
 #include <linux/config.h>
 #include <linux/bootmem.h>
@@ -23,10 +25,12 @@
 #include <linux/mc146818rtc.h>
 
 #include <asm/smp.h>
+#include <asm/acpi.h>
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>
 #include <asm/pgalloc.h>
 #include <asm/smpboot.h>
+#include <asm/io_apic.h>
 
 /* Have we found an MP table */
 int smp_found_config;
@@ -135,12 +139,6 @@
 	return n;
 }
 
-#ifdef CONFIG_X86_IO_APIC
-extern int have_acpi_tables;	/* set by acpitable.c */
-#else
-#define have_acpi_tables (0)
-#endif
-
 /* 
  * Have to match translation table entries to main table entries by counter
  * hence the mpc_record variable .... can't see a less disgusting way of
@@ -445,10 +443,11 @@
 	
 	printk("APIC at: 0x%lX\n",mpc->mpc_lapic);
 
-	/* save the local APIC address, it might be non-default,
-	 * but only if we're not using the ACPI tables
+	/* 
+	 * Save the local APIC address (it might be non-default) -- but only
+	 * if we're not using ACPI.
 	 */
-	if (!have_acpi_tables)
+	if (!acpi_lapic)
 		mp_lapic_addr = mpc->mpc_lapic;
 
 	if ((clustered_apic_mode == CLUSTERED_APIC_NUMAQ) && mpc->mpc_oemptr) {
@@ -528,9 +527,8 @@
 			{
 				struct mpc_config_processor *m=
 					(struct mpc_config_processor *)mpt;
-
-				/* ACPI may already have provided this one for us */
-				if (!have_acpi_tables)
+				/* ACPI may have already provided this data */
+				if (!acpi_lapic)
 					MP_processor_info(m);
 				mpt += sizeof(*m);
 				count += sizeof(*m);
@@ -759,7 +757,6 @@
 }
 
 static struct intel_mp_floating *mpf_found;
-extern void 	config_acpi_tables(void);
 
 /*
  * Scan the memory blocks for an SMP configuration block.
@@ -768,17 +765,19 @@
 {
 	struct intel_mp_floating *mpf = mpf_found;
 
-#ifdef CONFIG_X86_IO_APIC
 	/*
-	 * Check if the ACPI tables are provided. Use them only to get
-	 * the processor information, mainly because it provides
-	 * the info on the logical processor(s), rather than the physical
-	 * processor(s) that are provided by the MPS. We attempt to 
-	 * check only if the user provided a commandline override
+	 * ACPI may be used to obtain the entire SMP configuration or just to 
+	 * enumerate/configure processors (CONFIG_ACPI_HT_ONLY).  Note that 
+	 * ACPI supports both logical (e.g. Hyper-Threading) and physical 
+	 * processors, where MPS only supports physical.
 	 */
-	config_acpi_tables();
-#endif
-	
+	if (acpi_lapic && acpi_ioapic) {
+		printk(KERN_INFO "Using ACPI (MADT) for SMP configuration information\n");
+		return;
+	}
+	else if (acpi_lapic)
+		printk(KERN_INFO "Using ACPI for processor (LAPIC) configuration information\n");
+
 	printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification);
 	if (mpf->mpf_feature2 & (1<<7)) {
 		printk("    IMCR and PIC compatibility mode.\n");
@@ -937,3 +936,378 @@
 #endif
 }
 
+
+/* --------------------------------------------------------------------------
+                            ACPI-based MP Configuration
+   -------------------------------------------------------------------------- */
+
+#ifdef CONFIG_ACPI_BOOT
+
+void __init mp_register_lapic_address (
+	u64			address)
+{
+	mp_lapic_addr = (unsigned long) address;
+
+	set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr);
+
+	if (boot_cpu_physical_apicid == -1U)
+		boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
+
+	Dprintk("Boot CPU = %d\n", boot_cpu_physical_apicid);
+}
+
+
+void __init mp_register_lapic (
+	u8			id, 
+	u8			enabled)
+{
+	struct mpc_config_processor processor;
+	int			boot_cpu = 0;
+	
+	if (id >= MAX_APICS) {
+		printk(KERN_WARNING "Processor #%d invalid (max %d)\n",
+			id, MAX_APICS);
+		return;
+	}
+
+	if (id == boot_cpu_physical_apicid)
+		boot_cpu = 1;
+
+	processor.mpc_type = MP_PROCESSOR;
+	processor.mpc_apicid = id;
+	processor.mpc_apicver = 0x10; /* TBD: lapic version */
+	processor.mpc_cpuflag = (enabled ? CPU_ENABLED : 0);
+	processor.mpc_cpuflag |= (boot_cpu ? CPU_BOOTPROCESSOR : 0);
+	processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | 
+		(boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
+	processor.mpc_featureflag = boot_cpu_data.x86_capability[0];
+	processor.mpc_reserved[0] = 0;
+	processor.mpc_reserved[1] = 0;
+
+	MP_processor_info(&processor);
+}
+
+#ifdef CONFIG_X86_IO_APIC
+
+#define MP_ISA_BUS		0
+#define MP_MAX_IOAPIC_PIN	127
+
+struct mp_ioapic_routing {
+	int			apic_id;
+	int			irq_start;
+	int			irq_end;
+	u32			pin_programmed[4];
+} mp_ioapic_routing[MAX_IO_APICS];
+
+
+static int __init mp_find_ioapic (
+	int			irq)
+{
+	int			i = 0;
+
+	/* Find the IOAPIC that manages this IRQ. */
+	for (i = 0; i < nr_ioapics; i++) {
+		if ((irq >= mp_ioapic_routing[i].irq_start)
+			&& (irq <= mp_ioapic_routing[i].irq_end))
+			return i;
+	}
+
+	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d/n", irq);
+
+	return -1;
+}
+	
+
+void __init mp_register_ioapic (
+	u8			id, 
+	u32			address,
+	u32			irq_base)
+{
+	int			idx = 0;
+
+	if (nr_ioapics >= MAX_IO_APICS) {
+		printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
+			"(found %d)\n", MAX_IO_APICS, nr_ioapics);
+		panic("Recompile kernel with bigger MAX_IO_APICS!\n");
+	}
+	if (!address) {
+		printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
+			" found in MADT table, skipping!\n");
+		return;
+	}
+
+	idx = nr_ioapics++;
+
+	mp_ioapics[idx].mpc_type = MP_IOAPIC;
+	mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE;
+	mp_ioapics[idx].mpc_apicaddr = address;
+
+	set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
+	mp_ioapics[idx].mpc_apicid = io_apic_get_unique_id(idx, id);
+	mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx);
+	
+	/* 
+	 * Build basic IRQ lookup table to facilitate irq->io_apic lookups
+	 * and to prevent reprogramming of IOAPIC pins (PCI IRQs).
+	 */
+	mp_ioapic_routing[idx].apic_id = mp_ioapics[idx].mpc_apicid;
+	mp_ioapic_routing[idx].irq_start = irq_base;
+	mp_ioapic_routing[idx].irq_end = irq_base + 
+		io_apic_get_redir_entries(idx);
+
+	printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%lx, "
+		"IRQ %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, 
+		mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr,
+		mp_ioapic_routing[idx].irq_start,
+		mp_ioapic_routing[idx].irq_end);
+
+	return;
+}
+
+
+void __init mp_override_legacy_irq (
+	u8			bus_irq,
+	u8			polarity, 
+	u8			trigger, 
+	u32			global_irq)
+{
+	struct mpc_config_intsrc intsrc;
+	int			i = 0;
+	int			found = 0;
+	int			ioapic = -1;
+	int			pin = -1;
+
+	/* 
+	 * Convert 'global_irq' to 'ioapic.pin'.
+	 */
+	ioapic = mp_find_ioapic(global_irq);
+	if (ioapic < 0)
+		return;
+	pin = global_irq - mp_ioapic_routing[ioapic].irq_start;
+
+	/*
+	 * TBD: This check is for faulty timer entries, where the override
+	 *      erroneously sets the trigger to level, resulting in a HUGE 
+	 *      increase of timer interrupts!
+	 */
+	if ((bus_irq == 0) && (global_irq == 2) && (trigger == 3))
+		trigger = 1;
+
+	intsrc.mpc_type = MP_INTSRC;
+	intsrc.mpc_irqtype = mp_INT;
+	intsrc.mpc_irqflag = (trigger << 2) | polarity;
+	intsrc.mpc_srcbus = MP_ISA_BUS;
+	intsrc.mpc_srcbusirq = bus_irq;				       /* IRQ */
+	intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid;	   /* APIC ID */
+	intsrc.mpc_dstirq = pin;				    /* INTIN# */
+
+	Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, %d-%d\n",
+		intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, 
+		(intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, 
+		intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq);
+
+	/* 
+	 * If an existing [IOAPIC.PIN -> IRQ] routing entry exists we override it.
+	 * Otherwise create a new entry (e.g. global_irq == 2).
+	 */
+	for (i = 0; i < mp_irq_entries; i++) {
+		if ((mp_irqs[i].mpc_dstapic == intsrc.mpc_dstapic) 
+			&& (mp_irqs[i].mpc_dstirq == intsrc.mpc_dstirq)) {
+			mp_irqs[i] = intsrc;
+			found = 1;
+			break;
+		}
+	}
+	if (!found) {
+		mp_irqs[mp_irq_entries] = intsrc;
+		if (++mp_irq_entries == MAX_IRQ_SOURCES)
+			panic("Max # of irq sources exceeded!\n");
+	}
+
+	return;
+}
+
+
+void __init mp_config_acpi_legacy_irqs (void)
+{
+	int			i = 0;
+	int			ioapic = -1;
+
+	/*
+	 * Initialize mp_irqs for IRQ configuration.
+	 */
+	unsigned char *bus_data;
+	int count;
+
+	count = (MAX_MP_BUSSES * sizeof(int)) * 4;
+	count += (MAX_IRQ_SOURCES * sizeof(int)) * 4;
+	bus_data = alloc_bootmem(count);
+	if (!bus_data) {
+		panic("Fatal: can't allocate bus memory for ACPI legacy IRQ!");
+	}
+	mp_bus_id_to_type = (int *)&bus_data[0];
+	mp_bus_id_to_node = (int *)&bus_data[(MAX_MP_BUSSES * sizeof(int))];
+	mp_bus_id_to_local = (int *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 2];
+	mp_bus_id_to_pci_bus = (int *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 3];
+	mp_irqs = (struct mpc_config_intsrc *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 4];
+	memset(mp_bus_id_to_pci_bus, -1, MAX_MP_BUSSES);
+
+	/* 
+	 * Fabricate the legacy ISA bus (bus #31).
+	 */
+	mp_bus_id_to_type[MP_ISA_BUS] = MP_BUS_ISA;
+	Dprintk("Bus #%d is ISA\n", MP_ISA_BUS);
+
+	/* 
+	 * Locate the IOAPIC that manages the ISA IRQs (0-15). 
+	 */
+	ioapic = mp_find_ioapic(0);
+	if (ioapic < 0)
+		return;
+
+	/* 
+	 * Use the default configuration for the IRQs 0-15.  These may be
+	 * overriden by (MADT) interrupt source override entries.
+	 */
+	for (i = 0; i < 16; i++) {
+
+		if (i == 2) continue;			/* Don't connect IRQ2 */
+
+		mp_irqs[mp_irq_entries].mpc_type = MP_INTSRC;
+		mp_irqs[mp_irq_entries].mpc_irqflag = 0;	/* Conforming */
+		mp_irqs[mp_irq_entries].mpc_srcbus = MP_ISA_BUS;
+		mp_irqs[mp_irq_entries].mpc_dstapic = mp_ioapics[ioapic].mpc_apicid;
+		mp_irqs[mp_irq_entries].mpc_irqtype = i ? mp_INT : mp_ExtINT;   /* 8259A to #0 */
+		mp_irqs[mp_irq_entries].mpc_srcbusirq = i;	   /* Identity mapped */
+		mp_irqs[mp_irq_entries].mpc_dstirq = i;
+
+		Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, "
+			"%d-%d\n", 
+			mp_irqs[mp_irq_entries].mpc_irqtype, 
+			mp_irqs[mp_irq_entries].mpc_irqflag & 3, 
+			(mp_irqs[mp_irq_entries].mpc_irqflag >> 2) & 3, 
+			mp_irqs[mp_irq_entries].mpc_srcbus, 
+			mp_irqs[mp_irq_entries].mpc_srcbusirq, 
+			mp_irqs[mp_irq_entries].mpc_dstapic, 
+			mp_irqs[mp_irq_entries].mpc_dstirq);
+
+		if (++mp_irq_entries == MAX_IRQ_SOURCES)
+			panic("Max # of irq sources exceeded!\n");
+	}
+}
+
+#ifndef CONFIG_ACPI_HT_ONLY
+
+/* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
+
+extern FADT_DESCRIPTOR acpi_fadt;
+
+void __init mp_config_ioapic_for_sci(int irq)
+{
+	int ioapic;
+	int ioapic_pin;
+	struct acpi_table_madt* madt;
+	struct acpi_table_int_src_ovr *entry = NULL;
+	void *madt_end;
+	acpi_status status;
+
+	/*
+	 * Ensure that if there is an interrupt source override entry
+	 * for the ACPI SCI, we leave it as is. Unfortunately this involves
+	 * walking the MADT again.
+	 */
+	status = acpi_get_firmware_table("APIC", 1, ACPI_LOGICAL_ADDRESSING,
+		(struct acpi_table_header **) &madt);
+	if (ACPI_SUCCESS(status)) {
+		madt_end = (void *) (unsigned long)madt + madt->header.length;
+
+		entry = (struct acpi_table_int_src_ovr *)
+                ((unsigned long) madt + sizeof(struct acpi_table_madt));
+
+		while ((void *) entry < madt_end) {
+                	if (entry->header.type == ACPI_MADT_INT_SRC_OVR &&
+			    acpi_fadt.sci_int == entry->global_irq)
+                		return;
+
+                	entry = (struct acpi_table_int_src_ovr *)
+                	        ((unsigned long) entry + entry->header.length);
+        	}
+	}
+
+	ioapic = mp_find_ioapic(irq);
+
+	ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
+
+	io_apic_set_pci_routing(ioapic, ioapic_pin, irq);
+}
+
+#endif /*CONFIG_ACPI_HT_ONLY*/
+
+#ifdef CONFIG_ACPI_PCI
+
+void __init mp_parse_prt (void)
+{
+	struct list_head	*node = NULL;
+	struct acpi_prt_entry	*entry = NULL;
+	int			ioapic = -1;
+	int			ioapic_pin = 0;
+	int			irq = 0;
+	int			idx, bit = 0;
+
+	/*
+	 * Parsing through the PCI Interrupt Routing Table (PRT) and program
+	 * routing for all static (IOAPIC-direct) entries.
+	 */
+	list_for_each(node, &acpi_prt.entries) {
+		entry = list_entry(node, struct acpi_prt_entry, node);
+
+		/* We're only interested in static (non-link) entries. */
+		if (entry->link.handle)
+			continue;
+
+		irq = entry->link.index;
+		ioapic = mp_find_ioapic(irq);
+		if (ioapic < 0)
+			continue;
+		ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
+
+		/* 
+		 * Avoid pin reprogramming.  PRTs typically include entries  
+		 * with redundant pin->irq mappings (but unique PCI devices);
+		 * we only only program the IOAPIC on the first.
+		 */
+		bit = ioapic_pin % 32;
+		idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32);
+		if (idx > 3) {
+			printk(KERN_ERR "Invalid reference to IOAPIC pin "
+				"%d-%d\n", mp_ioapic_routing[ioapic].apic_id, 
+				ioapic_pin);
+			continue;
+		}
+		if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) {
+			printk(KERN_DEBUG "Pin %d-%d already programmed\n",
+				mp_ioapic_routing[ioapic].apic_id, ioapic_pin);
+			entry->irq = irq;
+			continue;
+		}
+
+		mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
+
+		if (!io_apic_set_pci_routing(ioapic, ioapic_pin, irq))
+			entry->irq = irq;
+
+		printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d\n",
+			entry->id.segment, entry->id.bus, 
+			entry->id.device, ('A' + entry->pin), 
+			mp_ioapic_routing[ioapic].apic_id, ioapic_pin, 
+			entry->irq);
+	}
+	
+	return;
+}
+
+#endif /*CONFIG_ACPI_PCI*/
+
+#endif /*CONFIG_X86_IO_APIC*/
+
+#endif /*CONFIG_ACPI_BOOT*/
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/pci-irq.c b/arch/i386/kernel/pci-irq.c
--- a/arch/i386/kernel/pci-irq.c	2003-01-25 01:26:40.000000000 -0800
+++ b/arch/i386/kernel/pci-irq.c	2003-01-25 01:30:55.000000000 -0800
@@ -115,7 +115,7 @@
  *  Code for querying and setting of IRQ routes on various interrupt routers.
  */
 
-static void eisa_set_level_irq(unsigned int irq)
+void eisa_set_level_irq(unsigned int irq)
 {
 	unsigned char mask = 1 << (irq & 7);
 	unsigned int port = 0x4d0 + (irq >> 3);
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/pci-pc.c b/arch/i386/kernel/pci-pc.c
--- a/arch/i386/kernel/pci-pc.c	2003-01-25 01:25:38.000000000 -0800
+++ b/arch/i386/kernel/pci-pc.c	2003-01-25 01:30:19.000000000 -0800
@@ -11,6 +11,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
+#include <linux/acpi.h>
 
 #include <asm/segment.h>
 #include <asm/io.h>
@@ -28,6 +29,8 @@
 int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value) = NULL;
 int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value) = NULL;
 
+static int pci_using_acpi_prt = 0;
+
 #ifdef CONFIG_MULTIQUAD
 #define BUS2QUAD(global) (mp_bus_id_to_node[global])
 #define BUS2LOCAL(global) (mp_bus_id_to_local[global])
@@ -1353,6 +1356,23 @@
 	pci_read_bridge_bases(b);
 }
 
+struct pci_bus * __devinit pcibios_scan_root(int busnum)
+{
+	struct list_head *list;
+	struct pci_bus *bus;
+
+	list_for_each(list, &pci_root_buses) {
+		bus = pci_bus_b(list);
+		if (bus->number == busnum) {
+			/* Already scanned */
+			return bus;
+		}
+	}
+
+	printk("PCI: Probing PCI hardware (bus %02x)\n", busnum);
+
+	return pci_scan_bus(busnum, pci_root_ops, NULL);
+}
 
 void __devinit pcibios_config_init(void)
 {
@@ -1394,6 +1414,8 @@
 	return;
 }
 
+int use_acpi_pci __initdata = 1;
+
 void __init pcibios_init(void)
 {
 	int quad;
@@ -1406,7 +1428,19 @@
 	}
 
 	printk(KERN_INFO "PCI: Probing PCI hardware\n");
-	pci_root_bus = pci_scan_bus(0, pci_root_ops, NULL);
+#ifdef CONFIG_ACPI_PCI
+	if (use_acpi_pci && !acpi_pci_irq_init()) {
+		pci_using_acpi_prt = 1;
+		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");
+	}
+#endif
+	if (!pci_using_acpi_prt) {
+		pci_root_bus = pcibios_scan_root(0);
+		pcibios_irq_init();
+		pcibios_fixup_peer_bridges();
+		pcibios_fixup_irqs();
+	}
 	if (clustered_apic_mode && (numnodes > 1)) {
 		for (quad = 1; quad < numnodes; ++quad) {
 			printk("Scanning PCI bus %d for quad %d\n", 
@@ -1416,9 +1450,6 @@
 		}
 	}
 
-	pcibios_irq_init();
-	pcibios_fixup_peer_bridges();
-	pcibios_fixup_irqs();
 	pcibios_resource_survey();
 
 #ifdef CONFIG_PCI_BIOS
@@ -1470,6 +1501,9 @@
 	} else if (!strncmp(str, "lastbus=", 8)) {
 		pcibios_last_bus = simple_strtol(str+8, NULL, 0);
 		return NULL;
+	} else if (!strncmp(str, "noacpi", 6)) {
+		use_acpi_pci = 0;
+		return NULL;
 	}
 	return str;
 }
@@ -1485,6 +1519,15 @@
 
 	if ((err = pcibios_enable_resources(dev, mask)) < 0)
 		return err;
+
+#ifdef CONFIG_ACPI_PCI
+	if (pci_using_acpi_prt) {
+		acpi_pci_irq_enable(dev);
+		return 0;
+	}
+#endif
+
 	pcibios_enable_irq(dev);
+
 	return 0;
 }
diff -Naur -X /root/bin/dontdiff a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c	2003-01-25 01:26:09.000000000 -0800
+++ b/arch/i386/kernel/setup.c	2003-01-25 01:30:22.000000000 -0800
@@ -95,6 +95,7 @@
 #include <linux/delay.h>
 #include <linux/config.h>
 #include <linux/init.h>
+#include <linux/acpi.h>
 #include <linux/apm_bios.h>
 #ifdef CONFIG_BLK_DEV_RAM
 #include <linux/blk.h>
@@ -172,9 +173,10 @@
 static int disable_x86_serial_nr __initdata = 1;
 static int disable_x86_ht __initdata = 0;
 static u32 disabled_x86_caps[NCAPINTS] __initdata = { 0 };
-extern int blk_nohighio;
 
-int enable_acpi_smp_table;
+int acpi_disabled __initdata = 0;
+
+extern int blk_nohighio;
 
 /*
  * This is set up by the setup-routine at boot-time
@@ -795,9 +797,9 @@
 			set_bit(X86_FEATURE_HT, disabled_x86_caps);
 		}
 
-		/* "acpismp=force" forces parsing and use of the ACPI SMP table */
-		else if (!memcmp(from, "acpismp=force", 13))
-			enable_acpi_smp_table = 1;
+		/* "acpi=off" disables both ACPI table parsing and interpreter init */
+		else if (!memcmp(from, "acpi=off", 8))
+			acpi_disabled = 1;
 
 		/*
 		 * highmem=size forces highmem to be exactly 'size' bytes.
@@ -1007,10 +1009,15 @@
 	 */
 	reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
 #endif
-
+#ifdef CONFIG_ACPI_SLEEP
+	/*
+	 * Reserve low memory region for sleep support.
+	 */
+	acpi_reserve_bootmem();
+#endif
 #ifdef CONFIG_X86_LOCAL_APIC
 	/*
-	 * Find and reserve possible boot-time SMP configuration:
+	 * Find and reserve possible boot-time SMP configuration.
 	 */
 	find_smp_config();
 #endif
@@ -1043,7 +1050,6 @@
 {
 	unsigned long low_mem_size;
 	int i;
-
 	probe_roms();
 	for (i = 0; i < e820.nr_map; i++) {
 		struct resource *res;
@@ -1129,21 +1135,10 @@
 
 	max_low_pfn = setup_memory();
 
-	/*
-	 * If enable_acpi_smp_table and HT feature present, acpitable.c
-	 * will find all logical cpus despite disable_x86_ht: so if both
-	 * "noht" and "acpismp=force" are specified, let "noht" override
-	 * "acpismp=force" cleanly.  Why retain "acpismp=force"? because
-	 * parsing ACPI SMP table might prove useful on some non-HT cpu.
-	 */
 	if (disable_x86_ht) {
 		clear_bit(X86_FEATURE_HT, &boot_cpu_data.x86_capability[0]);
 		set_bit(X86_FEATURE_HT, disabled_x86_caps);
-		enable_acpi_smp_table = 0;
 	}
-	if (test_bit(X86_FEATURE_HT, &boot_cpu_data.x86_capability[0]))
-		enable_acpi_smp_table = 1;
-	
 
 	/*
 	 * NOTE: before this point _nobody_ is allowed to allocate
@@ -1154,6 +1149,13 @@
 	smp_alloc_memory(); /* AP processor realmode stacks in low memory*/
 #endif
 	paging_init();
+#ifdef CONFIG_ACPI_BOOT
+	/*
+	 * Parse the ACPI tables for possible boot-time SMP configuration.
+	 */
+	if (!acpi_disabled)
+		acpi_boot_init();
+#endif
 #ifdef CONFIG_X86_LOCAL_APIC
 	/*
 	 * get boot-time SMP configuration:
diff -Naur -X /root/bin/dontdiff a/Documentation/Configure.help b/Documentation/Configure.help
--- a/Documentation/Configure.help	2003-01-25 01:26:37.000000000 -0800
+++ b/Documentation/Configure.help	2003-01-25 01:30:47.000000000 -0800
@@ -18567,6 +18567,30 @@
   This driver handles overheating conditions on laptops. It is HIGHLY
   recommended, as your laptop CPU may be damaged without it.
 
+ACPI Toshiba Laptop Extras
+CONFIG_ACPI_TOSHIBA
+  This driver adds support for access to certain system settings
+  on "legacy free" Toshiba laptops.  These laptops can be recognized by
+  their lack of a BIOS setup menu and APM support.
+
+  On these machines, all system configuration is handled through the
+  ACPI.  This driver is required for access to controls not covered
+  by the general ACPI drivers, such as LCD brightness, video output,
+  etc.
+
+  This driver differs from the non-ACPI Toshiba laptop driver (located
+  under "Processor type and features") in several aspects.
+  Configuration is accessed by reading and writing text files in the
+  /proc tree instead of by program interface to /dev.  Furthermore, no
+  power management functions are exposed, as those are handled by the
+  general ACPI drivers.
+
+  More information about this driver is available at
+  <http://memebeam.org/toys/ToshibaAcpiDriver>.
+
+  If you have a legacy free Toshiba laptop (such as the Libretto L1
+  series), say Y.
+
 Advanced Power Management BIOS support
 CONFIG_APM
   APM is a BIOS specification for saving power using several different
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/ac.c b/drivers/acpi/ac.c
--- a/drivers/acpi/ac.c	1969-12-31 16:00:00.000000000 -0800
+++ b/drivers/acpi/ac.c	2003-01-25 01:30:33.000000000 -0800
@@ -0,0 +1,346 @@
+/*
+ *  acpi_ac.c - ACPI AC Adapter Driver ($Revision: 26 $)
+ *
+ *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
+ *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/compatmac.h>
+#include <linux/proc_fs.h>
+#include "acpi_bus.h"
+#include "acpi_drivers.h"
+
+
+#define _COMPONENT		ACPI_AC_COMPONENT
+ACPI_MODULE_NAME		("acpi_ac")
+
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+
+#define PREFIX			"ACPI: "
+
+
+int acpi_ac_add (struct acpi_device *device);
+int acpi_ac_remove (struct acpi_device *device, int type);
+
+static struct acpi_driver acpi_ac_driver = {
+	.name =		ACPI_AC_DRIVER_NAME,
+	.class =	ACPI_AC_CLASS,
+	.ids =		ACPI_AC_HID,
+	.ops =		{
+				.add =		acpi_ac_add,
+				.remove =	acpi_ac_remove,
+			},
+};
+
+struct acpi_ac {
+	acpi_handle		handle;
+	unsigned long		state;
+};
+
+
+/* --------------------------------------------------------------------------
+                               AC Adapter Management
+   -------------------------------------------------------------------------- */
+
+static int
+acpi_ac_get_state (
+	struct acpi_ac		*ac)
+{
+	acpi_status		status = AE_OK;
+
+	ACPI_FUNCTION_TRACE("acpi_ac_get_state");
+
+	if (!ac)
+		return_VALUE(-EINVAL);
+
+	status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error reading AC Adapter state\n"));
+		ac->state = ACPI_AC_STATUS_UNKNOWN;
+		return_VALUE(-ENODEV);
+	}
+	
+	return_VALUE(0);
+}
+
+
+/* --------------------------------------------------------------------------
+                              FS Interface (/proc)
+   -------------------------------------------------------------------------- */
+
+struct proc_dir_entry		*acpi_ac_dir = NULL;
+
+static int
+acpi_ac_read_state (
+	char			*page,
+	char			**start,
+	off_t			off,
+	int 			count,
+	int 			*eof,
+	void			*data)
+{
+	struct acpi_ac		*ac = (struct acpi_ac *) data;
+	char			*p = page;
+	int			len = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_ac_read_state");
+
+	if (!ac || (off != 0))
+		goto end;
+
+	if (acpi_ac_get_state(ac)) {
+		p += sprintf(p, "ERROR: Unable to read AC Adapter state\n");
+		goto end;
+	}
+
+	p += sprintf(p, "state:                   ");
+	switch (ac->state) {
+	case ACPI_AC_STATUS_OFFLINE:
+		p += sprintf(p, "off-line\n");
+		break;
+	case ACPI_AC_STATUS_ONLINE:
+		p += sprintf(p, "on-line\n");
+		break;
+	default:
+		p += sprintf(p, "unknown\n");
+		break;
+	}
+
+end:
+	len = (p - page);
+	if (len <= off+count) *eof = 1;
+	*start = page + off;
+	len -= off;
+	if (len>count) len = count;
+	if (len<0) len = 0;
+
+	return_VALUE(len);
+}
+
+
+static int
+acpi_ac_add_fs (
+	struct acpi_device	*device)
+{
+	struct proc_dir_entry	*entry = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_ac_add_fs");
+
+	if (!acpi_device_dir(device)) {
+		acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
+			acpi_ac_dir);
+		if (!acpi_device_dir(device))
+			return_VALUE(-ENODEV);
+	}
+
+	/* 'state' [R] */
+	entry = create_proc_entry(ACPI_AC_FILE_STATE,
+		S_IRUGO, acpi_device_dir(device));
+	if (!entry)
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Unable to create '%s' fs entry\n",
+			ACPI_AC_FILE_STATE));
+	else {
+		entry->read_proc = acpi_ac_read_state;
+		entry->data = acpi_driver_data(device);
+	}
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_ac_remove_fs (
+	struct acpi_device	*device)
+{
+	ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
+
+	if (acpi_device_dir(device)) {
+		remove_proc_entry(acpi_device_bid(device), acpi_ac_dir);
+		acpi_device_dir(device) = NULL;
+	}
+
+	return_VALUE(0);
+}
+
+
+/* --------------------------------------------------------------------------
+                                   Driver Model
+   -------------------------------------------------------------------------- */
+
+void
+acpi_ac_notify (
+	acpi_handle		handle,
+	u32			event,
+	void			*data)
+{
+	struct acpi_ac		*ac = (struct acpi_ac *) data;
+	struct acpi_device	*device = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_ac_notify");
+
+	if (!ac)
+		return;
+
+	if (acpi_bus_get_device(ac->handle, &device))
+		return_VOID;
+
+	switch (event) {
+	case ACPI_AC_NOTIFY_STATUS:
+		acpi_ac_get_state(ac);
+		acpi_bus_generate_event(device, event, (u32) ac->state);
+		break;
+	default:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"Unsupported event [0x%x]\n", event));
+		break;
+	}
+
+	return_VOID;
+}
+
+
+int
+acpi_ac_add (
+	struct acpi_device	*device)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	struct acpi_ac		*ac = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_ac_add");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL);
+	if (!ac)
+		return_VALUE(-ENOMEM);
+	memset(ac, 0, sizeof(struct acpi_ac));
+
+	ac->handle = device->handle;
+	sprintf(acpi_device_name(device), "%s", ACPI_AC_DEVICE_NAME);
+	sprintf(acpi_device_class(device), "%s", ACPI_AC_CLASS);
+	acpi_driver_data(device) = ac;
+
+	result = acpi_ac_get_state(ac);
+	if (result)
+		goto end;
+
+	result = acpi_ac_add_fs(device);
+	if (result)
+		goto end;
+
+	status = acpi_install_notify_handler(ac->handle,
+		ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error installing notify handler\n"));
+		result = -ENODEV;
+		goto end;
+	}
+
+	printk(KERN_INFO PREFIX "%s [%s] (%s)\n", 
+		acpi_device_name(device), acpi_device_bid(device), 
+		ac->state?"on-line":"off-line");
+
+end:
+	if (result) {
+		acpi_ac_remove_fs(device);
+		kfree(ac);
+	}
+
+	return_VALUE(result);
+}
+
+
+int
+acpi_ac_remove (
+	struct acpi_device	*device,
+	int			type)
+{
+	acpi_status		status = AE_OK;
+	struct acpi_ac		*ac = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_ac_remove");
+
+	if (!device || !acpi_driver_data(device))
+		return_VALUE(-EINVAL);
+
+	ac = (struct acpi_ac *) acpi_driver_data(device);
+
+	status = acpi_remove_notify_handler(ac->handle,
+		ACPI_DEVICE_NOTIFY, acpi_ac_notify);
+	if (ACPI_FAILURE(status))
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error removing notify handler\n"));
+
+	acpi_ac_remove_fs(device);
+
+	kfree(ac);
+
+	return_VALUE(0);
+}
+
+
+int __init
+acpi_ac_init (void)
+{
+	int			result = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_ac_init");
+
+	acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
+	if (!acpi_ac_dir)
+		return_VALUE(-ENODEV);
+
+	result = acpi_bus_register_driver(&acpi_ac_driver);
+	if (result < 0) {
+		remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
+		return_VALUE(-ENODEV);
+	}
+
+	return_VALUE(0);
+}
+
+
+void __exit
+acpi_ac_exit (void)
+{
+	ACPI_FUNCTION_TRACE("acpi_ac_exit");
+
+	acpi_bus_unregister_driver(&acpi_ac_driver);
+
+	remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
+
+	return_VOID;
+}
+
+
+module_init(acpi_ac_init);
+module_exit(acpi_ac_exit);
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/acpi_ksyms.c b/drivers/acpi/acpi_ksyms.c
--- a/drivers/acpi/acpi_ksyms.c	2003-01-25 01:25:31.000000000 -0800
+++ b/drivers/acpi/acpi_ksyms.c	2003-01-25 01:30:17.000000000 -0800
@@ -1,64 +1,56 @@
 /*
- *  ksyms.c - ACPI exported symbols
+ *  acpi_ksyms.c - ACPI Kernel Symbols ($Revision: 15 $)
  *
- *  Copyright (C) 2000 Andrew Grover
+ *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
+ *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
 #include <linux/acpi.h>
-#include "acpi.h"
-#include "acdebug.h"
 
-extern int acpi_in_debugger;
-extern FADT_DESCRIPTOR acpi_fadt;
+#ifdef CONFIG_ACPI_INTERPRETER
 
-#define _COMPONENT	OS_DEPENDENT
-	MODULE_NAME	("symbols")
+/* ACPI Debugger */
 
 #ifdef ENABLE_DEBUGGER
+
+extern int			acpi_in_debugger;
+
 EXPORT_SYMBOL(acpi_in_debugger);
 EXPORT_SYMBOL(acpi_db_user_commands);
-#endif
 
-#ifdef ACPI_DEBUG
+#endif /* ENABLE_DEBUGGER */
+
+/* ACPI Core Subsystem */
+
+#ifdef ACPI_DEBUG_OUTPUT
+EXPORT_SYMBOL(acpi_dbg_layer);
+EXPORT_SYMBOL(acpi_dbg_level);
 EXPORT_SYMBOL(acpi_ut_debug_print_raw);
 EXPORT_SYMBOL(acpi_ut_debug_print);
 EXPORT_SYMBOL(acpi_ut_status_exit);
+EXPORT_SYMBOL(acpi_ut_value_exit);
 EXPORT_SYMBOL(acpi_ut_exit);
 EXPORT_SYMBOL(acpi_ut_trace);
-#endif
-
-EXPORT_SYMBOL(acpi_gbl_FADT);
-
-EXPORT_SYMBOL(acpi_os_free);
-EXPORT_SYMBOL(acpi_os_printf);
-EXPORT_SYMBOL(acpi_os_callocate);
-EXPORT_SYMBOL(acpi_os_sleep);
-EXPORT_SYMBOL(acpi_os_stall);
-EXPORT_SYMBOL(acpi_os_queue_for_execution);
-
-EXPORT_SYMBOL(acpi_dbg_layer);
-EXPORT_SYMBOL(acpi_dbg_level);
-
-EXPORT_SYMBOL(acpi_format_exception);
+#endif /*ACPI_DEBUG_OUTPUT*/
 
 EXPORT_SYMBOL(acpi_get_handle);
 EXPORT_SYMBOL(acpi_get_parent);
@@ -68,7 +60,7 @@
 EXPORT_SYMBOL(acpi_get_next_object);
 EXPORT_SYMBOL(acpi_evaluate_object);
 EXPORT_SYMBOL(acpi_get_table);
-
+EXPORT_SYMBOL(acpi_get_firmware_table);
 EXPORT_SYMBOL(acpi_install_notify_handler);
 EXPORT_SYMBOL(acpi_remove_notify_handler);
 EXPORT_SYMBOL(acpi_install_gpe_handler);
@@ -77,40 +69,84 @@
 EXPORT_SYMBOL(acpi_remove_address_space_handler);
 EXPORT_SYMBOL(acpi_install_fixed_event_handler);
 EXPORT_SYMBOL(acpi_remove_fixed_event_handler);
-
 EXPORT_SYMBOL(acpi_acquire_global_lock);
 EXPORT_SYMBOL(acpi_release_global_lock);
-
 EXPORT_SYMBOL(acpi_get_current_resources);
 EXPORT_SYMBOL(acpi_get_possible_resources);
 EXPORT_SYMBOL(acpi_set_current_resources);
-
 EXPORT_SYMBOL(acpi_enable_event);
 EXPORT_SYMBOL(acpi_disable_event);
 EXPORT_SYMBOL(acpi_clear_event);
-
 EXPORT_SYMBOL(acpi_get_timer_duration);
 EXPORT_SYMBOL(acpi_get_timer);
+EXPORT_SYMBOL(acpi_get_sleep_type_data);
+EXPORT_SYMBOL(acpi_get_register);
+EXPORT_SYMBOL(acpi_set_register);
+EXPORT_SYMBOL(acpi_enter_sleep_state);
+EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios);
+EXPORT_SYMBOL(acpi_get_system_info);
+EXPORT_SYMBOL(acpi_get_devices);
+
+/* ACPI OS Services Layer (acpi_osl.c) */
 
+EXPORT_SYMBOL(acpi_os_free);
+EXPORT_SYMBOL(acpi_os_printf);
+EXPORT_SYMBOL(acpi_os_sleep);
+EXPORT_SYMBOL(acpi_os_stall);
+EXPORT_SYMBOL(acpi_os_signal);
+EXPORT_SYMBOL(acpi_os_queue_for_execution);
 EXPORT_SYMBOL(acpi_os_signal_semaphore);
 EXPORT_SYMBOL(acpi_os_create_semaphore);
 EXPORT_SYMBOL(acpi_os_delete_semaphore);
 EXPORT_SYMBOL(acpi_os_wait_semaphore);
 
-EXPORT_SYMBOL(acpi_os_read_port);
-EXPORT_SYMBOL(acpi_os_write_port);
+EXPORT_SYMBOL(acpi_os_read_pci_configuration);
+
+/* ACPI Utilities (acpi_utils.c) */
+
+EXPORT_SYMBOL(acpi_extract_package);
+EXPORT_SYMBOL(acpi_evaluate_integer);
+EXPORT_SYMBOL(acpi_evaluate_reference);
+
+#endif /*CONFIG_ACPI_INTERPRETER*/
+
+
+/* ACPI Bus Driver (acpi_bus.c) */
+
+#ifdef CONFIG_ACPI_BUS
 
 EXPORT_SYMBOL(acpi_fadt);
-EXPORT_SYMBOL(acpi_hw_register_bit_access);
-EXPORT_SYMBOL(acpi_hw_obtain_sleep_type_register_data);
-EXPORT_SYMBOL(acpi_enter_sleep_state);
-EXPORT_SYMBOL(acpi_get_system_info);
-EXPORT_SYMBOL(acpi_leave_sleep_state);
 EXPORT_SYMBOL(acpi_walk_namespace);
-/*EXPORT_SYMBOL(acpi_save_state_mem);*/
-/*EXPORT_SYMBOL(acpi_save_state_disk);*/
-EXPORT_SYMBOL(acpi_hw_register_read);
-EXPORT_SYMBOL(acpi_set_firmware_waking_vector);
-EXPORT_SYMBOL(acpi_subsystem_status);
+EXPORT_SYMBOL(acpi_root_dir);
+EXPORT_SYMBOL(acpi_bus_get_device);
+EXPORT_SYMBOL(acpi_bus_get_status);
+EXPORT_SYMBOL(acpi_bus_get_power);
+EXPORT_SYMBOL(acpi_bus_set_power);
+EXPORT_SYMBOL(acpi_bus_generate_event);
+EXPORT_SYMBOL(acpi_bus_receive_event);
+EXPORT_SYMBOL(acpi_bus_register_driver);
+EXPORT_SYMBOL(acpi_bus_unregister_driver);
+EXPORT_SYMBOL(acpi_bus_scan);
+EXPORT_SYMBOL(acpi_init);
+
+#endif /*CONFIG_ACPI_BUS*/
+
+
+/* ACPI PCI Driver (pci_irq.c) */
+
+#ifdef CONFIG_ACPI_PCI
+
+#include <linux/pci.h>
+extern int acpi_pci_irq_enable(struct pci_dev *dev);
+EXPORT_SYMBOL(acpi_pci_irq_enable);
+extern int acpi_pci_irq_lookup (int segment, int bus, int device, int pin);
+EXPORT_SYMBOL(acpi_pci_irq_lookup);
+#endif /*CONFIG_ACPI_PCI */
+
+#ifdef CONFIG_ACPI_EC
+/* ACPI EC driver (ec.c) */
+
+EXPORT_SYMBOL(ec_read);
+EXPORT_SYMBOL(ec_write);
+#endif
 
-EXPORT_SYMBOL(acpi_os_signal);
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/battery.c b/drivers/acpi/battery.c
--- a/drivers/acpi/battery.c	1969-12-31 16:00:00.000000000 -0800
+++ b/drivers/acpi/battery.c	2003-01-25 01:30:13.000000000 -0800
@@ -0,0 +1,825 @@
+/*
+ *  acpi_battery.c - ACPI Battery Driver ($Revision: 36 $)
+ *
+ *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
+ *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/compatmac.h>
+#include <linux/proc_fs.h>
+#include "acpi_bus.h"
+#include "acpi_drivers.h"
+
+
+#define _COMPONENT		ACPI_BATTERY_COMPONENT
+ACPI_MODULE_NAME		("acpi_battery")
+
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+
+#define PREFIX			"ACPI: "
+
+
+#define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF
+
+#define ACPI_BATTERY_FORMAT_BIF	"NNNNNNNNNSSSS"
+#define ACPI_BATTERY_FORMAT_BST	"NNNN"
+
+static int acpi_battery_add (struct acpi_device *device);
+static int acpi_battery_remove (struct acpi_device *device, int type);
+
+static struct acpi_driver acpi_battery_driver = {
+	.name =		ACPI_BATTERY_DRIVER_NAME,
+	.class =	ACPI_BATTERY_CLASS,
+	.ids =		ACPI_BATTERY_HID,
+	.ops =		{
+				.add =		acpi_battery_add,
+				.remove =	acpi_battery_remove,
+			},
+};
+
+struct acpi_battery_status {
+	acpi_integer		state;
+	acpi_integer		present_rate;
+	acpi_integer		remaining_capacity;
+	acpi_integer		present_voltage;
+};
+
+struct acpi_battery_info {
+	acpi_integer		power_unit;
+	acpi_integer		design_capacity;
+	acpi_integer		last_full_capacity;
+	acpi_integer		battery_technology;
+	acpi_integer		design_voltage;
+	acpi_integer		design_capacity_warning;
+	acpi_integer		design_capacity_low;
+	acpi_integer		battery_capacity_granularity_1;
+	acpi_integer		battery_capacity_granularity_2;
+	acpi_string		model_number;
+	acpi_string		serial_number;
+	acpi_string		battery_type;
+	acpi_string		oem_info;
+};
+
+struct acpi_battery_flags {
+	u8			present:1;	/* Bay occupied? */
+	u8			power_unit:1;	/* 0=watts, 1=apms */
+	u8			alarm:1;	/* _BTP present? */
+	u8			reserved:5;
+};
+
+struct acpi_battery_trips {
+	unsigned long		warning;
+	unsigned long		low;
+};
+
+struct acpi_battery {
+	acpi_handle		handle;
+	struct acpi_battery_flags flags;
+	struct acpi_battery_trips trips;
+	unsigned long		alarm;
+	struct acpi_battery_info *info;
+};
+
+
+/* --------------------------------------------------------------------------
+                               Battery Management
+   -------------------------------------------------------------------------- */
+
+static int
+acpi_battery_get_info (
+	struct acpi_battery	*battery,
+	struct acpi_battery_info **bif)
+{
+	int			result = 0;
+	acpi_status 		status = 0;
+	struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+	struct acpi_buffer	format = {sizeof(ACPI_BATTERY_FORMAT_BIF),
+						ACPI_BATTERY_FORMAT_BIF};
+	struct acpi_buffer	data = {0, NULL};
+	union acpi_object	*package = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_get_info");
+
+	if (!battery || !bif)
+		return_VALUE(-EINVAL);
+
+	/* Evalute _BIF */
+
+	status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n"));
+		return_VALUE(-ENODEV);
+	}
+
+	package = (union acpi_object *) buffer.pointer;
+
+	/* Extract Package Data */
+
+	status = acpi_extract_package(package, &format, &data);
+	if (status != AE_BUFFER_OVERFLOW) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
+		result = -ENODEV;
+		goto end;
+	}
+
+	data.pointer = kmalloc(data.length, GFP_KERNEL);
+	if (!data.pointer) {
+		result = -ENOMEM;
+		goto end;
+	}
+	memset(data.pointer, 0, data.length);
+
+	status = acpi_extract_package(package, &format, &data);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n"));
+		kfree(data.pointer);
+		result = -ENODEV;
+		goto end;
+	}
+
+end:
+	acpi_os_free(buffer.pointer);
+
+	if (!result)
+		(*bif) = (struct acpi_battery_info *) data.pointer;
+
+	return_VALUE(result);
+}
+
+static int
+acpi_battery_get_status (
+	struct acpi_battery	*battery,
+	struct acpi_battery_status **bst)
+{
+	int			result = 0;
+	acpi_status 		status = 0;
+	struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+	struct acpi_buffer	format = {sizeof(ACPI_BATTERY_FORMAT_BST),
+						ACPI_BATTERY_FORMAT_BST};
+	struct acpi_buffer	data = {0, NULL};
+	union acpi_object	*package = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_get_status");
+
+	if (!battery || !bst)
+		return_VALUE(-EINVAL);
+
+	/* Evalute _BST */
+
+	status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n"));
+		return_VALUE(-ENODEV);
+	}
+
+	package = (union acpi_object *) buffer.pointer;
+
+	/* Extract Package Data */
+
+	status = acpi_extract_package(package, &format, &data);
+	if (status != AE_BUFFER_OVERFLOW) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
+		result = -ENODEV;
+		goto end;
+	}
+
+	data.pointer = kmalloc(data.length, GFP_KERNEL);
+	if (!data.pointer) {
+		result = -ENOMEM;
+		goto end;
+	}
+	memset(data.pointer, 0, data.length);
+
+	status = acpi_extract_package(package, &format, &data);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n"));
+		kfree(data.pointer);
+		result = -ENODEV;
+		goto end;
+	}
+
+end:
+	acpi_os_free(buffer.pointer);
+
+	if (!result)
+		(*bst) = (struct acpi_battery_status *) data.pointer;
+
+	return_VALUE(result);
+}
+
+
+static int
+acpi_battery_set_alarm (
+	struct acpi_battery	*battery,
+	unsigned long		alarm)
+{
+	acpi_status		status = 0;
+	union acpi_object	arg0 = {ACPI_TYPE_INTEGER};
+	struct acpi_object_list	arg_list = {1, &arg0};
+
+	ACPI_FUNCTION_TRACE("acpi_battery_set_alarm");
+
+	if (!battery)
+		return_VALUE(-EINVAL);
+
+	if (!battery->flags.alarm)
+		return_VALUE(-ENODEV);
+
+	arg0.integer.value = alarm;
+
+	status = acpi_evaluate_object(battery->handle, "_BTP", &arg_list, NULL);
+	if (ACPI_FAILURE(status))
+		return_VALUE(-ENODEV);
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", (u32) alarm));
+
+	battery->alarm = alarm;
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_battery_check (
+	struct acpi_battery	*battery)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	acpi_handle		handle = NULL;
+	struct acpi_device	*device = NULL;
+	struct acpi_battery_info *bif = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_check");
+	
+	if (!battery)
+		return_VALUE(-EINVAL);
+
+	result = acpi_bus_get_device(battery->handle, &device);
+	if (result)
+		return_VALUE(result);
+
+	result = acpi_bus_get_status(device);
+	if (result)
+		return_VALUE(result);
+
+	/* Insertion? */
+
+	if (!battery->flags.present && device->status.battery_present) {
+
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Battery inserted\n"));
+
+		/* Evalute _BIF to get certain static information */
+
+		result = acpi_battery_get_info(battery, &bif);
+		if (result)
+			return_VALUE(result);
+
+		battery->flags.power_unit = bif->power_unit;
+		battery->trips.warning = bif->design_capacity_warning;
+		battery->trips.low = bif->design_capacity_low;
+		kfree(bif);
+
+		/* See if alarms are supported, and if so, set default */
+
+		status = acpi_get_handle(battery->handle, "_BTP", &handle);
+		if (ACPI_SUCCESS(status)) {
+			battery->flags.alarm = 1;
+			acpi_battery_set_alarm(battery, battery->trips.warning);
+		}
+	}
+
+	/* Removal? */
+
+	else if (battery->flags.present && !device->status.battery_present) {
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Battery removed\n"));
+	}
+
+	battery->flags.present = device->status.battery_present;
+
+	return_VALUE(result);
+}
+
+
+/* --------------------------------------------------------------------------
+                              FS Interface (/proc)
+   -------------------------------------------------------------------------- */
+
+struct proc_dir_entry		*acpi_battery_dir = NULL;
+
+static int
+acpi_battery_read_info (
+	char			*page,
+	char			**start,
+	off_t			off,
+	int 			count,
+	int 			*eof,
+	void			*data)
+{
+	int			result = 0;
+	struct acpi_battery	*battery = (struct acpi_battery *) data;
+	struct acpi_battery_info *bif = NULL;
+	char			*units = "?";
+	char			*p = page;
+	int			len = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_read_info");
+
+	if (!battery)
+		goto end;
+
+	if (battery->flags.present)
+		p += sprintf(p, "present:                 yes\n");
+	else {
+		p += sprintf(p, "present:                 no\n");
+		goto end;
+	}
+
+	/* Battery Info (_BIF) */
+
+	result = acpi_battery_get_info(battery, &bif);
+	if (result || !bif) {
+		p += sprintf(p, "ERROR: Unable to read battery information\n");
+		goto end;
+	}
+
+	units = bif->power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+					
+	if (bif->design_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
+		p += sprintf(p, "design capacity:         unknown\n");
+	else
+		p += sprintf(p, "design capacity:         %d %sh\n",
+			(u32) bif->design_capacity, units);
+
+	if (bif->last_full_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
+		p += sprintf(p, "last full capacity:      unknown\n");
+	else
+		p += sprintf(p, "last full capacity:      %d %sh\n",
+			(u32) bif->last_full_capacity, units);
+
+	switch ((u32) bif->battery_technology) {
+	case 0:
+		p += sprintf(p, "battery technology:      non-rechargeable\n");
+		break;
+	case 1:
+		p += sprintf(p, "battery technology:      rechargeable\n");
+		break;
+	default:
+		p += sprintf(p, "battery technology:      unknown\n");
+		break;
+	}
+
+	if (bif->design_voltage == ACPI_BATTERY_VALUE_UNKNOWN)
+		p += sprintf(p, "design voltage:          unknown\n");
+	else
+		p += sprintf(p, "design voltage:          %d mV\n",
+			(u32) bif->design_voltage);
+	
+	p += sprintf(p, "design capacity warning: %d %sh\n",
+		(u32) bif->design_capacity_warning, units);
+	p += sprintf(p, "design capacity low:     %d %sh\n",
+		(u32) bif->design_capacity_low, units);
+	p += sprintf(p, "capacity granularity 1:  %d %sh\n",
+		(u32) bif->battery_capacity_granularity_1, units);
+	p += sprintf(p, "capacity granularity 2:  %d %sh\n",
+		(u32) bif->battery_capacity_granularity_2, units);
+	p += sprintf(p, "model number:            %s\n",
+		bif->model_number);
+	p += sprintf(p, "serial number:           %s\n",
+		bif->serial_number);
+	p += sprintf(p, "battery type:            %s\n",
+		bif->battery_type);
+	p += sprintf(p, "OEM info:                %s\n",
+		bif->oem_info);
+
+end:
+	kfree(bif);
+
+	len = (p - page);
+	if (len <= off+count) *eof = 1;
+	*start = page + off;
+	len -= off;
+	if (len>count) len = count;
+	if (len<0) len = 0;
+
+	return_VALUE(len);
+}
+
+
+static int
+acpi_battery_read_state (
+	char			*page,
+	char			**start,
+	off_t			off,
+	int 			count,
+	int 			*eof,
+	void			*data)
+{
+	int			result = 0;
+	struct acpi_battery	*battery = (struct acpi_battery *) data;
+	struct acpi_battery_status *bst = NULL;
+	char			*units = "?";
+	char			*p = page;
+	int			len = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_read_state");
+
+	if (!battery)
+		goto end;
+
+	if (battery->flags.present)
+		p += sprintf(p, "present:                 yes\n");
+	else {
+		p += sprintf(p, "present:                 no\n");
+		goto end;
+	}
+
+	/* Battery Units */
+
+	units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+
+	/* Battery Status (_BST) */
+
+	result = acpi_battery_get_status(battery, &bst);
+	if (result || !bst) {
+		p += sprintf(p, "ERROR: Unable to read battery status\n");
+		goto end;
+	}
+
+	if (!(bst->state & 0x04))
+		p += sprintf(p, "capacity state:          ok\n");
+	else
+		p += sprintf(p, "capacity state:          critical\n");
+
+	if ((bst->state & 0x01) && (bst->state & 0x02))
+		p += sprintf(p, "charging state:          charging/discharging\n");
+	else if (bst->state & 0x01)
+		p += sprintf(p, "charging state:          discharging\n");
+	else if (bst->state & 0x02)
+		p += sprintf(p, "charging state:          charging\n");
+	else
+		p += sprintf(p, "charging state:          unknown\n");
+
+	if (bst->present_rate == ACPI_BATTERY_VALUE_UNKNOWN)
+		p += sprintf(p, "present rate:            unknown\n");
+	else
+		p += sprintf(p, "present rate:            %d %s\n",
+			(u32) bst->present_rate, units);
+
+	if (bst->remaining_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
+		p += sprintf(p, "remaining capacity:      unknown\n");
+	else
+		p += sprintf(p, "remaining capacity:      %d %sh\n",
+			(u32) bst->remaining_capacity, units);
+
+	if (bst->present_voltage == ACPI_BATTERY_VALUE_UNKNOWN)
+		p += sprintf(p, "present voltage:         unknown\n");
+	else
+		p += sprintf(p, "present voltage:         %d mV\n",
+			(u32) bst->present_voltage);
+
+end:
+	kfree(bst);
+
+	len = (p - page);
+	if (len <= off+count) *eof = 1;
+	*start = page + off;
+	len -= off;
+	if (len>count) len = count;
+	if (len<0) len = 0;
+
+	return_VALUE(len);
+}
+
+
+static int
+acpi_battery_read_alarm (
+	char			*page,
+	char			**start,
+	off_t			off,
+	int 			count,
+	int 			*eof,
+	void			*data)
+{
+	struct acpi_battery	*battery = (struct acpi_battery *) data;
+	char			*units = "?";
+	char			*p = page;
+	int			len = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
+
+	if (!battery)
+		goto end;
+
+	if (!battery->flags.present) {
+		p += sprintf(p, "present:                 no\n");
+		goto end;
+	}
+
+	/* Battery Units */
+	
+	units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+
+	/* Battery Alarm */
+
+	p += sprintf(p, "alarm:                   ");
+	if (!battery->alarm)
+		p += sprintf(p, "unsupported\n");
+	else
+		p += sprintf(p, "%d %sh\n", (u32) battery->alarm, units);
+
+end:
+	len = (p - page);
+	if (len <= off+count) *eof = 1;
+	*start = page + off;
+	len -= off;
+	if (len>count) len = count;
+	if (len<0) len = 0;
+
+	return_VALUE(len);
+}
+
+
+static int
+acpi_battery_write_alarm (
+	struct file		*file,
+	const char		*buffer,
+	unsigned long		count,
+	void			*data)
+{
+	int			result = 0;
+	struct acpi_battery	*battery = (struct acpi_battery *) data;
+	char			alarm_string[12] = {'\0'};
+
+	ACPI_FUNCTION_TRACE("acpi_battery_write_alarm");
+
+	if (!battery || (count > sizeof(alarm_string) - 1))
+		return_VALUE(-EINVAL);
+
+	if (!battery->flags.present)
+		return_VALUE(-ENODEV);
+
+	if (copy_from_user(alarm_string, buffer, count))
+		return_VALUE(-EFAULT);
+	
+	alarm_string[count] = '\0';
+
+	result = acpi_battery_set_alarm(battery, 
+		simple_strtoul(alarm_string, NULL, 0));
+	if (result)
+		return_VALUE(result);
+
+	return_VALUE(count);
+}
+
+
+static int
+acpi_battery_add_fs (
+	struct acpi_device	*device)
+{
+	struct proc_dir_entry	*entry = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_add_fs");
+
+	if (!acpi_device_dir(device)) {
+		acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
+			acpi_battery_dir);
+		if (!acpi_device_dir(device))
+			return_VALUE(-ENODEV);
+	}
+
+	/* 'info' [R] */
+	entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
+		S_IRUGO, acpi_device_dir(device));
+	if (!entry)
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Unable to create '%s' fs entry\n",
+			ACPI_BATTERY_FILE_INFO));
+	else {
+		entry->read_proc = acpi_battery_read_info;
+		entry->data = acpi_driver_data(device);
+	}
+
+	/* 'status' [R] */
+	entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
+		S_IRUGO, acpi_device_dir(device));
+	if (!entry)
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Unable to create '%s' fs entry\n",
+			ACPI_BATTERY_FILE_STATUS));
+	else {
+		entry->read_proc = acpi_battery_read_state;
+		entry->data = acpi_driver_data(device);
+	}
+
+	/* 'alarm' [R/W] */
+	entry = create_proc_entry(ACPI_BATTERY_FILE_ALARM,
+		S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device));
+	if (!entry)
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Unable to create '%s' fs entry\n",
+			ACPI_BATTERY_FILE_ALARM));
+	else {
+		entry->read_proc = acpi_battery_read_alarm;
+		entry->write_proc = acpi_battery_write_alarm;
+		entry->data = acpi_driver_data(device);
+	}
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_battery_remove_fs (
+	struct acpi_device	*device)
+{
+	ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
+
+	if (acpi_device_dir(device)) {
+		remove_proc_entry(acpi_device_bid(device), acpi_battery_dir);
+		acpi_device_dir(device) = NULL;
+	}
+
+	return_VALUE(0);
+}
+
+
+/* --------------------------------------------------------------------------
+                                 Driver Interface
+   -------------------------------------------------------------------------- */
+
+static void
+acpi_battery_notify (
+	acpi_handle		handle,
+	u32			event,
+	void			*data)
+{
+	struct acpi_battery	*battery = (struct acpi_battery *) data;
+	struct acpi_device	*device = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_notify");
+
+	if (!battery)
+		return_VOID;
+
+	if (acpi_bus_get_device(handle, &device))
+		return_VOID;
+
+	switch (event) {
+	case ACPI_BATTERY_NOTIFY_STATUS:
+	case ACPI_BATTERY_NOTIFY_INFO:
+		acpi_battery_check(battery);
+		acpi_bus_generate_event(device, event, battery->flags.present);
+		break;
+	default:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"Unsupported event [0x%x]\n", event));
+		break;
+	}
+
+	return_VOID;
+}
+
+
+static int
+acpi_battery_add (
+	struct acpi_device	*device)
+{
+	int			result = 0;
+	acpi_status		status = 0;
+	struct acpi_battery	*battery = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_add");
+	
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL);
+	if (!battery)
+		return_VALUE(-ENOMEM);
+	memset(battery, 0, sizeof(struct acpi_battery));
+
+	battery->handle = device->handle;
+	sprintf(acpi_device_name(device), "%s", ACPI_BATTERY_DEVICE_NAME);
+	sprintf(acpi_device_class(device), "%s", ACPI_BATTERY_CLASS);
+	acpi_driver_data(device) = battery;
+
+	result = acpi_battery_check(battery);
+	if (result)
+		goto end;
+
+	result = acpi_battery_add_fs(device);
+	if (result)
+		goto end;
+
+	status = acpi_install_notify_handler(battery->handle,
+		ACPI_DEVICE_NOTIFY, acpi_battery_notify, battery);
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error installing notify handler\n"));
+		result = -ENODEV;
+		goto end;
+	}
+
+	printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n",
+		ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
+		device->status.battery_present?"present":"absent");
+		
+end:
+	if (result) {
+		acpi_battery_remove_fs(device);
+		kfree(battery);
+	}
+
+	return_VALUE(result);
+}
+
+
+static int
+acpi_battery_remove (
+	struct acpi_device	*device,
+	int			type)
+{
+	acpi_status		status = 0;
+	struct acpi_battery	*battery = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_remove");
+
+	if (!device || !acpi_driver_data(device))
+		return_VALUE(-EINVAL);
+
+	battery = (struct acpi_battery *) acpi_driver_data(device);
+
+	status = acpi_remove_notify_handler(battery->handle,
+		ACPI_DEVICE_NOTIFY, acpi_battery_notify);
+	if (ACPI_FAILURE(status))
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error removing notify handler\n"));
+
+	acpi_battery_remove_fs(device);
+
+	kfree(battery);
+
+	return_VALUE(0);
+}
+
+
+static int __init
+acpi_battery_init (void)
+{
+	int			result = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_battery_init");
+
+	acpi_battery_dir = proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
+	if (!acpi_battery_dir)
+		return_VALUE(-ENODEV);
+
+	result = acpi_bus_register_driver(&acpi_battery_driver);
+	if (result < 0) {
+		remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
+		return_VALUE(-ENODEV);
+	}
+
+	return_VALUE(0);
+}
+
+
+static void __exit
+acpi_battery_exit (void)
+{
+	ACPI_FUNCTION_TRACE("acpi_battery_exit");
+
+	acpi_bus_unregister_driver(&acpi_battery_driver);
+
+	remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
+
+	return_VOID;
+}
+
+
+module_init(acpi_battery_init);
+module_exit(acpi_battery_exit);
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
--- a/drivers/acpi/blacklist.c	1969-12-31 16:00:00.000000000 -0800
+++ b/drivers/acpi/blacklist.c	2003-01-25 01:30:07.000000000 -0800
@@ -0,0 +1,141 @@
+/*
+ *  blacklist.c
+ *
+ *  Check to see if the given machine has a known bad ACPI BIOS
+ *
+ *  Copyright (C) 2002 Andy Grover <andrew.grover@intel.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/acpi.h>
+#include "acpi_bus.h"
+
+#define	PREFIX			"ACPI: "
+
+enum acpi_blacklist_predicates
+{
+        all_versions,
+        less_than_or_equal,
+        equal,
+        greater_than_or_equal,
+};
+
+struct acpi_blacklist_item
+{
+        char            oem_id[7];
+        char            oem_table_id[9];
+        u32             oem_revision;
+        acpi_table_type table;
+        enum acpi_blacklist_predicates oem_revision_predicate;
+        char            *reason;
+        u32             is_critical_error;
+};
+
+/*
+ * POLICY: If *anything* doesn't work, put it on the blacklist.
+ *	   If they are critical errors, mark it critical, and abort driver load.
+ */
+static struct acpi_blacklist_item acpi_blacklist[] __initdata =
+{
+	/* Portege 7020, BIOS 8.10 */
+	{"TOSHIB", "7020CT  ", 0x19991112, ACPI_DSDT, all_versions, "Implicit Return", 0},
+	/* Portege 4030 */
+	{"TOSHIB", "4030    ", 0x19991112, ACPI_DSDT, all_versions, "Implicit Return", 0},
+	/* Portege 310/320, BIOS 7.1 */
+	{"TOSHIB", "310     ", 0x19990511, ACPI_DSDT, all_versions, "Implicit Return", 0},
+	/* Seattle 2, old bios rev. */
+	{"INTEL ", "440BX   ", 0x00001000, ACPI_DSDT, less_than_or_equal, "Field beyond end of region", 0},
+	/* ASUS K7M */
+	{"ASUS  ", "K7M     ", 0x00001000, ACPI_DSDT, less_than_or_equal, "Field beyond end of region", 0},
+	/* Intel 810 Motherboard? */
+	{"MNTRAL", "MO81010A", 0x00000012, ACPI_DSDT, less_than_or_equal, "Field beyond end of region", 0},
+	/* Compaq Presario 711FR */
+	{"COMAPQ", "EAGLES", 0x06040000, ACPI_DSDT, less_than_or_equal, "SCI issues (C2 disabled)", 0},
+	/* Compaq Presario 1700 */
+	{"PTLTD ", "  DSDT  ", 0x06040000, ACPI_DSDT, less_than_or_equal, "Multiple problems", 1},
+	/* Sony FX120, FX140, FX150? */
+	{"SONY  ", "U0      ", 0x20010313, ACPI_DSDT, less_than_or_equal, "ACPI driver problem", 1},
+	/* Compaq Presario 800, Insyde BIOS */
+	{"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1},
+	/* IBM 600E - _ADR should return 7, but it returns 1 */
+	{"IBM   ", "TP600E  ", 0x00000105, ACPI_DSDT, less_than_or_equal, "Incorrect _ADR", 1},
+	{"ASUS\0\0", "P2B-S   ", 0, ACPI_DSDT, all_versions, "Bogus PCI routing", 1},
+
+	{""}
+};
+
+
+int __init
+acpi_blacklisted(void)
+{
+	int i = 0;
+	int blacklisted = 0;
+	struct acpi_table_header *table_header;
+
+	while (acpi_blacklist[i].oem_id[0] != '\0')
+	{
+		if (acpi_get_table_header_early(acpi_blacklist[i].table, &table_header)) {
+			i++;
+			continue;
+		}
+
+		if (strncmp(acpi_blacklist[i].oem_id, table_header->oem_id, 6)) {
+			i++;
+			continue;
+		}
+
+		if (strncmp(acpi_blacklist[i].oem_table_id, table_header->oem_table_id, 8)) {
+			i++;
+			continue;
+		}
+
+		if ((acpi_blacklist[i].oem_revision_predicate == all_versions)
+		    || (acpi_blacklist[i].oem_revision_predicate == less_than_or_equal
+		        && table_header->oem_revision <= acpi_blacklist[i].oem_revision)
+		    || (acpi_blacklist[i].oem_revision_predicate == greater_than_or_equal
+		        && table_header->oem_revision >= acpi_blacklist[i].oem_revision)
+		    || (acpi_blacklist[i].oem_revision_predicate == equal
+		        && table_header->oem_revision == acpi_blacklist[i].oem_revision)) {
+
+			printk(KERN_ERR PREFIX "Vendor \"%6.6s\" System \"%8.8s\" "
+				"Revision 0x%x has a known ACPI BIOS problem.\n",
+				acpi_blacklist[i].oem_id,
+				acpi_blacklist[i].oem_table_id,
+				acpi_blacklist[i].oem_revision);
+
+			printk(KERN_ERR PREFIX "Reason: %s. This is a %s error\n",
+				acpi_blacklist[i].reason,
+				(acpi_blacklist[i].is_critical_error ? "non-recoverable" : "recoverable"));
+
+			blacklisted = acpi_blacklist[i].is_critical_error;
+			break;
+		}
+		else {
+			i++;
+		}
+	}
+
+	return blacklisted;
+}
+
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/bus.c b/drivers/acpi/bus.c
--- a/drivers/acpi/bus.c	1969-12-31 16:00:00.000000000 -0800
+++ b/drivers/acpi/bus.c	2003-01-25 01:30:05.000000000 -0800
@@ -0,0 +1,2095 @@
+/*
+ *  acpi_bus.c - ACPI Bus Driver ($Revision: 77 $)
+ *
+ *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/version.h>
+#include <linux/ioport.h>
+#include <linux/list.h>
+#include <linux/sched.h>
+#include <linux/pm.h>
+#include <linux/proc_fs.h>
+#ifdef CONFIG_X86
+#include <asm/mpspec.h>
+#endif
+#include "acpi_bus.h"
+#include "acpi_drivers.h"
+#include <acpi/acinterp.h>	/* for acpi_ex_eisa_id_to_string() */
+
+
+#define _COMPONENT		ACPI_BUS_COMPONENT
+ACPI_MODULE_NAME		("acpi_bus")
+
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION(ACPI_BUS_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+
+#define	PREFIX			"ACPI: "
+
+extern void eisa_set_level_irq(unsigned int irq);
+
+extern int			acpi_disabled;
+
+FADT_DESCRIPTOR			acpi_fadt;
+struct acpi_device		*acpi_root;
+struct proc_dir_entry		*acpi_root_dir;
+
+#define STRUCT_TO_INT(s)	(*((int*)&s))
+
+
+/* --------------------------------------------------------------------------
+                          Linux Driver Model (LDM) Support
+   -------------------------------------------------------------------------- */
+
+#ifdef CONFIG_LDM
+
+static int acpi_device_probe(struct device *dev);
+static int acpi_device_remove(struct device *dev);
+static int acpi_device_suspend(struct device *dev, u32 state, u32 stage);
+static int acpi_device_resume(struct device *dev, u32 stage);
+
+static struct device_driver acpi_bus_driver = {
+	.probe = acpi_device_probe,
+	.remove = acpi_device_remove,	
+	.suspend = acpi_device_suspend,
+	.resume = acpi_device_resume,
+};
+
+
+static int
+acpi_device_probe (
+	struct device		*dev)
+{
+	ACPI_FUNCTION_TRACE("acpi_device_probe");
+
+	if (!dev)
+		return_VALUE(-EINVAL);
+
+	/* TBD */
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_device_remove (
+	struct device		*dev)
+{
+	ACPI_FUNCTION_TRACE("acpi_device_remove");
+
+	if (!dev)
+		return_VALUE(-EINVAL);
+
+	/* TBD */
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_device_suspend (
+	struct device		*dev,
+	u32			state,
+	u32			stage)
+{
+	ACPI_FUNCTION_TRACE("acpi_device_suspend");
+
+	if (!dev)
+		return_VALUE(-EINVAL);
+
+	/* TBD */
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_device_resume (
+	struct device		*dev,
+	u32			stage)
+{
+	ACPI_FUNCTION_TRACE("acpi_device_resume");
+
+	if (!dev)
+		return_VALUE(-EINVAL);
+
+	/* TBD */
+
+	return_VALUE(0);
+}
+
+#if 0 /* not used ATM */
+static int
+acpi_platform_add (
+	struct device		*dev)
+{
+	ACPI_FUNCTION_TRACE("acpi_platform_add");
+
+	if (!dev)
+		return -EINVAL;
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s (%s) added\n",
+		dev->name, dev->bus_id));
+
+	/* TBD */
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_platform_remove (
+	struct device		*dev)
+{
+	ACPI_FUNCTION_TRACE("acpi_platform_add");
+
+	if (!dev)
+		return -EINVAL;
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s (%s) removed\n",
+		dev->name, dev->bus_id));
+
+	/* TBD */
+
+	return_VALUE(0);
+}
+#endif /* unused */
+
+
+#endif /*CONFIG_LDM*/
+
+
+static int
+acpi_device_register (
+	struct acpi_device	*device,
+	struct acpi_device	*parent)
+{
+	int			result = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_device_register");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+#ifdef CONFIG_LDM
+	sprintf(device->dev.name, "ACPI device %s:%s", 
+		device->pnp.hardware_id, device->pnp.unique_id);
+	strncpy(device->dev.bus_id, device->pnp.bus_id, sizeof(acpi_bus_id));
+	if (parent)
+		device->dev.parent = &parent->dev;
+	device->dev.driver = &acpi_bus_driver;
+
+	result = device_register(&device->dev);
+#endif /*CONFIG_LDM*/
+
+	return_VALUE(result);
+}
+
+
+static int
+acpi_device_unregister (
+	struct acpi_device	*device)
+{
+	ACPI_FUNCTION_TRACE("acpi_device_unregister");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+#ifdef CONFIG_LDM
+	put_device(&device->dev);
+#endif /*CONFIG_LDM*/
+
+	return_VALUE(0);
+}
+
+
+/* --------------------------------------------------------------------------
+                                Device Management
+   -------------------------------------------------------------------------- */
+
+static void
+acpi_bus_data_handler (
+	acpi_handle		handle,
+	u32			function,
+	void			*context)
+{
+	ACPI_FUNCTION_TRACE("acpi_bus_data_handler");
+
+	/* TBD */
+
+	return_VOID;
+}
+
+
+int
+acpi_bus_get_device (
+	acpi_handle		handle,
+	struct acpi_device	**device)
+{
+	acpi_status		status = AE_OK;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_get_device");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	/* TBD: Support fixed-feature devices */
+
+	status = acpi_get_data(handle, acpi_bus_data_handler, (void**) device);
+	if (ACPI_FAILURE(status) || !*device) {
+		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error getting context for object [%p]\n",
+			handle));
+		return_VALUE(-ENODEV);
+	}
+
+	return_VALUE(0);
+}
+
+int
+acpi_bus_get_status (
+	struct acpi_device	*device)
+{
+	acpi_status		status = AE_OK;
+	unsigned long		sta = 0;
+	
+	ACPI_FUNCTION_TRACE("acpi_bus_get_status");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	/*
+	 * Evaluate _STA if present.
+	 */
+	if (device->flags.dynamic_status) {
+		status = acpi_evaluate_integer(device->handle, "_STA", NULL, &sta);
+		if (ACPI_FAILURE(status))
+			return_VALUE(-ENODEV);
+		STRUCT_TO_INT(device->status) = (int) sta;
+	}
+
+	/*
+	 * Otherwise we assume the status of our parent (unless we don't
+	 * have one, in which case status is implied).
+	 */
+	else if (device->parent)
+		device->status = device->parent->status;
+	else
+		STRUCT_TO_INT(device->status) = 0x0F;
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n", 
+		device->pnp.bus_id, (u32) STRUCT_TO_INT(device->status)));
+
+	return_VALUE(0);
+}
+
+
+/*
+static int
+acpi_bus_create_device_fs (struct device *device)
+{
+	ACPI_FUNCTION_TRACE("acpi_bus_create_device_fs");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	if (device->dir.entry)
+		return_VALUE(-EEXIST);
+
+	if (!device->parent)
+		device->dir.entry = proc_mkdir(device->pnp.bus_id, NULL);
+	else
+		device->dir.entry = proc_mkdir(device->pnp.bus_id,
+			device->parent->fs.entry);
+
+	if (!device->dir.entry) {
+		printk(KERN_ERR PREFIX "Unable to create fs entry '%s'\n",
+			device->pnp.bus_id);
+		return_VALUE(-ENODEV);
+	}
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_bus_remove_device_fs (struct device *device)
+{
+	ACPI_FUNCTION_TRACE("acpi_bus_create_device_fs");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	if (!device->dir.entry)
+		return_VALUE(-ENODEV);
+
+	if (!device->parent)
+		remove_proc_entry(device->pnp_bus_id, NULL);
+	else
+		remove_proc_entry(device->pnp.bus_id, device->parent->fs.entry);
+
+	device->dir.entry = NULL;
+
+	return_VALUE(0);
+}
+*/
+
+
+/* --------------------------------------------------------------------------
+                                 Power Management
+   -------------------------------------------------------------------------- */
+
+int
+acpi_bus_get_power (
+	acpi_handle		handle,
+	int			*state)
+{
+	int			result = 0;
+	acpi_status             status = 0;
+	struct acpi_device	*device = NULL;
+	unsigned long		psc = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_get_power");
+
+	result = acpi_bus_get_device(handle, &device);
+	if (result)
+		return_VALUE(result);
+
+	*state = ACPI_STATE_UNKNOWN;
+
+	if (!device->flags.power_manageable) {
+		/* TBD: Non-recursive algorithm for walking up hierarchy */
+		if (device->parent)
+			*state = device->parent->power.state;
+		else
+			*state = ACPI_STATE_D0;
+	}
+	else {
+		/*
+		 * Get the device's power state either directly (via _PSC) or 
+		 * indirectly (via power resources).
+		 */
+		if (device->power.flags.explicit_get) {
+			status = acpi_evaluate_integer(device->handle, "_PSC", 
+				NULL, &psc);
+			if (ACPI_FAILURE(status))
+				return_VALUE(-ENODEV);
+			device->power.state = (int) psc;
+		}
+		else if (device->power.flags.power_resources) {
+			result = acpi_power_get_inferred_state(device);
+			if (result)
+				return_VALUE(result);
+		}
+
+		*state = device->power.state;
+	}
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n",
+		device->pnp.bus_id, device->power.state));
+
+	return_VALUE(0);
+}
+
+
+int
+acpi_bus_set_power (
+	acpi_handle		handle,
+	int			state)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	struct acpi_device	*device = NULL;
+	char			object_name[5] = {'_','P','S','0'+state,'\0'};
+
+	ACPI_FUNCTION_TRACE("acpi_bus_set_power");
+
+	result = acpi_bus_get_device(handle, &device);
+	if (result)
+		return_VALUE(result);
+
+	if ((state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
+		return_VALUE(-EINVAL);
+
+	/* Make sure this is a valid target state */
+
+	if (!device->flags.power_manageable) {
+		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device is not power manageable\n"));
+		return_VALUE(-ENODEV);
+	}
+	if (state == device->power.state) {
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", state));
+		return_VALUE(0);
+	}
+	if (!device->power.states[state].flags.valid) {
+		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n", state));
+		return_VALUE(-ENODEV);
+	}
+	if (device->parent && (state < device->parent->power.state)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Cannot set device to a higher-powered state than parent\n"));
+		return_VALUE(-ENODEV);
+	}
+
+	/*
+	 * Transition Power
+	 * ----------------
+	 * On transitions to a high-powered state we first apply power (via
+	 * power resources) then evalute _PSx.  Conversly for transitions to
+	 * a lower-powered state.
+	 */ 
+	if (state < device->power.state) {
+		if (device->power.flags.power_resources) {
+			result = acpi_power_transition(device, state);
+			if (result)
+				goto end;
+		}
+		if (device->power.states[state].flags.explicit_set) {
+			status = acpi_evaluate_object(device->handle, 
+				object_name, NULL, NULL);
+			if (ACPI_FAILURE(status)) {
+				result = -ENODEV;
+				goto end;
+			}
+		}
+	}
+	else {
+		if (device->power.states[state].flags.explicit_set) {
+			status = acpi_evaluate_object(device->handle, 
+				object_name, NULL, NULL);
+			if (ACPI_FAILURE(status)) {
+				result = -ENODEV;
+				goto end;
+			}
+		}
+		if (device->power.flags.power_resources) {
+			result = acpi_power_transition(device, state);
+			if (result)
+				goto end;
+		}
+	}
+
+end:
+	if (result)
+		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error transitioning device [%s] to D%d\n",
+			device->pnp.bus_id, state));
+	else
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] transitioned to D%d\n",
+			device->pnp.bus_id, state));
+
+	return_VALUE(result);
+}
+
+
+static int
+acpi_bus_get_power_flags (
+	struct acpi_device	*device)
+{
+	acpi_status             status = 0;
+	acpi_handle		handle = 0;
+	u32                     i = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_get_power_flags");
+
+	if (!device)
+		return -ENODEV;
+
+	/*
+	 * Power Management Flags
+	 */
+	status = acpi_get_handle(device->handle, "_PSC", &handle);
+	if (ACPI_SUCCESS(status))
+		device->power.flags.explicit_get = 1;
+	status = acpi_get_handle(device->handle, "_IRC", &handle);
+	if (ACPI_SUCCESS(status))
+		device->power.flags.inrush_current = 1;
+	status = acpi_get_handle(device->handle, "_PRW", &handle);
+	if (ACPI_SUCCESS(status))
+		device->power.flags.wake_capable = 1;
+
+	/*
+	 * Enumerate supported power management states
+	 */
+	for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3; i++) {
+		struct acpi_device_power_state *ps = &device->power.states[i];
+		char		object_name[5] = {'_','P','R','0'+i,'\0'};
+
+		/* Evaluate "_PRx" to se if power resources are referenced */
+		acpi_evaluate_reference(device->handle, object_name, NULL,
+			&ps->resources);
+		if (ps->resources.count) {
+			device->power.flags.power_resources = 1;
+			ps->flags.valid = 1;
+		}
+
+		/* Evaluate "_PSx" to see if we can do explicit sets */
+		object_name[2] = 'S';
+		status = acpi_get_handle(device->handle, object_name, &handle);
+		if (ACPI_SUCCESS(status)) {
+			ps->flags.explicit_set = 1;
+			ps->flags.valid = 1;
+		}
+
+		/* State is valid if we have some power control */
+		if (ps->resources.count || ps->flags.explicit_set)
+			ps->flags.valid = 1;
+
+		ps->power = -1;		/* Unknown - driver assigned */
+		ps->latency = -1;	/* Unknown - driver assigned */
+	}
+
+	/* Set defaults for D0 and D3 states (always valid) */
+	device->power.states[ACPI_STATE_D0].flags.valid = 1;
+	device->power.states[ACPI_STATE_D0].power = 100;
+	device->power.states[ACPI_STATE_D3].flags.valid = 1;
+	device->power.states[ACPI_STATE_D3].power = 0;
+
+	/*
+	 * System Power States
+	 * -------------------
+	 */
+	/* TBD: S1-S4 power state support and resource requirements. */
+	/*
+	for (i=ACPI_STATE_S1; i<ACPI_STATE_S5; i++) {
+		char name[5] = {'_','S',('0'+i),'D','\0'};
+		status = acpi_evaluate_integer(device->handle, name, NULL,
+			&state);
+		if (ACPI_FAILURE(status))
+			continue;
+	}
+	*/
+
+	/* TBD: System wake support and resource requirements. */
+
+	device->power.state = ACPI_STATE_UNKNOWN;
+
+	return 0;
+}
+
+
+/* --------------------------------------------------------------------------
+                              Performance Management
+   -------------------------------------------------------------------------- */
+
+static int
+acpi_bus_get_perf_flags (
+	struct acpi_device	*device)
+{
+	ACPI_FUNCTION_TRACE("acpi_bus_get_perf_flags");
+
+	if (!device)
+		return -ENODEV;
+
+	device->performance.state = ACPI_STATE_UNKNOWN;
+
+	return 0;
+}
+
+
+/* --------------------------------------------------------------------------
+                                Event Management
+   -------------------------------------------------------------------------- */
+
+static spinlock_t		acpi_bus_event_lock = SPIN_LOCK_UNLOCKED;
+
+LIST_HEAD(acpi_bus_event_list);
+DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
+
+extern int			event_is_open;
+
+int
+acpi_bus_generate_event (
+	struct acpi_device	*device,
+	u8			type,
+	int			data)
+{
+	struct acpi_bus_event	*event = NULL;
+	u32			flags = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_generate_event");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	/* drop event on the floor if no one's listening */
+	if (!event_is_open)
+		return_VALUE(0);
+
+	event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
+	if (!event)
+		return_VALUE(-ENOMEM);
+
+	sprintf(event->device_class, "%s", device->pnp.device_class);
+	sprintf(event->bus_id, "%s", device->pnp.bus_id);
+	event->type = type;
+	event->data = data;
+
+	spin_lock_irqsave(&acpi_bus_event_lock, flags);
+	list_add_tail(&event->node, &acpi_bus_event_list);
+	spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
+
+	wake_up_interruptible(&acpi_bus_event_queue);
+
+	return_VALUE(0);
+}
+
+int
+acpi_bus_receive_event (
+	struct acpi_bus_event	*event)
+{
+	u32			flags = 0;
+	struct acpi_bus_event	*entry = NULL;
+
+	DECLARE_WAITQUEUE(wait, current);
+
+	ACPI_FUNCTION_TRACE("acpi_bus_receive_event");
+
+	if (!event)
+		return -EINVAL;
+
+	if (list_empty(&acpi_bus_event_list)) {
+
+		set_current_state(TASK_INTERRUPTIBLE);
+		add_wait_queue(&acpi_bus_event_queue, &wait);
+
+		if (list_empty(&acpi_bus_event_list))
+			schedule();
+
+		remove_wait_queue(&acpi_bus_event_queue, &wait);
+		set_current_state(TASK_RUNNING);
+
+		if (signal_pending(current))
+			return_VALUE(-ERESTARTSYS);
+	}
+
+	spin_lock_irqsave(&acpi_bus_event_lock, flags);
+	entry = list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node);
+	if (entry)
+		list_del(&entry->node);
+	spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
+
+	if (!entry)
+		return_VALUE(-ENODEV);
+
+	memcpy(event, entry, sizeof(struct acpi_bus_event));
+
+	kfree(entry);
+
+	return_VALUE(0);
+}
+
+
+/* --------------------------------------------------------------------------
+                               Namespace Management
+   -------------------------------------------------------------------------- */
+
+#define WALK_UP			0
+#define WALK_DOWN		1
+
+typedef int (*acpi_bus_walk_callback)(struct acpi_device*, int, void*);
+
+#define HAS_CHILDREN(d)		((d)->children.next != &((d)->children))
+#define HAS_SIBLINGS(d)		(((d)->parent) && ((d)->node.next != &(d)->parent->children))
+#define NODE_TO_DEVICE(n)	(list_entry(n, struct acpi_device, node))
+
+
+/**
+ * acpi_bus_walk
+ * -------------
+ * Used to walk the ACPI Bus's device namespace.  Can walk down (depth-first)
+ * or up.  Able to parse starting at any node in the namespace.  Note that a
+ * callback return value of -ELOOP will terminate the walk.
+ *
+ * @start:	starting point
+ * callback:	function to call for every device encountered while parsing
+ * direction:	direction to parse (up or down)
+ * @data:	context for this search operation
+ */
+static int
+acpi_bus_walk (
+	struct acpi_device	*start, 
+	acpi_bus_walk_callback	callback, 
+	int			direction, 
+	void			*data)
+{
+	int			result = 0;
+	int			level = 0;
+	struct acpi_device	*device = NULL;
+
+	if (!start || !callback)
+		return -EINVAL;
+
+	device = start;
+
+	/*
+	 * Parse Namespace
+	 * ---------------
+	 * Parse a given subtree (specified by start) in the given direction.
+	 * Walking 'up' simply means that we execute the callback on leaf
+	 * devices prior to their parents (useful for things like removing
+	 * or powering down a subtree).
+	 */
+
+	while (device) {
+
+		if (direction == WALK_DOWN)
+			if (-ELOOP == callback(device, level, data))
+				break;
+
+		/* Depth First */
+
+		if (HAS_CHILDREN(device)) {
+			device = NODE_TO_DEVICE(device->children.next);
+			++level;
+			continue;
+		}
+
+		if (direction == WALK_UP)
+			if (-ELOOP == callback(device, level, data))
+				break;
+
+		/* Now Breadth */
+
+		if (HAS_SIBLINGS(device)) {
+			device = NODE_TO_DEVICE(device->node.next);
+			continue;
+		}
+
+		/* Scope Exhausted - Find Next */
+
+		while ((device = device->parent)) {
+			--level;
+			if (HAS_SIBLINGS(device)) {
+				device = NODE_TO_DEVICE(device->node.next);
+				break;
+			}
+		}
+	}
+
+	if ((direction == WALK_UP) && (result == 0))
+		callback(start, level, data);
+
+	return result;
+}
+
+
+/* --------------------------------------------------------------------------
+                             Notification Handling
+   -------------------------------------------------------------------------- */
+
+static int
+acpi_bus_check_device (
+	struct acpi_device	*device,
+	int			*status_changed)
+{
+	acpi_status             status = 0;
+	struct acpi_device_status old_status;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_check_device");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	if (status_changed)
+		*status_changed = 0;
+
+	old_status = device->status;
+
+	/*
+	 * Make sure this device's parent is present before we go about
+	 * messing with the device.
+	 */
+	if (device->parent && !device->parent->status.present) {
+		device->status = device->parent->status;
+		if (STRUCT_TO_INT(old_status) != STRUCT_TO_INT(device->status)) {
+			if (status_changed)
+				*status_changed = 1;
+		}
+		return_VALUE(0);
+	}
+
+	status = acpi_bus_get_status(device);
+	if (ACPI_FAILURE(status))
+		return_VALUE(-ENODEV);
+
+	if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status))
+		return_VALUE(0);
+
+	if (status_changed)
+		*status_changed = 1;
+	
+	/*
+	 * Device Insertion/Removal
+	 */
+	if ((device->status.present) && !(old_status.present)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device insertion detected\n"));
+		/* TBD: Handle device insertion */
+	}
+	else if (!(device->status.present) && (old_status.present)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device removal detected\n"));
+		/* TBD: Handle device removal */
+	}
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_bus_check_scope (
+	struct acpi_device	*device)
+{
+	int			result = 0;
+	int			status_changed = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_check_scope");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	/* Status Change? */
+	result = acpi_bus_check_device(device, &status_changed);
+	if (result)
+		return_VALUE(result);
+
+	if (!status_changed)
+		return_VALUE(0);
+
+	/*
+	 * TBD: Enumerate child devices within this device's scope and
+	 *       run acpi_bus_check_device()'s on them.
+	 */
+
+	return_VALUE(0);
+}
+
+
+/**
+ * acpi_bus_notify
+ * ---------------
+ * Callback for all 'system-level' device notifications (values 0x00-0x7F).
+ */
+static void 
+acpi_bus_notify (
+	acpi_handle             handle,
+	u32                     type,
+	void                    *data)
+{
+	int			result = 0;
+	struct acpi_device	*device = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_notify");
+
+	if (acpi_bus_get_device(handle, &device))
+		return_VOID;
+
+	switch (type) {
+
+	case ACPI_NOTIFY_BUS_CHECK:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received BUS CHECK notification for device [%s]\n", 
+			device->pnp.bus_id));
+		result = acpi_bus_check_scope(device);
+		/* 
+		 * TBD: We'll need to outsource certain events to non-ACPI
+		 *	drivers via the device manager (device.c).
+		 */
+		break;
+
+	case ACPI_NOTIFY_DEVICE_CHECK:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE CHECK notification for device [%s]\n", 
+			device->pnp.bus_id));
+		result = acpi_bus_check_device(device, NULL);
+		/* 
+		 * TBD: We'll need to outsource certain events to non-ACPI
+		 *	drivers via the device manager (device.c).
+		 */
+		break;
+
+	case ACPI_NOTIFY_DEVICE_WAKE:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE WAKE notification for device [%s]\n", 
+			device->pnp.bus_id));
+		/* TBD */
+		break;
+
+	case ACPI_NOTIFY_EJECT_REQUEST:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received EJECT REQUEST notification for device [%s]\n", 
+			device->pnp.bus_id));
+		/* TBD */
+		break;
+
+	case ACPI_NOTIFY_DEVICE_CHECK_LIGHT:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE CHECK LIGHT notification for device [%s]\n", 
+			device->pnp.bus_id));
+		/* TBD: Exactly what does 'light' mean? */
+		break;
+
+	case ACPI_NOTIFY_FREQUENCY_MISMATCH:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received FREQUENCY MISMATCH notification for device [%s]\n", 
+			device->pnp.bus_id));
+		/* TBD */
+		break;
+
+	case ACPI_NOTIFY_BUS_MODE_MISMATCH:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received BUS MODE MISMATCH notification for device [%s]\n", 
+			device->pnp.bus_id));
+		/* TBD */
+		break;
+
+	case ACPI_NOTIFY_POWER_FAULT:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received POWER FAULT notification for device [%s]\n", 
+			device->pnp.bus_id));
+		/* TBD */
+		break;
+
+	default:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received unknown/unsupported notification [%08x]\n", 
+			type));
+		break;
+	}
+
+	return_VOID;
+}
+
+
+/* --------------------------------------------------------------------------
+                                 Driver Management
+   -------------------------------------------------------------------------- */
+
+static LIST_HEAD(acpi_bus_drivers);
+static DECLARE_MUTEX(acpi_bus_drivers_lock);
+
+
+/**
+ * acpi_bus_match 
+ * --------------
+ * Checks the device's hardware (_HID) or compatible (_CID) ids to see if it
+ * matches the specified driver's criteria.
+ */
+static int
+acpi_bus_match (
+	struct acpi_device	*device,
+	struct acpi_driver	*driver)
+{
+
+	if (!device || !driver)
+		return -EINVAL;
+
+	if (device->flags.hardware_id) {
+		if (strstr(driver->ids, device->pnp.hardware_id))
+			return 0;
+	}
+
+	if (device->flags.compatible_ids) {
+		acpi_status		status = AE_OK;
+		struct acpi_buffer	buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+		union acpi_object	*object = NULL;
+		char			cid[256];
+
+		memset(cid, 0, sizeof(cid));
+
+		status = acpi_evaluate_object(device->handle, "_CID", NULL, 
+			&buffer);
+		if (ACPI_FAILURE(status) || !buffer.pointer)
+			return -ENOENT;
+
+		object = (union acpi_object *) buffer.pointer;
+
+		switch (object->type) {
+		case ACPI_TYPE_INTEGER:
+			acpi_ex_eisa_id_to_string((u32) object->integer.value, 
+				cid);
+			break;
+		case ACPI_TYPE_STRING:
+			strncpy(cid, object->string.pointer, sizeof(cid) - 1);
+			break;
+		case ACPI_TYPE_PACKAGE:
+			/* TBD: Support CID packages */
+			break;
+		}
+
+		if (!cid[0]) {
+			acpi_os_free(buffer.pointer);
+			return -ENOENT;
+		}
+
+		if (strstr(driver->ids, cid)) {
+			acpi_os_free(buffer.pointer);
+			return 0;
+		}
+
+		acpi_os_free(buffer.pointer);
+	}
+
+	return -ENOENT;
+}
+
+
+/**
+ * acpi_bus_driver_init 
+ * --------------------
+ * Used to initialize a device via its device driver.  Called whenever a 
+ * driver is bound to a device.  Invokes the driver's add() and start() ops.
+ */
+static int
+acpi_bus_driver_init (
+	struct acpi_device	*device, 
+	struct acpi_driver	*driver)
+{
+	int			result = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_driver_init");
+
+	if (!device || !driver)
+		return_VALUE(-EINVAL);
+
+	if (!driver->ops.add)
+		return_VALUE(-ENOSYS);
+
+	result = driver->ops.add(device);
+	if (result) {
+		device->driver = NULL;
+		acpi_driver_data(device) = NULL;
+		return_VALUE(result);
+	}
+
+	device->driver = driver;
+
+	/*
+	 * TBD - Configuration Management: Assign resources to device based
+	 * upon possible configuration and currently allocated resources.
+	 */
+
+	if (driver->ops.start) {
+		result = driver->ops.start(device);
+		if (result && driver->ops.remove)
+			driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL);
+		return_VALUE(result);
+	}
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Driver successfully bound to device\n"));
+
+#ifdef CONFIG_LDM
+	/* 
+	 * Update the device information (in the global device hierarchy) now
+	 * that there's a driver bound to it.
+	 */
+	strncpy(device->dev.name, device->pnp.device_name, 
+		sizeof(device->dev.name));
+#endif
+
+	if (driver->ops.scan) {
+		driver->ops.scan(device);
+	}
+
+	return_VALUE(0);
+}
+
+
+/**
+ * acpi_bus_attach 
+ * -------------
+ * Callback for acpi_bus_walk() used to find devices that match a specific 
+ * driver's criteria and then attach the driver.
+ */
+static int
+acpi_bus_attach (
+	struct acpi_device	*device, 
+	int			level, 
+	void			*data)
+{
+	int			result = 0;
+	struct acpi_driver	*driver = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_attach");
+
+	if (!device || !data)
+		return_VALUE(-EINVAL);
+
+	driver = (struct acpi_driver *) data;
+
+	if (device->driver)
+		return_VALUE(-EEXIST);
+
+	if (!device->status.present)
+		return_VALUE(-ENODEV);
+
+	result = acpi_bus_match(device, driver);
+	if (result)
+		return_VALUE(result);
+
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found driver [%s] for device [%s]\n",
+		driver->name, device->pnp.bus_id));
+	
+	result = acpi_bus_driver_init(device, driver);
+	if (result)
+		return_VALUE(result);
+
+	down(&acpi_bus_drivers_lock);
+	++driver->references;
+	up(&acpi_bus_drivers_lock);
+
+	return_VALUE(0);
+}
+
+
+/**
+ * acpi_bus_unattach 
+ * -----------------
+ * Callback for acpi_bus_walk() used to find devices that match a specific 
+ * driver's criteria and unattach the driver.
+ */
+static int
+acpi_bus_unattach (
+	struct acpi_device	*device, 
+	int			level, 
+	void			*data)
+{
+	int			result = 0;
+	struct acpi_driver	*driver = (struct acpi_driver *) data;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_unattach");
+
+	if (!device || !driver)
+		return_VALUE(-EINVAL);
+
+	if (device->driver != driver)
+		return_VALUE(-ENOENT);
+
+	if (!driver->ops.remove)
+		return_VALUE(-ENOSYS);
+
+	result = driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL);
+	if (result)
+		return_VALUE(result);
+
+	device->driver = NULL;
+	acpi_driver_data(device) = NULL;
+
+	down(&acpi_bus_drivers_lock);
+	driver->references--;
+	up(&acpi_bus_drivers_lock);
+
+	return_VALUE(0);
+}
+
+
+/**
+ * acpi_bus_find_driver 
+ * --------------------
+ * Parses the list of registered drivers looking for a driver applicable for
+ * the specified device.
+ */
+static int
+acpi_bus_find_driver (
+	struct acpi_device	*device)
+{
+	int			result = -ENODEV;
+	struct list_head	*entry = NULL;
+	struct acpi_driver	*driver = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_find_driver");
+
+	if (!device || device->driver)
+		return_VALUE(-EINVAL);
+
+	down(&acpi_bus_drivers_lock);
+
+	list_for_each(entry, &acpi_bus_drivers) {
+
+		driver = list_entry(entry, struct acpi_driver, node);
+
+		if (acpi_bus_match(device, driver))
+			continue;
+
+		result = acpi_bus_driver_init(device, driver);
+		if (!result)
+			++driver->references;
+
+		break;
+	}
+
+	up(&acpi_bus_drivers_lock);
+
+	return_VALUE(result);
+}
+
+
+/**
+ * acpi_bus_register_driver 
+ * ------------------------ 
+ * Registers a driver with the ACPI bus.  Searches the namespace for all
+ * devices that match the driver's criteria and binds.
+ */
+int
+acpi_bus_register_driver (
+	struct acpi_driver	*driver)
+{
+	ACPI_FUNCTION_TRACE("acpi_bus_register_driver");
+
+	if (!driver)
+		return_VALUE(-EINVAL);
+
+	down(&acpi_bus_drivers_lock);
+	list_add_tail(&driver->node, &acpi_bus_drivers);
+	up(&acpi_bus_drivers_lock);
+
+	acpi_bus_walk(acpi_root, acpi_bus_attach, 
+		WALK_DOWN, driver);
+
+	return_VALUE(driver->references);
+}
+
+
+/**
+ * acpi_bus_unregister_driver 
+ * --------------------------
+ * Unregisters a driver with the ACPI bus.  Searches the namespace for all
+ * devices that match the driver's criteria and unbinds.
+ */
+int
+acpi_bus_unregister_driver (
+	struct acpi_driver	*driver)
+{
+	ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver");
+
+	if (!driver)
+		return_VALUE(-EINVAL);
+
+	acpi_bus_walk(acpi_root, acpi_bus_unattach, WALK_UP, driver);
+
+	if (driver->references)
+		return_VALUE(driver->references);
+
+	down(&acpi_bus_drivers_lock);
+	list_del(&driver->node);
+	up(&acpi_bus_drivers_lock);
+
+	return_VALUE(0);
+}
+
+
+/* --------------------------------------------------------------------------
+                                 Device Enumeration
+   -------------------------------------------------------------------------- */
+
+static int 
+acpi_bus_get_flags (
+	struct acpi_device	*device)
+{
+	acpi_status		status = AE_OK;
+	acpi_handle		temp = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_get_flags");
+
+	/* Presence of _STA indicates 'dynamic_status' */
+	status = acpi_get_handle(device->handle, "_STA", &temp);
+	if (ACPI_SUCCESS(status))
+		device->flags.dynamic_status = 1;
+
+	/* Presence of _CID indicates 'compatible_ids' */
+	status = acpi_get_handle(device->handle, "_CID", &temp);
+	if (ACPI_SUCCESS(status))
+		device->flags.compatible_ids = 1;
+
+	/* Presence of _RMV indicates 'removable' */
+	status = acpi_get_handle(device->handle, "_RMV", &temp);
+	if (ACPI_SUCCESS(status))
+		device->flags.removable = 1;
+
+	/* Presence of _EJD|_EJ0 indicates 'ejectable' */
+	status = acpi_get_handle(device->handle, "_EJD", &temp);
+	if (ACPI_SUCCESS(status))
+		device->flags.ejectable = 1;
+	else {
+		status = acpi_get_handle(device->handle, "_EJ0", &temp);
+		if (ACPI_SUCCESS(status))
+			device->flags.ejectable = 1;
+	}
+
+	/* Presence of _LCK indicates 'lockable' */
+	status = acpi_get_handle(device->handle, "_LCK", &temp);
+	if (ACPI_SUCCESS(status))
+		device->flags.lockable = 1;
+
+	/* Presence of _PS0|_PR0 indicates 'power manageable' */
+	status = acpi_get_handle(device->handle, "_PS0", &temp);
+	if (ACPI_FAILURE(status))
+		status = acpi_get_handle(device->handle, "_PR0", &temp);
+	if (ACPI_SUCCESS(status))
+		device->flags.power_manageable = 1;
+
+	/* TBD: Peformance management */
+
+	return_VALUE(0);
+}
+
+
+static int 
+acpi_bus_add (
+	struct acpi_device	**child,
+	struct acpi_device	*parent,
+	acpi_handle		handle,
+	int			type)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	struct acpi_device	*device = NULL;
+	char			bus_id[5] = {'?',0};
+	struct acpi_buffer	buffer = {sizeof(bus_id), bus_id};
+	struct acpi_device_info	info;
+	char			*hid = NULL;
+	char			*uid = NULL;
+	int			i = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_add");
+
+	if (!child)
+		return_VALUE(-EINVAL);
+
+	device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL);
+	if (!device) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Memory allocation error\n"));
+		return_VALUE(-ENOMEM);
+	}
+	memset(device, 0, sizeof(struct acpi_device));
+
+	device->handle = handle;
+	device->parent = parent;
+
+	memset(&info, 0, sizeof(struct acpi_device_info));
+
+	/*
+	 * Bus ID
+	 * ------
+	 * The device's Bus ID is simply the object name.
+	 * TBD: Shouldn't this value be unique (within the ACPI namespace)?
+	 */
+	switch (type) {
+	case ACPI_BUS_TYPE_SYSTEM:
+		sprintf(device->pnp.bus_id, "%s", "ACPI");
+		break;
+	case ACPI_BUS_TYPE_POWER_BUTTON:
+		sprintf(device->pnp.bus_id, "%s", "PWRF");
+		break;
+	case ACPI_BUS_TYPE_SLEEP_BUTTON:
+		sprintf(device->pnp.bus_id, "%s", "SLPF");
+		break;
+	default:
+		acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer);
+		/* Clean up trailing underscores (if any) */
+		for (i = 3; i > 1; i--) {
+			if (bus_id[i] == '_')
+				bus_id[i] = '\0';
+			else
+				break;
+		}
+		sprintf(device->pnp.bus_id, "%s", bus_id);
+		break;
+	}
+
+	/*
+	 * Flags
+	 * -----
+	 * Get prior to calling acpi_bus_get_status() so we know whether
+	 * or not _STA is present.  Note that we only look for object
+	 * handles -- cannot evaluate objects until we know the device is
+	 * present and properly initialized.
+	 */
+	result = acpi_bus_get_flags(device);
+	if (result)
+		goto end;
+
+	/*
+	 * Status
+	 * ------
+	 * See if the device is present.  We always assume that non-Device()
+	 * objects (e.g. thermal zones, power resources, processors, etc.) are
+	 * present, functioning, etc. (at least when parent object is present).
+	 * Note that _STA has a different meaning for some objects (e.g.
+	 * power resources) so we need to be careful how we use it.
+	 */
+	switch (type) {
+	case ACPI_BUS_TYPE_DEVICE:
+		result = acpi_bus_get_status(device);
+		if (result)
+			goto end;
+		break;
+	default:
+		STRUCT_TO_INT(device->status) = 0x0F;
+		break;
+	}
+	if (!device->status.present) {
+		result = -ENOENT;
+		goto end;
+	}
+
+	/*
+	 * Initialize Device
+	 * -----------------
+	 * TBD: Synch with Core's enumeration/initialization process.
+	 */
+
+	/*
+	 * Hardware ID, Unique ID, & Bus Address
+	 * -------------------------------------
+	 */
+	switch (type) {
+	case ACPI_BUS_TYPE_DEVICE:
+		status = acpi_get_object_info(handle, &info);
+		if (ACPI_FAILURE(status)) {
+			ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+				"Error reading device info\n"));
+			result = -ENODEV;
+			goto end;
+		}
+		/* Clean up info strings (not NULL terminated) */
+		info.hardware_id[sizeof(info.hardware_id)-1] = '\0';
+		info.unique_id[sizeof(info.unique_id)-1] = '\0';
+		if (info.valid & ACPI_VALID_HID)
+			hid = info.hardware_id;
+		if (info.valid & ACPI_VALID_UID)
+			uid = info.unique_id;
+		if (info.valid & ACPI_VALID_ADR) {
+			device->pnp.bus_address = info.address;
+			device->flags.bus_address = 1;
+		}
+		break;
+	case ACPI_BUS_TYPE_POWER:
+		hid = ACPI_POWER_HID;
+		break;
+	case ACPI_BUS_TYPE_PROCESSOR:
+		hid = ACPI_PROCESSOR_HID;
+		break;
+	case ACPI_BUS_TYPE_SYSTEM:
+		hid = ACPI_SYSTEM_HID;
+		break;
+	case ACPI_BUS_TYPE_THERMAL:
+		hid = ACPI_THERMAL_HID;
+		break;
+	case ACPI_BUS_TYPE_POWER_BUTTON:
+		hid = ACPI_BUTTON_HID_POWERF;
+		break;
+	case ACPI_BUS_TYPE_SLEEP_BUTTON:
+		hid = ACPI_BUTTON_HID_SLEEPF;
+		break;
+	}
+
+	/* 
+	 * \_SB
+	 * ----
+	 * Fix for the system root bus device -- the only root-level device.
+	 */
+	if ((parent == ACPI_ROOT_OBJECT) && (type == ACPI_BUS_TYPE_DEVICE)) {
+		hid = ACPI_BUS_HID;
+		sprintf(device->pnp.device_name, "%s", ACPI_BUS_DEVICE_NAME);
+		sprintf(device->pnp.device_class, "%s", ACPI_BUS_CLASS);
+	}
+
+	if (hid) {
+		sprintf(device->pnp.hardware_id, "%s", hid);
+		device->flags.hardware_id = 1;
+	}
+	if (uid) {
+		sprintf(device->pnp.unique_id, "%s", uid);
+		device->flags.unique_id = 1;
+	}
+
+	/*
+	 * Power Management
+	 * ----------------
+	 */
+	if (device->flags.power_manageable) {
+		result = acpi_bus_get_power_flags(device);
+		if (result)
+			goto end;
+	}
+
+	/*
+	 * Performance Management
+	 * ----------------------
+	 */
+	if (device->flags.performance_manageable) {
+		result = acpi_bus_get_perf_flags(device);
+		if (result)
+			goto end;
+	}
+
+	/*
+	 * Context
+	 * -------
+	 * Attach this 'struct acpi_device' to the ACPI object.  This makes
+	 * resolutions from handle->device very efficient.  Note that we need
+	 * to be careful with fixed-feature devices as they all attach to the
+	 * root object.
+	 */
+	switch (type) {
+	case ACPI_BUS_TYPE_POWER_BUTTON:
+	case ACPI_BUS_TYPE_SLEEP_BUTTON:
+		break;
+	default:
+		status = acpi_attach_data(device->handle,
+			acpi_bus_data_handler, device);
+		break;
+	}
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error attaching device data\n"));
+		result = -ENODEV;
+		goto end;
+	}
+
+	/*
+	 * Linkage
+	 * -------
+	 * Link this device to its parent and siblings.
+	 */
+	INIT_LIST_HEAD(&device->children);
+	if (!device->parent)
+		INIT_LIST_HEAD(&device->node);
+	else
+		list_add_tail(&device->node, &device->parent->children);
+
+#ifdef CONFIG_ACPI_DEBUG
+	{
+		char			*type_string = NULL;
+		char			name[80] = {'?','\0'};
+		struct acpi_buffer	buffer = {sizeof(name), name};
+
+		acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
+
+		switch (type) {
+		case ACPI_BUS_TYPE_DEVICE:
+			type_string = "Device";
+			break;
+		case ACPI_BUS_TYPE_POWER:
+			type_string = "Power Resource";
+			break;
+		case ACPI_BUS_TYPE_PROCESSOR:
+			type_string = "Processor";
+			break;
+		case ACPI_BUS_TYPE_SYSTEM:
+			type_string = "System";
+			break;
+		case ACPI_BUS_TYPE_THERMAL:
+			type_string = "Thermal Zone";
+			break;
+		case ACPI_BUS_TYPE_POWER_BUTTON:
+			type_string = "Power Button";
+			sprintf(name, "PWRB");
+			break;
+		case ACPI_BUS_TYPE_SLEEP_BUTTON:
+			type_string = "Sleep Button";
+			sprintf(name, "SLPB");
+			break;
+		}
+
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s %s [%p]\n", 
+			type_string, name, handle));
+	}
+#endif /*CONFIG_ACPI_DEBUG*/
+
+	/*
+	 * Global Device Hierarchy:
+	 * ------------------------
+	 * Register this device with the global device hierarchy.
+	 */
+	acpi_device_register(device, parent);
+
+	/*
+	 * Bind _ADR-Based Devices
+	 * -----------------------
+	 * If there's a a bus address (_ADR) then we utilize the parent's 
+	 * 'bind' function (if exists) to bind the ACPI- and natively-
+	 * enumerated device representations.
+	 */
+	if (device->flags.bus_address) {
+		if (device->parent && device->parent->ops.bind)
+			device->parent->ops.bind(device);
+	}
+
+	/*
+	 * Locate & Attach Driver
+	 * ----------------------
+	 * If there's a hardware id (_HID) or compatible ids (_CID) we check
+	 * to see if there's a driver installed for this kind of device.  Note
+	 * that drivers can install before or after a device is enumerated.
+	 *
+	 * TBD: Assumes LDM provides driver hot-plug capability.
+	 */
+	if (device->flags.hardware_id || device->flags.compatible_ids)
+		acpi_bus_find_driver(device);
+
+end:
+	if (result) {
+		kfree(device);
+		return_VALUE(result);
+	}
+
+	*child = device;
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_bus_remove (
+	struct acpi_device	*device, 
+	int			type)
+{
+	ACPI_FUNCTION_TRACE("acpi_bus_remove");
+
+	if (!device)
+		return_VALUE(-ENODEV);
+
+	acpi_device_unregister(device);
+
+	kfree(device);
+
+	return_VALUE(0);
+}
+
+
+int
+acpi_bus_scan (
+	struct acpi_device	*start)
+{
+	acpi_status		status = AE_OK;
+	struct acpi_device	*parent = NULL;
+	struct acpi_device	*child = NULL;
+	acpi_handle		phandle = 0;
+	acpi_handle		chandle = 0;
+	acpi_object_type	type = 0;
+	u32			level = 1;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_scan");
+
+	if (!start)
+		return_VALUE(-EINVAL);
+
+	parent = start;
+	phandle = start->handle;
+	
+	/*
+	 * Parse through the ACPI namespace, identify all 'devices', and
+	 * create a new 'struct acpi_device' for each.
+	 */
+	while ((level > 0) && parent) {
+
+		status = acpi_get_next_object(ACPI_TYPE_ANY, phandle,
+			chandle, &chandle);
+
+		/*
+		 * If this scope is exhausted then move our way back up.
+		 */
+		if (ACPI_FAILURE(status)) {
+			level--;
+			chandle = phandle;
+			acpi_get_parent(phandle, &phandle);
+			if (parent->parent)
+				parent = parent->parent;
+			continue;
+		}
+
+		status = acpi_get_type(chandle, &type);
+		if (ACPI_FAILURE(status))
+			continue;
+
+		/*
+		 * If this is a scope object then parse it (depth-first).
+		 */
+		if (type == ACPI_TYPE_LOCAL_SCOPE) {
+			level++;
+			phandle = chandle;
+			chandle = 0;
+			continue;
+		}
+
+		/*
+		 * We're only interested in objects that we consider 'devices'.
+		 */
+		switch (type) {
+		case ACPI_TYPE_DEVICE:
+			type = ACPI_BUS_TYPE_DEVICE;
+			break;
+		case ACPI_TYPE_PROCESSOR:
+			type = ACPI_BUS_TYPE_PROCESSOR;
+			break;
+		case ACPI_TYPE_THERMAL:
+			type = ACPI_BUS_TYPE_THERMAL;
+			break;
+		case ACPI_TYPE_POWER:
+			type = ACPI_BUS_TYPE_POWER;
+			break;
+		default:
+			continue;
+		}
+
+		status = acpi_bus_add(&child, parent, chandle, type);
+		if (ACPI_FAILURE(status))
+			continue;
+
+		/*
+		 * If the device is present, enabled, and functioning then
+		 * parse its scope (depth-first).  Note that we need to
+		 * represent absent devices to facilitate PnP notifications
+		 * -- but only the subtree head (not all of its children,
+		 * which will be enumerated when the parent is inserted).
+		 *
+		 * TBD: Need notifications and other detection mechanisms
+		 *	in place before we can fully implement this.
+		 */
+		if (child->status.present) {
+			status = acpi_get_next_object(ACPI_TYPE_ANY, chandle,
+				0, NULL);
+			if (ACPI_SUCCESS(status)) {
+				level++;
+				phandle = chandle;
+				chandle = 0;
+				parent = child;
+			}
+		}
+	}
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_bus_scan_fixed (
+	struct acpi_device	*root)
+{
+	int			result = 0;
+	struct acpi_device	*device = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed");
+
+	if (!root)
+		return_VALUE(-ENODEV);
+
+	/*
+	 * Enumerate all fixed-feature devices.
+	 */
+	if (acpi_fadt.pwr_button == 0)
+		result = acpi_bus_add(&device, acpi_root, 
+			NULL, ACPI_BUS_TYPE_POWER_BUTTON);
+
+	if (acpi_fadt.sleep_button == 0)
+		result = acpi_bus_add(&device, acpi_root, 
+			NULL, ACPI_BUS_TYPE_SLEEP_BUTTON);
+
+	return_VALUE(result);
+}
+
+
+/* --------------------------------------------------------------------------
+                             Initialization/Cleanup
+   -------------------------------------------------------------------------- */
+
+static int __init
+acpi_bus_init_irq (void)
+{
+	acpi_status		status = AE_OK;
+	union acpi_object	arg = {ACPI_TYPE_INTEGER};
+	struct acpi_object_list	arg_list = {1, &arg};
+	char			*message = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_init_irq");
+
+	/* 
+	 * Let the system know what interrupt model we are using by
+	 * evaluating the \_PIC object, if exists.
+	 */
+
+	switch (acpi_irq_model) {
+	case ACPI_IRQ_MODEL_PIC:
+		message = "PIC";
+		break;
+	case ACPI_IRQ_MODEL_IOAPIC:
+		message = "IOAPIC";
+		break;
+	case ACPI_IRQ_MODEL_IOSAPIC:
+		message = "IOSAPIC";
+		break;
+	default:
+		printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n");
+		return_VALUE(-ENODEV);
+	}
+
+	printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message);
+
+	arg.integer.value = acpi_irq_model;
+
+	status = acpi_evaluate_object(NULL, "\\_PIC", &arg_list, NULL);
+	if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _PIC\n"));
+		return_VALUE(-ENODEV);
+	}
+
+	return_VALUE(0);
+}
+
+
+static int __init
+acpi_bus_init (void)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	struct acpi_buffer	buffer = {sizeof(acpi_fadt), &acpi_fadt};
+
+	ACPI_FUNCTION_TRACE("acpi_bus_init");
+
+	status = acpi_initialize_subsystem();
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_ERR PREFIX "Unable to initialize the ACPI Interpreter\n");
+		goto error0;
+	}
+
+	status = acpi_load_tables();
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_ERR PREFIX "Unable to load the System Description Tables\n");
+		goto error0;
+	}
+
+	/*
+	 * Get a separate copy of the FADT for use by other drivers.
+	 */
+	status = acpi_get_table(ACPI_TABLE_FADT, 1, &buffer);
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_ERR PREFIX "Unable to get the FADT\n");
+		goto error1;
+	}
+
+#ifdef CONFIG_X86
+        /* Ensure the SCI is set to level-triggered, active-low */
+        if (acpi_ioapic)
+         	mp_config_ioapic_for_sci(acpi_fadt.sci_int);
+	else
+                eisa_set_level_irq(acpi_fadt.sci_int);
+#endif
+
+	status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION);
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_ERR PREFIX "Unable to start the ACPI Interpreter\n");
+		goto error1;
+	}
+
+#ifdef CONFIG_ACPI_EC
+	/*
+	 * ACPI 2.0 requires the EC driver to be loaded and work before
+	 * the EC device is found in the namespace. This is accomplished
+	 * by looking for the ECDT table, and getting the EC parameters out
+	 * of that.
+	 */
+	result = acpi_ec_ecdt_probe();
+	if (result) {
+		goto error1;
+	}
+#endif
+
+	status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n");
+		goto error1;
+	}
+
+	printk(KERN_INFO PREFIX "Interpreter enabled\n");
+
+	/*
+	 * Get the system interrupt model and evaluate \_PIC.
+	 */
+	result = acpi_bus_init_irq();
+	if (result)
+		goto error1;
+
+	/*
+	 * Register the for all standard device notifications.
+	 */
+	status = acpi_install_notify_handler(ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY, &acpi_bus_notify, NULL);
+	if (ACPI_FAILURE(status)) {
+		printk(KERN_ERR PREFIX "Unable to register for device notifications\n");
+		result = -ENODEV;
+		goto error1;
+	}
+
+	/*
+	 * Create the root device in the bus's device tree
+	 */
+	result = acpi_bus_add(&acpi_root, NULL, ACPI_ROOT_OBJECT, 
+		ACPI_BUS_TYPE_SYSTEM);
+	if (result)
+		goto error2;
+
+	/*
+	 * Create the top ACPI proc directory
+	 */
+	acpi_device_dir(acpi_root) = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL);
+	if (!acpi_root) {
+		result = -ENODEV;
+		goto error3;
+	}
+	acpi_root_dir = acpi_device_dir(acpi_root);
+
+	/*
+	 * Install drivers required for proper enumeration of the
+	 * ACPI namespace.
+	 */
+	acpi_system_init();	/* ACPI System */
+	acpi_power_init();	/* ACPI Bus Power Management */
+#ifdef CONFIG_ACPI_EC
+	acpi_ec_init();		/* ACPI Embedded Controller */
+#endif
+#ifdef CONFIG_ACPI_PCI
+	acpi_pci_link_init();	/* ACPI PCI Interrupt Link */
+	acpi_pci_root_init();	/* ACPI PCI Root Bridge */
+#endif
+	/*
+	 * Enumerate devices in the ACPI namespace.
+	 */
+	result = acpi_bus_scan_fixed(acpi_root);
+	if (result)
+		goto error4;
+	result = acpi_bus_scan(acpi_root);
+	if (result)
+		goto error4;
+
+	return_VALUE(0);
+
+	/* Mimic structured exception handling */
+error4:
+	remove_proc_entry(ACPI_BUS_FILE_ROOT, NULL);
+error3:
+	acpi_bus_remove(acpi_root, ACPI_BUS_REMOVAL_NORMAL);
+error2:
+	acpi_remove_notify_handler(ACPI_ROOT_OBJECT,
+		ACPI_SYSTEM_NOTIFY, &acpi_bus_notify);
+error1:
+	acpi_terminate();
+error0:
+	return_VALUE(-ENODEV);
+}
+
+
+static void __exit
+acpi_bus_exit (void)
+{
+	acpi_status		status = AE_OK;
+
+	ACPI_FUNCTION_TRACE("acpi_bus_exit");
+
+	status = acpi_remove_notify_handler(ACPI_ROOT_OBJECT,
+		ACPI_SYSTEM_NOTIFY, acpi_bus_notify);
+	if (ACPI_FAILURE(status))
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error removing notify handler\n"));
+
+#ifdef CONFIG_ACPI_PCI
+	acpi_pci_root_exit();
+	acpi_pci_link_exit();
+#endif
+#ifdef CONFIG_ACPI_EC
+	acpi_ec_exit();
+#endif
+	acpi_power_exit();
+	acpi_system_exit();
+
+	acpi_bus_remove(acpi_root, ACPI_BUS_REMOVAL_NORMAL);
+
+	remove_proc_entry(ACPI_BUS_FILE_ROOT, NULL);
+
+	status = acpi_terminate();
+	if (ACPI_FAILURE(status))
+		printk(KERN_ERR PREFIX "Unable to terminate the ACPI Interpreter\n");
+	else
+		printk(KERN_ERR PREFIX "Interpreter disabled\n");
+
+	return_VOID;
+}
+
+
+int __init
+acpi_init (void)
+{
+	int			result = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_init");
+
+	printk(KERN_INFO PREFIX "Subsystem revision %08x\n",
+		ACPI_CA_VERSION);
+
+	/* Initial core debug level excludes drivers, so include them now */
+	acpi_set_debug(ACPI_DEBUG_LOW);
+
+	if (acpi_disabled) {
+		printk(KERN_INFO PREFIX "Disabled via command line (acpi=off)\n");
+		return -ENODEV;
+	}
+
+#ifdef CONFIG_PM
+	if (PM_IS_ACTIVE()) {
+		printk(KERN_INFO PREFIX "APM is already active, exiting\n");
+		return -ENODEV;
+	}
+#endif
+
+	result = acpi_bus_init();
+	if (result)
+		return_VALUE(result);
+
+#ifdef CONFIG_PM
+	pm_active = 1;
+#endif
+
+	return_VALUE(0);
+}
+
+
+void __exit
+acpi_exit (void)
+{
+	ACPI_FUNCTION_TRACE("acpi_exit");
+
+#ifdef CONFIG_PM
+	pm_active = 0;
+#endif
+
+	acpi_bus_exit();
+
+	return_VOID;
+}
+
+
+int __init
+acpi_setup(char *str)
+{
+	while (str && *str) {
+		if (strncmp(str, "off", 3) == 0)
+			acpi_disabled = 1;
+		str = strchr(str, ',');
+		if (str)
+			str += strspn(str, ", \t");
+	}
+	return 1;
+}
+
+
+__setup("acpi=", acpi_setup);
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/button.c b/drivers/acpi/button.c
--- a/drivers/acpi/button.c	1969-12-31 16:00:00.000000000 -0800
+++ b/drivers/acpi/button.c	2003-01-25 01:30:13.000000000 -0800
@@ -0,0 +1,498 @@
+/*
+ *  acpi_button.c - ACPI Button Driver ($Revision: 29 $)
+ *
+ *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
+ *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/compatmac.h>
+#include <linux/proc_fs.h>
+#include "acpi_bus.h"
+#include "acpi_drivers.h"
+
+
+#define _COMPONENT		ACPI_BUTTON_COMPONENT
+ACPI_MODULE_NAME		("acpi_button")
+
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION(ACPI_BUTTON_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+
+#define PREFIX			"ACPI: "
+
+
+static int acpi_button_add (struct acpi_device *device);
+static int acpi_button_remove (struct acpi_device *device, int type);
+
+static struct acpi_driver acpi_button_driver = {
+	.name =		ACPI_BUTTON_DRIVER_NAME,
+	.class =	ACPI_BUTTON_CLASS,
+	.ids =		"ACPI_FPB,ACPI_FSB,PNP0C0D,PNP0C0C,PNP0C0E",
+	.ops =		{
+				.add =		acpi_button_add,
+				.remove =	acpi_button_remove,
+			},
+};
+
+struct acpi_button {
+	acpi_handle		handle;
+	struct acpi_device	*device;	/* Fixed button kludge */
+	u8			type;
+	unsigned long		pushed;
+};
+
+
+/* --------------------------------------------------------------------------
+                              FS Interface (/proc)
+   -------------------------------------------------------------------------- */
+
+static struct proc_dir_entry	*acpi_button_dir = NULL;
+
+static int
+acpi_button_read_info (
+	char			*page,
+	char			**start,
+	off_t			off,
+	int 			count,
+	int 			*eof,
+	void			*data)
+{
+	struct acpi_button	*button = (struct acpi_button *) data;
+	char			*p = page;
+	int			len = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_button_read_info");
+
+	if (!button || !button->device)
+		goto end;
+
+	p += sprintf(p, "type:                    %s\n", 
+		acpi_device_name(button->device));
+
+end:
+	len = (p - page);
+	if (len <= off+count) *eof = 1;
+	*start = page + off;
+	len -= off;
+	if (len>count) len = count;
+	if (len<0) len = 0;
+
+	return_VALUE(len);
+}
+
+static int
+acpi_button_lid_read_state(
+	char			*page,
+	char			**start,
+	off_t			off,
+	int 			count,
+	int 			*eof,
+	void			*data)
+{
+	struct acpi_button	*button = (struct acpi_button *) data;
+	char			*p = page;
+	int			len = 0;
+	acpi_status		status=AE_OK;
+	unsigned long		state;
+
+	ACPI_FUNCTION_TRACE("acpi_button_lid_read_state");
+
+	if (!button || !button->device)
+		goto end;
+
+	status=acpi_evaluate_integer(button->handle,"_LID",NULL,&state);
+	if (ACPI_FAILURE(status)){
+	    p += sprintf(p, "state:      unsupported\n");
+	}
+	else{
+	    p += sprintf(p, "state:      %s\n", (state ? "open" : "closed")); 
+	}
+
+end:
+	len = (p - page);
+	if (len <= off+count) *eof = 1;
+	*start = page + off;
+	len -= off;
+	if (len>count) len = count;
+	if (len<0) len = 0;
+
+	return_VALUE(len);
+}
+
+static int
+acpi_button_add_fs (
+	struct acpi_device	*device)
+{
+	struct proc_dir_entry	*entry = NULL;
+	struct acpi_button	*button = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_button_add_fs");
+
+	if (!device || !acpi_driver_data(device))
+		return_VALUE(-EINVAL);
+
+	button = acpi_driver_data(device);
+
+	switch (button->type) {
+	case ACPI_BUTTON_TYPE_POWER:
+	case ACPI_BUTTON_TYPE_POWERF:
+			entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER, 
+				acpi_button_dir);
+		break;
+	case ACPI_BUTTON_TYPE_SLEEP:
+	case ACPI_BUTTON_TYPE_SLEEPF:
+			entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP, 
+				acpi_button_dir);
+		break;
+	case ACPI_BUTTON_TYPE_LID:
+			entry = proc_mkdir(ACPI_BUTTON_SUBCLASS_LID, 
+				acpi_button_dir);
+		break;
+	}
+
+	acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry);
+	if (!acpi_device_dir(device))
+		return_VALUE(-ENODEV);
+
+	/* 'info' [R] */
+	entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
+		S_IRUGO, acpi_device_dir(device));
+	if (!entry)
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Unable to create '%s' fs entry\n",
+			ACPI_BUTTON_FILE_INFO));
+	else {
+		entry->read_proc = acpi_button_read_info;
+		entry->data = acpi_driver_data(device);
+	}
+	
+	if (button->type==ACPI_BUTTON_TYPE_LID){
+	    /* 'state' [R] */
+	    entry = create_proc_entry(ACPI_BUTTON_FILE_STATE,
+			S_IRUGO, acpi_device_dir(device));
+	    if (!entry)
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			  "Unable to create '%s' fs entry\n",
+			   ACPI_BUTTON_FILE_STATE));
+	    else {
+		entry->read_proc = acpi_button_lid_read_state;
+		entry->data = acpi_driver_data(device);
+	    }
+	}
+
+	return_VALUE(0);
+}
+
+
+static int
+acpi_button_remove_fs (
+	struct acpi_device	*device)
+{
+	ACPI_FUNCTION_TRACE("acpi_button_remove_fs");
+
+	if (acpi_device_dir(device)) {
+		remove_proc_entry(acpi_device_bid(device), acpi_button_dir);
+		acpi_device_dir(device) = NULL;
+	}
+
+	return_VALUE(0);
+}
+
+
+/* --------------------------------------------------------------------------
+                                Driver Interface
+   -------------------------------------------------------------------------- */
+
+void
+acpi_button_notify (
+	acpi_handle		handle,
+	u32			event,
+	void			*data)
+{
+	struct acpi_button	*button = (struct acpi_button *) data;
+
+	ACPI_FUNCTION_TRACE("acpi_button_notify");
+
+	if (!button || !button->device)
+		return_VOID;
+
+	switch (event) {
+	case ACPI_BUTTON_NOTIFY_STATUS:
+		acpi_bus_generate_event(button->device, event, ++button->pushed);
+		break;
+	default:
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+			"Unsupported event [0x%x]\n", event));
+		break;
+	}
+
+	return_VOID;
+}
+
+
+acpi_status
+acpi_button_notify_fixed (
+	void			*data)
+{
+	struct acpi_button	*button = (struct acpi_button *) data;
+	
+	ACPI_FUNCTION_TRACE("acpi_button_notify_fixed");
+
+	if (!button)
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+
+	acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button);
+
+	return_ACPI_STATUS(AE_OK);
+}
+
+
+static int
+acpi_button_add (
+	struct acpi_device	*device)
+{
+	int			result = 0;
+	acpi_status		status = AE_OK;
+	struct acpi_button	*button = NULL;
+
+	static struct acpi_device *power_button;
+	static struct acpi_device *sleep_button;
+	static struct acpi_device *lid_button;
+
+	ACPI_FUNCTION_TRACE("acpi_button_add");
+
+	if (!device)
+		return_VALUE(-EINVAL);
+
+	button = kmalloc(sizeof(struct acpi_button), GFP_KERNEL);
+	if (!button)
+		return_VALUE(-ENOMEM);
+	memset(button, 0, sizeof(struct acpi_button));
+
+	button->device = device;
+	button->handle = device->handle;
+	acpi_driver_data(device) = button;
+
+	/*
+	 * Determine the button type (via hid), as fixed-feature buttons
+	 * need to be handled a bit differently than generic-space.
+	 */
+	if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWER)) {
+		button->type = ACPI_BUTTON_TYPE_POWER;
+		sprintf(acpi_device_name(device), "%s",
+			ACPI_BUTTON_DEVICE_NAME_POWER);
+		sprintf(acpi_device_class(device), "%s/%s", 
+			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
+	}
+	else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) {
+		button->type = ACPI_BUTTON_TYPE_POWERF;
+		sprintf(acpi_device_name(device), "%s",
+			ACPI_BUTTON_DEVICE_NAME_POWERF);
+		sprintf(acpi_device_class(device), "%s/%s", 
+			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
+	}
+	else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) {
+		button->type = ACPI_BUTTON_TYPE_SLEEP;
+		sprintf(acpi_device_name(device), "%s",
+			ACPI_BUTTON_DEVICE_NAME_SLEEP);
+		sprintf(acpi_device_class(device), "%s/%s", 
+			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
+	}
+	else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) {
+		button->type = ACPI_BUTTON_TYPE_SLEEPF;
+		sprintf(acpi_device_name(device), "%s",
+			ACPI_BUTTON_DEVICE_NAME_SLEEPF);
+		sprintf(acpi_device_class(device), "%s/%s", 
+			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
+	}
+	else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) {
+		button->type = ACPI_BUTTON_TYPE_LID;
+		sprintf(acpi_device_name(device), "%s",
+			ACPI_BUTTON_DEVICE_NAME_LID);
+		sprintf(acpi_device_class(device), "%s/%s", 
+			ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
+	}
+	else {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n",
+			acpi_device_hid(device)));
+		result = -ENODEV;
+		goto end;
+	}
+
+	/*
+	 * Ensure only one button of each type is used.
+	 */
+	switch (button->type) {
+	case ACPI_BUTTON_TYPE_POWER:
+	case ACPI_BUTTON_TYPE_POWERF:
+		if (!power_button)
+			power_button = device;
+		else {
+			kfree(button);
+			return_VALUE(-ENODEV);
+		}
+		break;
+	case ACPI_BUTTON_TYPE_SLEEP:
+	case ACPI_BUTTON_TYPE_SLEEPF:
+		if (!sleep_button)
+			sleep_button = device;
+		else {
+			kfree(button);
+			return_VALUE(-ENODEV);
+		}
+		break;
+	case ACPI_BUTTON_TYPE_LID:
+		if (!lid_button)
+			lid_button = device;
+		else {
+			kfree(button);
+			return_VALUE(-ENODEV);
+		}
+		break;
+	}
+
+	result = acpi_button_add_fs(device);
+	if (result)
+		goto end;
+
+	switch (button->type) {
+	case ACPI_BUTTON_TYPE_POWERF:
+		status = acpi_install_fixed_event_handler (
+			ACPI_EVENT_POWER_BUTTON,
+			acpi_button_notify_fixed,
+			button);
+		break;
+	case ACPI_BUTTON_TYPE_SLEEPF:
+		status = acpi_install_fixed_event_handler (
+			ACPI_EVENT_SLEEP_BUTTON,
+			acpi_button_notify_fixed,
+			button);
+		break;
+	default:
+		status = acpi_install_notify_handler (
+			button->handle,
+			ACPI_DEVICE_NOTIFY,
+			acpi_button_notify,
+			button);
+		break;
+	}
+
+	if (ACPI_FAILURE(status)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error installing notify handler\n"));
+		result = -ENODEV;
+		goto end;
+	}
+
+	printk(KERN_INFO PREFIX "%s [%s]\n", 
+		acpi_device_name(device), acpi_device_bid(device));
+
+end:
+	if (result) {
+		acpi_button_remove_fs(device);
+		kfree(button);
+	}
+
+	return_VALUE(result);
+}
+
+
+static int
+acpi_button_remove (struct acpi_device *device, int type)
+{
+	acpi_status		status = 0;
+	struct acpi_button	*button = NULL;
+
+	ACPI_FUNCTION_TRACE("acpi_button_remove");
+
+	if (!device || !acpi_driver_data(device))
+		return_VALUE(-EINVAL);
+
+	button = acpi_driver_data(device);
+
+	/* Unregister for device notifications. */
+	switch (button->type) {
+	case ACPI_BUTTON_TYPE_POWERF:
+		status = acpi_remove_fixed_event_handler(
+			ACPI_EVENT_POWER_BUTTON, acpi_button_notify_fixed);
+		break;
+	case ACPI_BUTTON_TYPE_SLEEPF:
+		status = acpi_remove_fixed_event_handler(
+			ACPI_EVENT_SLEEP_BUTTON, acpi_button_notify_fixed);
+		break;
+	default:
+		status = acpi_remove_notify_handler(button->handle,
+			ACPI_DEVICE_NOTIFY, acpi_button_notify);
+		break;
+	}
+
+	if (ACPI_FAILURE(status))
+		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+			"Error removing notify handler\n"));
+
+	acpi_button_remove_fs(device);	
+
+	kfree(button);
+
+	return_VALUE(0);
+}
+
+
+static int __init
+acpi_button_init (void)
+{
+	int			result = 0;
+
+	ACPI_FUNCTION_TRACE("acpi_button_init");
+
+	acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
+	if (!acpi_button_dir)
+		return_VALUE(-ENODEV);
+
+	result = acpi_bus_register_driver(&acpi_button_driver);
+	if (result < 0) {
+		remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
+		return_VALUE(-ENODEV);
+	}
+
+	return_VALUE(0);
+}
+
+
+static void __exit
+acpi_button_exit (void)
+{
+	ACPI_FUNCTION_TRACE("acpi_button_exit");
+
+	acpi_bus_unregister_driver(&acpi_button_driver);
+
+	remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
+
+	return_VOID;
+}
+
+
+module_init(acpi_button_init);
+module_exit(acpi_button_exit);
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/Config.in b/drivers/acpi/Config.in
--- a/drivers/acpi/Config.in	2003-01-25 01:26:34.000000000 -0800
+++ b/drivers/acpi/Config.in	2003-01-25 01:30:37.000000000 -0800
@@ -1,17 +1,92 @@
 #
-# ACPI configuration
+# ACPI Configuration
 #
-#mainmenu_option next_comment
-#comment 'ACPI Configuration'
 
-dep_bool     '    ACPI Debug Statements' CONFIG_ACPI_DEBUG $CONFIG_ACPI
-dep_tristate '    ACPI Bus Manager' CONFIG_ACPI_BUSMGR $CONFIG_ACPI
+if [ "$CONFIG_X86" = "y" ]; then
 
-dep_tristate '      System' CONFIG_ACPI_SYS $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
-dep_tristate '      Processor' CONFIG_ACPI_CPU $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
-dep_tristate '      Button' CONFIG_ACPI_BUTTON $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
-dep_tristate '      AC Adapter' CONFIG_ACPI_AC $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
-dep_tristate '      Embedded Controller' CONFIG_ACPI_EC $CONFIG_ACPI_BUSMGR $CONFIG_ACPI
-dep_tristate '      Control Method Battery' CONFIG_ACPI_CMBATT $CONFIG_ACPI_BUSMGR $CONFIG_ACPI $CONFIG_ACPI_EC
-dep_tristate '      Thermal' CONFIG_ACPI_THERMAL $CONFIG_ACPI_BUSMGR $CONFIG_ACPI  $CONFIG_ACPI_EC
-#endmenu
+  mainmenu_option next_comment
+  comment 'ACPI Support'
+  bool         'ACPI Support' CONFIG_ACPI
+  if [ "$CONFIG_ACPI" = "y" ]; then
+    if [ "$CONFIG_X86_LOCAL_APIC" = "y" ]; then
+      bool         'CPU Enumeration Only' CONFIG_ACPI_HT_ONLY
+    fi
+
+    if [ "$CONFIG_ACPI_HT_ONLY" = "y" ]; then
+      define_bool CONFIG_ACPI_BOOT		y
+    else
+      define_bool CONFIG_ACPI_BOOT		y
+      define_bool CONFIG_ACPI_BUS		y
+      define_bool CONFIG_ACPI_INTERPRETER	y
+      define_bool CONFIG_ACPI_EC		y
+      define_bool CONFIG_ACPI_POWER		y
+      if [ "$CONFIG_PCI" = "y" ]; then
+        define_bool CONFIG_ACPI_PCI		y
+      fi
+      define_bool CONFIG_ACPI_SLEEP		y
+      define_bool CONFIG_ACPI_SYSTEM		y
+      tristate     '  AC Adapter'	CONFIG_ACPI_AC
+      tristate     '  Battery'		CONFIG_ACPI_BATTERY
+      tristate     '  Button'		CONFIG_ACPI_BUTTON
+      tristate     '  Fan'		CONFIG_ACPI_FAN
+      tristate     '  Processor'	CONFIG_ACPI_PROCESSOR
+      dep_tristate '  Thermal Zone' 	CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR
+      if [ "$CONFIG_NUMA" = "y" ]; then
+        dep_bool       '  NUMA support'     CONFIG_ACPI_NUMA $CONFIG_NUMA
+      fi
+      tristate     '  Toshiba Laptop Extras'	CONFIG_ACPI_TOSHIBA
+      bool         '  Debug Statements'	CONFIG_ACPI_DEBUG
+    fi
+  fi
+
+  endmenu
+
+fi
+
+
+if [ "$CONFIG_IA64" = "y" ]; then
+
+  if [ "$CONFIG_IA64_SGI_SN" = "y" ]; then
+    mainmenu_option next_comment
+    comment 'ACPI Support'
+    define_bool CONFIG_ACPI		y
+    define_bool CONFIG_ACPI_EFI		y
+    define_bool CONFIG_ACPI_BOOT	y
+    define_bool CONFIG_ACPI_BUS		n
+    define_bool CONFIG_ACPI_INTERPRETER n
+    define_bool CONFIG_ACPI_PCI		n
+    define_bool CONFIG_ACPI_POWER 	n
+    define_bool CONFIG_ACPI_SYSTEM 	n
+    define_bool CONFIG_ACPI_BUTTON	n
+    define_bool CONFIG_ACPI_FAN		n
+    define_bool CONFIG_ACPI_PROCESSOR	n
+    define_bool CONFIG_ACPI_THERMAL	n
+    define_bool CONFIG_ACPI_NUMA	y
+    endmenu
+  fi
+
+  if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
+    mainmenu_option next_comment
+    comment 'ACPI Support'
+    if [ "$CONFIG_PCI" = "y" ]; then
+      define_bool CONFIG_ACPI_PCI 	y
+    fi
+    define_bool CONFIG_ACPI		y
+    define_bool CONFIG_ACPI_EFI		y
+    define_bool CONFIG_ACPI_BOOT	y
+    define_bool CONFIG_ACPI_BUS		y
+    define_bool CONFIG_ACPI_INTERPRETER y
+    define_bool CONFIG_ACPI_POWER 	y
+    define_bool CONFIG_ACPI_SYSTEM 	y
+    tristate     '  Button'		CONFIG_ACPI_BUTTON
+    tristate     '  Fan'		CONFIG_ACPI_FAN
+    tristate     '  Processor'		CONFIG_ACPI_PROCESSOR
+    dep_tristate '  Thermal Zone'       CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR
+    if [ "$CONFIG_NUMA" = "y" ]; then
+      dep_bool       '  NUMA support'       CONFIG_ACPI_NUMA $CONFIG_NUMA
+    fi
+    bool         '  Debug Statements' 	CONFIG_ACPI_DEBUG
+    endmenu
+  fi
+
+fi
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbcmds.c b/drivers/acpi/debugger/dbcmds.c
--- a/drivers/acpi/debugger/dbcmds.c	2003-01-25 01:24:29.000000000 -0800
+++ b/drivers/acpi/debugger/dbcmds.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,996 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbcmds - debug commands and output routines
- *              $Revision: 66 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "acdispat.h"
-#include "amlcode.h"
-#include "acnamesp.h"
-#include "acparser.h"
-#include "acevents.h"
-#include "acinterp.h"
-#include "acdebug.h"
-#include "actables.h"
-#include "acresrc.h"
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbcmds")
-
-
-/*
- * Arguments for the Objects command
- * These object types map directly to the ACPI_TYPES
- */
-
-ARGUMENT_INFO         acpi_db_object_types [] =
-{ {"ANY"},
-	{"NUMBERS"},
-	{"STRINGS"},
-	{"BUFFERS"},
-	{"PACKAGES"},
-	{"FIELDS"},
-	{"DEVICES"},
-	{"EVENTS"},
-	{"METHODS"},
-	{"MUTEXES"},
-	{"REGIONS"},
-	{"POWERRESOURCES"},
-	{"PROCESSORS"},
-	{"THERMALZONES"},
-	{"BUFFERFIELDS"},
-	{"DDBHANDLES"},
-	{NULL}           /* Must be null terminated */
-};
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_walk_for_references
- *
- * PARAMETERS:  Callback from Walk_namespace
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Check if this namespace object refers to the target object
- *              that is passed in as the context value.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_walk_for_references (
-	acpi_handle             obj_handle,
-	u32                     nesting_level,
-	void                    *context,
-	void                    **return_value)
-{
-	acpi_operand_object     *obj_desc = (acpi_operand_object *) context;
-	acpi_namespace_node     *node = (acpi_namespace_node *) obj_handle;
-
-
-	/* Check for match against the namespace node itself */
-
-	if (node == (void *) obj_desc) {
-		acpi_os_printf ("Object is a Node [%4.4s]\n", &node->name);
-	}
-
-	/* Check for match against the object attached to the node */
-
-	if (node->object == obj_desc) {
-		acpi_os_printf ("Reference at Node->Object %p [%4.4s]\n", node, &node->name);
-	}
-
-	/* Check first child for a match */
-	/* TBD: [Investigate] probably now obsolete with new datastructure */
-
-	if (node->child == (void *) obj_desc) {
-		acpi_os_printf ("Reference at Node->Child %p [%4.4s]\n", node, &node->name);
-	}
-
-	return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_find_references
- *
- * PARAMETERS:  Object_arg      - String with hex value of the object
- *
- * RETURN:      None
- *
- * DESCRIPTION: Search namespace for all references to the input object
- *
- ******************************************************************************/
-
-void
-acpi_db_find_references (
-	NATIVE_CHAR             *object_arg)
-{
-	acpi_operand_object     *obj_desc;
-
-
-	/* Convert string to object pointer */
-
-	obj_desc = (acpi_operand_object *) STRTOUL (object_arg, NULL, 16);
-
-	/* Search all nodes in namespace */
-
-	acpi_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-			  acpi_db_walk_for_references, (void *) obj_desc, NULL);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_locks
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display information about internal mutexes.
- *
- ******************************************************************************/
-
-void
-acpi_db_display_locks (void)
-{
-	u32                     i;
-
-
-	for (i = 0; i < MAX_MTX; i++) {
-		acpi_os_printf ("%26s : %s\n", acpi_ut_get_mutex_name (i),
-				 acpi_gbl_acpi_mutex_info[i].owner_id == ACPI_MUTEX_NOT_ACQUIRED
-						? "Locked" : "Unlocked");
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_table_info
- *
- * PARAMETERS:  Table_arg       - String with name of table to be displayed
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display information about loaded tables.  Current
- *              implementation displays all loaded tables.
- *
- ******************************************************************************/
-
-void
-acpi_db_display_table_info (
-	NATIVE_CHAR             *table_arg)
-{
-	u32                     i;
-
-
-	for (i = 0; i < NUM_ACPI_TABLES; i++) {
-		if (acpi_gbl_acpi_tables[i].pointer) {
-			acpi_os_printf ("%s at %p length %X\n", acpi_gbl_acpi_table_data[i].name,
-					 acpi_gbl_acpi_tables[i].pointer, acpi_gbl_acpi_tables[i].length);
-		}
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_unload_acpi_table
- *
- * PARAMETERS:  Table_arg       - Name of the table to be unloaded
- *              Instance_arg    - Which instance of the table to unload (if
- *                                there are multiple tables of the same type)
- *
- * RETURN:      Nonde
- *
- * DESCRIPTION: Unload an ACPI table.
- *              Instance is not implemented
- *
- ******************************************************************************/
-
-void
-acpi_db_unload_acpi_table (
-	NATIVE_CHAR             *table_arg,
-	NATIVE_CHAR             *instance_arg)
-{
-	u32                     i;
-	acpi_status             status;
-
-
-	/* Search all tables for the target type */
-
-	for (i = 0; i < NUM_ACPI_TABLES; i++) {
-		if (!STRNCMP (table_arg, acpi_gbl_acpi_table_data[i].signature,
-				acpi_gbl_acpi_table_data[i].sig_length)) {
-			/* Found the table, unload it */
-
-			status = acpi_unload_table (i);
-			if (ACPI_SUCCESS (status)) {
-				acpi_os_printf ("[%s] unloaded and uninstalled\n", table_arg);
-			}
-			else {
-				acpi_os_printf ("%s, while unloading [%s]\n",
-					acpi_format_exception (status), table_arg);
-			}
-
-			return;
-		}
-	}
-
-	acpi_os_printf ("Unknown table type [%s]\n", table_arg);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_set_method_breakpoint
- *
- * PARAMETERS:  Location            - AML offset of breakpoint
- *              Walk_state          - Current walk info
- *              Op                  - Current Op (from parse walk)
- *
- * RETURN:      None
- *
- * DESCRIPTION: Set a breakpoint in a control method at the specified
- *              AML offset
- *
- ******************************************************************************/
-
-void
-acpi_db_set_method_breakpoint (
-	NATIVE_CHAR             *location,
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
-{
-	u32                     address;
-
-
-	if (!op) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-	/* Get and verify the breakpoint address */
-
-	address = STRTOUL (location, NULL, 16);
-	if (address <= op->aml_offset) {
-		acpi_os_printf ("Breakpoint %X is beyond current address %X\n", address, op->aml_offset);
-	}
-
-	/* Save breakpoint in current walk */
-
-	walk_state->method_breakpoint = address;
-	acpi_os_printf ("Breakpoint set at AML offset %X\n", address);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_set_method_call_breakpoint
- *
- * PARAMETERS:  Op                  - Current Op (from parse walk)
- *
- * RETURN:      None
- *
- * DESCRIPTION: Set a breakpoint in a control method at the specified
- *              AML offset
- *
- ******************************************************************************/
-
-void
-acpi_db_set_method_call_breakpoint (
-	acpi_parse_object       *op)
-{
-
-
-	if (!op) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-
-	acpi_gbl_step_to_next_call = TRUE;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_disassemble_aml
- *
- * PARAMETERS:  Statements          - Number of statements to disassemble
- *              Op                  - Current Op (from parse walk)
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
- *              of statements specified.
- *
- ******************************************************************************/
-
-void
-acpi_db_disassemble_aml (
-	NATIVE_CHAR             *statements,
-	acpi_parse_object       *op)
-{
-	u32                     num_statements = 8;
-
-
-	if (!op) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-	if (statements) {
-		num_statements = STRTOUL (statements, NULL, 0);
-	}
-
-
-	acpi_db_display_op (NULL, op, num_statements);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_dump_namespace
- *
- * PARAMETERS:  Start_arg       - Node to begin namespace dump
- *              Depth_arg       - Maximum tree depth to be dumped
- *
- * RETURN:      None
- *
- * DESCRIPTION: Dump entire namespace or a subtree.  Each node is displayed
- *              with type and other information.
- *
- ******************************************************************************/
-
-void
-acpi_db_dump_namespace (
-	NATIVE_CHAR             *start_arg,
-	NATIVE_CHAR             *depth_arg)
-{
-	acpi_handle             subtree_entry = acpi_gbl_root_node;
-	u32                     max_depth = ACPI_UINT32_MAX;
-
-
-	/* No argument given, just start at the root and dump entire namespace */
-
-	if (start_arg) {
-		/* Check if numeric argument, must be a Node */
-
-		if ((start_arg[0] >= 0x30) && (start_arg[0] <= 0x39)) {
-			subtree_entry = (acpi_handle) STRTOUL (start_arg, NULL, 16);
-			if (!acpi_os_readable (subtree_entry, sizeof (acpi_namespace_node))) {
-				acpi_os_printf ("Address %p is invalid in this address space\n", subtree_entry);
-				return;
-			}
-
-			if (!VALID_DESCRIPTOR_TYPE ((subtree_entry), ACPI_DESC_TYPE_NAMED)) {
-				acpi_os_printf ("Address %p is not a valid Named object\n", subtree_entry);
-				return;
-			}
-		}
-
-		/* Alpha argument */
-
-		else {
-			/* The parameter is a name string that must be resolved to a Named obj*/
-
-			subtree_entry = acpi_db_local_ns_lookup (start_arg);
-			if (!subtree_entry) {
-				subtree_entry = acpi_gbl_root_node;
-			}
-		}
-
-		/* Now we can check for the depth argument */
-
-		if (depth_arg) {
-			max_depth = STRTOUL (depth_arg, NULL, 0);
-		}
-	}
-
-
-	acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);
-	acpi_os_printf ("ACPI Namespace (from %p subtree):\n", subtree_entry);
-
-	/* Display the subtree */
-
-	acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
-	acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth, ACPI_UINT32_MAX, subtree_entry);
-	acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_dump_namespace_by_owner
- *
- * PARAMETERS:  Owner_arg       - Owner ID whose nodes will be displayed
- *              Depth_arg       - Maximum tree depth to be dumped
- *
- * RETURN:      None
- *
- * DESCRIPTION: Dump elements of the namespace that are owned by the Owner_id.
- *
- ******************************************************************************/
-
-void
-acpi_db_dump_namespace_by_owner (
-	NATIVE_CHAR             *owner_arg,
-	NATIVE_CHAR             *depth_arg)
-{
-	acpi_handle             subtree_entry = acpi_gbl_root_node;
-	u32                     max_depth = ACPI_UINT32_MAX;
-	u16                     owner_id;
-
-
-	owner_id = (u16) STRTOUL (owner_arg, NULL, 0);
-
-
-	/* Now we can check for the depth argument */
-
-	if (depth_arg) {
-		max_depth = STRTOUL (depth_arg, NULL, 0);
-	}
-
-
-	acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);
-	acpi_os_printf ("ACPI Namespace by owner %X:\n", owner_id);
-
-	/* Display the subtree */
-
-	acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
-	acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, max_depth, owner_id, subtree_entry);
-	acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_send_notify
- *
- * PARAMETERS:  Name            - Name of ACPI object to send the notify to
- *              Value           - Value of the notify to send.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Send an ACPI notification.  The value specified is sent to the
- *              named object as an ACPI notify.
- *
- ******************************************************************************/
-
-void
-acpi_db_send_notify (
-	NATIVE_CHAR             *name,
-	u32                     value)
-{
-	acpi_namespace_node     *node;
-
-
-	/* Translate name to an Named object */
-
-	node = acpi_db_local_ns_lookup (name);
-	if (!node) {
-		return;
-	}
-
-	/* Decode Named object type */
-
-	switch (node->type) {
-	case ACPI_TYPE_DEVICE:
-	case ACPI_TYPE_THERMAL:
-
-		 /* Send the notify */
-
-		acpi_ev_queue_notify_request (node, value);
-		break;
-
-	default:
-		acpi_os_printf ("Named object is not a device or a thermal object\n");
-		break;
-	}
-
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_set_method_data
- *
- * PARAMETERS:  Type_arg        - L for local, A for argument
- *              Index_arg       - which one
- *              Value_arg       - Value to set.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Set a local or argument for the running control method.
- *              NOTE: only object supported is Number.
- *
- ******************************************************************************/
-
-void
-acpi_db_set_method_data (
-	NATIVE_CHAR             *type_arg,
-	NATIVE_CHAR             *index_arg,
-	NATIVE_CHAR             *value_arg)
-{
-	NATIVE_CHAR             type;
-	u32                     index;
-	u32                     value;
-	acpi_walk_state         *walk_state;
-	acpi_operand_object     *obj_desc;
-
-
-	/* Validate Type_arg */
-
-	STRUPR (type_arg);
-	type = type_arg[0];
-	if ((type != 'L') &&
-		(type != 'A')) {
-		acpi_os_printf ("Invalid SET operand: %s\n", type_arg);
-		return;
-	}
-
-	/* Get the index and value */
-
-	index = STRTOUL (index_arg, NULL, 16);
-	value = STRTOUL (value_arg, NULL, 16);
-
-	walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list);
-	if (!walk_state) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-
-	/* Create and initialize the new object */
-
-	obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_INTEGER);
-	if (!obj_desc) {
-		acpi_os_printf ("Could not create an internal object\n");
-		return;
-	}
-
-	obj_desc->integer.value = value;
-
-
-	/* Store the new object into the target */
-
-	switch (type) {
-	case 'A':
-
-		/* Set a method argument */
-
-		if (index > MTH_NUM_ARGS) {
-			acpi_os_printf ("Arg%d - Invalid argument name\n", index);
-			return;
-		}
-
-		acpi_ds_store_object_to_local (AML_ARG_OP, index, obj_desc, walk_state);
-		obj_desc = walk_state->arguments[index].object;
-
-		acpi_os_printf ("Arg%d: ", index);
-		acpi_db_display_internal_object (obj_desc, walk_state);
-		break;
-
-	case 'L':
-
-		/* Set a method local */
-
-		if (index > MTH_NUM_LOCALS) {
-			acpi_os_printf ("Local%d - Invalid local variable name\n", index);
-			return;
-		}
-
-		acpi_ds_store_object_to_local (AML_LOCAL_OP, index, obj_desc, walk_state);
-		obj_desc = walk_state->local_variables[index].object;
-
-		acpi_os_printf ("Local%d: ", index);
-		acpi_db_display_internal_object (obj_desc, walk_state);
-		break;
-
-	default:
-		break;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_walk_for_specific_objects
- *
- * PARAMETERS:  Callback from Walk_namespace
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Display short info about objects in the namespace
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_walk_for_specific_objects (
-	acpi_handle             obj_handle,
-	u32                     nesting_level,
-	void                    *context,
-	void                    **return_value)
-{
-	acpi_operand_object     *obj_desc;
-	acpi_status             status;
-	u32                     buf_size;
-	NATIVE_CHAR             buffer[64];
-
-
-	obj_desc = ((acpi_namespace_node *)obj_handle)->object;
-	buf_size = sizeof (buffer) / sizeof (*buffer);
-
-	/* Get and display the full pathname to this object */
-
-	status = acpi_ns_handle_to_pathname (obj_handle, &buf_size, buffer);
-
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Could Not get pathname for object %p\n", obj_handle);
-		return (AE_OK);
-	}
-
-	acpi_os_printf ("%32s", buffer);
-
-
-	/* Display short information about the object */
-
-	if (obj_desc) {
-		switch (obj_desc->common.type) {
-		case ACPI_TYPE_METHOD:
-			acpi_os_printf (" #Args %d Concurrency %X", obj_desc->method.param_count, obj_desc->method.concurrency);
-			break;
-
-		case ACPI_TYPE_INTEGER:
-			acpi_os_printf (" Value %X", obj_desc->integer.value);
-			break;
-
-		case ACPI_TYPE_STRING:
-			acpi_os_printf (" \"%s\"", obj_desc->string.pointer);
-			break;
-
-		case ACPI_TYPE_REGION:
-			acpi_os_printf (" Space_id %X Address %X Length %X", obj_desc->region.space_id, obj_desc->region.address, obj_desc->region.length);
-			break;
-
-		case ACPI_TYPE_PACKAGE:
-			acpi_os_printf (" #Elements %X", obj_desc->package.count);
-			break;
-
-		case ACPI_TYPE_BUFFER:
-			acpi_os_printf (" Length %X", obj_desc->buffer.length);
-			break;
-		}
-	}
-
-	acpi_os_printf ("\n");
-	return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_objects
- *
- * PARAMETERS:  Obj_type_arg        - Type of object to display
- *              Display_count_arg   - Max depth to display
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display objects in the namespace of the requested type
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_display_objects (
-	NATIVE_CHAR             *obj_type_arg,
-	NATIVE_CHAR             *display_count_arg)
-{
-	acpi_object_type8       type;
-
-
-	/* Get the object type */
-
-	type = acpi_db_match_argument (obj_type_arg, acpi_db_object_types);
-	if (type == ACPI_TYPE_NOT_FOUND) {
-		acpi_os_printf ("Invalid or unsupported argument\n");
-		return (AE_OK);
-	}
-
-	acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);
-	acpi_os_printf ("Objects of type [%s] defined in the current ACPI Namespace: \n", acpi_ut_get_type_name (type));
-
-	acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
-
-	/* Walk the namespace from the root */
-
-	acpi_walk_namespace (type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-			   acpi_db_walk_for_specific_objects, (void *) &type, NULL);
-
-	acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-	return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_walk_and_match_name
- *
- * PARAMETERS:  Callback from Walk_namespace
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Find a particular name/names within the namespace.  Wildcards
- *              are supported -- '?' matches any character.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_walk_and_match_name (
-	acpi_handle             obj_handle,
-	u32                     nesting_level,
-	void                    *context,
-	void                    **return_value)
-{
-	acpi_status             status;
-	NATIVE_CHAR             *requested_name = (NATIVE_CHAR *) context;
-	u32                     i;
-	u32                     buf_size;
-	NATIVE_CHAR             buffer[96];
-
-
-	/* Check for a name match */
-
-	for (i = 0; i < 4; i++) {
-		/* Wildcard support */
-
-		if ((requested_name[i] != '?') &&
-			(requested_name[i] != ((NATIVE_CHAR *) (&((acpi_namespace_node *) obj_handle)->name))[i])) {
-			/* No match, just exit */
-
-			return (AE_OK);
-		}
-	}
-
-
-	/* Get the full pathname to this object */
-
-	buf_size = sizeof (buffer) / sizeof (*buffer);
-
-	status = acpi_ns_handle_to_pathname (obj_handle, &buf_size, buffer);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Could Not get pathname for object %p\n", obj_handle);
-	}
-
-	else {
-		acpi_os_printf ("%32s (%p) - %s\n", buffer, obj_handle,
-			acpi_ut_get_type_name (((acpi_namespace_node *) obj_handle)->type));
-	}
-
-	return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_find_name_in_namespace
- *
- * PARAMETERS:  Name_arg        - The 4-character ACPI name to find.
- *                                wildcards are supported.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Search the namespace for a given name (with wildcards)
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_find_name_in_namespace (
-	NATIVE_CHAR             *name_arg)
-{
-
-	if (STRLEN (name_arg) > 4) {
-		acpi_os_printf ("Name must be no longer than 4 characters\n");
-		return (AE_OK);
-	}
-
-	/* Walk the namespace from the root */
-
-	acpi_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-			   acpi_db_walk_and_match_name, name_arg, NULL);
-
-	acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-	return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_set_scope
- *
- * PARAMETERS:  Name                - New scope path
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Set the "current scope" as maintained by this utility.
- *              The scope is used as a prefix to ACPI paths.
- *
- ******************************************************************************/
-
-void
-acpi_db_set_scope (
-	NATIVE_CHAR             *name)
-{
-
-	if (!name || name[0] == 0) {
-		acpi_os_printf ("Current scope: %s\n", acpi_gbl_db_scope_buf);
-		return;
-	}
-
-	acpi_db_prep_namestring (name);
-
-	/* TBD: [Future] Validate scope here */
-
-	if (name[0] == '\\') {
-		STRCPY (acpi_gbl_db_scope_buf, name);
-		STRCAT (acpi_gbl_db_scope_buf, "\\");
-	}
-
-	else {
-		STRCAT (acpi_gbl_db_scope_buf, name);
-		STRCAT (acpi_gbl_db_scope_buf, "\\");
-	}
-
-	acpi_os_printf ("New scope: %s\n", acpi_gbl_db_scope_buf);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_resources
- *
- * PARAMETERS:  Object_arg      - String with hex value of the object
- *
- * RETURN:      None
- *
- * DESCRIPTION:
- *
- ******************************************************************************/
-
-void
-acpi_db_display_resources (
-	NATIVE_CHAR             *object_arg)
-{
-#ifndef _IA16
-	acpi_operand_object     *obj_desc;
-	acpi_status             status;
-	acpi_buffer             return_obj;
-
-
-	acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
-
-	/* Convert string to object pointer */
-
-	obj_desc = (acpi_operand_object *) STRTOUL (object_arg, NULL, 16);
-
-	/* Prepare for a return object of arbitrary size */
-
-	return_obj.pointer          = acpi_gbl_db_buffer;
-	return_obj.length           = ACPI_DEBUG_BUFFER_SIZE;
-
-
-	/* _PRT */
-
-	acpi_os_printf ("Evaluating _PRT\n");
-
-	status = acpi_evaluate_object (obj_desc, "_PRT", NULL, &return_obj);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Could not obtain _PRT: %s\n", acpi_format_exception (status));
-		goto get_crs;
-	}
-
-	return_obj.pointer          = acpi_gbl_db_buffer;
-	return_obj.length           = ACPI_DEBUG_BUFFER_SIZE;
-
-	status = acpi_get_irq_routing_table (obj_desc, &return_obj);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Get_irq_routing_table failed: %s\n", acpi_format_exception (status));
-	}
-
-	else {
-		acpi_rs_dump_irq_list ((u8 *) acpi_gbl_db_buffer);
-	}
-
-
-	/* _CRS */
-
-get_crs:
-	acpi_os_printf ("Evaluating _CRS\n");
-
-	return_obj.pointer          = acpi_gbl_db_buffer;
-	return_obj.length           = ACPI_DEBUG_BUFFER_SIZE;
-
-	status = acpi_evaluate_object (obj_desc, "_CRS", NULL, &return_obj);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Could not obtain _CRS: %s\n", acpi_format_exception (status));
-		goto get_prs;
-	}
-
-	return_obj.pointer          = acpi_gbl_db_buffer;
-	return_obj.length           = ACPI_DEBUG_BUFFER_SIZE;
-
-	status = acpi_get_current_resources (obj_desc, &return_obj);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Acpi_get_current_resources failed: %s\n", acpi_format_exception (status));
-	}
-
-	else {
-		acpi_rs_dump_resource_list ((acpi_resource *) acpi_gbl_db_buffer);
-	}
-
-
-	/* _PRS */
-
-get_prs:
-	acpi_os_printf ("Evaluating _PRS\n");
-
-	return_obj.pointer          = acpi_gbl_db_buffer;
-	return_obj.length           = ACPI_DEBUG_BUFFER_SIZE;
-
-	status = acpi_evaluate_object (obj_desc, "_PRS", NULL, &return_obj);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Could not obtain _PRS: %s\n", acpi_format_exception (status));
-		goto cleanup;
-	}
-
-	return_obj.pointer          = acpi_gbl_db_buffer;
-	return_obj.length           = ACPI_DEBUG_BUFFER_SIZE;
-
-	status = acpi_get_possible_resources (obj_desc, &return_obj);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Acpi_get_possible_resources failed: %s\n", acpi_format_exception (status));
-	}
-
-	else {
-		acpi_rs_dump_resource_list ((acpi_resource *) acpi_gbl_db_buffer);
-	}
-
-
-cleanup:
-
-	acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-	return;
-#endif
-
-}
-
-
-#endif /* ENABLE_DEBUGGER */
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbdisasm.c b/drivers/acpi/debugger/dbdisasm.c
--- a/drivers/acpi/debugger/dbdisasm.c	2003-01-25 01:26:11.000000000 -0800
+++ b/drivers/acpi/debugger/dbdisasm.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,715 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbdisasm - parser op tree display routines
- *              $Revision: 50 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "amlcode.h"
-#include "acnamesp.h"
-#include "acdebug.h"
-
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbdisasm")
-
-
-#define MAX_SHOW_ENTRY      128
-#define BLOCK_PAREN         1
-#define BLOCK_BRACE         2
-#define DB_NO_OP_INFO       "            [%2.2d]  "
-#define DB_FULL_OP_INFO     "%5.5X #%4.4X [%2.2d]  "
-
-
-NATIVE_CHAR                 *acpi_gbl_db_disasm_indent = "....";
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_block_type
- *
- * PARAMETERS:  Op              - Object to be examined
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Type of block for this op (parens or braces)
- *
- ******************************************************************************/
-
-u32
-acpi_db_block_type (
-	acpi_parse_object       *op)
-{
-
-	switch (op->opcode) {
-	case AML_METHOD_OP:
-		return (BLOCK_BRACE);
-		break;
-
-	default:
-		break;
-	}
-
-	return (BLOCK_PAREN);
-
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_ps_display_object_pathname
- *
- * PARAMETERS:  Op              - Object whose pathname is to be obtained
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Diplay the pathname associated with a named object.  Two
- *              versions. One searches the parse tree (for parser-only
- *              applications suchas Acpi_dump), and the other searches the
- *              ACPI namespace (the parse tree is probably deleted)
- *
- ******************************************************************************/
-
-#ifdef PARSER_ONLY
-
-acpi_status
-acpi_ps_display_object_pathname (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
-{
-	acpi_parse_object       *target_op;
-
-
-	/* Search parent tree up to the root if necessary */
-
-	target_op = acpi_ps_find (op, op->value.name, 0, 0);
-	if (!target_op) {
-		/*
-		 * Didn't find the name in the parse tree.  This may be
-		 * a problem, or it may simply be one of the predefined names
-		 * (such as _OS_).  Rather than worry about looking up all
-		 * the predefined names, just display the name as given
-		 */
-		acpi_os_printf (" **** Path not found in parse tree");
-	}
-
-	else {
-		/* The target was found, print the name and complete path */
-
-		acpi_os_printf (" (Path ");
-		acpi_db_display_path (target_op);
-		acpi_os_printf (")");
-	}
-
-	return (AE_OK);
-}
-
-#else
-
-acpi_status
-acpi_ps_display_object_pathname (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
-{
-	acpi_status             status;
-	acpi_namespace_node     *node;
-	NATIVE_CHAR             buffer[MAX_SHOW_ENTRY];
-	u32                     buffer_size = MAX_SHOW_ENTRY;
-	u32                     debug_level;
-
-
-	/* Save current debug level so we don't get extraneous debug output */
-
-	debug_level = acpi_dbg_level;
-	acpi_dbg_level = 0;
-
-	/* Just get the Node out of the Op object */
-
-	node = op->node;
-	if (!node) {
-		/* Node not defined in this scope, look it up */
-
-		status = acpi_ns_lookup (walk_state->scope_info, op->value.string, ACPI_TYPE_ANY,
-				  IMODE_EXECUTE, NS_SEARCH_PARENT, walk_state, &(node));
-
-		if (ACPI_FAILURE (status)) {
-			/*
-			 * We can't get the pathname since the object
-			 * is not in the namespace.  This can happen during single
-			 * stepping where a dynamic named object is *about* to be created.
-			 */
-			acpi_os_printf (" [Path not found]");
-			goto exit;
-		}
-
-		/* Save it for next time. */
-
-		op->node = node;
-	}
-
-	/* Convert Named_desc/handle to a full pathname */
-
-	status = acpi_ns_handle_to_pathname (node, &buffer_size, buffer);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("****Could not get pathname****)");
-		goto exit;
-	}
-
-	acpi_os_printf (" (Path %s)", buffer);
-
-
-exit:
-	/* Restore the debug level */
-
-	acpi_dbg_level = debug_level;
-	return (status);
-}
-
-#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_op
- *
- * PARAMETERS:  Origin          - Starting object
- *              Num_opcodes     - Max number of opcodes to be displayed
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display parser object and its children
- *
- ******************************************************************************/
-
-void
-acpi_db_display_op (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *origin,
-	u32                     num_opcodes)
-{
-	acpi_parse_object       *op = origin;
-	acpi_parse_object       *arg;
-	acpi_parse_object       *depth;
-	u32                     depth_count = 0;
-	u32                     last_depth = 0;
-	u32                     i;
-	u32                     j;
-
-
-	if (op) {
-		while (op) {
-			/* indentation */
-
-			depth_count = 0;
-			if (!acpi_gbl_db_opt_verbose) {
-				depth_count++;
-			}
-
-			/* Determine the nesting depth of this argument */
-
-			for (depth = op->parent; depth; depth = depth->parent) {
-				arg = acpi_ps_get_arg (depth, 0);
-				while (arg && arg != origin) {
-					arg = arg->next;
-				}
-
-				if (arg) {
-					break;
-				}
-
-				depth_count++;
-			}
-
-
-			/* Open a new block if we are nested further than last time */
-
-			if (depth_count > last_depth) {
-				VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth));
-				for (i = 0; i < last_depth; i++) {
-					acpi_os_printf ("%s", acpi_gbl_db_disasm_indent);
-				}
-
-				if (acpi_db_block_type (op) == BLOCK_PAREN) {
-					acpi_os_printf ("(\n");
-				}
-				else {
-					acpi_os_printf ("{\n");
-				}
-			}
-
-			/* Close a block if we are nested less than last time */
-
-			else if (depth_count < last_depth) {
-				for (j = 0; j < (last_depth - depth_count); j++) {
-					VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth - j));
-					for (i = 0; i < (last_depth - j - 1); i++) {
-						acpi_os_printf ("%s", acpi_gbl_db_disasm_indent);
-					}
-
-					if (acpi_db_block_type (op) == BLOCK_PAREN) {
-						acpi_os_printf (")\n");
-					}
-					else {
-						acpi_os_printf ("}\n");
-					}
-				}
-			}
-
-			/* In verbose mode, print the AML offset, opcode and depth count */
-
-			VERBOSE_PRINT ((DB_FULL_OP_INFO, (unsigned) op->aml_offset, op->opcode, depth_count));
-
-
-			/* Indent the output according to the depth count */
-
-			for (i = 0; i < depth_count; i++) {
-				acpi_os_printf ("%s", acpi_gbl_db_disasm_indent);
-			}
-
-
-			/* Now print the opcode */
-
-			acpi_db_display_opcode (walk_state, op);
-
-			/* Resolve a name reference */
-
-			if ((op->opcode == AML_INT_NAMEPATH_OP && op->value.name)  &&
-				(op->parent) &&
-				(acpi_gbl_db_opt_verbose)) {
-				acpi_ps_display_object_pathname (walk_state, op);
-			}
-
-			acpi_os_printf ("\n");
-
-			/* Get the next node in the tree */
-
-			op = acpi_ps_get_depth_next (origin, op);
-			last_depth = depth_count;
-
-			num_opcodes--;
-			if (!num_opcodes) {
-				op = NULL;
-			}
-		}
-
-		/* Close the last block(s) */
-
-		depth_count = last_depth -1;
-		for (i = 0; i < last_depth; i++) {
-			VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth - i));
-			for (j = 0; j < depth_count; j++) {
-				acpi_os_printf ("%s", acpi_gbl_db_disasm_indent);
-			}
-			acpi_os_printf ("}\n");
-			depth_count--;
-		}
-
-	}
-
-	else {
-		acpi_db_display_opcode (walk_state, op);
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_namestring
- *
- * PARAMETERS:  Name                - ACPI Name string to store
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display namestring. Handles prefix characters
- *
- ******************************************************************************/
-
-void
-acpi_db_display_namestring (
-	NATIVE_CHAR             *name)
-{
-	u32                     seg_count;
-	u8                      do_dot = FALSE;
-
-
-	if (!name) {
-		acpi_os_printf ("<NULL NAME PTR>");
-		return;
-	}
-
-	if (acpi_ps_is_prefix_char (GET8 (name))) {
-		/* append prefix character */
-
-		acpi_os_printf ("%1c", GET8 (name));
-		name++;
-	}
-
-	switch (GET8 (name)) {
-	case AML_DUAL_NAME_PREFIX:
-		seg_count = 2;
-		name++;
-		break;
-
-	case AML_MULTI_NAME_PREFIX_OP:
-		seg_count = (u32) GET8 (name + 1);
-		name += 2;
-		break;
-
-	default:
-		seg_count = 1;
-		break;
-	}
-
-	while (seg_count--) {
-		/* append Name segment */
-
-		if (do_dot) {
-			/* append dot */
-
-			acpi_os_printf (".");
-		}
-
-		acpi_os_printf ("%4.4s", name);
-		do_dot = TRUE;
-
-		name += 4;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_path
- *
- * PARAMETERS:  Op                  - Named Op whose path is to be constructed
- *
- * RETURN:      None
- *
- * DESCRIPTION: Walk backwards from current scope and display the name
- *              of each previous level of scope up to the root scope
- *              (like "pwd" does with file systems)
- *
- ******************************************************************************/
-
-void
-acpi_db_display_path (
-	acpi_parse_object       *op)
-{
-	acpi_parse_object       *prev;
-	acpi_parse_object       *search;
-	u32                     name;
-	u8                      do_dot = FALSE;
-	acpi_parse_object       *name_path;
-	const acpi_opcode_info  *op_info;
-
-
-	/* We are only interested in named objects */
-
-	op_info = acpi_ps_get_opcode_info (op->opcode);
-	if (!(op_info->flags & AML_NSNODE)) {
-		return;
-	}
-
-
-	if (op_info->flags & AML_CREATE) {
-		/* Field creation - check for a fully qualified namepath */
-
-		if (op->opcode == AML_CREATE_FIELD_OP) {
-			name_path = acpi_ps_get_arg (op, 3);
-		}
-		else {
-			name_path = acpi_ps_get_arg (op, 2);
-		}
-
-		if ((name_path) &&
-			(name_path->value.string) &&
-			(name_path->value.string[0] == '\\')) {
-			acpi_db_display_namestring (name_path->value.string);
-			return;
-		}
-	}
-
-	prev = NULL;            /* Start with Root Node */
-
-	while (prev != op) {
-		/* Search upwards in the tree to find scope with "prev" as its parent */
-
-		search = op;
-		for (; ;) {
-			if (search->parent == prev) {
-				break;
-			}
-
-			/* Go up one level */
-
-			search = search->parent;
-		}
-
-		if (prev) {
-			op_info = acpi_ps_get_opcode_info (search->opcode);
-			if (!(op_info->flags & AML_FIELD)) {
-				/* below root scope, append scope name */
-
-				if (do_dot) {
-					/* append dot */
-
-					acpi_os_printf (".");
-				}
-
-				if (op_info->flags & AML_CREATE) {
-					if (op->opcode == AML_CREATE_FIELD_OP) {
-						name_path = acpi_ps_get_arg (op, 3);
-					}
-					else {
-						name_path = acpi_ps_get_arg (op, 2);
-					}
-
-					if ((name_path) &&
-						(name_path->value.string)) {
-						acpi_os_printf ("%4.4s", name_path->value.string);
-					}
-				}
-
-				else {
-					name = acpi_ps_get_name (search);
-					acpi_os_printf ("%4.4s", &name);
-				}
-
-				do_dot = TRUE;
-			}
-		}
-
-		prev = search;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_opcode
- *
- * PARAMETERS:  Op                  - Op that is to be printed
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Store printed op in a Buffer and return its length
- *              (or -1 if out of space)
- *
- * NOTE: Terse mode prints out ASL-like code.  Verbose mode adds more info.
- *
- ******************************************************************************/
-
-void
-acpi_db_display_opcode (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
-{
-	u8                      *byte_data;
-	u32                     byte_count;
-	u32                     i;
-	const acpi_opcode_info  *op_info = NULL;
-	u32                     name;
-
-
-	if (!op) {
-		acpi_os_printf ("<NULL OP PTR>");
-	}
-
-
-	/* op and arguments */
-
-	switch (op->opcode) {
-
-	case AML_BYTE_OP:
-
-		if (acpi_gbl_db_opt_verbose) {
-			acpi_os_printf ("(u8) 0x%2.2X", op->value.integer8);
-		}
-
-		else {
-			acpi_os_printf ("0x%2.2X", op->value.integer8);
-		}
-
-		break;
-
-
-	case AML_WORD_OP:
-
-		if (acpi_gbl_db_opt_verbose) {
-			acpi_os_printf ("(u16) 0x%4.4X", op->value.integer16);
-		}
-
-		else {
-			acpi_os_printf ("0x%4.4X", op->value.integer16);
-		}
-
-		break;
-
-
-	case AML_DWORD_OP:
-
-		if (acpi_gbl_db_opt_verbose) {
-			acpi_os_printf ("(u32) 0x%8.8X", op->value.integer32);
-		}
-
-		else {
-			acpi_os_printf ("0x%8.8X", op->value.integer32);
-		}
-
-		break;
-
-
-	case AML_QWORD_OP:
-
-		if (acpi_gbl_db_opt_verbose) {
-			acpi_os_printf ("(u64) 0x%8.8X%8.8X", op->value.integer64.hi,
-					 op->value.integer64.lo);
-		}
-
-		else {
-			acpi_os_printf ("0x%8.8X%8.8X", op->value.integer64.hi,
-					 op->value.integer64.lo);
-		}
-
-		break;
-
-
-	case AML_STRING_OP:
-
-		if (op->value.string) {
-			acpi_os_printf ("\"%s\"", op->value.string);
-		}
-
-		else {
-			acpi_os_printf ("<\"NULL STRING PTR\">");
-		}
-
-		break;
-
-
-	case AML_INT_STATICSTRING_OP:
-
-		if (op->value.string) {
-			acpi_os_printf ("\"%s\"", op->value.string);
-		}
-
-		else {
-			acpi_os_printf ("\"<NULL STATIC STRING PTR>\"");
-		}
-
-		break;
-
-
-	case AML_INT_NAMEPATH_OP:
-
-		acpi_db_display_namestring (op->value.name);
-		break;
-
-
-	case AML_INT_NAMEDFIELD_OP:
-
-		acpi_os_printf ("Named_field (Length 0x%8.8X)  ", op->value.integer32);
-		break;
-
-
-	case AML_INT_RESERVEDFIELD_OP:
-
-		acpi_os_printf ("Reserved_field (Length 0x%8.8X) ", op->value.integer32);
-		break;
-
-
-	case AML_INT_ACCESSFIELD_OP:
-
-		acpi_os_printf ("Access_field (Length 0x%8.8X) ", op->value.integer32);
-		break;
-
-
-	case AML_INT_BYTELIST_OP:
-
-		if (acpi_gbl_db_opt_verbose) {
-			acpi_os_printf ("Byte_list   (Length 0x%8.8X)  ", op->value.integer32);
-		}
-
-		else {
-			acpi_os_printf ("0x%2.2X", op->value.integer32);
-
-			byte_count = op->value.integer32;
-			byte_data = ((acpi_parse2_object *) op)->data;
-
-			for (i = 0; i < byte_count; i++) {
-				acpi_os_printf (", 0x%2.2X", byte_data[i]);
-			}
-		}
-
-		break;
-
-
-	default:
-
-		/* Just get the opcode name and print it */
-
-		op_info = acpi_ps_get_opcode_info (op->opcode);
-		acpi_os_printf ("%s", op_info->name);
-
-
-#ifndef PARSER_ONLY
-		if ((op->opcode == AML_INT_RETURN_VALUE_OP) &&
-			(walk_state->results) &&
-			(walk_state->results->results.num_results)) {
-			acpi_db_decode_internal_object (walk_state->results->results.obj_desc [walk_state->results->results.num_results-1]);
-		}
-#endif
-
-		break;
-	}
-
-	if (!op_info) {
-		/* If there is another element in the list, add a comma */
-
-		if (op->next) {
-			acpi_os_printf (",");
-		}
-	}
-
-	/*
-	 * If this is a named opcode, print the associated name value
-	 */
-	op_info = acpi_ps_get_opcode_info (op->opcode);
-	if (op && (op_info->flags & AML_NAMED)) {
-		name = acpi_ps_get_name (op);
-		acpi_os_printf (" %4.4s", &name);
-
-		if (acpi_gbl_db_opt_verbose) {
-			acpi_os_printf (" (Path \\");
-			acpi_db_display_path (op);
-			acpi_os_printf (")");
-		}
-	}
-}
-
-
-#endif  /* ENABLE_DEBUGGER */
-
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbdisply.c b/drivers/acpi/debugger/dbdisply.c
--- a/drivers/acpi/debugger/dbdisply.c	2003-01-25 01:25:06.000000000 -0800
+++ b/drivers/acpi/debugger/dbdisply.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,794 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbdisply - debug display commands
- *              $Revision: 57 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "amlcode.h"
-#include "acdispat.h"
-#include "acnamesp.h"
-#include "acparser.h"
-#include "acevents.h"
-#include "acinterp.h"
-#include "acdebug.h"
-
-
-#ifdef ENABLE_DEBUGGER
-
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbdisply")
-
-
-/******************************************************************************
- *
- * FUNCTION:    Acpi_db_get_pointer
- *
- * PARAMETERS:  Target          - Pointer to string to be converted
- *
- * RETURN:      Converted pointer
- *
- * DESCRIPTION: Convert an ascii pointer value to a real value
- *
- *****************************************************************************/
-
-void *
-acpi_db_get_pointer (
-	void                    *target)
-{
-	void                    *obj_ptr;
-
-
-#ifdef _IA16
-#include <stdio.h>
-
-	/* Have to handle 16-bit pointers of the form segment:offset */
-
-	if (!sscanf (target, "%p", &obj_ptr)) {
-		acpi_os_printf ("Invalid pointer: %s\n", target);
-		return (NULL);
-	}
-
-#else
-
-	/* Simple flat pointer */
-
-	obj_ptr = (void *) STRTOUL (target, NULL, 16);
-
-#endif
-
-	return (obj_ptr);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_dump_parser_descriptor
- *
- * PARAMETERS:  Op              - A parser Op descriptor
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display a formatted parser object
- *
- ******************************************************************************/
-
-void
-acpi_db_dump_parser_descriptor (
-	acpi_parse_object       *op)
-{
-	const acpi_opcode_info  *info;
-
-
-	info = acpi_ps_get_opcode_info (op->opcode);
-
-	acpi_os_printf ("Parser Op Descriptor:\n");
-	acpi_os_printf ("%20.20s : %4.4X\n", "Opcode", op->opcode);
-
-	DEBUG_ONLY_MEMBERS (acpi_os_printf ("%20.20s : %s\n", "Opcode Name", info->name));
-
-	acpi_os_printf ("%20.20s : %p\n", "Value/Arg_list", op->value);
-	acpi_os_printf ("%20.20s : %p\n", "Parent", op->parent);
-	acpi_os_printf ("%20.20s : %p\n", "Next_op", op->next);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_decode_and_display_object
- *
- * PARAMETERS:  Target          - String with object to be displayed.  Names
- *                                and hex pointers are supported.
- *              Output_type     - Byte, Word, Dword, or Qword (B|W|D|Q)
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display a formatted ACPI object
- *
- ******************************************************************************/
-
-void
-acpi_db_decode_and_display_object (
-	NATIVE_CHAR             *target,
-	NATIVE_CHAR             *output_type)
-{
-	void                    *obj_ptr;
-	acpi_namespace_node     *node;
-	u32                     display = DB_BYTE_DISPLAY;
-	NATIVE_CHAR             buffer[80];
-	acpi_buffer             ret_buf;
-	acpi_status             status;
-	u32                     size;
-
-
-	if (!target) {
-		return;
-	}
-
-	/* Decode the output type */
-
-	if (output_type) {
-		STRUPR (output_type);
-		if (output_type[0] == 'W') {
-			display = DB_WORD_DISPLAY;
-		}
-		else if (output_type[0] == 'D') {
-			display = DB_DWORD_DISPLAY;
-		}
-		else if (output_type[0] == 'Q') {
-			display = DB_QWORD_DISPLAY;
-		}
-	}
-
-
-	ret_buf.length = sizeof (buffer);
-	ret_buf.pointer = buffer;
-
-	/* Differentiate between a number and a name */
-
-	if ((target[0] >= 0x30) && (target[0] <= 0x39)) {
-		obj_ptr = acpi_db_get_pointer (target);
-		if (!acpi_os_readable (obj_ptr, 16)) {
-			acpi_os_printf ("Address %p is invalid in this address space\n", obj_ptr);
-			return;
-		}
-
-		/* Decode the object type */
-
-		if (VALID_DESCRIPTOR_TYPE ((obj_ptr), ACPI_DESC_TYPE_NAMED)) {
-			/* This is a Node */
-
-			if (!acpi_os_readable (obj_ptr, sizeof (acpi_namespace_node))) {
-				acpi_os_printf ("Cannot read entire Named object at address %p\n", obj_ptr);
-				return;
-			}
-
-			node = obj_ptr;
-			goto dump_nte;
-		}
-
-		else if (VALID_DESCRIPTOR_TYPE ((obj_ptr), ACPI_DESC_TYPE_INTERNAL)) {
-			/* This is an ACPI OBJECT */
-
-			if (!acpi_os_readable (obj_ptr, sizeof (acpi_operand_object))) {
-				acpi_os_printf ("Cannot read entire ACPI object at address %p\n", obj_ptr);
-				return;
-			}
-
-			acpi_ut_dump_buffer (obj_ptr, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX);
-			acpi_ex_dump_object_descriptor (obj_ptr, 1);
-		}
-
-		else if (VALID_DESCRIPTOR_TYPE ((obj_ptr), ACPI_DESC_TYPE_PARSER)) {
-			/* This is an Parser Op object */
-
-			if (!acpi_os_readable (obj_ptr, sizeof (acpi_parse_object))) {
-				acpi_os_printf ("Cannot read entire Parser object at address %p\n", obj_ptr);
-				return;
-			}
-
-
-			acpi_ut_dump_buffer (obj_ptr, sizeof (acpi_parse_object), display, ACPI_UINT32_MAX);
-			acpi_db_dump_parser_descriptor ((acpi_parse_object *) obj_ptr);
-		}
-
-		else {
-			size = 16;
-			if (acpi_os_readable (obj_ptr, 64)) {
-				size = 64;
-			}
-
-			/* Just dump some memory */
-
-			acpi_ut_dump_buffer (obj_ptr, size, display, ACPI_UINT32_MAX);
-		}
-
-		return;
-	}
-
-
-	/* The parameter is a name string that must be resolved to a Named obj */
-
-	node = acpi_db_local_ns_lookup (target);
-	if (!node) {
-		return;
-	}
-
-
-dump_nte:
-	/* Now dump the Named obj */
-
-	status = acpi_get_name (node, ACPI_FULL_PATHNAME, &ret_buf);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Could not convert name to pathname\n");
-	}
-
-	else {
-		acpi_os_printf ("Object (%p) Pathname: %s\n", node, ret_buf.pointer);
-	}
-
-	if (!acpi_os_readable (node, sizeof (acpi_namespace_node))) {
-		acpi_os_printf ("Invalid Named object at address %p\n", node);
-		return;
-	}
-
-	acpi_ut_dump_buffer ((void *) node, sizeof (acpi_namespace_node), display, ACPI_UINT32_MAX);
-	acpi_ex_dump_node (node, 1);
-
-	if (node->object) {
-		acpi_os_printf ("\n_attached Object (%p):\n", node->object);
-		if (!acpi_os_readable (node->object, sizeof (acpi_operand_object))) {
-			acpi_os_printf ("Invalid internal ACPI Object at address %p\n", node->object);
-			return;
-		}
-
-		acpi_ut_dump_buffer ((void *) node->object, sizeof (acpi_operand_object), display, ACPI_UINT32_MAX);
-		acpi_ex_dump_object_descriptor (node->object, 1);
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_decode_internal_object
- *
- * PARAMETERS:  Obj_desc        - Object to be displayed
- *
- * RETURN:      None
- *
- * DESCRIPTION: Short display of an internal object.  Numbers and Strings.
- *
- ******************************************************************************/
-
-void
-acpi_db_decode_internal_object (
-	acpi_operand_object     *obj_desc)
-{
-	u32                     i;
-
-
-	if (!obj_desc) {
-		return;
-	}
-
-	acpi_os_printf (" %s", acpi_ut_get_type_name (obj_desc->common.type));
-
-	switch (obj_desc->common.type) {
-	case ACPI_TYPE_INTEGER:
-
-		acpi_os_printf (" %.8X%.8X", HIDWORD (obj_desc->integer.value),
-				 LODWORD (obj_desc->integer.value));
-		break;
-
-
-	case ACPI_TYPE_STRING:
-
-		acpi_os_printf ("(%d) \"%.24s",
-				obj_desc->string.length, obj_desc->string.pointer);
-
-		if (obj_desc->string.length > 24)
-		{
-			acpi_os_printf ("...");
-		}
-		else
-		{
-			acpi_os_printf ("\"");
-		}
-		break;
-
-
-	case ACPI_TYPE_BUFFER:
-
-		acpi_os_printf ("(%d)", obj_desc->buffer.length);
-		for (i = 0; (i < 8) && (i < obj_desc->buffer.length); i++) {
-			acpi_os_printf (" %2.2X", obj_desc->buffer.pointer[i]);
-		}
-		break;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_internal_object
- *
- * PARAMETERS:  Obj_desc        - Object to be displayed
- *              Walk_state      - Current walk state
- *
- * RETURN:      None
- *
- * DESCRIPTION: Short display of an internal object
- *
- ******************************************************************************/
-
-void
-acpi_db_display_internal_object (
-	acpi_operand_object     *obj_desc,
-	acpi_walk_state         *walk_state)
-{
-	u8                      type;
-
-
-	acpi_os_printf ("%p ", obj_desc);
-
-	if (!obj_desc) {
-		acpi_os_printf ("<Null_obj>\n");
-		return;
-	}
-
-
-	/* Decode the object type */
-
-	else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_PARSER)) {
-		acpi_os_printf ("<Parser> ");
-	}
-
-	else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_NAMED)) {
-		acpi_os_printf ("<Node>          Name %4.4s Type-%s",
-				  &((acpi_namespace_node *)obj_desc)->name,
-				  acpi_ut_get_type_name (((acpi_namespace_node *) obj_desc)->type));
-		if (((acpi_namespace_node *) obj_desc)->flags & ANOBJ_METHOD_ARG) {
-			acpi_os_printf (" [Method Arg]");
-		}
-		if (((acpi_namespace_node *) obj_desc)->flags & ANOBJ_METHOD_LOCAL) {
-			acpi_os_printf (" [Method Local]");
-		}
-	}
-
-	else if (VALID_DESCRIPTOR_TYPE (obj_desc, ACPI_DESC_TYPE_INTERNAL)) {
-		type = obj_desc->common.type;
-		if (type > INTERNAL_TYPE_MAX) {
-			acpi_os_printf (" Type %x [Invalid Type]", type);
-			return;
-		}
-
-		/* Decode the ACPI object type */
-
-		switch (obj_desc->common.type) {
-		case INTERNAL_TYPE_REFERENCE:
-			switch (obj_desc->reference.opcode) {
-			case AML_ZERO_OP:
-				acpi_os_printf ("[Const]         Zero (0) [Null Target]", 0);
-				break;
-
-			case AML_ONES_OP:
-				acpi_os_printf ("[Const]         Ones (0xFFFFFFFFFFFFFFFF) [No Limit]");
-				break;
-
-			case AML_ONE_OP:
-				acpi_os_printf ("[Const]         One (1)");
-				break;
-
-			case AML_REVISION_OP:
-				acpi_os_printf ("[Const]         Revision (%X)", ACPI_CA_SUPPORT_LEVEL);
-				break;
-
-			case AML_LOCAL_OP:
-				acpi_os_printf ("[Local%d]", obj_desc->reference.offset);
-				if (walk_state) {
-					obj_desc = walk_state->local_variables[obj_desc->reference.offset].object;
-					acpi_os_printf (" %p", obj_desc);
-					acpi_db_decode_internal_object (obj_desc);
-				}
-				break;
-
-			case AML_ARG_OP:
-				acpi_os_printf ("[Arg%d] ", obj_desc->reference.offset);
-				if (walk_state) {
-					obj_desc = walk_state->arguments[obj_desc->reference.offset].object;
-					acpi_os_printf (" %p", obj_desc);
-					acpi_db_decode_internal_object (obj_desc);
-				}
-				break;
-
-			case AML_DEBUG_OP:
-				acpi_os_printf ("[Debug] ");
-				break;
-
-			case AML_INDEX_OP:
-				acpi_os_printf ("[Index]   ");
-				acpi_db_decode_internal_object (obj_desc->reference.object);
-				break;
-
-			default:
-				break;
-
-			}
-			break;
-
-		default:
-			acpi_os_printf ("<Obj> ");
-			acpi_os_printf ("         ");
-			acpi_db_decode_internal_object (obj_desc);
-			break;
-		}
-	}
-
-	else {
-		acpi_os_printf ("<Not a valid ACPI Object Descriptor> ");
-	}
-
-	acpi_os_printf ("\n");
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_method_info
- *
- * PARAMETERS:  Start_op        - Root of the control method parse tree
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display information about the current method
- *
- ******************************************************************************/
-
-void
-acpi_db_display_method_info (
-	acpi_parse_object       *start_op)
-{
-	acpi_walk_state         *walk_state;
-	acpi_operand_object     *obj_desc;
-	acpi_namespace_node     *node;
-	acpi_parse_object       *root_op;
-	acpi_parse_object       *op;
-	const acpi_opcode_info  *op_info;
-	u32                     num_ops = 0;
-	u32                     num_operands = 0;
-	u32                     num_operators = 0;
-	u32                     num_remaining_ops = 0;
-	u32                     num_remaining_operands = 0;
-	u32                     num_remaining_operators = 0;
-	u32                     num_args;
-	u32                     concurrency;
-	u8                      count_remaining = FALSE;
-
-
-	walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list);
-	if (!walk_state) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-	obj_desc = walk_state->method_desc;
-	node = walk_state->method_node;
-
-	num_args = obj_desc->method.param_count;
-	concurrency = obj_desc->method.concurrency;
-
-	acpi_os_printf ("Currently executing control method is [%4.4s]\n", &node->name);
-	acpi_os_printf ("%X arguments, max concurrency = %X\n", num_args, concurrency);
-
-
-	root_op = start_op;
-	while (root_op->parent) {
-		root_op = root_op->parent;
-	}
-
-	op = root_op;
-
-	while (op) {
-		if (op == start_op) {
-			count_remaining = TRUE;
-		}
-
-		num_ops++;
-		if (count_remaining) {
-			num_remaining_ops++;
-		}
-
-		/* Decode the opcode */
-
-		op_info = acpi_ps_get_opcode_info (op->opcode);
-		switch (op_info->class) {
-		case AML_CLASS_ARGUMENT:
-			if (count_remaining) {
-				num_remaining_operands++;
-			}
-
-			num_operands++;
-			break;
-
-		case AML_CLASS_UNKNOWN:
-			/* Bad opcode or ASCII character */
-
-			continue;
-
-		default:
-			if (count_remaining) {
-				num_remaining_operators++;
-			}
-
-			num_operators++;
-			break;
-		}
-
-
-		op = acpi_ps_get_depth_next (start_op, op);
-	}
-
-	acpi_os_printf ("Method contains:     %X AML Opcodes - %X Operators, %X Operands\n",
-			 num_ops, num_operators, num_operands);
-
-	acpi_os_printf ("Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n",
-			 num_remaining_ops, num_remaining_operators, num_remaining_operands);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_locals
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display all locals for the currently running control method
- *
- ******************************************************************************/
-
-void
-acpi_db_display_locals (void)
-{
-	u32                     i;
-	acpi_walk_state         *walk_state;
-	acpi_operand_object     *obj_desc;
-	acpi_namespace_node     *node;
-
-
-	walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list);
-	if (!walk_state) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-	obj_desc = walk_state->method_desc;
-	node = walk_state->method_node;
-
-
-	acpi_os_printf ("Local Variables for method [%4.4s]:\n", &node->name);
-
-	for (i = 0; i < MTH_NUM_LOCALS; i++) {
-		obj_desc = walk_state->local_variables[i].object;
-		acpi_os_printf ("Local%d: ", i);
-		acpi_db_display_internal_object (obj_desc, walk_state);
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_arguments
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display all arguments for the currently running control method
- *
- ******************************************************************************/
-
-void
-acpi_db_display_arguments (void)
-{
-	u32                     i;
-	acpi_walk_state         *walk_state;
-	acpi_operand_object     *obj_desc;
-	u32                     num_args;
-	u32                     concurrency;
-	acpi_namespace_node     *node;
-
-
-	walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list);
-	if (!walk_state) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-	obj_desc = walk_state->method_desc;
-	node = walk_state->method_node;
-
-	num_args = obj_desc->method.param_count;
-	concurrency = obj_desc->method.concurrency;
-
-	acpi_os_printf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", &node->name, num_args, concurrency);
-
-	for (i = 0; i < num_args; i++) {
-		obj_desc = walk_state->arguments[i].object;
-		acpi_os_printf ("Arg%d: ", i);
-		acpi_db_display_internal_object (obj_desc, walk_state);
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_results
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display current contents of a method result stack
- *
- ******************************************************************************/
-
-void
-acpi_db_display_results (void)
-{
-	u32                     i;
-	acpi_walk_state         *walk_state;
-	acpi_operand_object     *obj_desc;
-	u32                     num_results = 0;
-	acpi_namespace_node     *node;
-
-
-	walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list);
-	if (!walk_state) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-	obj_desc = walk_state->method_desc;
-	node = walk_state->method_node;
-
-	if (walk_state->results) {
-		num_results = walk_state->results->results.num_results;
-	}
-
-	acpi_os_printf ("Method [%4.4s] has %X stacked result objects\n", &node->name, num_results);
-
-	for (i = 0; i < num_results; i++) {
-		obj_desc = walk_state->results->results.obj_desc[i];
-		acpi_os_printf ("Result%d: ", i);
-		acpi_db_display_internal_object (obj_desc, walk_state);
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_calling_tree
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display current calling tree of nested control methods
- *
- ******************************************************************************/
-
-void
-acpi_db_display_calling_tree (void)
-{
-	u32                     i;
-	acpi_walk_state         *walk_state;
-	acpi_namespace_node     *node;
-
-
-	walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list);
-	if (!walk_state) {
-		acpi_os_printf ("There is no method currently executing\n");
-		return;
-	}
-
-	node = walk_state->method_node;
-
-	acpi_os_printf ("Current Control Method Call Tree\n");
-
-	for (i = 0; walk_state; i++) {
-		node = walk_state->method_node;
-
-		acpi_os_printf ("  [%4.4s]\n", &node->name);
-
-		walk_state = walk_state->next;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_result_object
- *
- * PARAMETERS:  Obj_desc        - Object to be displayed
- *              Walk_state      - Current walk state
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display the result of an AML opcode
- *
- ******************************************************************************/
-
-void
-acpi_db_display_result_object (
-	acpi_operand_object     *obj_desc,
-	acpi_walk_state         *walk_state)
-{
-
-	/* TBD: [Future] We don't always want to display the result.
-	 * For now, only display if single stepping
-	 * however, this output is very useful in other contexts also
-	 */
-	if (!acpi_gbl_cm_single_step) {
-		return;
-	}
-
-	acpi_os_printf ("Result_obj: ");
-	acpi_db_display_internal_object (obj_desc, walk_state);
-	acpi_os_printf ("\n");
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_argument_object
- *
- * PARAMETERS:  Obj_desc        - Object to be displayed
- *              Walk_state      - Current walk state
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display the result of an AML opcode
- *
- ******************************************************************************/
-
-void
-acpi_db_display_argument_object (
-	acpi_operand_object     *obj_desc,
-	acpi_walk_state         *walk_state)
-{
-
-
-	if (!acpi_gbl_cm_single_step) {
-		return;
-	}
-
-	acpi_os_printf ("Arg_obj: ");
-	acpi_db_display_internal_object (obj_desc, walk_state);
-}
-
-#endif /* ENABLE_DEBUGGER */
-
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbexec.c b/drivers/acpi/debugger/dbexec.c
--- a/drivers/acpi/debugger/dbexec.c	2003-01-25 01:25:23.000000000 -0800
+++ b/drivers/acpi/debugger/dbexec.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,404 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbexec - debugger control method execution
- *              $Revision: 34 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "acdispat.h"
-#include "amlcode.h"
-#include "acnamesp.h"
-#include "acparser.h"
-#include "acevents.h"
-#include "acinterp.h"
-#include "acdebug.h"
-#include "actables.h"
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbexec")
-
-
-db_method_info              acpi_gbl_db_method_info;
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_execute_method
- *
- * PARAMETERS:  Info            - Valid info segment
- *              Return_obj      - Where to put return object
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Execute a control method.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_execute_method (
-	db_method_info          *info,
-	acpi_buffer             *return_obj)
-{
-	acpi_status             status;
-	acpi_object_list        param_objects;
-	acpi_object             params[MTH_NUM_ARGS];
-	u32                     i;
-
-
-	if (acpi_gbl_db_output_to_file && !acpi_dbg_level) {
-		acpi_os_printf ("Warning: debug output is not enabled!\n");
-	}
-
-	/* Are there arguments to the method? */
-
-	if (info->args && info->args[0]) {
-		for (i = 0; info->args[i] && i < MTH_NUM_ARGS; i++) {
-			params[i].type              = ACPI_TYPE_INTEGER;
-			params[i].integer.value     = STRTOUL (info->args[i], NULL, 16);
-		}
-
-		param_objects.pointer       = params;
-		param_objects.count         = i;
-	}
-
-	else {
-		/* Setup default parameters */
-
-		params[0].type              = ACPI_TYPE_INTEGER;
-		params[0].integer.value     = 0x01020304;
-
-		params[1].type              = ACPI_TYPE_STRING;
-		params[1].string.length     = 12;
-		params[1].string.pointer    = "AML Debugger";
-
-		param_objects.pointer       = params;
-		param_objects.count         = 2;
-	}
-
-	/* Prepare for a return object of arbitrary size */
-
-	return_obj->pointer          = acpi_gbl_db_buffer;
-	return_obj->length           = ACPI_DEBUG_BUFFER_SIZE;
-
-
-	/* Do the actual method execution */
-
-	status = acpi_evaluate_object (NULL, info->pathname, &param_objects, return_obj);
-
-	acpi_gbl_cm_single_step = FALSE;
-	acpi_gbl_method_executing = FALSE;
-
-	return (status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_execute_setup
- *
- * PARAMETERS:  Info            - Valid method info
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Setup info segment prior to method execution
- *
- ******************************************************************************/
-
-void
-acpi_db_execute_setup (
-	db_method_info          *info)
-{
-
-	/* Catenate the current scope to the supplied name */
-
-	info->pathname[0] = 0;
-	if ((info->name[0] != '\\') &&
-		(info->name[0] != '/')) {
-		STRCAT (info->pathname, acpi_gbl_db_scope_buf);
-	}
-
-	STRCAT (info->pathname, info->name);
-	acpi_db_prep_namestring (info->pathname);
-
-	acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);
-	acpi_os_printf ("Executing %s\n", info->pathname);
-
-	if (info->flags & EX_SINGLE_STEP) {
-		acpi_gbl_cm_single_step = TRUE;
-		acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-	}
-
-	else {
-		/* No single step, allow redirection to a file */
-
-		acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_get_outstanding_allocations
- *
- * PARAMETERS:  None
- *
- * RETURN:      Current global allocation count minus cache entries
- *
- * DESCRIPTION: Determine the current number of "outstanding" allocations --
- *              those allocations that have not been freed and also are not
- *              in one of the various object caches.
- *
- ******************************************************************************/
-
-u32
-acpi_db_get_outstanding_allocations (void)
-{
-	u32                     i;
-	u32                     outstanding = 0;
-
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-
-	for (i = ACPI_MEM_LIST_FIRST_CACHE_LIST; i < ACPI_NUM_MEM_LISTS; i++) {
-		outstanding += (acpi_gbl_memory_lists[i].total_allocated -
-				  acpi_gbl_memory_lists[i].total_freed -
-				  acpi_gbl_memory_lists[i].cache_depth);
-	}
-#endif
-
-	return (outstanding);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_execute
- *
- * PARAMETERS:  Name                - Name of method to execute
- *              Args                - Parameters to the method
- *              Flags               - single step/no single step
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Execute a control method.  Name is relative to the current
- *              scope.
- *
- ******************************************************************************/
-
-void
-acpi_db_execute (
-	NATIVE_CHAR             *name,
-	NATIVE_CHAR             **args,
-	u32                     flags)
-{
-	acpi_status             status;
-	acpi_buffer             return_obj;
-
-
-#ifdef ACPI_DEBUG
-	u32                     previous_allocations;
-	u32                     allocations;
-
-
-	/* Memory allocation tracking */
-
-	previous_allocations = acpi_db_get_outstanding_allocations ();
-#endif
-
-	acpi_gbl_db_method_info.name = name;
-	acpi_gbl_db_method_info.args = args;
-	acpi_gbl_db_method_info.flags = flags;
-
-	acpi_db_execute_setup (&acpi_gbl_db_method_info);
-	status = acpi_db_execute_method (&acpi_gbl_db_method_info, &return_obj);
-
-	/*
-	 * Allow any handlers in separate threads to complete.
-	 * (Such as Notify handlers invoked from AML executed above).
-	 */
-	acpi_os_sleep (0, 10);
-
-
-#ifdef ACPI_DEBUG
-
-	/* Memory allocation tracking */
-
-	allocations = acpi_db_get_outstanding_allocations () - previous_allocations;
-
-	acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);
-
-	if (allocations > 0) {
-		acpi_os_printf ("Outstanding: %ld allocations after execution\n",
-				  allocations);
-	}
-#endif
-
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Execution of %s failed with status %s\n",
-			acpi_gbl_db_method_info.pathname, acpi_format_exception (status));
-	}
-
-	else {
-		/* Display a return object, if any */
-
-		if (return_obj.length) {
-			acpi_os_printf ("Execution of %s returned object %p Buflen %X\n",
-				acpi_gbl_db_method_info.pathname, return_obj.pointer, return_obj.length);
-			acpi_db_dump_object (return_obj.pointer, 1);
-		}
-	}
-
-	acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_method_thread
- *
- * PARAMETERS:  Context             - Execution info segment
- *
- * RETURN:      None
- *
- * DESCRIPTION: Debugger execute thread.  Waits for a command line, then
- *              simply dispatches it.
- *
- ******************************************************************************/
-
-void
-acpi_db_method_thread (
-	void                    *context)
-{
-	acpi_status             status;
-	db_method_info          *info = context;
-	u32                     i;
-	acpi_buffer             return_obj;
-
-
-	for (i = 0; i < info->num_loops; i++) {
-		status = acpi_db_execute_method (info, &return_obj);
-		if (ACPI_SUCCESS (status)) {
-			if (return_obj.length) {
-				acpi_os_printf ("Execution of %s returned object %p Buflen %X\n",
-					info->pathname, return_obj.pointer, return_obj.length);
-				acpi_db_dump_object (return_obj.pointer, 1);
-			}
-		}
-	}
-
-	/* Signal our completion */
-
-	acpi_os_signal_semaphore (info->thread_gate, 1);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_create_execution_threads
- *
- * PARAMETERS:  Num_threads_arg         - Number of threads to create
- *              Num_loops_arg           - Loop count for the thread(s)
- *              Method_name_arg         - Control method to execute
- *
- * RETURN:      None
- *
- * DESCRIPTION: Create threads to execute method(s)
- *
- ******************************************************************************/
-
-void
-acpi_db_create_execution_threads (
-	NATIVE_CHAR             *num_threads_arg,
-	NATIVE_CHAR             *num_loops_arg,
-	NATIVE_CHAR             *method_name_arg)
-{
-	acpi_status             status;
-	u32                     num_threads;
-	u32                     num_loops;
-	u32                     i;
-	acpi_handle             thread_gate;
-
-
-	/* Get the arguments */
-
-	num_threads = STRTOUL (num_threads_arg, NULL, 0);
-	num_loops = STRTOUL (num_loops_arg, NULL, 0);
-
-	if (!num_threads || !num_loops) {
-		acpi_os_printf ("Bad argument: Threads %X, Loops %X\n", num_threads, num_loops);
-		return;
-	}
-
-
-	/* Create the synchronization semaphore */
-
-	status = acpi_os_create_semaphore (1, 0, &thread_gate);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Could not create semaphore, %s\n", acpi_format_exception (status));
-		return;
-	}
-
-	/* Setup the context to be passed to each thread */
-
-	acpi_gbl_db_method_info.name = method_name_arg;
-	acpi_gbl_db_method_info.args = NULL;
-	acpi_gbl_db_method_info.flags = 0;
-	acpi_gbl_db_method_info.num_loops = num_loops;
-	acpi_gbl_db_method_info.thread_gate = thread_gate;
-
-	acpi_db_execute_setup (&acpi_gbl_db_method_info);
-
-
-	/* Create the threads */
-
-	acpi_os_printf ("Creating %X threads to execute %X times each\n", num_threads, num_loops);
-
-	for (i = 0; i < (num_threads); i++) {
-		acpi_os_queue_for_execution (OSD_PRIORITY_MED, acpi_db_method_thread, &acpi_gbl_db_method_info);
-	}
-
-
-	/* Wait for all threads to complete */
-
-	i = num_threads;
-	while (i)   /* Brain damage for OSD implementations that only support wait of 1 unit */ {
-		status = acpi_os_wait_semaphore (thread_gate, 1, WAIT_FOREVER);
-		i--;
-	}
-
-	/* Cleanup and exit */
-
-	acpi_os_delete_semaphore (thread_gate);
-
-	acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);
-	acpi_os_printf ("All threads (%X) have completed\n", num_threads);
-	acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-}
-
-
-#endif /* ENABLE_DEBUGGER */
-
-
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbfileio.c b/drivers/acpi/debugger/dbfileio.c
--- a/drivers/acpi/debugger/dbfileio.c	2003-01-25 01:24:50.000000000 -0800
+++ b/drivers/acpi/debugger/dbfileio.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,381 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbfileio - Debugger file I/O commands.  These can't usually
- *              be used when running the debugger in Ring 0 (Kernel mode)
- *              $Revision: 53 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acdebug.h"
-#include "acnamesp.h"
-#include "acparser.h"
-#include "acevents.h"
-#include "actables.h"
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbfileio")
-
-
-/*
- * NOTE: this is here for lack of a better place.  It is used in all
- * flavors of the debugger, need LCD file
- */
-#ifdef ACPI_APPLICATION
-#include <stdio.h>
-FILE                        *acpi_gbl_debug_file = NULL;
-#endif
-
-
-acpi_table_header           *acpi_gbl_db_table_ptr = NULL;
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_match_argument
- *
- * PARAMETERS:  User_argument           - User command line
- *              Arguments               - Array of commands to match against
- *
- * RETURN:      Index into command array or ACPI_TYPE_NOT_FOUND if not found
- *
- * DESCRIPTION: Search command array for a command match
- *
- ******************************************************************************/
-
-acpi_object_type8
-acpi_db_match_argument (
-	NATIVE_CHAR             *user_argument,
-	ARGUMENT_INFO           *arguments)
-{
-	u32                     i;
-
-
-	if (!user_argument || user_argument[0] == 0) {
-		return (ACPI_TYPE_NOT_FOUND);
-	}
-
-	for (i = 0; arguments[i].name; i++) {
-		if (STRSTR (arguments[i].name, user_argument) == arguments[i].name) {
-			return ((acpi_object_type8) i);
-		}
-	}
-
-	/* Argument not recognized */
-
-	return (ACPI_TYPE_NOT_FOUND);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_close_debug_file
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: If open, close the current debug output file
- *
- ******************************************************************************/
-
-void
-acpi_db_close_debug_file (
-	void)
-{
-
-#ifdef ACPI_APPLICATION
-
-	if (acpi_gbl_debug_file) {
-	   fclose (acpi_gbl_debug_file);
-	   acpi_gbl_debug_file = NULL;
-	   acpi_gbl_db_output_to_file = FALSE;
-	   acpi_os_printf ("Debug output file %s closed\n", acpi_gbl_db_debug_filename);
-	}
-#endif
-
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_open_debug_file
- *
- * PARAMETERS:  Name                - Filename to open
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Open a file where debug output will be directed.
- *
- ******************************************************************************/
-
-void
-acpi_db_open_debug_file (
-	NATIVE_CHAR             *name)
-{
-
-#ifdef ACPI_APPLICATION
-
-	acpi_db_close_debug_file ();
-	acpi_gbl_debug_file = fopen (name, "w+");
-	if (acpi_gbl_debug_file) {
-		acpi_os_printf ("Debug output file %s opened\n", name);
-		STRCPY (acpi_gbl_db_debug_filename, name);
-		acpi_gbl_db_output_to_file = TRUE;
-	}
-	else {
-		acpi_os_printf ("Could not open debug file %s\n", name);
-	}
-
-#endif
-}
-
-
-#ifdef ACPI_APPLICATION
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_load_table
- *
- * PARAMETERS:  fp              - File that contains table
- *              Table_ptr       - Return value, buffer with table
- *              Table_lenght    - Return value, length of table
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Load the DSDT from the file pointer
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_load_table(
-	FILE                    *fp,
-	acpi_table_header       **table_ptr,
-	u32                     *table_length)
-{
-	acpi_table_header       table_header;
-	u8                      *aml_start;
-	u32                     aml_length;
-	u32                     actual;
-	acpi_status             status;
-
-
-	/* Read the table header */
-
-	if (fread (&table_header, 1, sizeof (table_header), fp) != sizeof (acpi_table_header)) {
-		acpi_os_printf ("Couldn't read the table header\n");
-		return (AE_BAD_SIGNATURE);
-	}
-
-
-	/* Validate the table header/length */
-
-	status = acpi_tb_validate_table_header (&table_header);
-	if ((ACPI_FAILURE (status)) ||
-		(table_header.length > 524288)) /* 1/2 Mbyte should be enough */ {
-		acpi_os_printf ("Table header is invalid!\n");
-		return (AE_ERROR);
-	}
-
-
-	/* We only support a limited number of table types */
-
-	if (STRNCMP ((char *) table_header.signature, DSDT_SIG, 4) &&
-		STRNCMP ((char *) table_header.signature, PSDT_SIG, 4) &&
-		STRNCMP ((char *) table_header.signature, SSDT_SIG, 4)) {
-		acpi_os_printf ("Table signature is invalid\n");
-		DUMP_BUFFER (&table_header, sizeof (acpi_table_header));
-		return (AE_ERROR);
-	}
-
-	/* Allocate a buffer for the table */
-
-	*table_length = table_header.length;
-	*table_ptr = acpi_os_allocate ((size_t) *table_length);
-	if (!*table_ptr) {
-		acpi_os_printf ("Could not allocate memory for ACPI table %4.4s (size=%X)\n",
-				 table_header.signature, table_header.length);
-		return (AE_NO_MEMORY);
-	}
-
-
-	aml_start = (u8 *) *table_ptr + sizeof (table_header);
-	aml_length = *table_length - sizeof (table_header);
-
-	/* Copy the header to the buffer */
-
-	MEMCPY (*table_ptr, &table_header, sizeof (table_header));
-
-	/* Get the rest of the table */
-
-	actual = fread (aml_start, 1, (size_t) aml_length, fp);
-	if (actual == aml_length) {
-		return (AE_OK);
-	}
-
-	if (actual > 0) {
-		acpi_os_printf ("Warning - reading table, asked for %X got %X\n", aml_length, actual);
-		return (AE_OK);
-	}
-
-
-	acpi_os_printf ("Error - could not read the table file\n");
-	acpi_os_free (*table_ptr);
-	*table_ptr = NULL;
-	*table_length = 0;
-
-	return (AE_ERROR);
-}
-#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Ae_local_load_table
- *
- * PARAMETERS:  Table_ptr       - pointer to a buffer containing the entire
- *                                table to be loaded
- *
- * RETURN:      Status
- *
- * DESCRIPTION: This function is called to load a table from the caller's
- *              buffer.  The buffer must contain an entire ACPI Table including
- *              a valid header.  The header fields will be verified, and if it
- *              is determined that the table is invalid, the call will fail.
- *
- *              If the call fails an appropriate status will be returned.
- *
- ******************************************************************************/
-
-acpi_status
-ae_local_load_table (
-	acpi_table_header       *table_ptr)
-{
-	acpi_status             status;
-	acpi_table_desc         table_info;
-
-
-	FUNCTION_TRACE ("Ae_local_load_table");
-
-	if (!table_ptr) {
-		return_ACPI_STATUS (AE_BAD_PARAMETER);
-	}
-
-	/* Install the new table into the local data structures */
-
-	table_info.pointer = table_ptr;
-
-	status = acpi_tb_install_table (NULL, &table_info);
-	if (ACPI_FAILURE (status)) {
-		/* Free table allocated by Acpi_tb_get_table */
-
-		acpi_tb_delete_single_table (&table_info);
-		return_ACPI_STATUS (status);
-	}
-
-
-#ifndef PARSER_ONLY
-	status = acpi_ns_load_table (table_info.installed_desc, acpi_gbl_root_node);
-	if (ACPI_FAILURE (status)) {
-		/* Uninstall table and free the buffer */
-
-		acpi_tb_delete_acpi_table (ACPI_TABLE_DSDT);
-		return_ACPI_STATUS (status);
-	}
-#endif
-
-	return_ACPI_STATUS (status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_load_acpi_table
- *
- * PARAMETERS:  Filname         - File where table is located
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Load an ACPI table from a file
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_load_acpi_table (
-	NATIVE_CHAR             *filename)
-{
-#ifdef ACPI_APPLICATION
-	FILE                    *fp;
-	acpi_status             status;
-	u32                     table_length;
-
-
-	/* Open the file */
-
-	fp = fopen (filename, "rb");
-	if (!fp) {
-		acpi_os_printf ("Could not open file %s\n", filename);
-		return (AE_ERROR);
-	}
-
-
-	/* Get the entire file */
-
-	acpi_os_printf ("Loading Acpi table from file %s\n", filename);
-	status = acpi_db_load_table (fp, &acpi_gbl_db_table_ptr, &table_length);
-	fclose(fp);
-
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Couldn't get table from the file\n");
-		return (status);
-	}
-
-	/* Attempt to recognize and install the table */
-
-	status = ae_local_load_table (acpi_gbl_db_table_ptr);
-	if (ACPI_FAILURE (status)) {
-		if (status == AE_EXIST) {
-			acpi_os_printf ("Table %4.4s is already installed\n",
-					  &acpi_gbl_db_table_ptr->signature);
-		}
-		else {
-			acpi_os_printf ("Could not install table, %s\n",
-					  acpi_format_exception (status));
-		}
-
-		acpi_os_free (acpi_gbl_db_table_ptr);
-		return (status);
-	}
-
-	acpi_os_printf ("%4.4s at %p successfully installed and loaded\n",
-			  &acpi_gbl_db_table_ptr->signature, acpi_gbl_db_table_ptr);
-
-	acpi_gbl_acpi_hardware_present = FALSE;
-
-#endif  /* ACPI_APPLICATION */
-	return (AE_OK);
-}
-
-
-#endif  /* ENABLE_DEBUGGER */
-
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbhistry.c b/drivers/acpi/debugger/dbhistry.c
--- a/drivers/acpi/debugger/dbhistry.c	2003-01-25 01:26:21.000000000 -0800
+++ b/drivers/acpi/debugger/dbhistry.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,201 +0,0 @@
-/******************************************************************************
- *
- * Module Name: dbhistry - debugger HISTORY command
- *              $Revision: 19 $
- *
- *****************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "acdispat.h"
-#include "amlcode.h"
-#include "acnamesp.h"
-#include "acparser.h"
-#include "acevents.h"
-#include "acinterp.h"
-#include "acdebug.h"
-#include "actables.h"
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbhistry")
-
-
-#define HI_NO_HISTORY       0
-#define HI_RECORD_HISTORY   1
-#define HISTORY_SIZE        20
-
-
-typedef struct history_info
-{
-	NATIVE_CHAR             command[80];
-	u32                     cmd_num;
-
-} HISTORY_INFO;
-
-
-HISTORY_INFO                acpi_gbl_history_buffer[HISTORY_SIZE];
-u16                         acpi_gbl_lo_history = 0;
-u16                         acpi_gbl_num_history = 0;
-u16                         acpi_gbl_next_history_index = 0;
-u32                         acpi_gbl_next_cmd_num = 1;
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_add_to_history
- *
- * PARAMETERS:  Command_line    - Command to add
- *
- * RETURN:      None
- *
- * DESCRIPTION: Add a command line to the history buffer.
- *
- ******************************************************************************/
-
-void
-acpi_db_add_to_history (
-	NATIVE_CHAR             *command_line)
-{
-
-
-	/* Put command into the next available slot */
-
-	STRCPY (acpi_gbl_history_buffer[acpi_gbl_next_history_index].command, command_line);
-
-	acpi_gbl_history_buffer[acpi_gbl_next_history_index].cmd_num = acpi_gbl_next_cmd_num;
-
-	/* Adjust indexes */
-
-	if ((acpi_gbl_num_history == HISTORY_SIZE) &&
-		(acpi_gbl_next_history_index == acpi_gbl_lo_history)) {
-		acpi_gbl_lo_history++;
-		if (acpi_gbl_lo_history >= HISTORY_SIZE) {
-			acpi_gbl_lo_history = 0;
-		}
-	}
-
-	acpi_gbl_next_history_index++;
-	if (acpi_gbl_next_history_index >= HISTORY_SIZE) {
-		acpi_gbl_next_history_index = 0;
-	}
-
-
-	acpi_gbl_next_cmd_num++;
-	if (acpi_gbl_num_history < HISTORY_SIZE) {
-		acpi_gbl_num_history++;
-	}
-
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_history
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Display the contents of the history buffer
- *
- ******************************************************************************/
-
-void
-acpi_db_display_history (void)
-{
-	NATIVE_UINT             i;
-	u16                     history_index;
-
-
-	history_index = acpi_gbl_lo_history;
-
-	/* Dump entire history buffer */
-
-	for (i = 0; i < acpi_gbl_num_history; i++) {
-		acpi_os_printf ("%ld %s\n", acpi_gbl_history_buffer[history_index].cmd_num,
-				 acpi_gbl_history_buffer[history_index].command);
-
-		history_index++;
-		if (history_index >= HISTORY_SIZE) {
-			history_index = 0;
-		}
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_get_from_history
- *
- * PARAMETERS:  Command_num_arg         - String containing the number of the
- *                                        command to be retrieved
- *
- * RETURN:      None
- *
- * DESCRIPTION: Get a command from the history buffer
- *
- ******************************************************************************/
-
-NATIVE_CHAR *
-acpi_db_get_from_history (
-	NATIVE_CHAR             *command_num_arg)
-{
-	NATIVE_UINT             i;
-	u16                     history_index;
-	u32                     cmd_num;
-
-
-	if (command_num_arg == NULL) {
-		cmd_num = acpi_gbl_next_cmd_num - 1;
-	}
-
-	else {
-		cmd_num = STRTOUL (command_num_arg, NULL, 0);
-	}
-
-
-	/* Search history buffer */
-
-	history_index = acpi_gbl_lo_history;
-	for (i = 0; i < acpi_gbl_num_history; i++) {
-		if (acpi_gbl_history_buffer[history_index].cmd_num == cmd_num) {
-			/* Found the commnad, return it */
-
-			return (acpi_gbl_history_buffer[history_index].command);
-		}
-
-
-		history_index++;
-		if (history_index >= HISTORY_SIZE) {
-			history_index = 0;
-		}
-	}
-
-	acpi_os_printf ("Invalid history number: %d\n", history_index);
-	return (NULL);
-}
-
-
-#endif /* ENABLE_DEBUGGER */
-
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbinput.c b/drivers/acpi/debugger/dbinput.c
--- a/drivers/acpi/debugger/dbinput.c	2003-01-25 01:25:43.000000000 -0800
+++ b/drivers/acpi/debugger/dbinput.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,924 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbinput - user front-end to the AML debugger
- *              $Revision: 72 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "actables.h"
-#include "acnamesp.h"
-#include "acinterp.h"
-#include "acdebug.h"
-
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbinput")
-
-
-/*
- * Globals that are specific to the debugger
- */
-
-NATIVE_CHAR                 acpi_gbl_db_line_buf[80];
-NATIVE_CHAR                 acpi_gbl_db_parsed_buf[80];
-NATIVE_CHAR                 acpi_gbl_db_scope_buf[40];
-NATIVE_CHAR                 acpi_gbl_db_debug_filename[40];
-NATIVE_CHAR                 *acpi_gbl_db_args[DB_MAX_ARGS];
-NATIVE_CHAR                 *acpi_gbl_db_buffer = NULL;
-NATIVE_CHAR                 *acpi_gbl_db_filename = NULL;
-u8                          acpi_gbl_db_output_to_file = FALSE;
-
-u32                         acpi_gbl_db_debug_level = ACPI_LV_VERBOSITY2;
-u32                         acpi_gbl_db_console_debug_level = NORMAL_DEFAULT | ACPI_LV_TABLES;
-u8                          acpi_gbl_db_output_flags = DB_CONSOLE_OUTPUT;
-
-
-u8                          acpi_gbl_db_opt_tables    = FALSE;
-u8                          acpi_gbl_db_opt_disasm    = FALSE;
-u8                          acpi_gbl_db_opt_stats     = FALSE;
-u8                          acpi_gbl_db_opt_parse_jit = FALSE;
-u8                          acpi_gbl_db_opt_verbose   = TRUE;
-u8                          acpi_gbl_db_opt_ini_methods = TRUE;
-
-/*
- * Statistic globals
- */
-u16                         acpi_gbl_obj_type_count[INTERNAL_TYPE_NODE_MAX+1];
-u16                         acpi_gbl_node_type_count[INTERNAL_TYPE_NODE_MAX+1];
-u16                         acpi_gbl_obj_type_count_misc;
-u16                         acpi_gbl_node_type_count_misc;
-u32                         acpi_gbl_num_nodes;
-u32                         acpi_gbl_num_objects;
-
-
-u32                         acpi_gbl_size_of_parse_tree;
-u32                         acpi_gbl_size_of_method_trees;
-u32                         acpi_gbl_size_of_node_entries;
-u32                         acpi_gbl_size_of_acpi_objects;
-
-/*
- * Top-level debugger commands.
- *
- * This list of commands must match the string table below it
- */
-
-enum acpi_ex_debugger_commands
-{
-	CMD_NOT_FOUND = 0,
-	CMD_NULL,
-	CMD_ALLOCATIONS,
-	CMD_ARGS,
-	CMD_ARGUMENTS,
-	CMD_BREAKPOINT,
-	CMD_CALL,
-	CMD_CLOSE,
-	CMD_DEBUG,
-	CMD_DUMP,
-	CMD_ENABLEACPI,
-	CMD_EVENT,
-	CMD_EXECUTE,
-	CMD_EXIT,
-	CMD_FIND,
-	CMD_GO,
-	CMD_HELP,
-	CMD_HELP2,
-	CMD_HISTORY,
-	CMD_HISTORY_EXE,
-	CMD_HISTORY_LAST,
-	CMD_INFORMATION,
-	CMD_INTO,
-	CMD_LEVEL,
-	CMD_LIST,
-	CMD_LOAD,
-	CMD_LOCALS,
-	CMD_LOCKS,
-	CMD_METHODS,
-	CMD_NAMESPACE,
-	CMD_NOTIFY,
-	CMD_OBJECT,
-	CMD_OPEN,
-	CMD_OWNER,
-	CMD_PREFIX,
-	CMD_QUIT,
-	CMD_REFERENCES,
-	CMD_RESOURCES,
-	CMD_RESULTS,
-	CMD_SET,
-	CMD_STATS,
-	CMD_STOP,
-	CMD_TABLES,
-	CMD_TERMINATE,
-	CMD_THREADS,
-	CMD_TREE,
-	CMD_UNLOAD
-};
-
-#define CMD_FIRST_VALID     2
-
-
-const COMMAND_INFO          acpi_gbl_db_commands[] =
-{ {"<NOT FOUND>",  0},
-	{"<NULL>",       0},
-	{"ALLOCATIONS",  0},
-	{"ARGS",         0},
-	{"ARGUMENTS",    0},
-	{"BREAKPOINT",   1},
-	{"CALL",         0},
-	{"CLOSE",        0},
-	{"DEBUG",        1},
-	{"DUMP",         1},
-	{"ENABLEACPI",   0},
-	{"EVENT",        1},
-	{"EXECUTE",      1},
-	{"EXIT",         0},
-	{"FIND",         1},
-	{"GO",           0},
-	{"HELP",         0},
-	{"?",            0},
-	{"HISTORY",      0},
-	{"!",            1},
-	{"!!",           0},
-	{"INFORMATION",  0},
-	{"INTO",         0},
-	{"LEVEL",        0},
-	{"LIST",         0},
-	{"LOAD",         1},
-	{"LOCALS",       0},
-	{"LOCKS",        0},
-	{"METHODS",      0},
-	{"NAMESPACE",    0},
-	{"NOTIFY",       2},
-	{"OBJECT",       1},
-	{"OPEN",         1},
-	{"OWNER",        1},
-	{"PREFIX",       0},
-	{"QUIT",         0},
-	{"REFERENCES",   1},
-	{"RESOURCES",    1},
-	{"RESULTS",      0},
-	{"SET",          3},
-	{"STATS",        0},
-	{"STOP",         0},
-	{"TABLES",       0},
-	{"TERMINATE",    0},
-	{"THREADS",      3},
-	{"TREE",         0},
-	{"UNLOAD",       1},
-	{NULL,           0}
-};
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_help
- *
- * PARAMETERS:  Help_type       - Subcommand (optional)
- *
- * RETURN:      None
- *
- * DESCRIPTION: Print a usage message.
- *
- ******************************************************************************/
-
-void
-acpi_db_display_help (
-	NATIVE_CHAR             *help_type)
-{
-
-
-	/* No parameter, just give the overview */
-
-	if (!help_type)
-	{
-		acpi_os_printf ("ACPI CA Debugger Commands\n\n");
-		acpi_os_printf ("The following classes of commands are available. Help is available for\n");
-		acpi_os_printf ("each class by entering \"Help <Class_name>\"\n\n");
-		acpi_os_printf ("  [GENERAL]       General-Purpose Commands\n");
-		acpi_os_printf ("  [NAMESPACE]     Namespace Access Commands\n");
-		acpi_os_printf ("  [METHOD]        Control Method Execution Commands\n");
-		acpi_os_printf ("  [FILE]          File I/O Commands\n");
-		return;
-
-	}
-
-
-	/*
-	 * Parameter is the command class
-	 *
-	 * The idea here is to keep each class of commands smaller than a screenful
-	 */
-
-	switch (help_type[0])
-	{
-	case 'G':
-		acpi_os_printf ("\n_general-Purpose Commands\n\n");
-		acpi_os_printf ("Allocations                       Display list of current memory allocations\n");
-		acpi_os_printf ("Dump <Address>|<Namepath>\n");
-		acpi_os_printf ("   [Byte|Word|Dword|Qword]        Display ACPI objects or memory\n");
-		acpi_os_printf ("Enable_acpi                       Enable ACPI (hardware) mode\n");
-		acpi_os_printf ("Help                              This help screen\n");
-		acpi_os_printf ("History                           Display command history buffer\n");
-		acpi_os_printf ("Level [<Debug_level>] [console]   Get/Set debug level for file or console\n");
-		acpi_os_printf ("Locks                             Current status of internal mutexes\n");
-		acpi_os_printf ("Quit or Exit                      Exit this command\n");
-		acpi_os_printf ("Stats [Allocations|Memory|Misc\n");
-		acpi_os_printf ("     |Objects|Tables]             Display namespace and memory statistics\n");
-		acpi_os_printf ("Tables                            Display info about loaded ACPI tables\n");
-		acpi_os_printf ("Unload <Table_sig> [Instance]     Unload an ACPI table\n");
-		acpi_os_printf ("! <Command_number>                Execute command from history buffer\n");
-		acpi_os_printf ("!!                                Execute last command again\n");
-		return;
-
-	case 'N':
-		acpi_os_printf ("\n_namespace Access Commands\n\n");
-		acpi_os_printf ("Debug <Namepath> [Arguments]      Single Step a control method\n");
-		acpi_os_printf ("Event <F|G> <Value>               Generate Acpi_event (Fixed/GPE)\n");
-		acpi_os_printf ("Execute <Namepath> [Arguments]    Execute control method\n");
-		acpi_os_printf ("Find <Name> (? is wildcard)       Find ACPI name(s) with wildcards\n");
-		acpi_os_printf ("Method                            Display list of loaded control methods\n");
-		acpi_os_printf ("Namespace [<Addr>|<Path>] [Depth] Display loaded namespace tree/subtree\n");
-		acpi_os_printf ("Notify <Name_path> <Value>        Send a notification\n");
-		acpi_os_printf ("Objects <Object_type>             Display all objects of the given type\n");
-		acpi_os_printf ("Owner <Owner_id> [Depth]          Display loaded namespace by object owner\n");
-		acpi_os_printf ("Prefix [<Name_path>]              Set or Get current execution prefix\n");
-		acpi_os_printf ("References <Addr>                 Find all references to object at addr\n");
-		acpi_os_printf ("Resources xxx                     Get and display resources\n");
-		acpi_os_printf ("Terminate                         Delete namespace and all internal objects\n");
-		acpi_os_printf ("Thread <Threads><Loops><Name_path> Spawn threads to execute method(s)\n");
-		return;
-
-	case 'M':
-		acpi_os_printf ("\n_control Method Execution Commands\n\n");
-		acpi_os_printf ("Arguments (or Args)               Display method arguments\n");
-		acpi_os_printf ("Breakpoint <Aml_offset>           Set an AML execution breakpoint\n");
-		acpi_os_printf ("Call                              Run to next control method invocation\n");
-		acpi_os_printf ("Go                                Allow method to run to completion\n");
-		acpi_os_printf ("Information                       Display info about the current method\n");
-		acpi_os_printf ("Into                              Step into (not over) a method call\n");
-		acpi_os_printf ("List [# of Aml Opcodes]           Display method ASL statements\n");
-		acpi_os_printf ("Locals                            Display method local variables\n");
-		acpi_os_printf ("Results                           Display method result stack\n");
-		acpi_os_printf ("Set <A|L> <#> <Value>             Set method data (Arguments/Locals)\n");
-		acpi_os_printf ("Stop                              Terminate control method\n");
-		acpi_os_printf ("Tree                              Display control method calling tree\n");
-		acpi_os_printf ("<Enter>                           Single step next AML opcode (over calls)\n");
-		return;
-
-	case 'F':
-		acpi_os_printf ("\n_file I/O Commands\n\n");
-		acpi_os_printf ("Close                             Close debug output file\n");
-		acpi_os_printf ("Open <Output Filename>            Open a file for debug output\n");
-		acpi_os_printf ("Load <Input Filename>             Load ACPI table from a file\n");
-		return;
-
-	default:
-		acpi_os_printf ("Unrecognized Command Class: %x\n", help_type);
-		return;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_get_next_token
- *
- * PARAMETERS:  String          - Command buffer
- *              Next            - Return value, end of next token
- *
- * RETURN:      Pointer to the start of the next token.
- *
- * DESCRIPTION: Command line parsing.  Get the next token on the command line
- *
- ******************************************************************************/
-
-NATIVE_CHAR *
-acpi_db_get_next_token (
-	NATIVE_CHAR             *string,
-	NATIVE_CHAR             **next)
-{
-	NATIVE_CHAR             *start;
-
-	/* At end of buffer? */
-
-	if (!string || !(*string))
-	{
-		return (NULL);
-	}
-
-
-	/* Get rid of any spaces at the beginning */
-
-	if (*string == ' ')
-	{
-		while (*string && (*string == ' '))
-		{
-			string++;
-		}
-
-		if (!(*string))
-		{
-			return (NULL);
-		}
-	}
-
-	start = string;
-
-	/* Find end of token */
-
-	while (*string && (*string != ' '))
-	{
-		string++;
-	}
-
-
-	if (!(*string))
-	{
-		*next = NULL;
-	}
-
-	else
-	{
-		*string = 0;
-		*next = string + 1;
-	}
-
-	return (start);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_get_line
- *
- * PARAMETERS:  Input_buffer        - Command line buffer
- *
- * RETURN:      None
- *
- * DESCRIPTION: Get the next command line from the user.  Gets entire line
- *              up to the next newline
- *
- ******************************************************************************/
-
-u32
-acpi_db_get_line (
-	NATIVE_CHAR             *input_buffer)
-{
-	u32                     i;
-	u32                     count;
-	NATIVE_CHAR             *next;
-	NATIVE_CHAR             *this;
-
-
-	STRCPY (acpi_gbl_db_parsed_buf, input_buffer);
-	STRUPR (acpi_gbl_db_parsed_buf);
-
-	this = acpi_gbl_db_parsed_buf;
-	for (i = 0; i < DB_MAX_ARGS; i++)
-	{
-		acpi_gbl_db_args[i] = acpi_db_get_next_token (this, &next);
-		if (!acpi_gbl_db_args[i])
-		{
-			break;
-		}
-
-		this = next;
-	}
-
-
-	/* Uppercase the actual command */
-
-	if (acpi_gbl_db_args[0])
-	{
-		STRUPR (acpi_gbl_db_args[0]);
-	}
-
-	count = i;
-	if (count)
-	{
-		count--;  /* Number of args only */
-	}
-
-	return (count);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_match_command
- *
- * PARAMETERS:  User_command            - User command line
- *
- * RETURN:      Index into command array, -1 if not found
- *
- * DESCRIPTION: Search command array for a command match
- *
- ******************************************************************************/
-
-u32
-acpi_db_match_command (
-	NATIVE_CHAR             *user_command)
-{
-	u32                     i;
-
-
-	if (!user_command || user_command[0] == 0)
-	{
-		return (CMD_NULL);
-	}
-
-	for (i = CMD_FIRST_VALID; acpi_gbl_db_commands[i].name; i++)
-	{
-		if (STRSTR (acpi_gbl_db_commands[i].name, user_command) == acpi_gbl_db_commands[i].name)
-		{
-			return (i);
-		}
-	}
-
-	/* Command not recognized */
-
-	return (CMD_NOT_FOUND);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_command_dispatch
- *
- * PARAMETERS:  Input_buffer        - Command line buffer
- *              Walk_state          - Current walk
- *              Op                  - Current (executing) parse op
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Command dispatcher.  Called from two places:
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_command_dispatch (
-	NATIVE_CHAR             *input_buffer,
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
-{
-	u32                     temp;
-	u32                     command_index;
-	u32                     param_count;
-	NATIVE_CHAR             *command_line;
-	acpi_status             status = AE_CTRL_TRUE;
-
-
-	/* If Acpi_terminate has been called, terminate this thread */
-
-	if (acpi_gbl_db_terminate_threads)
-	{
-		return (AE_CTRL_TERMINATE);
-	}
-
-	param_count = acpi_db_get_line (input_buffer);
-	command_index = acpi_db_match_command (acpi_gbl_db_args[0]);
-	temp = 0;
-
-	/* Verify that we have the minimum number of params */
-
-	if (param_count < acpi_gbl_db_commands[command_index].min_args)
-	{
-		acpi_os_printf ("%d parameters entered, [%s] requires %d parameters\n",
-				  param_count, acpi_gbl_db_commands[command_index].name, acpi_gbl_db_commands[command_index].min_args);
-		return (AE_CTRL_TRUE);
-	}
-
-	/* Decode and dispatch the command */
-
-	switch (command_index)
-	{
-	case CMD_NULL:
-		if (op)
-		{
-			return (AE_OK);
-		}
-		break;
-
-	case CMD_ALLOCATIONS:
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-		acpi_ut_dump_allocations ((u32) -1, NULL);
-#endif
-		break;
-
-	case CMD_ARGS:
-	case CMD_ARGUMENTS:
-		acpi_db_display_arguments ();
-		break;
-
-	case CMD_BREAKPOINT:
-		acpi_db_set_method_breakpoint (acpi_gbl_db_args[1], walk_state, op);
-		break;
-
-	case CMD_CALL:
-		acpi_db_set_method_call_breakpoint (op);
-		status = AE_OK;
-		break;
-
-	case CMD_CLOSE:
-		acpi_db_close_debug_file ();
-		break;
-
-	case CMD_DEBUG:
-		acpi_db_execute (acpi_gbl_db_args[1], &acpi_gbl_db_args[2], EX_SINGLE_STEP);
-		break;
-
-	case CMD_DUMP:
-		acpi_db_decode_and_display_object (acpi_gbl_db_args[1], acpi_gbl_db_args[2]);
-		break;
-
-	case CMD_ENABLEACPI:
-		status = acpi_enable();
-		if (ACPI_FAILURE(status))
-		{
-			acpi_os_printf("Acpi_enable failed (Status=%X)\n", status);
-			return (status);
-		}
-		break;
-
-	case CMD_EVENT:
-		acpi_os_printf ("Event command not implemented\n");
-		break;
-
-	case CMD_EXECUTE:
-		acpi_db_execute (acpi_gbl_db_args[1], &acpi_gbl_db_args[2], EX_NO_SINGLE_STEP);
-		break;
-
-	case CMD_FIND:
-		acpi_db_find_name_in_namespace (acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_GO:
-		acpi_gbl_cm_single_step = FALSE;
-		return (AE_OK);
-
-	case CMD_HELP:
-	case CMD_HELP2:
-		acpi_db_display_help (acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_HISTORY:
-		acpi_db_display_history ();
-		break;
-
-	case CMD_HISTORY_EXE:
-		command_line = acpi_db_get_from_history (acpi_gbl_db_args[1]);
-		if (!command_line)
-		{
-			return (AE_CTRL_TRUE);
-		}
-
-		status = acpi_db_command_dispatch (command_line, walk_state, op);
-		if (ACPI_SUCCESS (status))
-		{
-			status = AE_CTRL_TRUE;
-		}
-		return (status);
-		break;
-
-	case CMD_HISTORY_LAST:
-		command_line = acpi_db_get_from_history (NULL);
-		if (!command_line)
-		{
-			return (AE_CTRL_TRUE);
-		}
-
-		status = acpi_db_command_dispatch (command_line, walk_state, op);
-		if (ACPI_SUCCESS (status))
-		{
-			status = AE_CTRL_TRUE;
-		}
-		return (status);
-
-	case CMD_INFORMATION:
-		acpi_db_display_method_info (op);
-		break;
-
-	case CMD_INTO:
-		if (op)
-		{
-			acpi_gbl_cm_single_step = TRUE;
-
-/* TBD: Must get current walk state */
-			/* Acpi_gbl_Method_breakpoint = 0; */
-			return (AE_OK);
-		}
-		break;
-
-	case CMD_LEVEL:
-		if (param_count == 0)
-		{
-			acpi_os_printf ("Current debug level for file output is:  %8.8lX\n", acpi_gbl_db_debug_level);
-			acpi_os_printf ("Current debug level for console output is: %8.8lX\n", acpi_gbl_db_console_debug_level);
-		}
-		else if (param_count == 2)
-		{
-			temp = acpi_gbl_db_console_debug_level;
-			acpi_gbl_db_console_debug_level = STRTOUL (acpi_gbl_db_args[1], NULL, 16);
-			acpi_os_printf ("Debug Level for console output was %8.8lX, now %8.8lX\n", temp, acpi_gbl_db_console_debug_level);
-		}
-		else
-		{
-			temp = acpi_gbl_db_debug_level;
-			acpi_gbl_db_debug_level = STRTOUL (acpi_gbl_db_args[1], NULL, 16);
-			acpi_os_printf ("Debug Level for file output was %8.8lX, now %8.8lX\n", temp, acpi_gbl_db_debug_level);
-		}
-		break;
-
-	case CMD_LIST:
-		acpi_db_disassemble_aml (acpi_gbl_db_args[1], op);
-		break;
-
-	case CMD_LOAD:
-		status = acpi_db_load_acpi_table (acpi_gbl_db_args[1]);
-		if (ACPI_FAILURE (status))
-		{
-			return (status);
-		}
-		break;
-
-	case CMD_LOCKS:
-		acpi_db_display_locks ();
-		break;
-
-	case CMD_LOCALS:
-		acpi_db_display_locals ();
-		break;
-
-	case CMD_METHODS:
-		acpi_db_display_objects ("METHOD", acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_NAMESPACE:
-		acpi_db_dump_namespace (acpi_gbl_db_args[1], acpi_gbl_db_args[2]);
-		break;
-
-	case CMD_NOTIFY:
-		temp = STRTOUL (acpi_gbl_db_args[2], NULL, 0);
-		acpi_db_send_notify (acpi_gbl_db_args[1], temp);
-		break;
-
-	case CMD_OBJECT:
-		acpi_db_display_objects (STRUPR (acpi_gbl_db_args[1]), acpi_gbl_db_args[2]);
-		break;
-
-	case CMD_OPEN:
-		acpi_db_open_debug_file (acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_OWNER:
-		acpi_db_dump_namespace_by_owner (acpi_gbl_db_args[1], acpi_gbl_db_args[2]);
-		break;
-
-	case CMD_PREFIX:
-		acpi_db_set_scope (acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_REFERENCES:
-		acpi_db_find_references (acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_RESOURCES:
-		acpi_db_display_resources (acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_RESULTS:
-		acpi_db_display_results ();
-		break;
-
-	case CMD_SET:
-		acpi_db_set_method_data (acpi_gbl_db_args[1], acpi_gbl_db_args[2], acpi_gbl_db_args[3]);
-		break;
-
-	case CMD_STATS:
-		acpi_db_display_statistics (acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_STOP:
-		return (AE_AML_ERROR);
-		break;
-
-	case CMD_TABLES:
-		acpi_db_display_table_info (acpi_gbl_db_args[1]);
-		break;
-
-	case CMD_TERMINATE:
-		acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
-		acpi_ut_subsystem_shutdown ();
-
-		/* TBD: [Restructure] Need some way to re-initialize without re-creating the semaphores! */
-
-		/*  Acpi_initialize (NULL); */
-		break;
-
-	case CMD_THREADS:
-		acpi_db_create_execution_threads (acpi_gbl_db_args[1], acpi_gbl_db_args[2], acpi_gbl_db_args[3]);
-		break;
-
-	case CMD_TREE:
-		acpi_db_display_calling_tree ();
-		break;
-
-	case CMD_UNLOAD:
-		acpi_db_unload_acpi_table (acpi_gbl_db_args[1], acpi_gbl_db_args[2]);
-		break;
-
-	case CMD_EXIT:
-	case CMD_QUIT:
-		if (op)
-		{
-			acpi_os_printf ("Method execution terminated\n");
-			return (AE_CTRL_TERMINATE);
-		}
-
-		if (!acpi_gbl_db_output_to_file)
-		{
-			acpi_dbg_level = DEBUG_DEFAULT;
-		}
-
-		/* Shutdown */
-
-		/* Acpi_ut_subsystem_shutdown (); */
-		acpi_db_close_debug_file ();
-
-		acpi_gbl_db_terminate_threads = TRUE;
-
-		return (AE_CTRL_TERMINATE);
-
-	case CMD_NOT_FOUND:
-		acpi_os_printf ("Unknown Command\n");
-		return (AE_CTRL_TRUE);
-	}
-
-
-	/* Add all commands that come here to the history buffer */
-
-	acpi_db_add_to_history (input_buffer);
-	return (status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_execute_thread
- *
- * PARAMETERS:  Context         - Not used
- *
- * RETURN:      None
- *
- * DESCRIPTION: Debugger execute thread.  Waits for a command line, then
- *              simply dispatches it.
- *
- ******************************************************************************/
-
-void
-acpi_db_execute_thread (
-	void                    *context)
-{
-	acpi_status             status = AE_OK;
-
-
-	while (status != AE_CTRL_TERMINATE)
-	{
-		acpi_gbl_method_executing = FALSE;
-		acpi_gbl_step_to_next_call = FALSE;
-
-		acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY);
-		status = acpi_db_command_dispatch (acpi_gbl_db_line_buf, NULL, NULL);
-		acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_single_thread
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Debugger execute thread.  Waits for a command line, then
- *              simply dispatches it.
- *
- ******************************************************************************/
-
-void
-acpi_db_single_thread (
-	void)
-{
-	acpi_status             status = AE_OK;
-
-
-	acpi_gbl_method_executing = FALSE;
-	acpi_gbl_step_to_next_call = FALSE;
-
-	status = acpi_db_command_dispatch (acpi_gbl_db_line_buf, NULL, NULL);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_user_commands
- *
- * PARAMETERS:  Prompt              - User prompt (depends on mode)
- *              Op                  - Current executing parse op
- *
- * RETURN:      None
- *
- * DESCRIPTION: Command line execution for the AML debugger.  Commands are
- *              matched and dispatched here.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_user_commands (
-	NATIVE_CHAR             prompt,
-	acpi_parse_object       *op)
-{
-	acpi_status             status = AE_OK;
-
-
-	/* TBD: [Restructure] Need a separate command line buffer for step mode */
-
-	while (!acpi_gbl_db_terminate_threads)
-	{
-		/* Force output to console until a command is entered */
-
-		acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-
-		/* Different prompt if method is executing */
-
-		if (!acpi_gbl_method_executing)
-		{
-			acpi_os_printf ("%1c ", DB_COMMAND_PROMPT);
-		}
-		else
-		{
-			acpi_os_printf ("%1c ", DB_EXECUTE_PROMPT);
-		}
-
-		/* Get the user input line */
-
-		acpi_os_get_line (acpi_gbl_db_line_buf);
-
-
-		/* Check for single or multithreaded debug */
-
-		if (acpi_gbl_debugger_configuration & DEBUGGER_MULTI_THREADED)
-		{
-			/*
-			 * Signal the debug thread that we have a command to execute,
-			 * and wait for the command to complete.
-			 */
-			acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_READY);
-			acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
-		}
-
-		else
-		{
-			/* Just call to the command line interpreter */
-
-			acpi_db_single_thread ();
-		}
-	}
-
-
-	/*
-	 * Only this thread (the original thread) should actually terminate the subsystem,
-	 * because all the semaphores are deleted during termination
-	 */
-	acpi_terminate ();
-	return (status);
-}
-
-
-#endif  /* ENABLE_DEBUGGER */
-
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbstats.c b/drivers/acpi/debugger/dbstats.c
--- a/drivers/acpi/debugger/dbstats.c	2003-01-25 01:24:27.000000000 -0800
+++ b/drivers/acpi/debugger/dbstats.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,456 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbstats - Generation and display of ACPI table statistics
- *              $Revision: 47 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include <acpi.h>
-#include <acdebug.h>
-#include <amlcode.h>
-#include <acparser.h>
-#include <acnamesp.h>
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbstats")
-
-/*
- * Statistics subcommands
- */
-ARGUMENT_INFO               acpi_db_stat_types [] =
-{ {"ALLOCATIONS"},
-	{"OBJECTS"},
-	{"MEMORY"},
-	{"MISC"},
-	{"TABLES"},
-	{"SIZES"},
-	{"STACK"},
-	{NULL}           /* Must be null terminated */
-};
-
-#define CMD_ALLOCATIONS     0
-#define CMD_OBJECTS         1
-#define CMD_MEMORY          2
-#define CMD_MISC            3
-#define CMD_TABLES          4
-#define CMD_SIZES           5
-#define CMD_STACK           6
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_enumerate_object
- *
- * PARAMETERS:  Obj_desc            - Object to be counted
- *
- * RETURN:      None
- *
- * DESCRIPTION: Add this object to the global counts, by object type.
- *              Recursively handles subobjects and packages.
- *
- *              [TBD] Restructure - remove recursion.
- *
- ******************************************************************************/
-
-void
-acpi_db_enumerate_object (
-	acpi_operand_object     *obj_desc)
-{
-	u32                     type;
-	u32                     i;
-
-
-	if (!obj_desc)
-	{
-		return;
-	}
-
-
-	/* Enumerate this object first */
-
-	acpi_gbl_num_objects++;
-
-	type = obj_desc->common.type;
-	if (type > INTERNAL_TYPE_NODE_MAX)
-	{
-		acpi_gbl_obj_type_count_misc++;
-	}
-	else
-	{
-		acpi_gbl_obj_type_count [type]++;
-	}
-
-	/* Count the sub-objects */
-
-	switch (type)
-	{
-	case ACPI_TYPE_PACKAGE:
-		for (i = 0; i< obj_desc->package.count; i++)
-		{
-			acpi_db_enumerate_object (obj_desc->package.elements[i]);
-		}
-		break;
-
-	case ACPI_TYPE_DEVICE:
-		acpi_db_enumerate_object (obj_desc->device.sys_handler);
-		acpi_db_enumerate_object (obj_desc->device.drv_handler);
-		acpi_db_enumerate_object (obj_desc->device.addr_handler);
-		break;
-
-	case ACPI_TYPE_REGION:
-		acpi_db_enumerate_object (obj_desc->region.addr_handler);
-		break;
-
-	case ACPI_TYPE_POWER:
-		acpi_db_enumerate_object (obj_desc->power_resource.sys_handler);
-		acpi_db_enumerate_object (obj_desc->power_resource.drv_handler);
-		break;
-
-	case ACPI_TYPE_PROCESSOR:
-		acpi_db_enumerate_object (obj_desc->processor.sys_handler);
-		acpi_db_enumerate_object (obj_desc->processor.drv_handler);
-		acpi_db_enumerate_object (obj_desc->processor.addr_handler);
-		break;
-
-	case ACPI_TYPE_THERMAL:
-		acpi_db_enumerate_object (obj_desc->thermal_zone.sys_handler);
-		acpi_db_enumerate_object (obj_desc->thermal_zone.drv_handler);
-		acpi_db_enumerate_object (obj_desc->thermal_zone.addr_handler);
-		break;
-	}
-}
-
-
-#ifndef PARSER_ONLY
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_classify_one_object
- *
- * PARAMETERS:  Callback for Walk_namespace
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Enumerate both the object descriptor (including subobjects) and
- *              the parent namespace node.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_classify_one_object (
-	acpi_handle             obj_handle,
-	u32                     nesting_level,
-	void                    *context,
-	void                    **return_value)
-{
-	acpi_namespace_node     *node;
-	acpi_operand_object     *obj_desc;
-	u32                     type;
-
-
-	acpi_gbl_num_nodes++;
-
-	node = (acpi_namespace_node *) obj_handle;
-	obj_desc = ((acpi_namespace_node *) obj_handle)->object;
-
-	acpi_db_enumerate_object (obj_desc);
-
-	type = node->type;
-	if (type > INTERNAL_TYPE_NODE_MAX)
-	{
-		acpi_gbl_node_type_count_misc++;
-	}
-
-	else
-	{
-		acpi_gbl_node_type_count [type]++;
-	}
-
-	return AE_OK;
-
-
-	/* TBD: These need to be counted during the initial parsing phase */
-	/*
-	if (Acpi_ps_is_named_op (Op->Opcode))
-	{
-		Num_nodes++;
-	}
-
-	if (Is_method)
-	{
-		Num_method_elements++;
-	}
-
-	Num_grammar_elements++;
-	Op = Acpi_ps_get_depth_next (Root, Op);
-
-	Size_of_parse_tree          = (Num_grammar_elements - Num_method_elements) * (u32) sizeof (acpi_parse_object);
-	Size_of_method_trees        = Num_method_elements * (u32) sizeof (acpi_parse_object);
-	Size_of_node_entries        = Num_nodes * (u32) sizeof (acpi_namespace_node);
-	Size_of_acpi_objects        = Num_nodes * (u32) sizeof (acpi_operand_object);
-
-	*/
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_count_namespace_objects
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Count and classify the entire namespace, including all
- *              namespace nodes and attached objects.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_count_namespace_objects (
-	void)
-{
-	u32                     i;
-
-
-	acpi_gbl_num_nodes = 0;
-	acpi_gbl_num_objects = 0;
-
-	acpi_gbl_obj_type_count_misc = 0;
-	for (i = 0; i < (INTERNAL_TYPE_NODE_MAX -1); i++)
-	{
-		acpi_gbl_obj_type_count [i] = 0;
-		acpi_gbl_node_type_count [i] = 0;
-	}
-
-	acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-			   FALSE, acpi_db_classify_one_object, NULL, NULL);
-
-	return (AE_OK);
-}
-
-#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_display_statistics
- *
- * PARAMETERS:  Type_arg        - Subcommand
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Display various statistics
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_display_statistics (
-	NATIVE_CHAR             *type_arg)
-{
-	u32                     i;
-	u32                     type;
-	u32                     outstanding;
-	u32                     size;
-
-
-	if (!acpi_gbl_DSDT)
-	{
-		acpi_os_printf ("*** Warning: There is no DSDT loaded\n");
-	}
-
-	if (!type_arg)
-	{
-		acpi_os_printf ("The following subcommands are available:\n  ALLOCATIONS, OBJECTS, MEMORY, MISC, SIZES, TABLES\n");
-		return (AE_OK);
-	}
-
-	STRUPR (type_arg);
-	type = acpi_db_match_argument (type_arg, acpi_db_stat_types);
-	if (type == (u32) -1)
-	{
-		acpi_os_printf ("Invalid or unsupported argument\n");
-		return (AE_OK);
-	}
-
-
-	switch (type)
-	{
-#ifndef PARSER_ONLY
-	case CMD_ALLOCATIONS:
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-		acpi_ut_dump_allocation_info ();
-#endif
-		break;
-#endif
-
-	case CMD_TABLES:
-
-		acpi_os_printf ("ACPI Table Information:\n\n");
-		if (acpi_gbl_DSDT)
-		{
-			acpi_os_printf ("DSDT Length:................% 7ld (%X)\n", acpi_gbl_DSDT->length, acpi_gbl_DSDT->length);
-		}
-		break;
-
-	case CMD_OBJECTS:
-
-#ifndef PARSER_ONLY
-
-		acpi_db_count_namespace_objects ();
-
-		acpi_os_printf ("\n_objects defined in the current namespace:\n\n");
-
-		acpi_os_printf ("%16.16s % 10.10s % 10.10s\n", "ACPI_TYPE", "NODES", "OBJECTS");
-
-		for (i = 0; i < INTERNAL_TYPE_NODE_MAX; i++)
-		{
-			acpi_os_printf ("%16.16s % 10ld% 10ld\n", acpi_ut_get_type_name (i),
-				acpi_gbl_node_type_count [i], acpi_gbl_obj_type_count [i]);
-		}
-		acpi_os_printf ("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
-			acpi_gbl_node_type_count_misc, acpi_gbl_obj_type_count_misc);
-
-		acpi_os_printf ("%16.16s % 10ld% 10ld\n", "TOTALS:",
-			acpi_gbl_num_nodes, acpi_gbl_num_objects);
-
-#endif
-		break;
-
-	case CMD_MEMORY:
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-		acpi_os_printf ("\n----Object and Cache Statistics---------------------------------------------\n");
-
-		for (i = 0; i < ACPI_NUM_MEM_LISTS; i++)
-		{
-			acpi_os_printf ("\n%s\n", acpi_gbl_memory_lists[i].list_name);
-
-			if (acpi_gbl_memory_lists[i].max_cache_depth > 0)
-			{
-				acpi_os_printf ("  Cache: [Depth Max Avail Size]         % 7d % 7d % 7d % 7d B\n",
-						acpi_gbl_memory_lists[i].cache_depth,
-						acpi_gbl_memory_lists[i].max_cache_depth,
-						acpi_gbl_memory_lists[i].max_cache_depth - acpi_gbl_memory_lists[i].cache_depth,
-						(acpi_gbl_memory_lists[i].cache_depth * acpi_gbl_memory_lists[i].object_size));
-
-				acpi_os_printf ("  Cache: [Requests Hits Misses Obj_size] % 7d % 7d % 7d % 7d B\n",
-						acpi_gbl_memory_lists[i].cache_requests,
-						acpi_gbl_memory_lists[i].cache_hits,
-						acpi_gbl_memory_lists[i].cache_requests - acpi_gbl_memory_lists[i].cache_hits,
-						acpi_gbl_memory_lists[i].object_size);
-			}
-
-			outstanding = acpi_gbl_memory_lists[i].total_allocated -
-					  acpi_gbl_memory_lists[i].total_freed -
-					  acpi_gbl_memory_lists[i].cache_depth;
-
-			if (acpi_gbl_memory_lists[i].object_size)
-			{
-				size = ROUND_UP_TO_1K (outstanding * acpi_gbl_memory_lists[i].object_size);
-			}
-			else
-			{
-				size = ROUND_UP_TO_1K (acpi_gbl_memory_lists[i].current_total_size);
-			}
-
-			acpi_os_printf ("  Mem:   [Alloc Free Outstanding Size]  % 7d % 7d % 7d % 7d Kb\n",
-					acpi_gbl_memory_lists[i].total_allocated,
-					acpi_gbl_memory_lists[i].total_freed,
-					outstanding, size);
-		}
-#endif
-
-		break;
-
-	case CMD_MISC:
-
-		acpi_os_printf ("\n_miscellaneous Statistics:\n\n");
-		acpi_os_printf ("Calls to Acpi_ps_find:.. ........% 7ld\n", acpi_gbl_ps_find_count);
-		acpi_os_printf ("Calls to Acpi_ns_lookup:..........% 7ld\n", acpi_gbl_ns_lookup_count);
-
-		acpi_os_printf ("\n");
-
-		acpi_os_printf ("Mutex usage:\n\n");
-		for (i = 0; i < NUM_MTX; i++)
-		{
-			acpi_os_printf ("%-28s:     % 7ld\n", acpi_ut_get_mutex_name (i), acpi_gbl_acpi_mutex_info[i].use_count);
-		}
-		break;
-
-
-	case CMD_SIZES:
-
-		acpi_os_printf ("\n_internal object sizes:\n\n");
-
-		acpi_os_printf ("Common         %3d\n", sizeof (ACPI_OBJECT_COMMON));
-		acpi_os_printf ("Number         %3d\n", sizeof (ACPI_OBJECT_INTEGER));
-		acpi_os_printf ("String         %3d\n", sizeof (ACPI_OBJECT_STRING));
-		acpi_os_printf ("Buffer         %3d\n", sizeof (ACPI_OBJECT_BUFFER));
-		acpi_os_printf ("Package        %3d\n", sizeof (ACPI_OBJECT_PACKAGE));
-		acpi_os_printf ("Buffer_field   %3d\n", sizeof (ACPI_OBJECT_BUFFER_FIELD));
-		acpi_os_printf ("Device         %3d\n", sizeof (ACPI_OBJECT_DEVICE));
-		acpi_os_printf ("Event          %3d\n", sizeof (ACPI_OBJECT_EVENT));
-		acpi_os_printf ("Method         %3d\n", sizeof (ACPI_OBJECT_METHOD));
-		acpi_os_printf ("Mutex          %3d\n", sizeof (ACPI_OBJECT_MUTEX));
-		acpi_os_printf ("Region         %3d\n", sizeof (ACPI_OBJECT_REGION));
-		acpi_os_printf ("Power_resource %3d\n", sizeof (ACPI_OBJECT_POWER_RESOURCE));
-		acpi_os_printf ("Processor      %3d\n", sizeof (ACPI_OBJECT_PROCESSOR));
-		acpi_os_printf ("Thermal_zone   %3d\n", sizeof (ACPI_OBJECT_THERMAL_ZONE));
-		acpi_os_printf ("Region_field   %3d\n", sizeof (ACPI_OBJECT_REGION_FIELD));
-		acpi_os_printf ("Bank_field     %3d\n", sizeof (ACPI_OBJECT_BANK_FIELD));
-		acpi_os_printf ("Index_field    %3d\n", sizeof (ACPI_OBJECT_INDEX_FIELD));
-		acpi_os_printf ("Reference      %3d\n", sizeof (ACPI_OBJECT_REFERENCE));
-		acpi_os_printf ("Notify_handler %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
-		acpi_os_printf ("Addr_handler   %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER));
-		acpi_os_printf ("Extra          %3d\n", sizeof (ACPI_OBJECT_EXTRA));
-
-		acpi_os_printf ("\n");
-
-		acpi_os_printf ("Parse_object   %3d\n", sizeof (acpi_parse_object));
-		acpi_os_printf ("Parse2_object  %3d\n", sizeof (acpi_parse2_object));
-		acpi_os_printf ("Operand_object %3d\n", sizeof (acpi_operand_object));
-		acpi_os_printf ("Namespace_node %3d\n", sizeof (acpi_namespace_node));
-
-		break;
-
-
-	case CMD_STACK:
-
-		size = acpi_gbl_entry_stack_pointer - acpi_gbl_lowest_stack_pointer;
-
-		acpi_os_printf ("\n_subsystem Stack Usage:\n\n");
-		acpi_os_printf ("Entry Stack Pointer        %X\n", acpi_gbl_entry_stack_pointer);
-		acpi_os_printf ("Lowest Stack Pointer       %X\n", acpi_gbl_lowest_stack_pointer);
-		acpi_os_printf ("Stack Use                  %X (%d)\n", size, size);
-		acpi_os_printf ("Deepest Procedure Nesting  %d\n", acpi_gbl_deepest_nesting);
-		break;
-	}
-
-	acpi_os_printf ("\n");
-	return (AE_OK);
-}
-
-
-#endif /* ENABLE_DEBUGGER  */
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbutils.c b/drivers/acpi/debugger/dbutils.c
--- a/drivers/acpi/debugger/dbutils.c	2003-01-25 01:24:57.000000000 -0800
+++ b/drivers/acpi/debugger/dbutils.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,384 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbutils - AML debugger utilities
- *              $Revision: 45 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "amlcode.h"
-#include "acnamesp.h"
-#include "acparser.h"
-#include "acevents.h"
-#include "acinterp.h"
-#include "acdebug.h"
-#include "acdispat.h"
-
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbutils")
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_set_output_destination
- *
- * PARAMETERS:  Output_flags        - Current flags word
- *
- * RETURN:      None
- *
- * DESCRIPTION: Set the current destination for debugger output.  Alos sets
- *              the debug output level accordingly.
- *
- ******************************************************************************/
-
-void
-acpi_db_set_output_destination (
-	u32                     output_flags)
-{
-
-	acpi_gbl_db_output_flags = (u8) output_flags;
-
-	if (output_flags & DB_REDIRECTABLE_OUTPUT) {
-		if (acpi_gbl_db_output_to_file) {
-			acpi_dbg_level = acpi_gbl_db_debug_level;
-		}
-	}
-	else {
-		acpi_dbg_level = acpi_gbl_db_console_debug_level;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_dump_buffer
- *
- * PARAMETERS:  Address             - Pointer to the buffer
- *
- * RETURN:      None
- *
- * DESCRIPTION: Print a portion of a buffer
- *
- ******************************************************************************/
-
-void
-acpi_db_dump_buffer (
-	u32                     address)
-{
-
-	acpi_os_printf ("\n_location %X:\n", address);
-
-	acpi_dbg_level |= ACPI_LV_TABLES;
-	acpi_ut_dump_buffer ((u8 *) address, 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_dump_object
- *
- * PARAMETERS:  Obj_desc        - External ACPI object to dump
- *              Level           - Nesting level.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Dump the contents of an ACPI external object
- *
- ******************************************************************************/
-
-void
-acpi_db_dump_object (
-	acpi_object             *obj_desc,
-	u32                     level)
-{
-	u32                     i;
-
-
-	if (!obj_desc) {
-		acpi_os_printf ("[Null Object]\n");
-		return;
-	}
-
-	for (i = 0; i < level; i++) {
-		acpi_os_printf (" ");
-	}
-
-	switch (obj_desc->type) {
-	case ACPI_TYPE_ANY:
-
-		acpi_os_printf ("[Object Reference] = %p\n", obj_desc->reference.handle);
-		break;
-
-
-	case ACPI_TYPE_INTEGER:
-
-		acpi_os_printf ("[Integer] = %8.8X%8.8X\n", HIDWORD (obj_desc->integer.value),
-				 LODWORD (obj_desc->integer.value));
-		break;
-
-
-	case ACPI_TYPE_STRING:
-
-		acpi_os_printf ("[String] Value: ");
-		for (i = 0; i < obj_desc->string.length; i++) {
-			acpi_os_printf ("%c", obj_desc->string.pointer[i]);
-		}
-		acpi_os_printf ("\n");
-		break;
-
-
-	case ACPI_TYPE_BUFFER:
-
-		acpi_os_printf ("[Buffer] = ");
-		acpi_ut_dump_buffer ((u8 *) obj_desc->buffer.pointer, obj_desc->buffer.length, DB_DWORD_DISPLAY, _COMPONENT);
-		break;
-
-
-	case ACPI_TYPE_PACKAGE:
-
-		acpi_os_printf ("[Package] Contains %d Elements: \n", obj_desc->package.count);
-
-		for (i = 0; i < obj_desc->package.count; i++) {
-			acpi_db_dump_object (&obj_desc->package.elements[i], level+1);
-		}
-		break;
-
-
-	case INTERNAL_TYPE_REFERENCE:
-
-		acpi_os_printf ("[Object Reference] = %p\n", obj_desc->reference.handle);
-		break;
-
-
-	case ACPI_TYPE_PROCESSOR:
-
-		acpi_os_printf ("[Processor]\n");
-		break;
-
-
-	case ACPI_TYPE_POWER:
-
-		acpi_os_printf ("[Power Resource]\n");
-		break;
-
-
-	default:
-
-		acpi_os_printf ("[Unknown Type] %X \n", obj_desc->type);
-		break;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_prep_namestring
- *
- * PARAMETERS:  Name            - String to prepare
- *
- * RETURN:      None
- *
- * DESCRIPTION: Translate all forward slashes and dots to backslashes.
- *
- ******************************************************************************/
-
-void
-acpi_db_prep_namestring (
-	NATIVE_CHAR             *name)
-{
-
-
-	if (!name) {
-		return;
-	}
-
-	STRUPR (name);
-
-	/* Convert a leading forward slash to a backslash */
-
-	if (*name == '/') {
-		*name = '\\';
-	}
-
-	/* Ignore a leading backslash, this is the root prefix */
-
-	if (*name == '\\') {
-		name++;
-	}
-
-	/* Convert all slash path separators to dots */
-
-	while (*name) {
-		if ((*name == '/') ||
-			(*name == '\\')) {
-			*name = '.';
-		}
-
-		name++;
-	}
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_second_pass_parse
- *
- * PARAMETERS:  Root            - Root of the parse tree
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Second pass parse of the ACPI tables.  We need to wait until
- *              second pass to parse the control methods
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_second_pass_parse (
-	acpi_parse_object       *root)
-{
-	acpi_parse_object       *op = root;
-	acpi_parse2_object      *method;
-	acpi_parse_object       *search_op;
-	acpi_parse_object       *start_op;
-	acpi_status             status = AE_OK;
-	u32                     base_aml_offset;
-	acpi_walk_state         *walk_state;
-
-
-	FUNCTION_ENTRY ();
-
-
-	acpi_os_printf ("Pass two parse ....\n");
-
-
-	while (op) {
-		if (op->opcode == AML_METHOD_OP) {
-			method = (acpi_parse2_object *) op;
-
-			walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
-					   NULL, NULL, NULL);
-			if (!walk_state) {
-				return (AE_NO_MEMORY);
-			}
-
-
-			walk_state->parser_state.aml        =
-			walk_state->parser_state.aml_start  = method->data;
-			walk_state->parser_state.aml_end    =
-			walk_state->parser_state.pkg_end    = method->data + method->length;
-			walk_state->parser_state.start_scope = op;
-
-			walk_state->descending_callback     = acpi_ds_load1_begin_op;
-			walk_state->ascending_callback      = acpi_ds_load1_end_op;
-
-
-			status = acpi_ps_parse_aml (walk_state);
-
-
-			base_aml_offset = (method->value.arg)->aml_offset + 1;
-			start_op = (method->value.arg)->next;
-			search_op = start_op;
-
-			while (search_op) {
-				search_op->aml_offset += base_aml_offset;
-				search_op = acpi_ps_get_depth_next (start_op, search_op);
-			}
-
-		}
-
-		if (op->opcode == AML_REGION_OP) {
-			/* TBD: [Investigate] this isn't quite the right thing to do! */
-			/*
-			 *
-			 * Method = (ACPI_DEFERRED_OP *) Op;
-			 * Status = Acpi_ps_parse_aml (Op, Method->Body, Method->Body_length);
-			 */
-		}
-
-		if (ACPI_FAILURE (status)) {
-			break;
-		}
-
-		op = acpi_ps_get_depth_next (root, op);
-	}
-
-	return (status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_local_ns_lookup
- *
- * PARAMETERS:  Name            - Name to lookup
- *
- * RETURN:      Pointer to a namespace node
- *
- * DESCRIPTION: Lookup a name in the ACPI namespace
- *
- ******************************************************************************/
-
-acpi_namespace_node *
-acpi_db_local_ns_lookup (
-	NATIVE_CHAR             *name)
-{
-	NATIVE_CHAR             *internal_path;
-	acpi_status             status;
-	acpi_namespace_node     *node = NULL;
-
-
-	acpi_db_prep_namestring (name);
-
-	/* Build an internal namestring */
-
-	status = acpi_ns_internalize_name (name, &internal_path);
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Invalid namestring: %s\n", name);
-		return (NULL);
-	}
-
-	/* Lookup the name */
-
-	/* TBD: [Investigate] what scope do we use? */
-	/* Use the root scope for the start of the search */
-
-	status = acpi_ns_lookup (NULL, internal_path, ACPI_TYPE_ANY, IMODE_EXECUTE,
-			   NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, NULL, &node);
-
-	if (ACPI_FAILURE (status)) {
-		acpi_os_printf ("Could not locate name: %s %s\n", name, acpi_format_exception (status));
-	}
-
-
-	ACPI_MEM_FREE (internal_path);
-
-	return (node);
-}
-
-
-#endif /* ENABLE_DEBUGGER */
-
-
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/dbxface.c b/drivers/acpi/debugger/dbxface.c
--- a/drivers/acpi/debugger/dbxface.c	2003-01-25 01:26:25.000000000 -0800
+++ b/drivers/acpi/debugger/dbxface.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,321 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbxface - AML Debugger external interfaces
- *              $Revision: 45 $
- *
- ******************************************************************************/
-
-/*
- *  Copyright (C) 2000, 2001 R. Byron Moore
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "amlcode.h"
-#include "acnamesp.h"
-#include "acparser.h"
-#include "acevents.h"
-#include "acinterp.h"
-#include "acdebug.h"
-
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT          ACPI_DEBUGGER
-	 MODULE_NAME         ("dbxface")
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_single_step
- *
- * PARAMETERS:  Walk_state      - Current walk
- *              Op              - Current executing op
- *              Opcode_class    - Class of the current AML Opcode
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Called just before execution of an AML opcode.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_db_single_step (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op,
-	u32                     opcode_class)
-{
-	acpi_parse_object       *next;
-	acpi_status             status = AE_OK;
-	u32                     original_debug_level;
-	acpi_parse_object       *display_op;
-
-
-	FUNCTION_ENTRY ();
-
-	/* Is there a breakpoint set? */
-
-	if (walk_state->method_breakpoint) {
-		/* Check if the breakpoint has been reached or passed */
-
-		if (walk_state->method_breakpoint <= op->aml_offset) {
-			/* Hit the breakpoint, resume single step, reset breakpoint */
-
-			acpi_os_printf ("***Break*** at AML offset %X\n", op->aml_offset);
-			acpi_gbl_cm_single_step = TRUE;
-			acpi_gbl_step_to_next_call = FALSE;
-			walk_state->method_breakpoint = 0;
-		}
-	}
-
-	/*
-	 * Check if this is an opcode that we are interested in --
-	 * namely, opcodes that have arguments
-	 */
-	if (op->opcode == AML_INT_NAMEDFIELD_OP) {
-		return (AE_OK);
-	}
-
-	switch (opcode_class) {
-	case AML_CLASS_UNKNOWN:
-	case AML_CLASS_ARGUMENT:    /* constants, literals, etc.  do nothing */
-		return (AE_OK);
-		break;
-	}
-
-	/*
-	 * Under certain debug conditions, display this opcode and its operands
-	 */
-	if ((acpi_gbl_db_output_to_file)        ||
-		(acpi_gbl_cm_single_step)           ||
-		(acpi_dbg_level & ACPI_LV_PARSE)) {
-		if ((acpi_gbl_db_output_to_file)    ||
-			(acpi_dbg_level & ACPI_LV_PARSE)) {
-			acpi_os_printf ("\n[Aml_debug] Next AML Opcode to execute:\n");
-		}
-
-		/*
-		 * Display this op (and only this op - zero out the NEXT field temporarily,
-		 * and disable parser trace output for the duration of the display because
-		 * we don't want the extraneous debug output)
-		 */
-		original_debug_level = acpi_dbg_level;
-		acpi_dbg_level &= ~(ACPI_LV_PARSE | ACPI_LV_FUNCTIONS);
-		next = op->next;
-		op->next = NULL;
-
-
-		display_op = op;
-		if (op->parent) {
-			if ((op->parent->opcode == AML_IF_OP) ||
-				(op->parent->opcode == AML_WHILE_OP)) {
-				display_op = op->parent;
-			}
-		}
-
-		/* Now we can display it */
-
-		acpi_db_display_op (walk_state, display_op, ACPI_UINT32_MAX);
-
-		if ((op->opcode == AML_IF_OP) ||
-			(op->opcode == AML_WHILE_OP)) {
-			if (walk_state->control_state->common.value) {
-				acpi_os_printf ("Predicate was TRUE, executed block\n");
-			}
-			else {
-				acpi_os_printf ("Predicate is FALSE, skipping block\n");
-			}
-		}
-
-		else if (op->opcode == AML_ELSE_OP) {
-			/* TBD */
-		}
-
-		/* Restore everything */
-
-		op->next = next;
-		acpi_os_printf ("\n");
-		acpi_dbg_level = original_debug_level;
-	}
-
-	/* If we are not single stepping, just continue executing the method */
-
-	if (!acpi_gbl_cm_single_step) {
-		return (AE_OK);
-	}
-
-
-	/*
-	 * If we are executing a step-to-call command,
-	 * Check if this is a method call.
-	 */
-	if (acpi_gbl_step_to_next_call) {
-		if (op->opcode != AML_INT_METHODCALL_OP) {
-			/* Not a method call, just keep executing */
-
-			return (AE_OK);
-		}
-
-		/* Found a method call, stop executing */
-
-		acpi_gbl_step_to_next_call = FALSE;
-	}
-
-
-	/*
-	 * If the next opcode is a method call, we will "step over" it
-	 * by default.
-	 */
-	if (op->opcode == AML_INT_METHODCALL_OP) {
-		acpi_gbl_cm_single_step = FALSE; /* No more single step while executing called method */
-
-		/* Set the breakpoint on the call, it will stop execution as soon as we return */
-
-		/* TBD: [Future] don't kill the user breakpoint! */
-
-		walk_state->method_breakpoint = /* Op->Aml_offset + */ 1; /* Must be non-zero! */
-	}
-
-
-	/* TBD: [Investigate] what are the namespace locking issues here */
-
-	/* Acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); */
-
-	/* Go into the command loop and await next user command */
-
-	acpi_gbl_method_executing = TRUE;
-	status = AE_CTRL_TRUE;
-	while (status == AE_CTRL_TRUE) {
-		if (acpi_gbl_debugger_configuration == DEBUGGER_MULTI_THREADED) {
-			/* Handshake with the front-end that gets user command lines */
-
-			acpi_ut_release_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
-			acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY);
-		}
-
-		else {
-			/* Single threaded, we must get a command line ourselves */
-
-			/* Force output to console until a command is entered */
-
-			acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
-
-			/* Different prompt if method is executing */
-
-			if (!acpi_gbl_method_executing) {
-				acpi_os_printf ("%1c ", DB_COMMAND_PROMPT);
-			}
-			else {
-				acpi_os_printf ("%1c ", DB_EXECUTE_PROMPT);
-			}
-
-			/* Get the user input line */
-
-			acpi_os_get_line (acpi_gbl_db_line_buf);
-		}
-
-		status = acpi_db_command_dispatch (acpi_gbl_db_line_buf, walk_state, op);
-	}
-
-	/* Acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); */
-
-	/* User commands complete, continue execution of the interrupted method */
-
-	return (status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_initialize
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Init and start debugger
- *
- ******************************************************************************/
-
-int
-acpi_db_initialize (void)
-{
-
-
-	/* Init globals */
-
-	acpi_gbl_db_buffer = acpi_os_callocate (ACPI_DEBUG_BUFFER_SIZE);
-
-	/* Initial scope is the root */
-
-	acpi_gbl_db_scope_buf [0] = '\\';
-	acpi_gbl_db_scope_buf [1] = 0;
-
-
-	/*
-	 * If configured for multi-thread support, the debug executor runs in
-	 * a separate thread so that the front end can be in another address
-	 * space, environment, or even another machine.
-	 */
-	if (acpi_gbl_debugger_configuration & DEBUGGER_MULTI_THREADED) {
-		/* These were created with one unit, grab it */
-
-		acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
-		acpi_ut_acquire_mutex (ACPI_MTX_DEBUG_CMD_READY);
-
-		/* Create the debug execution thread to execute commands */
-
-		acpi_os_queue_for_execution (0, acpi_db_execute_thread, NULL);
-	}
-
-	if (!acpi_gbl_db_opt_verbose) {
-		acpi_gbl_db_disasm_indent = " ";
-		acpi_gbl_db_opt_disasm = TRUE;
-		acpi_gbl_db_opt_stats = FALSE;
-	}
-
-	return (0);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_db_terminate
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Stop debugger
- *
- ******************************************************************************/
-
-void
-acpi_db_terminate (void)
-{
-
-	if (acpi_gbl_db_table_ptr) {
-		acpi_os_free (acpi_gbl_db_table_ptr);
-	}
-	if (acpi_gbl_db_buffer) {
-		acpi_os_free (acpi_gbl_db_buffer);
-	}
-}
-
-
-#endif /* ENABLE_DEBUGGER */
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/debugger/Makefile b/drivers/acpi/debugger/Makefile
--- a/drivers/acpi/debugger/Makefile	2003-01-25 01:25:14.000000000 -0800
+++ b/drivers/acpi/debugger/Makefile	1969-12-31 16:00:00.000000000 -0800
@@ -1,12 +0,0 @@
-#
-# Makefile for all Linux ACPI interpreter subdirectories
-# EXCEPT for the ospm directory
-#
-
-O_TARGET := $(notdir $(CURDIR)).o
-
-obj-$(CONFIG_ACPI) := $(patsubst %.c,%.o,$(wildcard *.c))
-
-EXTRA_CFLAGS += $(ACPI_CFLAGS)
-
-include $(TOPDIR)/Rules.make
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
--- a/drivers/acpi/dispatcher/dsfield.c	2003-01-25 01:24:46.000000000 -0800
+++ b/drivers/acpi/dispatcher/dsfield.c	2003-01-25 01:30:09.000000000 -0800
@@ -1,12 +1,11 @@
 /******************************************************************************
  *
  * Module Name: dsfield - Dispatcher field routines
- *              $Revision: 46 $
  *
  *****************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -33,46 +32,48 @@
 
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dsfield")
+	 ACPI_MODULE_NAME    ("dsfield")
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_create_buffer_field
+ * FUNCTION:    acpi_ds_create_buffer_field
  *
  * PARAMETERS:  Opcode              - The opcode to be executed
  *              Operands            - List of operands for the opcode
- *              Walk_state          - Current state
+ *              walk_state          - Current state
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Execute the Create_field operators:
- *              Create_bit_field_op,
- *              Create_byte_field_op,
- *              Create_word_field_op,
- *              Create_dWord_field_op,
- *              Create_qWord_field_op,
- *              Create_field_op     (all of which define fields in buffers)
+ * DESCRIPTION: Execute the create_field operators:
+ *              create_bit_field_op,
+ *              create_byte_field_op,
+ *              create_word_field_op,
+ *              create_dword_field_op,
+ *              create_qword_field_op,
+ *              create_field_op     (all of which define fields in buffers)
  *
  ******************************************************************************/
 
 acpi_status
 acpi_ds_create_buffer_field (
-	acpi_parse_object       *op,
-	acpi_walk_state         *walk_state)
+	union acpi_parse_object         *op,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_parse_object       *arg;
-	acpi_namespace_node     *node;
-	acpi_status             status;
-	acpi_operand_object     *obj_desc;
+	union acpi_parse_object         *arg;
+	struct acpi_namespace_node      *node;
+	acpi_status                     status;
+	union acpi_operand_object       *obj_desc;
+	union acpi_operand_object       *second_desc = NULL;
+	u32                             flags;
 
 
-	FUNCTION_TRACE ("Ds_create_buffer_field");
+	ACPI_FUNCTION_TRACE ("ds_create_buffer_field");
 
 
-	/* Get the Name_string argument */
+	/* Get the name_string argument */
 
-	if (op->opcode == AML_CREATE_FIELD_OP) {
+	if (op->common.aml_opcode == AML_CREATE_FIELD_OP) {
 		arg = acpi_ps_get_arg (op, 3);
 	}
 	else {
@@ -86,13 +87,25 @@
 	}
 
 	/*
-	 * Enter the Name_string into the namespace
+	 * During the load phase, we want to enter the name of the field into
+	 * the namespace.  During the execute phase (when we evaluate the size
+	 * operand), we want to lookup the name
 	 */
-	status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
-			 INTERNAL_TYPE_DEF_ANY, IMODE_LOAD_PASS1,
-			 NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
-			 walk_state, &(node));
+	if (walk_state->parse_flags & ACPI_PARSE_EXECUTE) {
+		flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE;
+	}
+	else {
+		flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND;
+	}
+
+	/*
+	 * Enter the name_string into the namespace
+	 */
+	status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
+			 ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
+			 flags, walk_state, &(node));
 	if (ACPI_FAILURE (status)) {
+		ACPI_REPORT_NSERROR (arg->common.value.string, status);
 		return_ACPI_STATUS (status);
 	}
 
@@ -100,14 +113,15 @@
 	 * for now, we will put it in the "op" object that the parser uses, so we
 	 * can get it again at the end of this scope
 	 */
-	op->node = node;
+	op->common.node = node;
 
 	/*
 	 * If there is no object attached to the node, this node was just created and
 	 * we need to create the field object.  Otherwise, this was a lookup of an
 	 * existing node and we don't want to create the field object again.
 	 */
-	if (node->object) {
+	obj_desc = acpi_ns_get_attached_object (node);
+	if (obj_desc) {
 		return_ACPI_STATUS (AE_OK);
 	}
 
@@ -125,27 +139,21 @@
 	}
 
 	/*
-	 * Allocate a method object for this field unit
-	 */
-	obj_desc->buffer_field.extra = acpi_ut_create_internal_object (
-			   INTERNAL_TYPE_EXTRA);
-	if (!obj_desc->buffer_field.extra) {
-		status = AE_NO_MEMORY;
-		goto cleanup;
-	}
-
-	/*
 	 * Remember location in AML stream of the field unit
 	 * opcode and operands -- since the buffer and index
 	 * operands must be evaluated.
 	 */
-	obj_desc->buffer_field.extra->extra.aml_start = ((acpi_parse2_object *) op)->data;
-	obj_desc->buffer_field.extra->extra.aml_length = ((acpi_parse2_object *) op)->length;
+	second_desc                 = obj_desc->common.next_object;
+	second_desc->extra.aml_start = op->named.data;
+	second_desc->extra.aml_length = op->named.length;
 	obj_desc->buffer_field.node = node;
 
-	/* Attach constructed field descriptor to parent node */
+	/* Attach constructed field descriptors to parent node */
 
 	status = acpi_ns_attach_object (node, obj_desc, ACPI_TYPE_BUFFER_FIELD);
+	if (ACPI_FAILURE (status)) {
+		goto cleanup;
+	}
 
 
 cleanup:
@@ -159,10 +167,10 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_get_field_names
+ * FUNCTION:    acpi_ds_get_field_names
  *
- * PARAMETERS:  Info            - Create_field info structure
- *  `           Walk_state      - Current method state
+ * PARAMETERS:  Info            - create_field info structure
+ *  `           walk_state      - Current method state
  *              Arg             - First parser arg for the field name list
  *
  * RETURN:      Status
@@ -174,14 +182,15 @@
 
 acpi_status
 acpi_ds_get_field_names (
-	ACPI_CREATE_FIELD_INFO  *info,
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *arg)
+	struct acpi_create_field_info   *info,
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *arg)
 {
-	acpi_status             status;
+	acpi_status                     status;
+	acpi_integer                    position;
 
 
-	PROC_NAME("acpi_ds_get_field_names"); 
+	ACPI_FUNCTION_TRACE_PTR ("ds_get_field_names", info);
 
 
 	/* First field starts at bit zero */
@@ -194,51 +203,78 @@
 		/*
 		 * Three types of field elements are handled:
 		 * 1) Offset - specifies a bit offset
-		 * 2) Access_as - changes the access mode
+		 * 2) access_as - changes the access mode
 		 * 3) Name - Enters a new named field into the namespace
 		 */
-		switch (arg->opcode) {
+		switch (arg->common.aml_opcode) {
 		case AML_INT_RESERVEDFIELD_OP:
 
-			info->field_bit_position += arg->value.size;
+			position = (acpi_integer) info->field_bit_position
+					 + (acpi_integer) arg->common.value.size;
+
+			if (position > ACPI_UINT32_MAX) {
+				ACPI_REPORT_ERROR (("Bit offset within field too large (> 0xFFFFFFFF)\n"));
+				return_ACPI_STATUS (AE_SUPPORT);
+			}
+
+			info->field_bit_position = (u32) position;
 			break;
 
 
 		case AML_INT_ACCESSFIELD_OP:
 
 			/*
-			 * Get a new Access_type and Access_attribute for all
-			 * entries (until end or another Access_as keyword)
+			 * Get a new access_type and access_attribute -- to be used for all
+			 * field units that follow, until field end or another access_as keyword.
+			 *
+			 * In field_flags, preserve the flag bits other than the ACCESS_TYPE bits
 			 */
-			info->field_flags = (u8) ((info->field_flags & FIELD_ACCESS_TYPE_MASK) ||
-					  ((u8) (arg->value.integer >> 8)));
+			info->field_flags = (u8) ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
+					  ((u8) (arg->common.value.integer32 >> 8)));
+
+			info->attribute = (u8) (arg->common.value.integer32);
 			break;
 
 
 		case AML_INT_NAMEDFIELD_OP:
 
-			/* Enter a new field name into the namespace */
+			/* Lookup the name */
 
 			status = acpi_ns_lookup (walk_state->scope_info,
-					  (NATIVE_CHAR *) &((acpi_parse2_object *)arg)->name,
-					  info->field_type, IMODE_LOAD_PASS1,
-					  NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE,
-					  NULL, &info->field_node);
+					  (char *) &arg->named.name,
+					  info->field_type, ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
+					  walk_state, &info->field_node);
 			if (ACPI_FAILURE (status)) {
-				return_ACPI_STATUS (status);
+				ACPI_REPORT_NSERROR ((char *) &arg->named.name, status);
+				if (status != AE_ALREADY_EXISTS) {
+					return_ACPI_STATUS (status);
+				}
+
+				/* Already exists, ignore error */
+			}
+			else {
+				arg->common.node = info->field_node;
+				info->field_bit_length = arg->common.value.size;
+
+				/* Create and initialize an object for the new Field Node */
+
+				status = acpi_ex_prep_field_value (info);
+				if (ACPI_FAILURE (status)) {
+					return_ACPI_STATUS (status);
+				}
 			}
 
-			/* Create and initialize an object for the new Field Node */
+			/* Keep track of bit position for the next field */
 
-			info->field_bit_length = arg->value.size;
+			position = (acpi_integer) info->field_bit_position
+					 + (acpi_integer) arg->common.value.size;
 
-			status = acpi_ex_prep_field_value (info);
-			if (ACPI_FAILURE (status)) {
-				return_ACPI_STATUS (status);
+			if (position > ACPI_UINT32_MAX) {
+				ACPI_REPORT_ERROR (("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n",
+						(char *) &info->field_node->name));
+				return_ACPI_STATUS (AE_SUPPORT);
 			}
 
-			/* Keep track of bit position for the next field */
-
 			info->field_bit_position += info->field_bit_length;
 			break;
 
@@ -246,12 +282,11 @@
 		default:
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n",
-				arg->opcode));
-			return_ACPI_STATUS (AE_AML_ERROR);
-			break;
+				arg->common.aml_opcode));
+			return_ACPI_STATUS (AE_AML_BAD_OPCODE);
 		}
 
-		arg = arg->next;
+		arg = arg->common.next;
 	}
 
 	return_ACPI_STATUS (AE_OK);
@@ -260,11 +295,11 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_create_field
+ * FUNCTION:    acpi_ds_create_field
  *
  * PARAMETERS:  Op              - Op containing the Field definition and args
- *              Region_node     - Object for the containing Operation Region
- *  `           Walk_state      - Current method state
+ *              region_node     - Object for the containing Operation Region
+ *  `           walk_state      - Current method state
  *
  * RETURN:      Status
  *
@@ -274,41 +309,43 @@
 
 acpi_status
 acpi_ds_create_field (
-	acpi_parse_object       *op,
-	acpi_namespace_node     *region_node,
-	acpi_walk_state         *walk_state)
+	union acpi_parse_object         *op,
+	struct acpi_namespace_node      *region_node,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_status             status = AE_AML_ERROR;
-	acpi_parse_object       *arg;
-	ACPI_CREATE_FIELD_INFO  info;
+	acpi_status                     status;
+	union acpi_parse_object         *arg;
+	struct acpi_create_field_info   info;
 
 
-	FUNCTION_TRACE_PTR ("Ds_create_field", op);
+	ACPI_FUNCTION_TRACE_PTR ("ds_create_field", op);
 
 
-	/* First arg is the name of the parent Op_region (must already exist) */
+	/* First arg is the name of the parent op_region (must already exist) */
 
-	arg = op->value.arg;
+	arg = op->common.value.arg;
 	if (!region_node) {
-		status = acpi_ns_lookup (walk_state->scope_info, arg->value.name,
-				  ACPI_TYPE_REGION, IMODE_EXECUTE,
-				  NS_SEARCH_PARENT, walk_state, &region_node);
+		status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.name,
+				  ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
+				  ACPI_NS_SEARCH_PARENT, walk_state, &region_node);
 		if (ACPI_FAILURE (status)) {
+			ACPI_REPORT_NSERROR (arg->common.value.name, status);
 			return_ACPI_STATUS (status);
 		}
 	}
 
 	/* Second arg is the field flags */
 
-	arg = arg->next;
-	info.field_flags = arg->value.integer8;
+	arg = arg->common.next;
+	info.field_flags = arg->common.value.integer8;
+	info.attribute = 0;
 
 	/* Each remaining arg is a Named Field */
 
-	info.field_type = INTERNAL_TYPE_REGION_FIELD;
+	info.field_type = ACPI_TYPE_LOCAL_REGION_FIELD;
 	info.region_node = region_node;
 
-	status = acpi_ds_get_field_names (&info, walk_state, arg->next);
+	status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
 
 	return_ACPI_STATUS (status);
 }
@@ -316,11 +353,95 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_create_bank_field
+ * FUNCTION:    acpi_ds_init_field_objects
  *
  * PARAMETERS:  Op              - Op containing the Field definition and args
- *              Region_node     - Object for the containing Operation Region
- *  `           Walk_state      - Current method state
+ *  `           walk_state      - Current method state
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: For each "Field Unit" name in the argument list that is
+ *              part of the field declaration, enter the name into the
+ *              namespace.
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ds_init_field_objects (
+	union acpi_parse_object         *op,
+	struct acpi_walk_state          *walk_state)
+{
+	acpi_status                     status;
+	union acpi_parse_object         *arg = NULL;
+	struct acpi_namespace_node      *node;
+	u8                              type = 0;
+
+
+	ACPI_FUNCTION_TRACE_PTR ("ds_init_field_objects", op);
+
+
+	switch (walk_state->opcode) {
+	case AML_FIELD_OP:
+		arg = acpi_ps_get_arg (op, 2);
+		type = ACPI_TYPE_LOCAL_REGION_FIELD;
+		break;
+
+	case AML_BANK_FIELD_OP:
+		arg = acpi_ps_get_arg (op, 4);
+		type = ACPI_TYPE_LOCAL_BANK_FIELD;
+		break;
+
+	case AML_INDEX_FIELD_OP:
+		arg = acpi_ps_get_arg (op, 3);
+		type = ACPI_TYPE_LOCAL_INDEX_FIELD;
+		break;
+
+	default:
+		return_ACPI_STATUS (AE_BAD_PARAMETER);
+	}
+
+	/*
+	 * Walk the list of entries in the field_list
+	 */
+	while (arg) {
+		/* Ignore OFFSET and ACCESSAS terms here */
+
+		if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) {
+			status = acpi_ns_lookup (walk_state->scope_info,
+					  (char *) &arg->named.name,
+					  type, ACPI_IMODE_LOAD_PASS1,
+					  ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND,
+					  walk_state, &node);
+			if (ACPI_FAILURE (status)) {
+				ACPI_REPORT_NSERROR ((char *) &arg->named.name, status);
+				if (status != AE_ALREADY_EXISTS) {
+					return_ACPI_STATUS (status);
+				}
+
+				/* Name already exists, just ignore this error */
+
+				status = AE_OK;
+			}
+
+			arg->common.node = node;
+		}
+
+		/* Move to next field in the list */
+
+		arg = arg->common.next;
+	}
+
+	return_ACPI_STATUS (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ds_create_bank_field
+ *
+ * PARAMETERS:  Op              - Op containing the Field definition and args
+ *              region_node     - Object for the containing Operation Region
+ *  `           walk_state      - Current method state
  *
  * RETURN:      Status
  *
@@ -330,56 +451,58 @@
 
 acpi_status
 acpi_ds_create_bank_field (
-	acpi_parse_object       *op,
-	acpi_namespace_node     *region_node,
-	acpi_walk_state         *walk_state)
+	union acpi_parse_object         *op,
+	struct acpi_namespace_node      *region_node,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_status             status = AE_AML_ERROR;
-	acpi_parse_object       *arg;
-	ACPI_CREATE_FIELD_INFO  info;
+	acpi_status                     status;
+	union acpi_parse_object         *arg;
+	struct acpi_create_field_info   info;
 
 
-	FUNCTION_TRACE_PTR ("Ds_create_bank_field", op);
+	ACPI_FUNCTION_TRACE_PTR ("ds_create_bank_field", op);
 
 
-	/* First arg is the name of the parent Op_region (must already exist) */
+	/* First arg is the name of the parent op_region (must already exist) */
 
-	arg = op->value.arg;
+	arg = op->common.value.arg;
 	if (!region_node) {
-		status = acpi_ns_lookup (walk_state->scope_info, arg->value.name,
-				  ACPI_TYPE_REGION, IMODE_EXECUTE,
-				  NS_SEARCH_PARENT, walk_state, &region_node);
+		status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.name,
+				  ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
+				  ACPI_NS_SEARCH_PARENT, walk_state, &region_node);
 		if (ACPI_FAILURE (status)) {
+			ACPI_REPORT_NSERROR (arg->common.value.name, status);
 			return_ACPI_STATUS (status);
 		}
 	}
 
-	/* Second arg is the Bank Register (must already exist) */
+	/* Second arg is the Bank Register (Field) (must already exist) */
 
-	arg = arg->next;
-	status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
-			  INTERNAL_TYPE_BANK_FIELD_DEFN, IMODE_EXECUTE,
-			  NS_SEARCH_PARENT, walk_state, &info.register_node);
+	arg = arg->common.next;
+	status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
+			  ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+			  ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node);
 	if (ACPI_FAILURE (status)) {
+		ACPI_REPORT_NSERROR (arg->common.value.string, status);
 		return_ACPI_STATUS (status);
 	}
 
-	/* Third arg is the Bank_value */
+	/* Third arg is the bank_value */
 
-	arg = arg->next;
-	info.bank_value = arg->value.integer32;
+	arg = arg->common.next;
+	info.bank_value = arg->common.value.integer32;
 
 	/* Fourth arg is the field flags */
 
-	arg = arg->next;
-	info.field_flags = arg->value.integer8;
+	arg = arg->common.next;
+	info.field_flags = arg->common.value.integer8;
 
 	/* Each remaining arg is a Named Field */
 
-	info.field_type = INTERNAL_TYPE_BANK_FIELD;
+	info.field_type = ACPI_TYPE_LOCAL_BANK_FIELD;
 	info.region_node = region_node;
 
-	status = acpi_ds_get_field_names (&info, walk_state, arg->next);
+	status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
 
 	return_ACPI_STATUS (status);
 }
@@ -387,11 +510,11 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_create_index_field
+ * FUNCTION:    acpi_ds_create_index_field
  *
  * PARAMETERS:  Op              - Op containing the Field definition and args
- *              Region_node     - Object for the containing Operation Region
- *  `           Walk_state      - Current method state
+ *              region_node     - Object for the containing Operation Region
+ *  `           walk_state      - Current method state
  *
  * RETURN:      Status
  *
@@ -401,50 +524,51 @@
 
 acpi_status
 acpi_ds_create_index_field (
-	acpi_parse_object       *op,
-	acpi_namespace_node     *region_node,
-	acpi_walk_state         *walk_state)
+	union acpi_parse_object         *op,
+	struct acpi_namespace_node      *region_node,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_status             status;
-	acpi_parse_object       *arg;
-	ACPI_CREATE_FIELD_INFO  info;
+	acpi_status                     status;
+	union acpi_parse_object         *arg;
+	struct acpi_create_field_info   info;
 
 
-	FUNCTION_TRACE_PTR ("Ds_create_index_field", op);
+	ACPI_FUNCTION_TRACE_PTR ("ds_create_index_field", op);
 
 
 	/* First arg is the name of the Index register (must already exist) */
 
-	arg = op->value.arg;
-	status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
-			  ACPI_TYPE_ANY, IMODE_EXECUTE,
-			  NS_SEARCH_PARENT, walk_state, &info.register_node);
+	arg = op->common.value.arg;
+	status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
+			  ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+			  ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node);
 	if (ACPI_FAILURE (status)) {
+		ACPI_REPORT_NSERROR (arg->common.value.string, status);
 		return_ACPI_STATUS (status);
 	}
 
 	/* Second arg is the data register (must already exist) */
 
-	arg = arg->next;
-	status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,
-			  INTERNAL_TYPE_INDEX_FIELD_DEFN, IMODE_EXECUTE,
-			  NS_SEARCH_PARENT, walk_state, &info.data_register_node);
+	arg = arg->common.next;
+	status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
+			  ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+			  ACPI_NS_SEARCH_PARENT, walk_state, &info.data_register_node);
 	if (ACPI_FAILURE (status)) {
+		ACPI_REPORT_NSERROR (arg->common.value.string, status);
 		return_ACPI_STATUS (status);
 	}
 
 	/* Next arg is the field flags */
 
-	arg = arg->next;
-	info.field_flags = arg->value.integer8;
-
+	arg = arg->common.next;
+	info.field_flags = arg->common.value.integer8;
 
 	/* Each remaining arg is a Named Field */
 
-	info.field_type = INTERNAL_TYPE_INDEX_FIELD;
+	info.field_type = ACPI_TYPE_LOCAL_INDEX_FIELD;
 	info.region_node = region_node;
 
-	status = acpi_ds_get_field_names (&info, walk_state, arg->next);
+	status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
 
 	return_ACPI_STATUS (status);
 }
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
--- a/drivers/acpi/dispatcher/dsinit.c	1969-12-31 16:00:00.000000000 -0800
+++ b/drivers/acpi/dispatcher/dsinit.c	2003-01-25 01:30:24.000000000 -0800
@@ -0,0 +1,216 @@
+/******************************************************************************
+ *
+ * Module Name: dsinit - Object initialization namespace walk
+ *
+ *****************************************************************************/
+
+/*
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#include "acpi.h"
+#include "acdispat.h"
+#include "acnamesp.h"
+
+#define _COMPONENT          ACPI_DISPATCHER
+	 ACPI_MODULE_NAME    ("dsinit")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ds_init_one_object
+ *
+ * PARAMETERS:  obj_handle      - Node
+ *              Level           - Current nesting level
+ *              Context         - Points to a init info struct
+ *              return_value    - Not used
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Callback from acpi_walk_namespace. Invoked for every object
+ *              within the namespace.
+ *
+ *              Currently, the only objects that require initialization are:
+ *              1) Methods
+ *              2) Operation Regions
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ds_init_one_object (
+	acpi_handle                     obj_handle,
+	u32                             level,
+	void                            *context,
+	void                            **return_value)
+{
+	acpi_object_type                type;
+	acpi_status                     status;
+	struct acpi_init_walk_info      *info = (struct acpi_init_walk_info *) context;
+
+
+	ACPI_FUNCTION_NAME ("ds_init_one_object");
+
+
+	/*
+	 * We are only interested in objects owned by the table that
+	 * was just loaded
+	 */
+	if (((struct acpi_namespace_node *) obj_handle)->owner_id !=
+			info->table_desc->table_id) {
+		return (AE_OK);
+	}
+
+	info->object_count++;
+
+	/* And even then, we are only interested in a few object types */
+
+	type = acpi_ns_get_type (obj_handle);
+
+	switch (type) {
+	case ACPI_TYPE_REGION:
+
+		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,
+				acpi_format_exception (status)));
+		}
+
+		info->op_region_count++;
+		break;
+
+
+	case ACPI_TYPE_METHOD:
+
+		info->method_count++;
+
+		/* Print a dot for each method unless we are going to print the entire pathname */
+
+		if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
+			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
+		}
+
+		/*
+		 * Set the execution data width (32 or 64) based upon the
+		 * revision number of the parent ACPI table.
+		 * TBD: This is really for possible future support of integer width
+		 * on a per-table basis. Currently, we just use a global for the width.
+		 */
+		if (info->table_desc->pointer->revision == 1) {
+			((struct acpi_namespace_node *) obj_handle)->flags |= ANOBJ_DATA_WIDTH_32;
+		}
+
+		/*
+		 * Always parse methods to detect errors, we may delete
+		 * the parse tree below
+		 */
+		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,
+				acpi_format_exception (status)));
+
+			/* This parse failed, but we will continue parsing more methods */
+
+			break;
+		}
+
+		/*
+		 * Delete the parse tree.  We simple re-parse the method
+		 * for every execution since there isn't much overhead
+		 */
+		acpi_ns_delete_namespace_subtree (obj_handle);
+		acpi_ns_delete_namespace_by_owner (((struct acpi_namespace_node *) obj_handle)->object->method.owning_id);
+		break;
+
+
+	case ACPI_TYPE_DEVICE:
+
+		info->device_count++;
+		break;
+
+
+	default:
+		break;
+	}
+
+	/*
+	 * We ignore errors from above, and always return OK, since
+	 * we don't want to abort the walk on a single error.
+	 */
+	return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ds_initialize_objects
+ *
+ * PARAMETERS:  table_desc      - Descriptor for parent ACPI table
+ *              start_node      - Root of subtree to be initialized.
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Walk the namespace starting at "start_node" and perform any
+ *              necessary initialization on the objects found therein
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ds_initialize_objects (
+	struct acpi_table_desc          *table_desc,
+	struct acpi_namespace_node      *start_node)
+{
+	acpi_status                     status;
+	struct acpi_init_walk_info      info;
+
+
+	ACPI_FUNCTION_TRACE ("ds_initialize_objects");
+
+
+	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+		"**** Starting initialization of namespace objects ****\n"));
+	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
+
+	info.method_count   = 0;
+	info.op_region_count = 0;
+	info.object_count   = 0;
+	info.device_count   = 0;
+	info.table_desc     = table_desc;
+
+	/* Walk entire namespace from the supplied root */
+
+	status = acpi_walk_namespace (ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
+			  acpi_ds_init_one_object, &info, NULL);
+	if (ACPI_FAILURE (status)) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed, %s\n",
+			acpi_format_exception (status)));
+	}
+
+	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
+		"\nTable [%4.4s] - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
+		table_desc->pointer->signature, info.object_count,
+		info.device_count, info.method_count, info.op_region_count));
+
+	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+		"%hd Methods, %hd Regions\n", info.method_count, info.op_region_count));
+
+	return_ACPI_STATUS (AE_OK);
+}
+
+
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
--- a/drivers/acpi/dispatcher/dsmethod.c	2003-01-25 01:26:10.000000000 -0800
+++ b/drivers/acpi/dispatcher/dsmethod.c	2003-01-25 01:30:22.000000000 -0800
@@ -1,12 +1,11 @@
 /******************************************************************************
  *
  * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
- *              $Revision: 69 $
  *
  *****************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -30,22 +29,20 @@
 #include "acdispat.h"
 #include "acinterp.h"
 #include "acnamesp.h"
-#include "actables.h"
-#include "acdebug.h"
 
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dsmethod")
+	 ACPI_MODULE_NAME    ("dsmethod")
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_parse_method
+ * FUNCTION:    acpi_ds_parse_method
  *
- * PARAMETERS:  Obj_handle      - Node of the method
+ * PARAMETERS:  obj_handle      - Node of the method
  *              Level           - Current nesting level
  *              Context         - Points to a method counter
- *              Return_value    - Not used
+ *              return_value    - Not used
  *
  * RETURN:      Status
  *
@@ -58,17 +55,17 @@
 
 acpi_status
 acpi_ds_parse_method (
-	acpi_handle             obj_handle)
+	acpi_handle                     obj_handle)
 {
-	acpi_status             status;
-	acpi_operand_object     *obj_desc;
-	acpi_parse_object       *op;
-	acpi_namespace_node     *node;
-	acpi_owner_id           owner_id;
-	acpi_walk_state         *walk_state;
+	acpi_status                     status;
+	union acpi_operand_object       *obj_desc;
+	union acpi_parse_object         *op;
+	struct acpi_namespace_node      *node;
+	acpi_owner_id                   owner_id;
+	struct acpi_walk_state          *walk_state;
 
 
-	FUNCTION_TRACE_PTR ("Ds_parse_method", obj_handle);
+	ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", obj_handle);
 
 
 	/* Parameter Validation */
@@ -77,14 +74,13 @@
 		return_ACPI_STATUS (AE_NULL_ENTRY);
 	}
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Parsing [%4.4s] **** Named_obj=%p\n",
-		(char*)&((acpi_namespace_node *)obj_handle)->name, obj_handle));
-
+	ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
+		((struct acpi_namespace_node *) obj_handle)->name.ascii, obj_handle));
 
 	/* Extract the method object from the method Node */
 
-	node = (acpi_namespace_node *) obj_handle;
-	obj_desc = node->object;
+	node = (struct acpi_namespace_node *) obj_handle;
+	obj_desc = acpi_ns_get_attached_object (node);
 	if (!obj_desc) {
 		return_ACPI_STATUS (AE_NULL_OBJECT);
 	}
@@ -112,13 +108,20 @@
 
 	/* Init new op with the method name and pointer back to the Node */
 
-	acpi_ps_set_name (op, node->name);
-	op->node = node;
+	acpi_ps_set_name (op, node->name.integer);
+	op->common.node = node;
+
+	/*
+	 * Get a new owner_id for objects created by this method. Namespace
+	 * objects (such as Operation Regions) can be created during the
+	 * first pass parse.
+	 */
+	owner_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
+	obj_desc->method.owning_id = owner_id;
 
 	/* Create and initialize a new walk state */
 
-	walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
-			   NULL, NULL, NULL);
+	walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL);
 	if (!walk_state) {
 		return_ACPI_STATUS (AE_NO_MEMORY);
 	}
@@ -126,7 +129,7 @@
 	status = acpi_ds_init_aml_walk (walk_state, op, node, obj_desc->method.aml_start,
 			  obj_desc->method.aml_length, NULL, NULL, 1);
 	if (ACPI_FAILURE (status)) {
-		/* TBD: delete walk state */
+		acpi_ds_delete_walk_state (walk_state);
 		return_ACPI_STATUS (status);
 	}
 
@@ -145,27 +148,22 @@
 		return_ACPI_STATUS (status);
 	}
 
-	/* Get a new Owner_id for objects created by this method */
-
-	owner_id = acpi_ut_allocate_owner_id (OWNER_TYPE_METHOD);
-	obj_desc->method.owning_id = owner_id;
-
-	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** [%4.4s] Parsed **** Named_obj=%p Op=%p\n",
-		(char*)&((acpi_namespace_node *)obj_handle)->name, obj_handle, op));
+	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_ps_delete_parse_tree (op);
-
 	return_ACPI_STATUS (status);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_begin_method_execution
+ * FUNCTION:    acpi_ds_begin_method_execution
  *
- * PARAMETERS:  Method_node         - Node of the method
- *              Obj_desc            - The method object
- *              Calling_method_node - Caller of this method (if non-null)
+ * PARAMETERS:  method_node         - Node of the method
+ *              obj_desc            - The method object
+ *              calling_method_node - Caller of this method (if non-null)
  *
  * RETURN:      Status
  *
@@ -179,21 +177,20 @@
 
 acpi_status
 acpi_ds_begin_method_execution (
-	acpi_namespace_node     *method_node,
-	acpi_operand_object     *obj_desc,
-	acpi_namespace_node     *calling_method_node)
+	struct acpi_namespace_node      *method_node,
+	union acpi_operand_object       *obj_desc,
+	struct acpi_namespace_node      *calling_method_node)
 {
-	acpi_status             status = AE_OK;
+	acpi_status                     status = AE_OK;
 
 
-	FUNCTION_TRACE_PTR ("Ds_begin_method_execution", method_node);
+	ACPI_FUNCTION_TRACE_PTR ("ds_begin_method_execution", method_node);
 
 
 	if (!method_node) {
 		return_ACPI_STATUS (AE_NULL_ENTRY);
 	}
 
-
 	/*
 	 * If there is a concurrency limit on this method, we need to
 	 * obtain a unit from the method semaphore.
@@ -201,7 +198,7 @@
 	if (obj_desc->method.semaphore) {
 		/*
 		 * Allow recursive method calls, up to the reentrancy/concurrency
-		 * limit imposed by the SERIALIZED rule and the Sync_level method
+		 * limit imposed by the SERIALIZED rule and the sync_level method
 		 * parameter.
 		 *
 		 * The point of this code is to avoid permanently blocking a
@@ -218,25 +215,23 @@
 		 * interpreter if we block
 		 */
 		status = acpi_ex_system_wait_semaphore (obj_desc->method.semaphore,
-				 WAIT_FOREVER);
+				 ACPI_WAIT_FOREVER);
 	}
 
-
 	/*
 	 * Increment the method parse tree thread count since it has been
 	 * reentered one more time (even if it is the same thread)
 	 */
 	obj_desc->method.thread_count++;
-
 	return_ACPI_STATUS (status);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_call_control_method
+ * FUNCTION:    acpi_ds_call_control_method
  *
- * PARAMETERS:  Walk_state          - Current state of the walk
+ * PARAMETERS:  walk_state          - Current state of the walk
  *              Op                  - Current Op to be walked
  *
  * RETURN:      Status
@@ -247,18 +242,18 @@
 
 acpi_status
 acpi_ds_call_control_method (
-	acpi_walk_list          *walk_list,
-	acpi_walk_state         *this_walk_state,
-	acpi_parse_object       *op)  /* TBD: This operand is obsolete */
+	struct acpi_thread_state        *thread,
+	struct acpi_walk_state          *this_walk_state,
+	union acpi_parse_object         *op)
 {
-	acpi_status             status;
-	acpi_namespace_node     *method_node;
-	acpi_operand_object     *obj_desc;
-	acpi_walk_state         *next_walk_state;
-	u32                     i;
+	acpi_status                     status;
+	struct acpi_namespace_node      *method_node;
+	union acpi_operand_object       *obj_desc;
+	struct acpi_walk_state          *next_walk_state;
+	u32                             i;
 
 
-	FUNCTION_TRACE_PTR ("Ds_call_control_method", this_walk_state);
+	ACPI_FUNCTION_TRACE_PTR ("ds_call_control_method", this_walk_state);
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Execute method %p, currentstate=%p\n",
 		this_walk_state->prev_op, this_walk_state));
@@ -284,19 +279,17 @@
 		return_ACPI_STATUS (status);
 	}
 
-
 	/* 1) Parse: Create a new walk state for the preempting walk */
 
 	next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
 			  op, obj_desc, NULL);
 	if (!next_walk_state) {
 		return_ACPI_STATUS (AE_NO_MEMORY);
-		goto cleanup;
 	}
 
 	/* Create and init a Root Node */
 
-	op = acpi_ps_alloc_op (AML_SCOPE_OP);
+	op = acpi_ps_create_scope_op ();
 	if (!op) {
 		status = AE_NO_MEMORY;
 		goto cleanup;
@@ -306,7 +299,7 @@
 			  obj_desc->method.aml_start, obj_desc->method.aml_length,
 			  NULL, NULL, 1);
 	if (ACPI_FAILURE (status)) {
-		/* TBD: delete walk state */
+		acpi_ds_delete_walk_state (next_walk_state);
 		goto cleanup;
 	}
 
@@ -315,11 +308,10 @@
 	status = acpi_ps_parse_aml (next_walk_state);
 	acpi_ps_delete_parse_tree (op);
 
-
 	/* 2) Execute: Create a new state for the preempting walk */
 
 	next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
-			  NULL, obj_desc, walk_list);
+			  NULL, obj_desc, thread);
 	if (!next_walk_state) {
 		status = AE_NO_MEMORY;
 		goto cleanup;
@@ -353,8 +345,8 @@
 
 	this_walk_state->num_operands = 0;
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Starting nested execution, newstate=%p\n",
-		next_walk_state));
+	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+		"Starting nested execution, newstate=%p\n", next_walk_state));
 
 	return_ACPI_STATUS (AE_OK);
 
@@ -362,7 +354,7 @@
 	/* On error, we must delete the new walk state */
 
 cleanup:
-	acpi_ds_terminate_control_method (next_walk_state);
+	(void) acpi_ds_terminate_control_method (next_walk_state);
 	acpi_ds_delete_walk_state (next_walk_state);
 	return_ACPI_STATUS (status);
 
@@ -371,9 +363,9 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_restart_control_method
+ * FUNCTION:    acpi_ds_restart_control_method
  *
- * PARAMETERS:  Walk_state          - State of the method when it was preempted
+ * PARAMETERS:  walk_state          - State of the method when it was preempted
  *              Op                  - Pointer to new current op
  *
  * RETURN:      Status
@@ -384,13 +376,13 @@
 
 acpi_status
 acpi_ds_restart_control_method (
-	acpi_walk_state         *walk_state,
-	acpi_operand_object     *return_desc)
+	struct acpi_walk_state          *walk_state,
+	union acpi_operand_object       *return_desc)
 {
-	acpi_status             status;
+	acpi_status                     status;
 
 
-	FUNCTION_TRACE_PTR ("Ds_restart_control_method", walk_state);
+	ACPI_FUNCTION_TRACE_PTR ("ds_restart_control_method", walk_state);
 
 
 	if (return_desc) {
@@ -405,7 +397,6 @@
 				return_ACPI_STATUS (status);
 			}
 		}
-
 		else {
 			/*
 			 * Delete the return value if it will not be used by the
@@ -413,24 +404,22 @@
 			 */
 			acpi_ut_remove_reference (return_desc);
 		}
-
 	}
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-		"Method=%p Return=%p Return_used?=%X Res_stack=%p State=%p\n",
+		"Method=%p Return=%p return_used?=%X res_stack=%p State=%p\n",
 		walk_state->method_call_op, return_desc, walk_state->return_used,
 		walk_state->results, walk_state));
 
-
 	return_ACPI_STATUS (AE_OK);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_terminate_control_method
+ * FUNCTION:    acpi_ds_terminate_control_method
  *
- * PARAMETERS:  Walk_state          - State of the method
+ * PARAMETERS:  walk_state          - State of the method
  *
  * RETURN:      Status
  *
@@ -442,16 +431,21 @@
 
 acpi_status
 acpi_ds_terminate_control_method (
-	acpi_walk_state         *walk_state)
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_operand_object     *obj_desc;
-	acpi_namespace_node     *method_node;
+	union acpi_operand_object       *obj_desc;
+	struct acpi_namespace_node      *method_node;
+	acpi_status                     status;
 
 
-	FUNCTION_TRACE_PTR ("Ds_terminate_control_method", walk_state);
+	ACPI_FUNCTION_TRACE_PTR ("ds_terminate_control_method", walk_state);
 
 
-	/* The method object should be stored in the walk state */
+	if (!walk_state) {
+		return (AE_BAD_PARAMETER);
+	}
+
+	/* The current method object was saved in the walk state */
 
 	obj_desc = walk_state->method_desc;
 	if (!obj_desc) {
@@ -467,14 +461,22 @@
 	 * If this is the last thread executing the method,
 	 * we have additional cleanup to perform
 	 */
-	acpi_ut_acquire_mutex (ACPI_MTX_PARSER);
-
+	status = acpi_ut_acquire_mutex (ACPI_MTX_PARSER);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
 
 	/* Signal completion of the execution of this method if necessary */
 
 	if (walk_state->method_desc->method.semaphore) {
-		acpi_os_signal_semaphore (
-			walk_state->method_desc->method.semaphore, 1);
+		status = acpi_os_signal_semaphore (
+				  walk_state->method_desc->method.semaphore, 1);
+		if (ACPI_FAILURE (status)) {
+			ACPI_REPORT_ERROR (("Could not signal method semaphore\n"));
+			status = AE_OK;
+
+			/* Ignore error and continue cleanup */
+		}
 	}
 
 	/* Decrement the thread count on the method parse tree */
@@ -493,7 +495,11 @@
 		 * Delete any namespace entries created immediately underneath
 		 * the method
 		 */
-		acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
+		status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
+
 		if (method_node->child) {
 			acpi_ns_delete_namespace_subtree (method_node);
 		}
@@ -503,11 +509,14 @@
 		 * the namespace
 		 */
 		acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owning_id);
-		acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+		status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 	}
 
-	acpi_ut_release_mutex (ACPI_MTX_PARSER);
-	return_ACPI_STATUS (AE_OK);
+	status = acpi_ut_release_mutex (ACPI_MTX_PARSER);
+	return_ACPI_STATUS (status);
 }
 
 
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c
--- a/drivers/acpi/dispatcher/dsmthdat.c	2003-01-25 01:25:34.000000000 -0800
+++ b/drivers/acpi/dispatcher/dsmthdat.c	2003-01-25 01:30:18.000000000 -0800
@@ -1,12 +1,11 @@
 /*******************************************************************************
  *
  * Module Name: dsmthdat - control method arguments and local variables
- *              $Revision: 49 $
  *
  ******************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -25,169 +24,154 @@
 
 
 #include "acpi.h"
-#include "acparser.h"
 #include "acdispat.h"
-#include "acinterp.h"
 #include "amlcode.h"
 #include "acnamesp.h"
+#include "acinterp.h"
 
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dsmthdat")
+	 ACPI_MODULE_NAME    ("dsmthdat")
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_method_data_init
+ * FUNCTION:    acpi_ds_method_data_init
  *
- * PARAMETERS:  Walk_state          - Current walk state object
+ * PARAMETERS:  walk_state          - Current walk state object
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Initialize the data structures that hold the method's arguments
  *              and locals.  The data struct is an array of NTEs for each.
- *              This allows Ref_of and De_ref_of to work properly for these
+ *              This allows ref_of and de_ref_of to work properly for these
  *              special data types.
  *
+ * NOTES:       walk_state fields are initialized to zero by the
+ *              ACPI_MEM_CALLOCATE().
+ *
+ *              A pseudo-Namespace Node is assigned to each argument and local
+ *              so that ref_of() can return a pointer to the Node.
+ *
  ******************************************************************************/
 
-acpi_status
+void
 acpi_ds_method_data_init (
-	acpi_walk_state         *walk_state)
+	struct acpi_walk_state          *walk_state)
 {
-	u32                     i;
+	u32                             i;
 
 
-	FUNCTION_TRACE ("Ds_method_data_init");
+	ACPI_FUNCTION_TRACE ("ds_method_data_init");
 
-	/*
-	 * Walk_state fields are initialized to zero by the
-	 * ACPI_MEM_CALLOCATE().
-	 *
-	 * An Node is assigned to each argument and local so
-	 * that Ref_of() can return a pointer to the Node.
-	 */
 
 	/* Init the method arguments */
 
-	for (i = 0; i < MTH_NUM_ARGS; i++) {
-		MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name,
+	for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
+		ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->arguments[i].name,
 				 NAMEOF_ARG_NTE);
-		walk_state->arguments[i].name      |= (i << 24);
-		walk_state->arguments[i].data_type  = ACPI_DESC_TYPE_NAMED;
-		walk_state->arguments[i].type       = ACPI_TYPE_ANY;
-		walk_state->arguments[i].flags      = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG;
+		walk_state->arguments[i].name.integer |= (i << 24);
+		walk_state->arguments[i].descriptor   = ACPI_DESC_TYPE_NAMED;
+		walk_state->arguments[i].type         = ACPI_TYPE_ANY;
+		walk_state->arguments[i].flags        = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG;
 	}
 
 	/* Init the method locals */
 
-	for (i = 0; i < MTH_NUM_LOCALS; i++) {
-		MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name,
+	for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) {
+		ACPI_MOVE_UNALIGNED32_TO_32 (&walk_state->local_variables[i].name,
 				 NAMEOF_LOCAL_NTE);
 
-		walk_state->local_variables[i].name  |= (i << 24);
-		walk_state->local_variables[i].data_type = ACPI_DESC_TYPE_NAMED;
-		walk_state->local_variables[i].type   = ACPI_TYPE_ANY;
-		walk_state->local_variables[i].flags  = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL;
+		walk_state->local_variables[i].name.integer |= (i << 24);
+		walk_state->local_variables[i].descriptor  = ACPI_DESC_TYPE_NAMED;
+		walk_state->local_variables[i].type        = ACPI_TYPE_ANY;
+		walk_state->local_variables[i].flags       = ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL;
 	}
 
-	return_ACPI_STATUS (AE_OK);
+	return_VOID;
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_method_data_delete_all
+ * FUNCTION:    acpi_ds_method_data_delete_all
  *
- * PARAMETERS:  Walk_state          - Current walk state object
+ * PARAMETERS:  walk_state          - Current walk state object
  *
- * RETURN:      Status
+ * RETURN:      None
  *
  * DESCRIPTION: Delete method locals and arguments.  Arguments are only
  *              deleted if this method was called from another method.
  *
  ******************************************************************************/
 
-acpi_status
+void
 acpi_ds_method_data_delete_all (
-	acpi_walk_state         *walk_state)
+	struct acpi_walk_state          *walk_state)
 {
-	u32                     index;
-	acpi_operand_object     *object;
-
-
-	FUNCTION_TRACE ("Ds_method_data_delete_all");
-
+	u32                             index;
 
-	/* Delete the locals */
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting local variables in %p\n", walk_state));
+	ACPI_FUNCTION_TRACE ("ds_method_data_delete_all");
 
-	for (index = 0; index < MTH_NUM_LOCALS; index++) {
-		object = walk_state->local_variables[index].object;
-		if (object) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n", index, object));
 
-			/* Remove first */
+	/* Detach the locals */
 
-			walk_state->local_variables[index].object = NULL;
+	for (index = 0; index < ACPI_METHOD_NUM_LOCALS; index++) {
+		if (walk_state->local_variables[index].object) {
+			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n",
+					index, walk_state->local_variables[index].object));
 
-			/* Was given a ref when stored */
+			/* Detach object (if present) and remove a reference */
 
-			acpi_ut_remove_reference (object);
-	   }
+			acpi_ns_detach_object (&walk_state->local_variables[index]);
+		}
 	}
 
+	/* Detach the arguments */
 
-	/* Delete the arguments */
-
-	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting arguments in %p\n", walk_state));
-
-	for (index = 0; index < MTH_NUM_ARGS; index++) {
-		object = walk_state->arguments[index].object;
-		if (object) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n", index, object));
-
-			/* Remove first */
+	for (index = 0; index < ACPI_METHOD_NUM_ARGS; index++) {
+		if (walk_state->arguments[index].object) {
+			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n",
+					index, walk_state->arguments[index].object));
 
-			walk_state->arguments[index].object = NULL;
+			/* Detach object (if present) and remove a reference */
 
-			 /* Was given a ref when stored */
-
-			acpi_ut_remove_reference (object);
+			acpi_ns_detach_object (&walk_state->arguments[index]);
 		}
 	}
 
-	return_ACPI_STATUS (AE_OK);
+	return_VOID;
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_method_data_init_args
+ * FUNCTION:    acpi_ds_method_data_init_args
  *
  * PARAMETERS:  *Params         - Pointer to a parameter list for the method
- *              Max_param_count - The arg count for this method
- *              Walk_state      - Current walk state object
+ *              max_param_count - The arg count for this method
+ *              walk_state      - Current walk state object
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Initialize arguments for a method
+ * DESCRIPTION: Initialize arguments for a method.  The parameter list is a list
+ *              of ACPI operand objects, either null terminated or whose length
+ *              is defined by max_param_count.
  *
  ******************************************************************************/
 
 acpi_status
 acpi_ds_method_data_init_args (
-	acpi_operand_object     **params,
-	u32                     max_param_count,
-	acpi_walk_state         *walk_state)
+	union acpi_operand_object       **params,
+	u32                             max_param_count,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_status             status;
-	u32                     mindex;
-	u32                     pindex;
+	acpi_status                     status;
+	u32                             index = 0;
 
 
-	FUNCTION_TRACE_PTR ("Ds_method_data_init_args", params);
+	ACPI_FUNCTION_TRACE_PTR ("ds_method_data_init_args", params);
 
 
 	if (!params) {
@@ -197,293 +181,237 @@
 
 	/* Copy passed parameters into the new method stack frame  */
 
-	for (pindex = mindex = 0;
-		(mindex < MTH_NUM_ARGS) && (pindex < max_param_count);
-		mindex++) {
-		if (params[pindex]) {
-			/*
-			 * A valid parameter.
-			 * Set the current method argument to the
-			 * Params[Pindex++] argument object descriptor
-			 */
-			status = acpi_ds_store_object_to_local (AML_ARG_OP, mindex,
-					  params[pindex], walk_state);
-			if (ACPI_FAILURE (status)) {
-				break;
-			}
-
-			pindex++;
+	while ((index < ACPI_METHOD_NUM_ARGS) && (index < max_param_count) && params[index]) {
+		/*
+		 * A valid parameter.
+		 * Store the argument in the method/walk descriptor
+		 */
+		status = acpi_ds_store_object_to_local (AML_ARG_OP, index, params[index],
+				 walk_state);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
 		}
 
-		else {
-			break;
-		}
+		index++;
 	}
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", pindex));
+	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", index));
 	return_ACPI_STATUS (AE_OK);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_method_data_get_entry
+ * FUNCTION:    acpi_ds_method_data_get_node
  *
  * PARAMETERS:  Opcode              - Either AML_LOCAL_OP or AML_ARG_OP
- *              Index               - Which local_var or argument to get
- *              Entry               - Pointer to where a pointer to the stack
- *                                    entry is returned.
- *              Walk_state          - Current walk state object
- *
- * RETURN:      Status
+ *              Index               - which local_var or argument whose type
+ *                                      to get
+ *              walk_state          - Current walk state object
  *
- * DESCRIPTION: Get the address of the object entry given by Opcode:Index
+ * RETURN:      Get the Node associated with a local or arg.
  *
  ******************************************************************************/
 
 acpi_status
-acpi_ds_method_data_get_entry (
-	u16                     opcode,
-	u32                     index,
-	acpi_walk_state         *walk_state,
-	acpi_operand_object     ***entry)
+acpi_ds_method_data_get_node (
+	u16                             opcode,
+	u32                             index,
+	struct acpi_walk_state          *walk_state,
+	struct acpi_namespace_node      **node)
 {
-
-	FUNCTION_TRACE_U32 ("Ds_method_data_get_entry", index);
+	ACPI_FUNCTION_TRACE ("ds_method_data_get_node");
 
 
 	/*
-	 * Get the requested object.
-	 * The stack "Opcode" is either a Local_variable or an Argument
+	 * Method Locals and Arguments are supported
 	 */
 	switch (opcode) {
-
 	case AML_LOCAL_OP:
 
-		if (index > MTH_MAX_LOCAL) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local_var index %d is invalid (max %d)\n",
-				index, MTH_MAX_LOCAL));
-			return_ACPI_STATUS (AE_BAD_PARAMETER);
+		if (index > ACPI_METHOD_MAX_LOCAL) {
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local index %d is invalid (max %d)\n",
+				index, ACPI_METHOD_MAX_LOCAL));
+			return_ACPI_STATUS (AE_AML_INVALID_INDEX);
 		}
 
-		*entry = (acpi_operand_object  **)
-				 &walk_state->local_variables[index].object;
-		break;
+		/* Return a pointer to the pseudo-node */
 
+		*node = &walk_state->local_variables[index];
+		break;
 
 	case AML_ARG_OP:
 
-		if (index > MTH_MAX_ARG) {
+		if (index > ACPI_METHOD_MAX_ARG) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n",
-				index, MTH_MAX_ARG));
-			return_ACPI_STATUS (AE_BAD_PARAMETER);
+				index, ACPI_METHOD_MAX_ARG));
+			return_ACPI_STATUS (AE_AML_INVALID_INDEX);
 		}
 
-		*entry = (acpi_operand_object  **)
-				 &walk_state->arguments[index].object;
-		break;
+		/* Return a pointer to the pseudo-node */
 
+		*node = &walk_state->arguments[index];
+		break;
 
 	default:
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Opcode %d is invalid\n", opcode));
-		return_ACPI_STATUS (AE_BAD_PARAMETER);
+		return_ACPI_STATUS (AE_AML_BAD_OPCODE);
 	}
 
-
 	return_ACPI_STATUS (AE_OK);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_method_data_set_entry
+ * FUNCTION:    acpi_ds_method_data_set_value
  *
  * PARAMETERS:  Opcode              - Either AML_LOCAL_OP or AML_ARG_OP
- *              Index               - Which local_var or argument to get
+ *              Index               - which local_var or argument to get
  *              Object              - Object to be inserted into the stack entry
- *              Walk_state          - Current walk state object
+ *              walk_state          - Current walk state object
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Insert an object onto the method stack at entry Opcode:Index.
+ *              Note: There is no "implicit conversion" for locals.
  *
  ******************************************************************************/
 
 acpi_status
-acpi_ds_method_data_set_entry (
-	u16                     opcode,
-	u32                     index,
-	acpi_operand_object     *object,
-	acpi_walk_state         *walk_state)
+acpi_ds_method_data_set_value (
+	u16                             opcode,
+	u32                             index,
+	union acpi_operand_object       *object,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_status             status;
-	acpi_operand_object     **entry;
+	acpi_status                     status;
+	struct acpi_namespace_node      *node;
+	union acpi_operand_object       *new_desc = object;
+
 
+	ACPI_FUNCTION_TRACE ("ds_method_data_set_value");
 
-	FUNCTION_TRACE ("Ds_method_data_set_entry");
 
+	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+		"obj %p op %X, ref count = %d [%s]\n", object,
+		opcode, object->common.reference_count,
+		acpi_ut_get_type_name (object->common.type)));
 
-	/* Get a pointer to the stack entry to set */
+	/* Get the namespace node for the arg/local */
 
-	status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry);
+	status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node);
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
 
-	/* Increment ref count so object can't be deleted while installed */
+	/*
+	 * If the object has just been created and is not attached to anything,
+	 * (the reference count is 1), then we can just store it directly into
+	 * the arg/local.  Otherwise, we must copy it.
+	 */
+	if (object->common.reference_count > 1) {
+		status = acpi_ut_copy_iobject_to_iobject (object, &new_desc, walk_state);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+		}
 
-	acpi_ut_add_reference (object);
+	   ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object Copied %p, new %p\n",
+		   object, new_desc));
+	}
+	else {
+		/* Increment ref count so object can't be deleted while installed */
 
-	/* Install the object into the stack entry */
+		acpi_ut_add_reference (new_desc);
+	}
 
-	*entry = object;
+	/* Install the object */
 
-	return_ACPI_STATUS (AE_OK);
+	node->object = new_desc;
+	return_ACPI_STATUS (status);
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_method_data_get_type
+ * FUNCTION:    acpi_ds_method_data_get_type
  *
  * PARAMETERS:  Opcode              - Either AML_LOCAL_OP or AML_ARG_OP
- *              Index               - Which local_var or argument whose type
+ *              Index               - which local_var or argument whose type
  *                                      to get
- *              Walk_state          - Current walk state object
+ *              walk_state          - Current walk state object
  *
- * RETURN:      Data type of selected Arg or Local
- *              Used only in Exec_monadic2()/Type_op.
+ * RETURN:      Data type of current value of the selected Arg or Local
  *
  ******************************************************************************/
 
-acpi_object_type8
+acpi_object_type
 acpi_ds_method_data_get_type (
-	u16                     opcode,
-	u32                     index,
-	acpi_walk_state         *walk_state)
+	u16                             opcode,
+	u32                             index,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_status             status;
-	acpi_operand_object     **entry;
-	acpi_operand_object     *object;
+	acpi_status                     status;
+	struct acpi_namespace_node      *node;
+	union acpi_operand_object       *object;
 
 
-	FUNCTION_TRACE ("Ds_method_data_get_type");
+	ACPI_FUNCTION_TRACE ("ds_method_data_get_type");
 
 
-	/* Get a pointer to the requested stack entry */
+	/* Get the namespace node for the arg/local */
 
-	status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry);
+	status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node);
 	if (ACPI_FAILURE (status)) {
 		return_VALUE ((ACPI_TYPE_NOT_FOUND));
 	}
 
-	/* Get the object from the method stack */
-
-	object = *entry;
-
-	/* Get the object type */
+	/* Get the object */
 
+	object = acpi_ns_get_attached_object (node);
 	if (!object) {
-		/* Any == 0 => "uninitialized" -- see spec 15.2.3.5.2.28 */
-		return_VALUE (ACPI_TYPE_ANY);
-	}
-
-	return_VALUE (object->common.type);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_ds_method_data_get_node
- *
- * PARAMETERS:  Opcode              - Either AML_LOCAL_OP or AML_ARG_OP
- *              Index               - Which local_var or argument whose type
- *                                      to get
- *              Walk_state          - Current walk state object
- *
- * RETURN:      Get the Node associated with a local or arg.
- *
- ******************************************************************************/
-
-acpi_namespace_node *
-acpi_ds_method_data_get_node (
-	u16                     opcode,
-	u32                     index,
-	acpi_walk_state         *walk_state)
-{
-	acpi_namespace_node     *node = NULL;
-
-
-	FUNCTION_TRACE ("Ds_method_data_get_node");
-
-
-	switch (opcode) {
-
-	case AML_LOCAL_OP:
-
-		if (index > MTH_MAX_LOCAL) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local index %d is invalid (max %d)\n",
-				index, MTH_MAX_LOCAL));
-			return_PTR (node);
-		}
-
-		node =  &walk_state->local_variables[index];
-		break;
-
-
-	case AML_ARG_OP:
-
-		if (index > MTH_MAX_ARG) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n",
-				index, MTH_MAX_ARG));
-			return_PTR (node);
-		}
-
-		node = &walk_state->arguments[index];
-		break;
+		/* Uninitialized local/arg, return TYPE_ANY */
 
-
-	default:
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Opcode %d is invalid\n", opcode));
-		break;
+		return_VALUE (ACPI_TYPE_ANY);
 	}
 
+	/* Get the object type */
 
-	return_PTR (node);
+	return_VALUE (ACPI_GET_OBJECT_TYPE (object));
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_method_data_get_value
+ * FUNCTION:    acpi_ds_method_data_get_value
  *
  * PARAMETERS:  Opcode              - Either AML_LOCAL_OP or AML_ARG_OP
- *              Index               - Which local_var or argument to get
- *              Walk_state          - Current walk state object
- *              *Dest_desc          - Ptr to Descriptor into which selected Arg
+ *              Index               - which local_var or argument to get
+ *              walk_state          - Current walk state object
+ *              *dest_desc          - Ptr to Descriptor into which selected Arg
  *                                    or Local value should be copied
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Retrieve value of selected Arg or Local from the method frame
  *              at the current top of the method stack.
- *              Used only in Acpi_ex_resolve_to_value().
+ *              Used only in acpi_ex_resolve_to_value().
  *
  ******************************************************************************/
 
 acpi_status
 acpi_ds_method_data_get_value (
-	u16                     opcode,
-	u32                     index,
-	acpi_walk_state         *walk_state,
-	acpi_operand_object     **dest_desc)
+	u16                             opcode,
+	u32                             index,
+	struct acpi_walk_state          *walk_state,
+	union acpi_operand_object       **dest_desc)
 {
-	acpi_status             status;
-	acpi_operand_object     **entry;
-	acpi_operand_object     *object;
+	acpi_status                     status;
+	struct acpi_namespace_node      *node;
+	union acpi_operand_object       *object;
 
 
-	FUNCTION_TRACE ("Ds_method_data_get_value");
+	ACPI_FUNCTION_TRACE ("ds_method_data_get_value");
 
 
 	/* Validate the object descriptor */
@@ -493,24 +421,22 @@
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
+	/* Get the namespace node for the arg/local */
 
-	/* Get a pointer to the requested method stack entry */
-
-	status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry);
+	status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node);
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
 
-	/* Get the object from the method stack */
-
-	object = *entry;
+	/* Get the object from the node */
 
+	object = node->object;
 
 	/* Examine the returned object, it must be valid. */
 
 	if (!object) {
 		/*
-		 * Index points to uninitialized object stack value.
+		 * Index points to uninitialized object.
 		 * This means that either 1) The expected argument was
 		 * not passed to the method, or 2) A local variable
 		 * was referenced by the method (via the ASL)
@@ -519,25 +445,25 @@
 		switch (opcode) {
 		case AML_ARG_OP:
 
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at entry %p\n",
-				index, entry));
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at node %p\n",
+				index, node));
 
 			return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG);
-			break;
 
 		case AML_LOCAL_OP:
 
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Local[%d] at entry %p\n",
-				index, entry));
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Local[%d] at node %p\n",
+				index, node));
 
 			return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL);
-			break;
+
+		default:
+			return_ACPI_STATUS (AE_AML_INTERNAL);
 		}
 	}
 
-
 	/*
-	 * Index points to initialized and valid object stack value.
+	 * The Index points to an initialized and valid object.
 	 * Return an additional reference to the object
 	 */
 	*dest_desc = object;
@@ -549,125 +475,126 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_method_data_delete_value
+ * FUNCTION:    acpi_ds_method_data_delete_value
  *
  * PARAMETERS:  Opcode              - Either AML_LOCAL_OP or AML_ARG_OP
- *              Index               - Which local_var or argument to delete
- *              Walk_state          - Current walk state object
+ *              Index               - which local_var or argument to delete
+ *              walk_state          - Current walk state object
  *
- * RETURN:      Status
+ * RETURN:      None
  *
  * DESCRIPTION: Delete the entry at Opcode:Index on the method stack.  Inserts
  *              a null into the stack slot after the object is deleted.
  *
  ******************************************************************************/
 
-acpi_status
+void
 acpi_ds_method_data_delete_value (
-	u16                     opcode,
-	u32                     index,
-	acpi_walk_state         *walk_state)
+	u16                             opcode,
+	u32                             index,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_status             status;
-	acpi_operand_object     **entry;
-	acpi_operand_object     *object;
+	acpi_status                     status;
+	struct acpi_namespace_node      *node;
+	union acpi_operand_object       *object;
 
 
-	FUNCTION_TRACE ("Ds_method_data_delete_value");
+	ACPI_FUNCTION_TRACE ("ds_method_data_delete_value");
 
 
-	/* Get a pointer to the requested entry */
+	/* Get the namespace node for the arg/local */
 
-	status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry);
+	status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node);
 	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
+		return_VOID;
 	}
 
-	/* Get the current entry in this slot k */
+	/* Get the associated object */
 
-	object = *entry;
+	object = acpi_ns_get_attached_object (node);
 
 	/*
 	 * Undefine the Arg or Local by setting its descriptor
 	 * pointer to NULL. Locals/Args can contain both
 	 * ACPI_OPERAND_OBJECTS and ACPI_NAMESPACE_NODEs
 	 */
-	*entry = NULL;
+	node->object = NULL;
 
 	if ((object) &&
-		(VALID_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_INTERNAL))) {
+		(ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_OPERAND)) {
 		/*
-		 * There is a valid object in this slot
+		 * There is a valid object.
 		 * Decrement the reference count by one to balance the
-		 * increment when the object was stored in the slot.
+		 * increment when the object was stored.
 		 */
 		acpi_ut_remove_reference (object);
 	}
 
-	return_ACPI_STATUS (AE_OK);
+	return_VOID;
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_store_object_to_local
+ * FUNCTION:    acpi_ds_store_object_to_local
  *
  * PARAMETERS:  Opcode              - Either AML_LOCAL_OP or AML_ARG_OP
- *              Index               - Which local_var or argument to set
- *              Src_desc            - Value to be stored
- *              Walk_state          - Current walk state
+ *              Index               - which local_var or argument to set
+ *              obj_desc            - Value to be stored
+ *              walk_state          - Current walk state
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Store a value in an Arg or Local.  The Src_desc is installed
+ * DESCRIPTION: Store a value in an Arg or Local.  The obj_desc is installed
  *              as the new value for the Arg or Local and the reference count
- *              for Src_desc is incremented.
+ *              for obj_desc is incremented.
  *
  ******************************************************************************/
 
 acpi_status
 acpi_ds_store_object_to_local (
-	u16                     opcode,
-	u32                     index,
-	acpi_operand_object     *src_desc,
-	acpi_walk_state         *walk_state)
+	u16                             opcode,
+	u32                             index,
+	union acpi_operand_object       *obj_desc,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_status             status;
-	acpi_operand_object     **entry;
+	acpi_status                     status;
+	struct acpi_namespace_node      *node;
+	union acpi_operand_object       *current_obj_desc;
 
 
-	FUNCTION_TRACE ("Ds_method_data_set_value");
+	ACPI_FUNCTION_TRACE ("ds_store_object_to_local");
 	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n",
-		opcode, index, src_desc));
+		opcode, index, obj_desc));
 
 
 	/* Parameter validation */
 
-	if (!src_desc) {
+	if (!obj_desc) {
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
+	/* Get the namespace node for the arg/local */
 
-	/* Get a pointer to the requested method stack entry */
-
-	status = acpi_ds_method_data_get_entry (opcode, index, walk_state, &entry);
+	status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node);
 	if (ACPI_FAILURE (status)) {
-		goto cleanup;
+		return_ACPI_STATUS (status);
 	}
 
-	if (*entry == src_desc) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", src_desc));
-		goto cleanup;
+	current_obj_desc = acpi_ns_get_attached_object (node);
+	if (current_obj_desc == obj_desc) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n",
+			obj_desc));
+		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
 	 * an indirect store!
 	 */
-	if (*entry) {
+	if (current_obj_desc) {
 		/*
 		 * Check for an indirect store if an argument
 		 * contains an object reference (stored as an Node).
@@ -675,45 +602,46 @@
 		 * locals, since a store to a local should overwrite
 		 * anything there, including an object reference.
 		 *
-		 * If both Arg0 and Local0 contain Ref_of (Local4):
+		 * If both Arg0 and Local0 contain ref_of (Local4):
 		 *
 		 * Store (1, Arg0)             - Causes indirect store to local4
 		 * Store (1, Local0)           - Stores 1 in local0, overwriting
 		 *                                  the reference to local4
-		 * Store (1, De_refof (Local0)) - Causes indirect store to local4
+		 * Store (1, de_refof (Local0)) - Causes indirect store to local4
 		 *
 		 * Weird, but true.
 		 */
-		if ((opcode == AML_ARG_OP) &&
-			(VALID_DESCRIPTOR_TYPE (*entry, ACPI_DESC_TYPE_NAMED))) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-				"Arg (%p) is an Obj_ref(Node), storing in %p\n",
-				src_desc, *entry));
-
-			/* Detach an existing object from the Node */
-
-			acpi_ns_detach_object ((acpi_namespace_node *) *entry);
-
+		if (opcode == AML_ARG_OP) {
 			/*
-			 * Store this object into the Node
-			 * (do the indirect store)
+			 * Make sure that the object is the correct type.  This may be overkill, but
+			 * it is here because references were NS nodes in the past.  Now they are
+			 * operand objects of type Reference.
 			 */
-			status = acpi_ns_attach_object ((acpi_namespace_node *) *entry, src_desc,
-					   src_desc->common.type);
-			return_ACPI_STATUS (status);
-		}
-
+			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));
+				return_ACPI_STATUS (AE_AML_INTERNAL);
+			}
 
-#ifdef ACPI_ENABLE_IMPLICIT_CONVERSION
-		/*
-		 * Perform "Implicit conversion" of the new object to the type of the
-		 * existing object
-		 */
-		status = acpi_ex_convert_to_target_type ((*entry)->common.type, &src_desc, walk_state);
-		if (ACPI_FAILURE (status)) {
-			goto cleanup;
+			/*
+			 * If we have a valid reference object that came from ref_of(), do the
+			 * indirect store
+			 */
+			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));
+
+				/*
+				 * Store this object to the Node
+				 * (perform the indirect store)
+				 */
+				status = acpi_ex_store_object_to_node (obj_desc,
+						 current_obj_desc->reference.object, walk_state);
+				return_ACPI_STATUS (status);
+			}
 		}
-#endif
 
 		/*
 		 * Delete the existing object
@@ -722,27 +650,14 @@
 		acpi_ds_method_data_delete_value (opcode, index, walk_state);
 	}
 
-
 	/*
-	 * Install the Obj_stack descriptor (*Src_desc) into
+	 * Install the obj_stack descriptor (*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_entry (opcode, index, src_desc, walk_state);
-	if (ACPI_FAILURE (status)) {
-		goto cleanup;
-	}
-
-	/* Normal exit */
-
-	return_ACPI_STATUS (AE_OK);
-
-
-	/* Error exit */
-
-cleanup:
-
+	status = acpi_ds_method_data_set_value (opcode, index, obj_desc, walk_state);
 	return_ACPI_STATUS (status);
 }
 
+
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
--- a/drivers/acpi/dispatcher/dsobject.c	2003-01-25 01:24:34.000000000 -0800
+++ b/drivers/acpi/dispatcher/dsobject.c	2003-01-25 01:30:06.000000000 -0800
@@ -1,12 +1,11 @@
 /******************************************************************************
  *
  * Module Name: dsobject - Dispatcher object management routines
- *              $Revision: 81 $
  *
  *****************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -28,665 +27,566 @@
 #include "acparser.h"
 #include "amlcode.h"
 #include "acdispat.h"
-#include "acinterp.h"
 #include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dsobject")
+	 ACPI_MODULE_NAME    ("dsobject")
 
 
-/*******************************************************************************
+#ifndef ACPI_NO_METHOD_EXECUTION
+/*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_init_one_object
+ * FUNCTION:    acpi_ds_build_internal_object
  *
- * PARAMETERS:  Obj_handle      - Node
- *              Level           - Current nesting level
- *              Context         - Points to a init info struct
- *              Return_value    - Not used
+ * PARAMETERS:  walk_state      - Current walk state
+ *              Op              - Parser object to be translated
+ *              obj_desc_ptr    - Where the ACPI internal object is returned
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Callback from Acpi_walk_namespace. Invoked for every object
- *              within the  namespace.
- *
- *              Currently, the only objects that require initialization are:
- *              1) Methods
- *              2) Op Regions
+ * DESCRIPTION: Translate a parser Op object to the equivalent namespace object
+ *              Simple objects are any objects other than a package object!
  *
- ******************************************************************************/
+ ****************************************************************************/
 
 acpi_status
-acpi_ds_init_one_object (
-	acpi_handle             obj_handle,
-	u32                     level,
-	void                    *context,
-	void                    **return_value)
+acpi_ds_build_internal_object (
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op,
+	union acpi_operand_object       **obj_desc_ptr)
 {
-	acpi_object_type8       type;
-	acpi_status             status;
-	acpi_init_walk_info     *info = (acpi_init_walk_info *) context;
-	u8                      table_revision;
-
-
-	PROC_NAME ("Ds_init_one_object");
-
-
-	info->object_count++;
-	table_revision = info->table_desc->pointer->revision;
+	union acpi_operand_object       *obj_desc;
+	acpi_status                     status;
 
-	/*
-	 * We are only interested in objects owned by the table that
-	 * was just loaded
-	 */
-	if (((acpi_namespace_node *) obj_handle)->owner_id !=
-			info->table_desc->table_id) {
-		return (AE_OK);
-	}
-
-
-	/* And even then, we are only interested in a few object types */
-
-	type = acpi_ns_get_type (obj_handle);
 
-	switch (type) {
+	ACPI_FUNCTION_TRACE ("ds_build_internal_object");
 
-	case ACPI_TYPE_REGION:
-
-		acpi_ds_initialize_region (obj_handle);
-
-		info->op_region_count++;
-		break;
-
-
-	case ACPI_TYPE_METHOD:
-
-		info->method_count++;
-
-		if (!(acpi_dbg_level & ACPI_LV_INIT)) {
-			ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "."));
-		}
-
-		/*
-		 * Set the execution data width (32 or 64) based upon the
-		 * revision number of the parent ACPI table.
-		 */
-		if (table_revision == 1) {
-			((acpi_namespace_node *)obj_handle)->flags |= ANOBJ_DATA_WIDTH_32;
-		}
 
+	*obj_desc_ptr = NULL;
+	if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
 		/*
-		 * Always parse methods to detect errors, we may delete
-		 * the parse tree below
+		 * This is an named object reference.  If this name was
+		 * previously looked up in the namespace, it was stored in this op.
+		 * Otherwise, go ahead and look it up now
 		 */
-		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, (char*)&((acpi_namespace_node *)obj_handle)->name,
-				acpi_format_exception (status)));
-
-			/* This parse failed, but we will continue parsing more methods */
+		if (!op->common.node) {
+			status = acpi_ns_lookup (walk_state->scope_info, op->common.value.string,
+					  ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+					  ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
+					  (struct acpi_namespace_node **) &(op->common.node));
 
-			break;
+			if (ACPI_FAILURE (status)) {
+				ACPI_REPORT_NSERROR (op->common.value.string, status);
+				return_ACPI_STATUS (status);
+			}
 		}
-
-		/*
-		 * Delete the parse tree.  We simple re-parse the method
-		 * for every execution since there isn't much overhead
-		 */
-		acpi_ns_delete_namespace_subtree (obj_handle);
-		break;
-
-	default:
-		break;
 	}
 
-	/*
-	 * We ignore errors from above, and always return OK, since
-	 * we don't want to abort the walk on a single error.
-	 */
-	return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_ds_initialize_objects
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Walk the entire namespace and perform any necessary
- *              initialization on the objects found therein
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ds_initialize_objects (
-	acpi_table_desc         *table_desc,
-	acpi_namespace_node     *start_node)
-{
-	acpi_status             status;
-	acpi_init_walk_info     info;
-
-
-	FUNCTION_TRACE ("Ds_initialize_objects");
-
-
-	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-		"**** Starting initialization of namespace objects ****\n"));
-	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Parsing Methods:"));
-
-
-	info.method_count   = 0;
-	info.op_region_count = 0;
-	info.object_count   = 0;
-	info.table_desc     = table_desc;
-
+	/* Create and init the internal ACPI object */
 
-	/* Walk entire namespace from the supplied root */
+	obj_desc = acpi_ut_create_internal_object ((acpi_ps_get_opcode_info (op->common.aml_opcode))->object_type);
+	if (!obj_desc) {
+		return_ACPI_STATUS (AE_NO_MEMORY);
+	}
 
-	status = acpi_walk_namespace (ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
-			  acpi_ds_init_one_object, &info, NULL);
+	status = acpi_ds_init_object_from_op (walk_state, op, op->common.aml_opcode, &obj_desc);
 	if (ACPI_FAILURE (status)) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %x\n", status));
+		acpi_ut_remove_reference (obj_desc);
+		return_ACPI_STATUS (status);
 	}
 
-	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
-		"\n%d Control Methods found and parsed (%d nodes total)\n",
-		info.method_count, info.object_count));
-	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-		"%d Control Methods found\n", info.method_count));
-	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-		"%d Op Regions found\n", info.op_region_count));
-
+	*obj_desc_ptr = obj_desc;
 	return_ACPI_STATUS (AE_OK);
 }
 
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_init_object_from_op
+ * FUNCTION:    acpi_ds_build_internal_buffer_obj
  *
- * PARAMETERS:  Op              - Parser op used to init the internal object
- *              Opcode          - AML opcode associated with the object
- *              Obj_desc        - Namespace object to be initialized
+ * PARAMETERS:  walk_state      - Current walk state
+ *              Op              - Parser object to be translated
+ *              buffer_length   - Length of the buffer
+ *              obj_desc_ptr    - Where the ACPI internal object is returned
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Initialize a namespace object from a parser Op and its
- *              associated arguments.  The namespace object is a more compact
- *              representation of the Op and its arguments.
+ * DESCRIPTION: Translate a parser Op package object to the equivalent
+ *              namespace object
  *
  ****************************************************************************/
 
 acpi_status
-acpi_ds_init_object_from_op (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op,
-	u16                     opcode,
-	acpi_operand_object     **ret_obj_desc)
+acpi_ds_build_internal_buffer_obj (
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op,
+	u32                             buffer_length,
+	union acpi_operand_object       **obj_desc_ptr)
 {
-	acpi_status             status;
-	acpi_parse_object       *arg;
-	acpi_parse2_object      *byte_list;
-	acpi_operand_object     *arg_desc;
-	const acpi_opcode_info  *op_info;
-	acpi_operand_object     *obj_desc;
+	union acpi_parse_object         *arg;
+	union acpi_operand_object       *obj_desc;
+	union acpi_parse_object         *byte_list;
+	u32                             byte_list_length = 0;
 
 
-	PROC_NAME ("Ds_init_object_from_op");
+	ACPI_FUNCTION_TRACE ("ds_build_internal_buffer_obj");
 
 
-	obj_desc = *ret_obj_desc;
-	op_info = acpi_ps_get_opcode_info (opcode);
-	if (op_info->class == AML_CLASS_UNKNOWN) {
-		/* Unknown opcode */
-
-		return (AE_TYPE);
+	obj_desc = *obj_desc_ptr;
+	if (obj_desc) {
+		/*
+		 * We are evaluating a Named buffer object "Name (xxxx, Buffer)".
+		 * The buffer object already exists (from the NS node)
+		 */
 	}
+	else {
+		/* Create a new buffer object */
 
-
-	/* Get and prepare the first argument */
-
-	switch (obj_desc->common.type) {
-	case ACPI_TYPE_BUFFER:
-
-		/* First arg is a number */
-
-		acpi_ds_create_operand (walk_state, op->value.arg, 0);
-		arg_desc = walk_state->operands [walk_state->num_operands - 1];
-		acpi_ds_obj_stack_pop (1, walk_state);
-
-		/* Resolve the object (could be an arg or local) */
-
-		status = acpi_ex_resolve_to_value (&arg_desc, walk_state);
-		if (ACPI_FAILURE (status)) {
-			acpi_ut_remove_reference (arg_desc);
-			return (status);
+		obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER);
+		*obj_desc_ptr = obj_desc;
+		if (!obj_desc) {
+			return_ACPI_STATUS (AE_NO_MEMORY);
 		}
+	}
 
-		/* We are expecting a number */
+	/*
+	 * Second arg is the buffer data (optional) byte_list can be either
+	 * individual bytes or a string initializer.  In either case, a
+	 * byte_list appears in the AML.
+	 */
+	arg = op->common.value.arg;         /* skip first arg */
 
-		if (arg_desc->common.type != ACPI_TYPE_INTEGER) {
+	byte_list = arg->named.next;
+	if (byte_list) {
+		if (byte_list->common.aml_opcode != AML_INT_BYTELIST_OP) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Expecting number, got obj: %p type %X\n",
-				arg_desc, arg_desc->common.type));
-			acpi_ut_remove_reference (arg_desc);
+				"Expecting bytelist, got AML opcode %X in op %p\n",
+				byte_list->common.aml_opcode, byte_list));
+
+			acpi_ut_remove_reference (obj_desc);
 			return (AE_TYPE);
 		}
 
-		/* Get the value, delete the internal object */
+		byte_list_length = byte_list->common.value.integer32;
+	}
 
-		obj_desc->buffer.length = (u32) arg_desc->integer.value;
-		acpi_ut_remove_reference (arg_desc);
+	/*
+	 * The buffer length (number of bytes) will be the larger of:
+	 * 1) The specified buffer length and
+	 * 2) The length of the initializer byte list
+	 */
+	obj_desc->buffer.length = buffer_length;
+	if (byte_list_length > buffer_length) {
+		obj_desc->buffer.length = byte_list_length;
+	}
 
-		/* Allocate the buffer */
+	/* Allocate the buffer */
 
-		if (obj_desc->buffer.length == 0) {
-			obj_desc->buffer.pointer = NULL;
-			REPORT_WARNING (("Buffer created with zero length in AML\n"));
-			break;
+	if (obj_desc->buffer.length == 0) {
+		obj_desc->buffer.pointer = NULL;
+		ACPI_REPORT_WARNING (("Buffer created with zero length in AML\n"));
+	}
+	else {
+		obj_desc->buffer.pointer = ACPI_MEM_CALLOCATE (
+				   obj_desc->buffer.length);
+		if (!obj_desc->buffer.pointer) {
+			acpi_ut_delete_object_desc (obj_desc);
+			return_ACPI_STATUS (AE_NO_MEMORY);
 		}
 
-		else {
-			obj_desc->buffer.pointer = ACPI_MEM_CALLOCATE (
-					   obj_desc->buffer.length);
+		/* Initialize buffer from the byte_list (if present) */
 
-			if (!obj_desc->buffer.pointer) {
-				return (AE_NO_MEMORY);
-			}
+		if (byte_list) {
+			ACPI_MEMCPY (obj_desc->buffer.pointer, byte_list->named.data,
+					  byte_list_length);
 		}
+	}
 
-		/*
-		 * Second arg is the buffer data (optional) Byte_list can be either
-		 * individual bytes or a string initializer.
-		 */
-		arg = op->value.arg;         /* skip first arg */
-
-		byte_list = (acpi_parse2_object *) arg->next;
-		if (byte_list) {
-			if (byte_list->opcode != AML_INT_BYTELIST_OP) {
-				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %p\n",
-					byte_list));
-				return (AE_TYPE);
-			}
+	obj_desc->buffer.flags |= AOPOBJ_DATA_VALID;
+	op->common.node = (struct acpi_namespace_node *) obj_desc;
+	return_ACPI_STATUS (AE_OK);
+}
 
-			MEMCPY (obj_desc->buffer.pointer, byte_list->data,
-					obj_desc->buffer.length);
-		}
 
-		break;
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ds_build_internal_package_obj
+ *
+ * PARAMETERS:  walk_state      - Current walk state
+ *              Op              - Parser object to be translated
+ *              package_length  - Number of elements in the package
+ *              obj_desc_ptr    - Where the ACPI internal object is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Translate a parser Op package object to the equivalent
+ *              namespace object
+ *
+ ****************************************************************************/
 
+acpi_status
+acpi_ds_build_internal_package_obj (
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op,
+	u32                             package_length,
+	union acpi_operand_object       **obj_desc_ptr)
+{
+	union acpi_parse_object         *arg;
+	union acpi_parse_object         *parent;
+	union acpi_operand_object       *obj_desc = NULL;
+	u32                             package_list_length;
+	acpi_status                     status = AE_OK;
+	u32                             i;
 
-	case ACPI_TYPE_PACKAGE:
 
-		/*
-		 * When called, an internal package object has already been built and
-		 * is pointed to by Obj_desc. Acpi_ds_build_internal_object builds another
-		 * internal package object, so remove reference to the original so
-		 * that it is deleted.  Error checking is done within the remove
-		 * reference function.
-		 */
-		acpi_ut_remove_reference (obj_desc);
-		status = acpi_ds_build_internal_object (walk_state, op, ret_obj_desc);
-		break;
+	ACPI_FUNCTION_TRACE ("ds_build_internal_package_obj");
 
-	case ACPI_TYPE_INTEGER:
-		obj_desc->integer.value = op->value.integer;
-		break;
 
+	/* Find the parent of a possibly nested package */
 
-	case ACPI_TYPE_STRING:
-		obj_desc->string.pointer = op->value.string;
-		obj_desc->string.length = STRLEN (op->value.string);
+	parent = op->common.parent;
+	while ((parent->common.aml_opcode == AML_PACKAGE_OP)    ||
+		   (parent->common.aml_opcode == AML_VAR_PACKAGE_OP)) {
+		parent = parent->common.parent;
+	}
 
+	obj_desc = *obj_desc_ptr;
+	if (obj_desc) {
 		/*
-		 * The string is contained in the ACPI table, don't ever try
-		 * to delete it
+		 * We are evaluating a Named package object "Name (xxxx, Package)".
+		 * Get the existing package object from the NS node
 		 */
-		obj_desc->common.flags |= AOPOBJ_STATIC_POINTER;
-		break;
-
-
-	case ACPI_TYPE_METHOD:
-		break;
-
-
-	case INTERNAL_TYPE_REFERENCE:
-
-		switch (op_info->type) {
-		case AML_TYPE_LOCAL_VARIABLE:
-
-			/* Split the opcode into a base opcode + offset */
-
-			obj_desc->reference.opcode = AML_LOCAL_OP;
-			obj_desc->reference.offset = opcode - AML_LOCAL_OP;
-			break;
+	}
+	else {
+		obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_PACKAGE);
+		*obj_desc_ptr = obj_desc;
+		if (!obj_desc) {
+			return_ACPI_STATUS (AE_NO_MEMORY);
+		}
 
+		obj_desc->package.node = parent->common.node;
+	}
 
-		case AML_TYPE_METHOD_ARGUMENT:
+	obj_desc->package.count = package_length;
 
-			/* Split the opcode into a base opcode + offset */
+	/* Count the number of items in the package list */
 
-			obj_desc->reference.opcode = AML_ARG_OP;
-			obj_desc->reference.offset = opcode - AML_ARG_OP;
-			break;
+	package_list_length = 0;
+	arg = op->common.value.arg;
+	arg = arg->common.next;
+	while (arg) {
+		package_list_length++;
+		arg = arg->common.next;
+	}
 
+	/*
+	 * The package length (number of elements) will be the greater
+	 * of the specified length and the length of the initializer list
+	 */
+	if (package_list_length > package_length) {
+		obj_desc->package.count = package_list_length;
+	}
 
-		default: /* Constants, Literals, etc.. */
+	/*
+	 * Allocate the pointer array (array of pointers to the
+	 * individual objects). Add an extra pointer slot so
+	 * that the list is always null terminated.
+	 */
+	obj_desc->package.elements = ACPI_MEM_CALLOCATE (
+			 ((acpi_size) obj_desc->package.count + 1) * sizeof (void *));
 
-			if (op->opcode == AML_INT_NAMEPATH_OP) {
-				/* Node was saved in Op */
+	if (!obj_desc->package.elements) {
+		acpi_ut_delete_object_desc (obj_desc);
+		return_ACPI_STATUS (AE_NO_MEMORY);
+	}
 
-				obj_desc->reference.node = op->node;
-			}
+	/*
+	 * Now init the elements of the package
+	 */
+	i = 0;
+	arg = op->common.value.arg;
+	arg = arg->common.next;
+	while (arg) {
+		if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
+			/* Object (package or buffer) is already built */
 
-			obj_desc->reference.opcode = opcode;
-			break;
+			obj_desc->package.elements[i] = ACPI_CAST_PTR (union acpi_operand_object, arg->common.node);
+		}
+		else {
+			status = acpi_ds_build_internal_object (walk_state, arg,
+					  &obj_desc->package.elements[i]);
 		}
 
-		break;
-
-
-	default:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unimplemented data type: %x\n",
-			obj_desc->common.type));
-
-		break;
+		i++;
+		arg = arg->common.next;
 	}
 
-	return (AE_OK);
+	obj_desc->package.flags |= AOPOBJ_DATA_VALID;
+	op->common.node = (struct acpi_namespace_node *) obj_desc;
+	return_ACPI_STATUS (status);
 }
 
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_build_internal_simple_obj
+ * FUNCTION:    acpi_ds_create_node
  *
- * PARAMETERS:  Op              - Parser object to be translated
- *              Obj_desc_ptr    - Where the ACPI internal object is returned
+ * PARAMETERS:  walk_state      - Current walk state
+ *              Node            - NS Node to be initialized
+ *              Op              - Parser object to be translated
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Translate a parser Op object to the equivalent namespace object
- *              Simple objects are any objects other than a package object!
+ * DESCRIPTION: Create the object to be associated with a namespace node
  *
  ****************************************************************************/
 
-static acpi_status
-acpi_ds_build_internal_simple_obj (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op,
-	acpi_operand_object     **obj_desc_ptr)
+acpi_status
+acpi_ds_create_node (
+	struct acpi_walk_state          *walk_state,
+	struct acpi_namespace_node      *node,
+	union acpi_parse_object         *op)
 {
-	acpi_operand_object     *obj_desc;
-	acpi_object_type8       type;
-	acpi_status             status;
-	u32                     length;
-	char                    *name;
+	acpi_status                     status;
+	union acpi_operand_object       *obj_desc;
 
 
-	FUNCTION_TRACE ("Ds_build_internal_simple_obj");
-
-
-	if (op->opcode == AML_INT_NAMEPATH_OP) {
-		/*
-		 * This is an object reference.  If The name was
-		 * previously looked up in the NS, it is stored in this op.
-		 * Otherwise, go ahead and look it up now
-		 */
-		if (!op->node) {
-			status = acpi_ns_lookup (walk_state->scope_info,
-					  op->value.string, ACPI_TYPE_ANY,
-					  IMODE_EXECUTE,
-					  NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE,
-					  NULL,
-					  (acpi_namespace_node **)&(op->node));
+	ACPI_FUNCTION_TRACE_PTR ("ds_create_node", op);
 
-			if (ACPI_FAILURE (status)) {
-				if (status == AE_NOT_FOUND) {
-					name = NULL;
-					acpi_ns_externalize_name (ACPI_UINT32_MAX, op->value.string, &length, &name);
-
-					if (name) {
-						REPORT_WARNING (("Reference %s at AML %X not found\n",
-								 name, op->aml_offset));
-						ACPI_MEM_FREE (name);
-					}
-
-					else {
-						REPORT_WARNING (("Reference %s at AML %X not found\n",
-								   op->value.string, op->aml_offset));
-					}
-
-					*obj_desc_ptr = NULL;
-				}
-
-				else {
-					return_ACPI_STATUS (status);
-				}
-			}
-		}
 
-		/*
-		 * The reference will be a Reference
-		 * TBD: [Restructure] unless we really need a separate
-		 *  type of INTERNAL_TYPE_REFERENCE change
-		 *  Acpi_ds_map_opcode_to_data_type to handle this case
-		 */
-		type = INTERNAL_TYPE_REFERENCE;
-	}
-	else {
-		type = acpi_ds_map_opcode_to_data_type (op->opcode, NULL);
+	/*
+	 * Because of the execution pass through the non-control-method
+	 * parts of the table, we can arrive here twice.  Only init
+	 * the named object node the first time through
+	 */
+	if (acpi_ns_get_attached_object (node)) {
+		return_ACPI_STATUS (AE_OK);
 	}
 
+	if (!op->common.value.arg) {
+		/* No arguments, there is nothing to do */
 
-	/* Create and init the internal ACPI object */
-
-	obj_desc = acpi_ut_create_internal_object (type);
-	if (!obj_desc) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+		return_ACPI_STATUS (AE_OK);
 	}
 
-	status = acpi_ds_init_object_from_op (walk_state, op, op->opcode, &obj_desc);
+	/* Build an internal object for the argument(s) */
+
+	status = acpi_ds_build_internal_object (walk_state, op->common.value.arg, &obj_desc);
 	if (ACPI_FAILURE (status)) {
-		acpi_ut_remove_reference (obj_desc);
 		return_ACPI_STATUS (status);
 	}
 
-	*obj_desc_ptr = obj_desc;
+	/* Re-type the object according to it's argument */
 
-	return_ACPI_STATUS (AE_OK);
+	node->type = ACPI_GET_OBJECT_TYPE (obj_desc);
+
+	/* Attach obj to node */
+
+	status = acpi_ns_attach_object (node, obj_desc, node->type);
+
+	/* Remove local reference to the object */
+
+	acpi_ut_remove_reference (obj_desc);
+	return_ACPI_STATUS (status);
 }
 
+#endif /* ACPI_NO_METHOD_EXECUTION */
+
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_build_internal_package_obj
+ * FUNCTION:    acpi_ds_init_object_from_op
  *
- * PARAMETERS:  Op              - Parser object to be translated
- *              Obj_desc_ptr    - Where the ACPI internal object is returned
+ * PARAMETERS:  walk_state      - Current walk state
+ *              Op              - Parser op used to init the internal object
+ *              Opcode          - AML opcode associated with the object
+ *              ret_obj_desc    - Namespace object to be initialized
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Translate a parser Op package object to the equivalent
- *              namespace object
+ * DESCRIPTION: Initialize a namespace object from a parser Op and its
+ *              associated arguments.  The namespace object is a more compact
+ *              representation of the Op and its arguments.
  *
  ****************************************************************************/
 
 acpi_status
-acpi_ds_build_internal_package_obj (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op,
-	acpi_operand_object     **obj_desc_ptr)
+acpi_ds_init_object_from_op (
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op,
+	u16                             opcode,
+	union acpi_operand_object       **ret_obj_desc)
 {
-	acpi_parse_object       *arg;
-	acpi_operand_object     *obj_desc;
-	acpi_status             status = AE_OK;
+	const struct acpi_opcode_info   *op_info;
+	union acpi_operand_object       *obj_desc;
+	acpi_status                     status = AE_OK;
 
 
-	FUNCTION_TRACE ("Ds_build_internal_package_obj");
+	ACPI_FUNCTION_TRACE ("ds_init_object_from_op");
 
 
-	obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_PACKAGE);
-	*obj_desc_ptr = obj_desc;
-	if (!obj_desc) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+	obj_desc = *ret_obj_desc;
+	op_info = acpi_ps_get_opcode_info (opcode);
+	if (op_info->class == AML_CLASS_UNKNOWN) {
+		/* Unknown opcode */
+
+		return_ACPI_STATUS (AE_TYPE);
 	}
 
-	if (op->opcode == AML_VAR_PACKAGE_OP) {
+	/* Perform per-object initialization */
+
+	switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
+	case ACPI_TYPE_BUFFER:
+
 		/*
-		 * Variable length package parameters are evaluated JIT
+		 * Defer evaluation of Buffer term_arg operand
 		 */
-		return_ACPI_STATUS (AE_OK);
-	}
+		obj_desc->buffer.node     = (struct acpi_namespace_node *) walk_state->operands[0];
+		obj_desc->buffer.aml_start = op->named.data;
+		obj_desc->buffer.aml_length = op->named.length;
+		break;
 
-	/* The first argument must be the package length */
 
-	arg = op->value.arg;
-	obj_desc->package.count = arg->value.integer32;
+	case ACPI_TYPE_PACKAGE:
 
-	/*
-	 * Allocate the array of pointers (ptrs to the
-	 * individual objects) Add an extra pointer slot so
-	 * that the list is always null terminated.
-	 */
-	obj_desc->package.elements = ACPI_MEM_CALLOCATE (
-			 (obj_desc->package.count + 1) * sizeof (void *));
+		/*
+		 * Defer evaluation of Package term_arg operand
+		 */
+		obj_desc->package.node     = (struct acpi_namespace_node *) walk_state->operands[0];
+		obj_desc->package.aml_start = op->named.data;
+		obj_desc->package.aml_length = op->named.length;
+		break;
 
-	if (!obj_desc->package.elements) {
-		acpi_ut_delete_object_desc (obj_desc);
-		return_ACPI_STATUS (AE_NO_MEMORY);
-	}
 
-	obj_desc->package.next_element = obj_desc->package.elements;
+	case ACPI_TYPE_INTEGER:
 
-	/*
-	 * Now init the elements of the package
-	 */
-	arg = arg->next;
-	while (arg) {
-		if (arg->opcode == AML_PACKAGE_OP) {
-			status = acpi_ds_build_internal_package_obj (walk_state, arg,
-					  obj_desc->package.next_element);
-		}
+		switch (op_info->type) {
+		case AML_TYPE_CONSTANT:
+			/*
+			 * Resolve AML Constants here - AND ONLY HERE!
+			 * All constants are integers.
+			 * We mark the integer with a flag that indicates that it started life
+			 * as a constant -- so that stores to constants will perform as expected (noop).
+			 * (zero_op is used as a placeholder for optional target operands.)
+			 */
+			obj_desc->common.flags = AOPOBJ_AML_CONSTANT;
 
-		else {
-			status = acpi_ds_build_internal_simple_obj (walk_state, arg,
-					  obj_desc->package.next_element);
-		}
+			switch (opcode) {
+			case AML_ZERO_OP:
 
-		obj_desc->package.next_element++;
-		arg = arg->next;
-	}
+				obj_desc->integer.value = 0;
+				break;
 
-	obj_desc->package.flags |= AOPOBJ_DATA_VALID;
-	return_ACPI_STATUS (status);
-}
+			case AML_ONE_OP:
 
+				obj_desc->integer.value = 1;
+				break;
 
-/*****************************************************************************
- *
- * FUNCTION:    Acpi_ds_build_internal_object
- *
- * PARAMETERS:  Op              - Parser object to be translated
- *              Obj_desc_ptr    - Where the ACPI internal object is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Translate a parser Op object to the equivalent namespace
- *              object
- *
- ****************************************************************************/
+			case AML_ONES_OP:
 
-acpi_status
-acpi_ds_build_internal_object (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op,
-	acpi_operand_object     **obj_desc_ptr)
-{
-	acpi_status             status;
+				obj_desc->integer.value = ACPI_INTEGER_MAX;
+
+				/* Truncate value if we are executing from a 32-bit ACPI table */
 
+#ifndef ACPI_NO_METHOD_EXECUTION
+				acpi_ex_truncate_for32bit_table (obj_desc);
+#endif
+				break;
+
+			case AML_REVISION_OP:
+
+				obj_desc->integer.value = ACPI_CA_SUPPORT_LEVEL;
+				break;
+
+			default:
+
+				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown constant opcode %X\n", opcode));
+				status = AE_AML_OPERAND_TYPE;
+				break;
+			}
+			break;
 
-	switch (op->opcode) {
-	case AML_PACKAGE_OP:
-	case AML_VAR_PACKAGE_OP:
 
-		status = acpi_ds_build_internal_package_obj (walk_state, op, obj_desc_ptr);
+		case AML_TYPE_LITERAL:
+
+			obj_desc->integer.value = op->common.value.integer;
+			break;
+
+
+		default:
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Integer type %X\n", op_info->type));
+			status = AE_AML_OPERAND_TYPE;
+			break;
+		}
 		break;
 
 
-	default:
+	case ACPI_TYPE_STRING:
+
+		obj_desc->string.pointer = op->common.value.string;
+		obj_desc->string.length = (u32) ACPI_STRLEN (op->common.value.string);
 
-		status = acpi_ds_build_internal_simple_obj (walk_state, op, obj_desc_ptr);
+		/*
+		 * The string is contained in the ACPI table, don't ever try
+		 * to delete it
+		 */
+		obj_desc->common.flags |= AOPOBJ_STATIC_POINTER;
 		break;
-	}
 
-	return (status);
-}
 
+	case ACPI_TYPE_METHOD:
+		break;
 
-/*****************************************************************************
- *
- * FUNCTION:    Acpi_ds_create_node
- *
- * PARAMETERS:  Op              - Parser object to be translated
- *              Obj_desc_ptr    - Where the ACPI internal object is returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION:
- *
- ****************************************************************************/
 
-acpi_status
-acpi_ds_create_node (
-	acpi_walk_state         *walk_state,
-	acpi_namespace_node     *node,
-	acpi_parse_object       *op)
-{
-	acpi_status             status;
-	acpi_operand_object     *obj_desc;
+	case ACPI_TYPE_LOCAL_REFERENCE:
 
+		switch (op_info->type) {
+		case AML_TYPE_LOCAL_VARIABLE:
 
-	FUNCTION_TRACE_PTR ("Ds_create_node", op);
+			/* Split the opcode into a base opcode + offset */
 
+			obj_desc->reference.opcode = AML_LOCAL_OP;
+			obj_desc->reference.offset = opcode - AML_LOCAL_OP;
 
-	/*
-	 * Because of the execution pass through the non-control-method
-	 * parts of the table, we can arrive here twice.  Only init
-	 * the named object node the first time through
-	 */
-	if (node->object) {
-		return_ACPI_STATUS (AE_OK);
-	}
+#ifndef ACPI_NO_METHOD_EXECUTION
+			status = acpi_ds_method_data_get_node (AML_LOCAL_OP, obj_desc->reference.offset,
+					 walk_state, (struct acpi_namespace_node **) &obj_desc->reference.object);
+#endif
+			break;
 
-	if (!op->value.arg) {
-		/* No arguments, there is nothing to do */
 
-		return_ACPI_STATUS (AE_OK);
-	}
+		case AML_TYPE_METHOD_ARGUMENT:
 
-	/* Build an internal object for the argument(s) */
+			/* Split the opcode into a base opcode + offset */
 
-	status = acpi_ds_build_internal_object (walk_state, op->value.arg, &obj_desc);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+			obj_desc->reference.opcode = AML_ARG_OP;
+			obj_desc->reference.offset = opcode - AML_ARG_OP;
+			break;
 
-	/* Re-type the object according to it's argument */
+		default: /* Other literals, etc.. */
 
-	node->type = obj_desc->common.type;
+			if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
+				/* Node was saved in Op */
 
-	/* Init obj */
+				obj_desc->reference.node = op->common.node;
+			}
 
-	status = acpi_ns_attach_object (node, obj_desc, (u8) node->type);
+			obj_desc->reference.opcode = opcode;
+			break;
+		}
+		break;
 
-	/* Remove local reference to the object */
 
-	acpi_ut_remove_reference (obj_desc);
+	default:
+
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unimplemented data type: %X\n",
+			ACPI_GET_OBJECT_TYPE (obj_desc)));
+
+		status = AE_AML_OPERAND_TYPE;
+		break;
+	}
+
 	return_ACPI_STATUS (status);
 }
 
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
--- a/drivers/acpi/dispatcher/dsopcode.c	2003-01-25 01:25:24.000000000 -0800
+++ b/drivers/acpi/dispatcher/dsopcode.c	2003-01-25 01:30:15.000000000 -0800
@@ -2,12 +2,11 @@
  *
  * Module Name: dsopcode - Dispatcher Op Region support and handling of
  *                         "control" opcodes
- *              $Revision: 56 $
  *
  *****************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -32,96 +31,70 @@
 #include "acinterp.h"
 #include "acnamesp.h"
 #include "acevents.h"
-#include "actables.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dsopcode")
+	 ACPI_MODULE_NAME    ("dsopcode")
 
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_get_buffer_field_arguments
+ * FUNCTION:    acpi_ds_execute_arguments
  *
- * PARAMETERS:  Obj_desc        - A valid Buffer_field object
+ * PARAMETERS:  Node                - Parent NS node
+ *              aml_length          - Length of executable AML
+ *              aml_start           - Pointer to the AML
  *
  * RETURN:      Status.
  *
- * DESCRIPTION: Get Buffer_field Buffer and Index. This implements the late
- *              evaluation of these field attributes.
+ * DESCRIPTION: Late execution of region or field arguments
  *
  ****************************************************************************/
 
 acpi_status
-acpi_ds_get_buffer_field_arguments (
-	acpi_operand_object     *obj_desc)
+acpi_ds_execute_arguments (
+	struct acpi_namespace_node      *node,
+	struct acpi_namespace_node      *scope_node,
+	u32                             aml_length,
+	u8                              *aml_start)
 {
-	acpi_operand_object     *extra_desc;
-	acpi_namespace_node     *node;
-	acpi_parse_object       *op;
-	acpi_parse_object       *field_op;
-	acpi_status             status;
-	acpi_table_desc         *table_desc;
-	acpi_walk_state         *walk_state;
-
+	acpi_status                     status;
+	union acpi_parse_object         *op;
+	struct acpi_walk_state          *walk_state;
+	union acpi_parse_object         *arg;
 
-	FUNCTION_TRACE_PTR ("Ds_get_buffer_field_arguments", obj_desc);
 
-
-	if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
-		return_ACPI_STATUS (AE_OK);
-	}
-
-
-	/* Get the AML pointer (method object) and Buffer_field node */
-
-	extra_desc = obj_desc->buffer_field.extra;
-	node = obj_desc->buffer_field.node;
-
-	DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Field]"));
-	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Buffer_field JIT Init\n",
-		(char*)&node->name));
+	ACPI_FUNCTION_TRACE ("acpi_ds_execute_arguments");
 
 
 	/*
-	 * Allocate a new parser op to be the root of the parsed
-	 * Op_region tree
+	 * Allocate a new parser op to be the root of the parsed tree
 	 */
-	op = acpi_ps_alloc_op (AML_SCOPE_OP);
+	op = acpi_ps_alloc_op (AML_INT_EVAL_SUBTREE_OP);
 	if (!op) {
-		return (AE_NO_MEMORY);
+		return_ACPI_STATUS (AE_NO_MEMORY);
 	}
 
-	/* Save the Node for use in Acpi_ps_parse_aml */
-
-	op->node = acpi_ns_get_parent_object (node);
+	/* Save the Node for use in acpi_ps_parse_aml */
 
-	/* Get a handle to the parent ACPI table */
-
-	status = acpi_tb_handle_to_object (node->owner_id, &table_desc);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+	op->common.node = scope_node;
 
 	/* Create and initialize a new parser state */
 
-	walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
-			   NULL, NULL, NULL);
+	walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, NULL);
 	if (!walk_state) {
 		return_ACPI_STATUS (AE_NO_MEMORY);
 	}
 
-	status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
-			  extra_desc->extra.aml_length, NULL, NULL, 1);
+	status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start,
+			  aml_length, NULL, NULL, 1);
 	if (ACPI_FAILURE (status)) {
-		/* TBD: delete walk state */
+		acpi_ds_delete_walk_state (walk_state);
 		return_ACPI_STATUS (status);
 	}
 
-	/* TBD: No Walk flags?? */
-
-	walk_state->parse_flags = 0;
+	walk_state->parse_flags = ACPI_PARSE_DEFERRED_OP;
 
-	/* Pass1: Parse the entire Buffer_field declaration */
+	/* Pass1: Parse the entire declaration */
 
 	status = acpi_ps_parse_aml (walk_state);
 	if (ACPI_FAILURE (status)) {
@@ -129,204 +102,250 @@
 		return_ACPI_STATUS (status);
 	}
 
-	/* Get and init the actual Field_unit Op created above */
-
-	field_op = op->value.arg;
-	op->node = node;
-
+	/* Get and init the Op created above */
 
-	field_op = op->value.arg;
-	field_op->node = node;
+	arg = op->common.value.arg;
+	op->common.node = node;
+	arg->common.node = node;
 	acpi_ps_delete_parse_tree (op);
 
-	/* Evaluate the address and length arguments for the Op_region */
+	/* Evaluate the address and length arguments for the Buffer Field */
 
-	op = acpi_ps_alloc_op (AML_SCOPE_OP);
+	op = acpi_ps_alloc_op (AML_INT_EVAL_SUBTREE_OP);
 	if (!op) {
-		return (AE_NO_MEMORY);
+		return_ACPI_STATUS (AE_NO_MEMORY);
 	}
 
-	op->node = acpi_ns_get_parent_object (node);
+	op->common.node = scope_node;
 
 	/* Create and initialize a new parser state */
 
-	walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
-			   NULL, NULL, NULL);
+	walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, NULL);
 	if (!walk_state) {
 		return_ACPI_STATUS (AE_NO_MEMORY);
 	}
 
-	status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
-			  extra_desc->extra.aml_length, NULL, NULL, 3);
+	status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start,
+			  aml_length, NULL, NULL, 3);
 	if (ACPI_FAILURE (status)) {
-		/* TBD: delete walk state */
+		acpi_ds_delete_walk_state (walk_state);
 		return_ACPI_STATUS (status);
 	}
 
 	status = acpi_ps_parse_aml (walk_state);
 	acpi_ps_delete_parse_tree (op);
-
-	/*
-	 * The pseudo-method object is no longer needed since the region is
-	 * now initialized
-	 */
-	acpi_ut_remove_reference (obj_desc->buffer_field.extra);
-	obj_desc->buffer_field.extra = NULL;
-
 	return_ACPI_STATUS (status);
 }
 
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_get_region_arguments
+ * FUNCTION:    acpi_ds_get_buffer_field_arguments
  *
- * PARAMETERS:  Obj_desc        - A valid region object
+ * PARAMETERS:  obj_desc        - A valid buffer_field object
  *
  * RETURN:      Status.
  *
- * DESCRIPTION: Get region address and length.  This implements the late
- *              evaluation of these region attributes.
+ * DESCRIPTION: Get buffer_field Buffer and Index. This implements the late
+ *              evaluation of these field attributes.
  *
  ****************************************************************************/
 
 acpi_status
-acpi_ds_get_region_arguments (
-	acpi_operand_object     *obj_desc)
+acpi_ds_get_buffer_field_arguments (
+	union acpi_operand_object       *obj_desc)
 {
-	acpi_operand_object     *extra_desc = NULL;
-	acpi_namespace_node     *node;
-	acpi_parse_object       *op;
-	acpi_parse_object       *region_op;
-	acpi_status             status;
-	acpi_table_desc         *table_desc;
-	acpi_walk_state         *walk_state;
+	union acpi_operand_object       *extra_desc;
+	struct acpi_namespace_node      *node;
+	acpi_status                     status;
 
 
-	FUNCTION_TRACE_PTR ("Ds_get_region_arguments", obj_desc);
+	ACPI_FUNCTION_TRACE_PTR ("ds_get_buffer_field_arguments", obj_desc);
 
 
-	if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
+	if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
 		return_ACPI_STATUS (AE_OK);
 	}
 
+	/* Get the AML pointer (method object) and buffer_field node */
 
-	/* Get the AML pointer (method object) and region node */
+	extra_desc = acpi_ns_get_secondary_object (obj_desc);
+	node = obj_desc->buffer_field.node;
 
-	extra_desc = obj_desc->region.extra;
-	node = obj_desc->region.node;
+	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_BUFFER_FIELD, node, NULL));
+	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] buffer_field JIT Init\n",
+		node->name.ascii));
 
-	DEBUG_EXEC(acpi_ut_display_init_pathname (node, " [Operation Region]"));
+	/* Execute the AML code for the term_arg arguments */
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] Op_region Init at AML %p\n",
-		(char*)&node->name, extra_desc->extra.aml_start));
+	status = acpi_ds_execute_arguments (node, acpi_ns_get_parent_node (node),
+			 extra_desc->extra.aml_length, extra_desc->extra.aml_start);
+	return_ACPI_STATUS (status);
+}
 
-	/*
-	 * Allocate a new parser op to be the root of the parsed
-	 * Op_region tree
-	 */
-	op = acpi_ps_alloc_op (AML_SCOPE_OP);
-	if (!op) {
-		return (AE_NO_MEMORY);
-	}
 
-	/* Save the Node for use in Acpi_ps_parse_aml */
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ds_get_buffer_arguments
+ *
+ * PARAMETERS:  obj_desc        - A valid Bufferobject
+ *
+ * RETURN:      Status.
+ *
+ * DESCRIPTION: Get Buffer length and initializer byte list.  This implements
+ *              the late evaluation of these attributes.
+ *
+ ****************************************************************************/
 
-	op->node = acpi_ns_get_parent_object (node);
+acpi_status
+acpi_ds_get_buffer_arguments (
+	union acpi_operand_object       *obj_desc)
+{
+	struct acpi_namespace_node      *node;
+	acpi_status                     status;
 
-	/* Get a handle to the parent ACPI table */
 
-	status = acpi_tb_handle_to_object (node->owner_id, &table_desc);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+	ACPI_FUNCTION_TRACE_PTR ("ds_get_buffer_arguments", obj_desc);
 
-	/* Create and initialize a new parser state */
 
-	walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
-			   op, NULL, NULL);
-	if (!walk_state) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+	if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
+		return_ACPI_STATUS (AE_OK);
 	}
 
-	status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
-			  extra_desc->extra.aml_length, NULL, NULL, 1);
-	if (ACPI_FAILURE (status)) {
-		/* TBD: delete walk state */
-		return_ACPI_STATUS (status);
+	/* Get the Buffer node */
+
+	node = obj_desc->buffer.node;
+	if (!node) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+				"No pointer back to NS node in buffer %p\n", obj_desc));
+		return_ACPI_STATUS (AE_AML_INTERNAL);
 	}
 
-	/* TBD: No Walk flags?? */
+	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer JIT Init\n"));
 
-	walk_state->parse_flags = 0;
+	/* Execute the AML code for the term_arg arguments */
 
-	/* Parse the entire Op_region declaration, creating a parse tree */
+	status = acpi_ds_execute_arguments (node, node,
+			 obj_desc->buffer.aml_length, obj_desc->buffer.aml_start);
+	return_ACPI_STATUS (status);
+}
 
-	status = acpi_ps_parse_aml (walk_state);
-	if (ACPI_FAILURE (status)) {
-		acpi_ps_delete_parse_tree (op);
-		return_ACPI_STATUS (status);
-	}
 
-	/* Get and init the actual Region_op created above */
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ds_get_package_arguments
+ *
+ * PARAMETERS:  obj_desc        - A valid Packageobject
+ *
+ * RETURN:      Status.
+ *
+ * DESCRIPTION: Get Package length and initializer byte list.  This implements
+ *              the late evaluation of these attributes.
+ *
+ ****************************************************************************/
 
-	region_op = op->value.arg;
-	op->node = node;
+acpi_status
+acpi_ds_get_package_arguments (
+	union acpi_operand_object       *obj_desc)
+{
+	struct acpi_namespace_node      *node;
+	acpi_status                     status;
 
 
-	region_op = op->value.arg;
-	region_op->node = node;
-	acpi_ps_delete_parse_tree (op);
+	ACPI_FUNCTION_TRACE_PTR ("ds_get_package_arguments", obj_desc);
 
-	/* Evaluate the address and length arguments for the Op_region */
 
-	op = acpi_ps_alloc_op (AML_SCOPE_OP);
-	if (!op) {
-		return (AE_NO_MEMORY);
+	if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
+		return_ACPI_STATUS (AE_OK);
 	}
 
-	op->node = acpi_ns_get_parent_object (node);
+	/* Get the Package node */
 
-	/* Create and initialize a new parser state */
+	node = obj_desc->package.node;
+	if (!node) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+				"No pointer back to NS node in package %p\n", obj_desc));
+		return_ACPI_STATUS (AE_AML_INTERNAL);
+	}
 
-	walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT,
-			   op, NULL, NULL);
-	if (!walk_state) {
-		return_ACPI_STATUS (AE_NO_MEMORY);
+	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package JIT Init\n"));
+
+	/* Execute the AML code for the term_arg arguments */
+
+	status = acpi_ds_execute_arguments (node, node,
+			 obj_desc->package.aml_length, obj_desc->package.aml_start);
+	return_ACPI_STATUS (status);
+}
+
+
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ds_get_region_arguments
+ *
+ * PARAMETERS:  obj_desc        - A valid region object
+ *
+ * RETURN:      Status.
+ *
+ * DESCRIPTION: Get region address and length.  This implements the late
+ *              evaluation of these region attributes.
+ *
+ ****************************************************************************/
+
+acpi_status
+acpi_ds_get_region_arguments (
+	union acpi_operand_object       *obj_desc)
+{
+	struct acpi_namespace_node      *node;
+	acpi_status                     status;
+	union acpi_operand_object       *extra_desc;
+
+
+	ACPI_FUNCTION_TRACE_PTR ("ds_get_region_arguments", obj_desc);
+
+
+	if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
+		return_ACPI_STATUS (AE_OK);
 	}
 
-	status = acpi_ds_init_aml_walk (walk_state, op, NULL, extra_desc->extra.aml_start,
-			  extra_desc->extra.aml_length, NULL, NULL, 3);
-	if (ACPI_FAILURE (status)) {
-		/* TBD: delete walk state */
-		return_ACPI_STATUS (status);
+	extra_desc = acpi_ns_get_secondary_object (obj_desc);
+	if (!extra_desc) {
+		return_ACPI_STATUS (AE_NOT_EXIST);
 	}
 
-	status = acpi_ps_parse_aml (walk_state);
-	acpi_ps_delete_parse_tree (op);
+	/* Get the Region node */
+
+	node = obj_desc->region.node;
 
+	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_REGION, node, NULL));
+
+	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] op_region Init at AML %p\n",
+		node->name.ascii, extra_desc->extra.aml_start));
+
+
+	status = acpi_ds_execute_arguments (node, acpi_ns_get_parent_node (node),
+			 extra_desc->extra.aml_length, extra_desc->extra.aml_start);
 	return_ACPI_STATUS (status);
 }
 
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_initialize_region
+ * FUNCTION:    acpi_ds_initialize_region
  *
  * PARAMETERS:  Op              - A valid region Op object
  *
  * RETURN:      Status
  *
- * DESCRIPTION:
+ * DESCRIPTION: Front end to ev_initialize_region
  *
  ****************************************************************************/
 
 acpi_status
 acpi_ds_initialize_region (
-	acpi_handle             obj_handle)
+	acpi_handle                     obj_handle)
 {
-	acpi_operand_object     *obj_desc;
-	acpi_status             status;
+	union acpi_operand_object       *obj_desc;
+	acpi_status                     status;
 
 
 	obj_desc = acpi_ns_get_attached_object (obj_handle);
@@ -334,301 +353,276 @@
 	/* Namespace is NOT locked */
 
 	status = acpi_ev_initialize_region (obj_desc, FALSE);
-
 	return (status);
 }
 
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_eval_buffer_field_operands
+ * FUNCTION:    acpi_ds_init_buffer_field
  *
- * PARAMETERS:  Op              - A valid Buffer_field Op object
+ * PARAMETERS:  aml_opcode      - create_xxx_field
+ *              obj_desc        - buffer_field object
+ *              buffer_desc     - Host Buffer
+ *              offset_desc     - Offset into buffer
+ *              Length          - Length of field (CREATE_FIELD_OP only)
+ *              Result          - Where to store the result
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Get Buffer_field Buffer and Index
- *              Called from Acpi_ds_exec_end_op during Buffer_field parse tree walk
- *
- * ACPI SPECIFICATION REFERENCES:
- *  Each of the Buffer Field opcodes is defined as specified in in-line
- *  comments below. For each one, use the following definitions.
- *
- *  Def_bit_field   :=  Bit_field_op    Src_buf Bit_idx Destination
- *  Def_byte_field  :=  Byte_field_op   Src_buf Byte_idx Destination
- *  Def_create_field := Create_field_op Src_buf Bit_idx Num_bits Name_string
- *  Def_dWord_field :=  DWord_field_op  Src_buf Byte_idx Destination
- *  Def_word_field  :=  Word_field_op   Src_buf Byte_idx Destination
- *  Bit_index       :=  Term_arg=>Integer
- *  Byte_index      :=  Term_arg=>Integer
- *  Destination     :=  Name_string
- *  Num_bits        :=  Term_arg=>Integer
- *  Source_buf      :=  Term_arg=>Buffer
+ * DESCRIPTION: Perform actual initialization of a buffer field
  *
  ****************************************************************************/
 
 acpi_status
-acpi_ds_eval_buffer_field_operands (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
+acpi_ds_init_buffer_field (
+	u16                             aml_opcode,
+	union acpi_operand_object       *obj_desc,
+	union acpi_operand_object       *buffer_desc,
+	union acpi_operand_object       *offset_desc,
+	union acpi_operand_object       *length_desc,
+	union acpi_operand_object       *result_desc)
 {
-	acpi_status             status;
-	acpi_operand_object     *obj_desc;
-	acpi_namespace_node     *node;
-	acpi_parse_object       *next_op;
-	u32                     offset;
-	u32                     bit_offset;
-	u32                     bit_count;
-	u8                      field_flags;
-	acpi_operand_object     *res_desc = NULL;
-	acpi_operand_object     *cnt_desc = NULL;
-	acpi_operand_object     *off_desc = NULL;
-	acpi_operand_object     *src_desc = NULL;
-
-
-	FUNCTION_TRACE_PTR ("Ds_eval_buffer_field_operands", op);
-
-
-	/*
-	 * This is where we evaluate the address and length fields of the
-	 * Create_xxx_field declaration
-	 */
-	node =  op->node;
-
-	/* Next_op points to the op that holds the Buffer */
-
-	next_op = op->value.arg;
-
-	/* Acpi_evaluate/create the address and length operands */
-
-	status = acpi_ds_create_operands (walk_state, next_op);
-	if (ACPI_FAILURE (status)) {
-		return_ACPI_STATUS (status);
-	}
+	u32                             offset;
+	u32                             bit_offset;
+	u32                             bit_count;
+	u8                              field_flags;
+	acpi_status                     status;
 
-	obj_desc = acpi_ns_get_attached_object (node);
-	if (!obj_desc) {
-		return_ACPI_STATUS (AE_NOT_EXIST);
-	}
 
+	ACPI_FUNCTION_TRACE_PTR ("ds_init_buffer_field", obj_desc);
 
-	/* Resolve the operands */
 
-	status = acpi_ex_resolve_operands (op->opcode, WALK_OPERANDS, walk_state);
-	DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, acpi_ps_get_opcode_name (op->opcode),
-			  walk_state->num_operands, "after Acpi_ex_resolve_operands");
+	/* Host object must be a Buffer */
 
-	if (ACPI_FAILURE (status)) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) (%X)\n",
-			acpi_ps_get_opcode_name (op->opcode), status));
+	if (ACPI_GET_OBJECT_TYPE (buffer_desc) != ACPI_TYPE_BUFFER) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Target of Create Field is not a Buffer object - %s\n",
+			acpi_ut_get_object_type_name (buffer_desc)));
 
+		status = AE_AML_OPERAND_TYPE;
 		goto cleanup;
 	}
 
-	/* Get the operands */
-
-	if (AML_CREATE_FIELD_OP == op->opcode) {
-		res_desc = walk_state->operands[3];
-		cnt_desc = walk_state->operands[2];
-	}
-	else {
-		res_desc = walk_state->operands[2];
-	}
-
-	off_desc = walk_state->operands[1];
-	src_desc = walk_state->operands[0];
-
-
-	offset = (u32) off_desc->integer.value;
-
 	/*
-	 * If Res_desc is a Name, it will be a direct name pointer after
-	 * Acpi_ex_resolve_operands()
+	 * The last parameter to all of these opcodes (result_desc) started
+	 * out as a name_string, and should therefore now be a NS node
+	 * after resolution in acpi_ex_resolve_operands().
 	 */
-	if (!VALID_DESCRIPTOR_TYPE (res_desc, ACPI_DESC_TYPE_NAMED)) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a Node\n",
-			acpi_ps_get_opcode_name (op->opcode)));
+	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)));
 
 		status = AE_AML_OPERAND_TYPE;
 		goto cleanup;
 	}
 
+	offset = (u32) offset_desc->integer.value;
+
 	/*
 	 * Setup the Bit offsets and counts, according to the opcode
 	 */
-	switch (op->opcode) {
-
-	/* Def_create_field */
-
+	switch (aml_opcode) {
 	case AML_CREATE_FIELD_OP:
 
 		/* Offset is in bits, count is in bits */
 
-		bit_offset  = offset;
-		bit_count   = (u32) cnt_desc->integer.value;
-		field_flags = ACCESS_BYTE_ACC;
+		bit_offset = offset;
+		bit_count  = (u32) length_desc->integer.value;
+		field_flags = AML_FIELD_ACCESS_BYTE;
 		break;
 
-
-	/* Def_create_bit_field */
-
 	case AML_CREATE_BIT_FIELD_OP:
 
 		/* Offset is in bits, Field is one bit */
 
-		bit_offset  = offset;
-		bit_count   = 1;
-		field_flags = ACCESS_BYTE_ACC;
+		bit_offset = offset;
+		bit_count  = 1;
+		field_flags = AML_FIELD_ACCESS_BYTE;
 		break;
 
-
-	/* Def_create_byte_field */
-
 	case AML_CREATE_BYTE_FIELD_OP:
 
 		/* Offset is in bytes, field is one byte */
 
-		bit_offset  = 8 * offset;
-		bit_count   = 8;
-		field_flags = ACCESS_BYTE_ACC;
+		bit_offset = 8 * offset;
+		bit_count  = 8;
+		field_flags = AML_FIELD_ACCESS_BYTE;
 		break;
 
-
-	/* Def_create_word_field */
-
 	case AML_CREATE_WORD_FIELD_OP:
 
 		/* Offset is in bytes, field is one word */
 
-		bit_offset  = 8 * offset;
-		bit_count   = 16;
-		field_flags = ACCESS_WORD_ACC;
+		bit_offset = 8 * offset;
+		bit_count  = 16;
+		field_flags = AML_FIELD_ACCESS_WORD;
 		break;
 
-
-	/* Def_create_dWord_field */
-
 	case AML_CREATE_DWORD_FIELD_OP:
 
 		/* Offset is in bytes, field is one dword */
 
-		bit_offset  = 8 * offset;
-		bit_count   = 32;
-		field_flags = ACCESS_DWORD_ACC;
+		bit_offset = 8 * offset;
+		bit_count  = 32;
+		field_flags = AML_FIELD_ACCESS_DWORD;
 		break;
 
-
-	/* Def_create_qWord_field */
-
 	case AML_CREATE_QWORD_FIELD_OP:
 
 		/* Offset is in bytes, field is one qword */
 
-		bit_offset  = 8 * offset;
-		bit_count   = 64;
-		field_flags = ACCESS_QWORD_ACC;
+		bit_offset = 8 * offset;
+		bit_count  = 64;
+		field_flags = AML_FIELD_ACCESS_QWORD;
 		break;
 
-
 	default:
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"Internal error - unknown field creation opcode %02x\n",
-			op->opcode));
+			"Unknown field creation opcode %02x\n",
+			aml_opcode));
 		status = AE_AML_BAD_OPCODE;
 		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));
+		status = AE_AML_BUFFER_LIMIT;
+		goto cleanup;
+	}
+
 	/*
-	 * Setup field according to the object type
+	 * Initialize areas of the field object that are common to all fields
+	 * For field_flags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE)
 	 */
-	switch (src_desc->common.type) {
+	status = acpi_ex_prep_common_field_object (obj_desc, field_flags, 0,
+			  bit_offset, bit_count);
+	if (ACPI_FAILURE (status)) {
+		goto cleanup;
+	}
 
-	/* Source_buff :=  Term_arg=>Buffer */
+	obj_desc->buffer_field.buffer_obj = buffer_desc;
 
-	case ACPI_TYPE_BUFFER:
+	/* Reference count for buffer_desc inherits obj_desc count */
 
-		if ((bit_offset + bit_count) >
-			(8 * (u32) src_desc->buffer.length)) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Field size %d exceeds Buffer size %d (bits)\n",
-				 bit_offset + bit_count, 8 * (u32) src_desc->buffer.length));
-			status = AE_AML_BUFFER_LIMIT;
-			goto cleanup;
-		}
+	buffer_desc->common.reference_count = (u16) (buffer_desc->common.reference_count +
+			  obj_desc->common.reference_count);
 
 
-		/*
-		 * Initialize areas of the field object that are common to all fields
-		 * For Field_flags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE)
-		 */
-		status = acpi_ex_prep_common_field_object (obj_desc, field_flags,
-				  bit_offset, bit_count);
-		if (ACPI_FAILURE (status)) {
-			return_ACPI_STATUS (status);
-		}
+cleanup:
 
-		obj_desc->buffer_field.buffer_obj = src_desc;
+	/* Always delete the operands */
 
-		/* Reference count for Src_desc inherits Obj_desc count */
+	acpi_ut_remove_reference (offset_desc);
+	acpi_ut_remove_reference (buffer_desc);
 
-		src_desc->common.reference_count = (u16) (src_desc->common.reference_count +
-				  obj_desc->common.reference_count);
+	if (aml_opcode == AML_CREATE_FIELD_OP) {
+		acpi_ut_remove_reference (length_desc);
+	}
 
-		break;
+	/* On failure, delete the result descriptor */
 
+	if (ACPI_FAILURE (status)) {
+		acpi_ut_remove_reference (result_desc); /* Result descriptor */
+	}
+	else {
+		/* Now the address and length are valid for this buffer_field */
 
-	/* Improper object type */
+		obj_desc->buffer_field.flags |= AOPOBJ_DATA_VALID;
+	}
 
-	default:
+	return_ACPI_STATUS (status);
+}
 
-		if ((src_desc->common.type > (u8) INTERNAL_TYPE_REFERENCE) || !acpi_ut_valid_object_type (src_desc->common.type)) /* TBD: This line MUST be a single line until Acpi_src can handle it (block deletion) */ {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Tried to create field in invalid object type %X\n",
-				src_desc->common.type));
-		}
 
-		else {
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Tried to create field in improper object type - %s\n",
-				acpi_ut_get_type_name (src_desc->common.type)));
-		}
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ds_eval_buffer_field_operands
+ *
+ * PARAMETERS:  walk_state      - Current walk
+ *              Op              - A valid buffer_field Op object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Get buffer_field Buffer and Index
+ *              Called from acpi_ds_exec_end_op during buffer_field parse tree walk
+ *
+ ****************************************************************************/
 
-		status = AE_AML_OPERAND_TYPE;
-		goto cleanup;
-	}
+acpi_status
+acpi_ds_eval_buffer_field_operands (
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op)
+{
+	acpi_status                     status;
+	union acpi_operand_object       *obj_desc;
+	struct acpi_namespace_node      *node;
+	union acpi_parse_object         *next_op;
 
 
-	if (AML_CREATE_FIELD_OP == op->opcode) {
-		/* Delete object descriptor unique to Create_field */
+	ACPI_FUNCTION_TRACE_PTR ("ds_eval_buffer_field_operands", op);
 
-		acpi_ut_remove_reference (cnt_desc);
-		cnt_desc = NULL;
-	}
 
+	/*
+	 * This is where we evaluate the address and length fields of the
+	 * create_xxx_field declaration
+	 */
+	node =  op->common.node;
+
+	/* next_op points to the op that holds the Buffer */
 
-cleanup:
+	next_op = op->common.value.arg;
 
-	/* Always delete the operands */
+	/* Evaluate/create the address and length operands */
 
-	acpi_ut_remove_reference (off_desc);
-	acpi_ut_remove_reference (src_desc);
+	status = acpi_ds_create_operands (walk_state, next_op);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
 
-	if (AML_CREATE_FIELD_OP == op->opcode) {
-		acpi_ut_remove_reference (cnt_desc);
+	obj_desc = acpi_ns_get_attached_object (node);
+	if (!obj_desc) {
+		return_ACPI_STATUS (AE_NOT_EXIST);
 	}
 
-	/* On failure, delete the result descriptor */
+	/* Resolve the operands */
+
+	status = acpi_ex_resolve_operands (op->common.aml_opcode,
+			  ACPI_WALK_OPERANDS, walk_state);
+
+	ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
+			  acpi_ps_get_opcode_name (op->common.aml_opcode),
+			  walk_state->num_operands, "after acpi_ex_resolve_operands");
 
 	if (ACPI_FAILURE (status)) {
-		acpi_ut_remove_reference (res_desc); /* Result descriptor */
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) bad operand(s) (%X)\n",
+			acpi_ps_get_opcode_name (op->common.aml_opcode), status));
+
+		return_ACPI_STATUS (status);
 	}
 
+	/* Initialize the Buffer Field */
+
+	if (op->common.aml_opcode == AML_CREATE_FIELD_OP) {
+		/* NOTE: Slightly different operands for this opcode */
+
+		status = acpi_ds_init_buffer_field (op->common.aml_opcode, obj_desc,
+				 walk_state->operands[0], walk_state->operands[1],
+				 walk_state->operands[2], walk_state->operands[3]);
+	}
 	else {
-		/* Now the address and length are valid for this Buffer_field */
+		/* All other, create_xxx_field opcodes */
 
-		obj_desc->buffer_field.flags |= AOPOBJ_DATA_VALID;
+		status = acpi_ds_init_buffer_field (op->common.aml_opcode, obj_desc,
+				 walk_state->operands[0], walk_state->operands[1],
+						  NULL, walk_state->operands[2]);
 	}
 
 	return_ACPI_STATUS (status);
@@ -637,46 +631,47 @@
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_eval_region_operands
+ * FUNCTION:    acpi_ds_eval_region_operands
  *
- * PARAMETERS:  Op              - A valid region Op object
+ * PARAMETERS:  walk_state      - Current walk
+ *              Op              - A valid region Op object
  *
  * RETURN:      Status
  *
  * DESCRIPTION: Get region address and length
- *              Called from Acpi_ds_exec_end_op during Op_region parse tree walk
+ *              Called from acpi_ds_exec_end_op during op_region parse tree walk
  *
  ****************************************************************************/
 
 acpi_status
 acpi_ds_eval_region_operands (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op)
 {
-	acpi_status             status;
-	acpi_operand_object     *obj_desc;
-	acpi_operand_object     *operand_desc;
-	acpi_namespace_node     *node;
-	acpi_parse_object       *next_op;
+	acpi_status                     status;
+	union acpi_operand_object       *obj_desc;
+	union acpi_operand_object       *operand_desc;
+	struct acpi_namespace_node      *node;
+	union acpi_parse_object         *next_op;
 
 
-	FUNCTION_TRACE_PTR ("Ds_eval_region_operands", op);
+	ACPI_FUNCTION_TRACE_PTR ("ds_eval_region_operands", op);
 
 
 	/*
-	 * This is where we evaluate the address and length fields of the Op_region declaration
+	 * This is where we evaluate the address and length fields of the op_region declaration
 	 */
-	node =  op->node;
+	node =  op->common.node;
 
-	/* Next_op points to the op that holds the Space_iD */
+	/* next_op points to the op that holds the space_iD */
 
-	next_op = op->value.arg;
+	next_op = op->common.value.arg;
 
-	/* Next_op points to address op */
+	/* next_op points to address op */
 
-	next_op = next_op->next;
+	next_op = next_op->common.next;
 
-	/* Acpi_evaluate/create the address and length operands */
+	/* Evaluate/create the address and length operands */
 
 	status = acpi_ds_create_operands (walk_state, next_op);
 	if (ACPI_FAILURE (status)) {
@@ -685,15 +680,14 @@
 
 	/* Resolve the length and address operands to numbers */
 
-	status = acpi_ex_resolve_operands (op->opcode, WALK_OPERANDS, walk_state);
+	status = acpi_ex_resolve_operands (op->common.aml_opcode, ACPI_WALK_OPERANDS, walk_state);
 	if (ACPI_FAILURE (status)) {
 		return_ACPI_STATUS (status);
 	}
 
-	DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE,
-			  acpi_ps_get_opcode_name (op->opcode),
-			  1, "after Acpi_ex_resolve_operands");
-
+	ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
+			  acpi_ps_get_opcode_name (op->common.aml_opcode),
+			  1, "after acpi_ex_resolve_operands");
 
 	obj_desc = acpi_ns_get_attached_object (node);
 	if (!obj_desc) {
@@ -715,12 +709,12 @@
 	 */
 	operand_desc = walk_state->operands[walk_state->num_operands - 2];
 
-	obj_desc->region.address = (ACPI_PHYSICAL_ADDRESS) operand_desc->integer.value;
+	obj_desc->region.address = (acpi_physical_address) operand_desc->integer.value;
 	acpi_ut_remove_reference (operand_desc);
 
-
-	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Rgn_obj %p Addr %8.8X%8.8X Len %X\n",
-		obj_desc, HIDWORD(obj_desc->region.address), LODWORD(obj_desc->region.address),
+	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),
 		obj_desc->region.length));
 
 	/* Now the address and length are valid for this opregion */
@@ -731,11 +725,106 @@
 }
 
 
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ds_eval_data_object_operands
+ *
+ * PARAMETERS:  walk_state      - Current walk
+ *              Op              - A valid data_object Op object
+ *              obj_desc        - data_object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Get the operands and complete the following data objec types:
+ *              Buffer
+ *              Package
+ *
+ ****************************************************************************/
+
+acpi_status
+acpi_ds_eval_data_object_operands (
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op,
+	union acpi_operand_object       *obj_desc)
+{
+	acpi_status                     status;
+	union acpi_operand_object       *arg_desc;
+	u32                             length;
+
+
+	ACPI_FUNCTION_TRACE ("ds_eval_data_object_operands");
+
+
+	/* The first operand (for all of these data objects) is the length */
+
+	status = acpi_ds_create_operand (walk_state, op->common.value.arg, 1);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
+
+	status = acpi_ex_resolve_operands (walk_state->opcode,
+			  &(walk_state->operands [walk_state->num_operands -1]),
+			  walk_state);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
+
+	/* Extract length operand */
+
+	arg_desc = walk_state->operands [walk_state->num_operands - 1];
+	length = (u32) arg_desc->integer.value;
+
+	/* Cleanup for length operand */
+
+	status = acpi_ds_obj_stack_pop (1, walk_state);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+	}
+
+	acpi_ut_remove_reference (arg_desc);
+
+	/*
+	 * Create the actual data object
+	 */
+	switch (op->common.aml_opcode) {
+	case AML_BUFFER_OP:
+
+		status = acpi_ds_build_internal_buffer_obj (walk_state, op, length, &obj_desc);
+		break;
+
+	case AML_PACKAGE_OP:
+	case AML_VAR_PACKAGE_OP:
+
+		status = acpi_ds_build_internal_package_obj (walk_state, op, length, &obj_desc);
+		break;
+
+	default:
+		return_ACPI_STATUS (AE_AML_BAD_OPCODE);
+	}
+
+	if (ACPI_SUCCESS (status)) {
+		/*
+		 * Return the object in the walk_state, unless the parent is a package --
+		 * in this case, the return object will be stored in the parse tree
+		 * for the package.
+		 */
+		if ((!op->common.parent) ||
+			((op->common.parent->common.aml_opcode != AML_PACKAGE_OP) &&
+			 (op->common.parent->common.aml_opcode != AML_VAR_PACKAGE_OP) &&
+			 (op->common.parent->common.aml_opcode != AML_NAME_OP))) {
+			walk_state->result_obj = obj_desc;
+		}
+	}
+
+	return_ACPI_STATUS (status);
+}
+
+
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_exec_begin_control_op
+ * FUNCTION:    acpi_ds_exec_begin_control_op
  *
- * PARAMETERS:  Walk_list       - The list that owns the walk stack
+ * PARAMETERS:  walk_list       - The list that owns the walk stack
  *              Op              - The control Op
  *
  * RETURN:      Status
@@ -747,20 +836,20 @@
 
 acpi_status
 acpi_ds_exec_begin_control_op (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op)
 {
-	acpi_status             status = AE_OK;
-	acpi_generic_state      *control_state;
+	acpi_status                     status = AE_OK;
+	union acpi_generic_state        *control_state;
 
 
-	PROC_NAME ("Ds_exec_begin_control_op");
+	ACPI_FUNCTION_NAME ("ds_exec_begin_control_op");
 
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n", op,
-		op->opcode, walk_state));
+		op->common.aml_opcode, walk_state));
 
-	switch (op->opcode) {
+	switch (op->common.aml_opcode) {
 	case AML_IF_OP:
 	case AML_WHILE_OP:
 
@@ -774,19 +863,19 @@
 			status = AE_NO_MEMORY;
 			break;
 		}
-
-		acpi_ut_push_generic_state (&walk_state->control_state, control_state);
-
 		/*
 		 * Save a pointer to the predicate for multiple executions
 		 * of a loop
 		 */
-		walk_state->control_state->control.aml_predicate_start =
-				 walk_state->parser_state.aml - 1;
-				 /* TBD: can this be removed? */
-				 /*Acpi_ps_pkg_length_encoding_size (GET8 (Walk_state->Parser_state->Aml));*/
-		break;
+		control_state->control.aml_predicate_start = walk_state->parser_state.aml - 1;
+		control_state->control.package_end = walk_state->parser_state.pkg_end;
+		control_state->control.opcode = op->common.aml_opcode;
+
 
+		/* Push the control state on this walk's control stack */
+
+		acpi_ut_push_generic_state (&walk_state->control_state, control_state);
+		break;
 
 	case AML_ELSE_OP:
 
@@ -799,12 +888,10 @@
 
 		break;
 
-
 	case AML_RETURN_OP:
 
 		break;
 
-
 	default:
 		break;
 	}
@@ -815,9 +902,9 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_exec_end_control_op
+ * FUNCTION:    acpi_ds_exec_end_control_op
  *
- * PARAMETERS:  Walk_list       - The list that owns the walk stack
+ * PARAMETERS:  walk_list       - The list that owns the walk stack
  *              Op              - The control Op
  *
  * RETURN:      Status
@@ -825,22 +912,21 @@
  * DESCRIPTION: Handles all control ops encountered during control method
  *              execution.
  *
- *
  ******************************************************************************/
 
 acpi_status
 acpi_ds_exec_end_control_op (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *op)
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *op)
 {
-	acpi_status             status = AE_OK;
-	acpi_generic_state      *control_state;
+	acpi_status                     status = AE_OK;
+	union acpi_generic_state        *control_state;
 
 
-	PROC_NAME ("Ds_exec_end_control_op");
+	ACPI_FUNCTION_NAME ("ds_exec_end_control_op");
 
 
-	switch (op->opcode) {
+	switch (op->common.aml_opcode) {
 	case AML_IF_OP:
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[IF_OP] Op=%p\n", op));
@@ -890,17 +976,17 @@
 	case AML_RETURN_OP:
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-			"[RETURN_OP] Op=%p Arg=%p\n",op, op->value.arg));
+			"[RETURN_OP] Op=%p Arg=%p\n",op, op->common.value.arg));
 
 		/*
 		 * One optional operand -- the return value
 		 * It can be either an immediate operand or a result that
 		 * has been bubbled up the tree
 		 */
-		if (op->value.arg) {
+		if (op->common.value.arg) {
 			/* Return statement has an immediate operand */
 
-			status = acpi_ds_create_operands (walk_state, op->value.arg);
+			status = acpi_ds_create_operands (walk_state, op->common.value.arg);
 			if (ACPI_FAILURE (status)) {
 				return (status);
 			}
@@ -917,12 +1003,11 @@
 
 			/*
 			 * Get the return value and save as the last result
-			 * value.  This is the only place where Walk_state->Return_desc
+			 * value.  This is the only place where walk_state->return_desc
 			 * is set to anything other than zero!
 			 */
 			walk_state->return_desc = walk_state->operands[0];
 		}
-
 		else if ((walk_state->results) &&
 				 (walk_state->results->results.num_results > 0)) {
 			/*
@@ -934,18 +1019,17 @@
 			 *
 			 * Allow references created by the Index operator to return unchanged.
 			 */
-			if (VALID_DESCRIPTOR_TYPE (walk_state->results->results.obj_desc [0], ACPI_DESC_TYPE_INTERNAL) &&
-				((walk_state->results->results.obj_desc [0])->common.type == INTERNAL_TYPE_REFERENCE) &&
+			if ((ACPI_GET_DESCRIPTOR_TYPE (walk_state->results->results.obj_desc[0]) == ACPI_DESC_TYPE_OPERAND) &&
+				(ACPI_GET_OBJECT_TYPE (walk_state->results->results.obj_desc [0]) == ACPI_TYPE_LOCAL_REFERENCE) &&
 				((walk_state->results->results.obj_desc [0])->reference.opcode != AML_INDEX_OP)) {
-					status = acpi_ex_resolve_to_value (&walk_state->results->results.obj_desc [0], walk_state);
-					if (ACPI_FAILURE (status)) {
-						return (status);
-					}
+				status = acpi_ex_resolve_to_value (&walk_state->results->results.obj_desc [0], walk_state);
+				if (ACPI_FAILURE (status)) {
+					return (status);
+				}
 			}
 
 			walk_state->return_desc = walk_state->results->results.obj_desc [0];
 		}
-
 		else {
 			/* No return operand */
 
@@ -960,7 +1044,7 @@
 
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-			"Completed RETURN_OP State=%p, Ret_val=%p\n",
+			"Completed RETURN_OP State=%p, ret_val=%p\n",
 			walk_state, walk_state->return_desc));
 
 		/* End the control method execution right now */
@@ -979,7 +1063,7 @@
 
 		/* Call up to the OS service layer to handle this */
 
-		acpi_os_signal (ACPI_SIGNAL_BREAKPOINT, "Executed AML Breakpoint opcode");
+		status = acpi_os_signal (ACPI_SIGNAL_BREAKPOINT, "Executed AML Breakpoint opcode");
 
 		/* If and when it returns, all done. */
 
@@ -987,43 +1071,47 @@
 
 
 	case AML_BREAK_OP:
+	case AML_CONTINUE_OP: /* ACPI 2.0 */
 
-		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-			"Break to end of current package, Op=%p\n", op));
 
-		/* TBD: update behavior for ACPI 2.0 */
+		/* Pop and delete control states until we find a while */
 
-		/*
-		 * As per the ACPI specification:
-		 *      "The break operation causes the current package
-		 *          execution to complete"
-		 *      "Break -- Stop executing the current code package
-		 *          at this point"
-		 *
-		 * Returning AE_FALSE here will cause termination of
-		 * the current package, and execution will continue one
-		 * level up, starting with the completion of the parent Op.
-		 */
-		status = AE_CTRL_FALSE;
-		break;
+		while (walk_state->control_state &&
+				(walk_state->control_state->control.opcode != AML_WHILE_OP)) {
+			control_state = acpi_ut_pop_generic_state (&walk_state->control_state);
+			acpi_ut_delete_generic_state (control_state);
+		}
 
+		/* No while found? */
 
-	case AML_CONTINUE_OP: /* ACPI 2.0 */
+		if (!walk_state->control_state) {
+			return (AE_AML_NO_WHILE);
+		}
+
+		/* Was: walk_state->aml_last_while = walk_state->control_state->Control.aml_predicate_start; */
+
+		walk_state->aml_last_while = walk_state->control_state->control.package_end;
 
-		status = AE_NOT_IMPLEMENTED;
+		/* Return status depending on opcode */
+
+		if (op->common.aml_opcode == AML_BREAK_OP) {
+			status = AE_CTRL_BREAK;
+		}
+		else {
+			status = AE_CTRL_CONTINUE;
+		}
 		break;
 
 
 	default:
 
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown control opcode=%X Op=%p\n",
-			op->opcode, op));
+			op->common.aml_opcode, op));
 
 		status = AE_AML_BAD_OPCODE;
 		break;
 	}
 
-
 	return (status);
 }
 
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c
--- a/drivers/acpi/dispatcher/dsutils.c	2003-01-25 01:26:08.000000000 -0800
+++ b/drivers/acpi/dispatcher/dsutils.c	2003-01-25 01:30:21.000000000 -0800
@@ -1,12 +1,11 @@
 /*******************************************************************************
  *
  * Module Name: dsutils - Dispatcher utilities
- *              $Revision: 80 $
  *
  ******************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -33,16 +32,17 @@
 #include "acdebug.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dsutils")
+	 ACPI_MODULE_NAME    ("dsutils")
 
+#ifndef ACPI_NO_METHOD_EXECUTION
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_is_result_used
+ * FUNCTION:    acpi_ds_is_result_used
  *
  * PARAMETERS:  Op
- *              Result_obj
- *              Walk_state
+ *              result_obj
+ *              walk_state
  *
  * RETURN:      Status
  *
@@ -52,13 +52,13 @@
 
 u8
 acpi_ds_is_result_used (
-	acpi_parse_object       *op,
-	acpi_walk_state         *walk_state)
+	union acpi_parse_object         *op,
+	struct acpi_walk_state          *walk_state)
 {
-	const acpi_opcode_info  *parent_info;
+	const struct acpi_opcode_info   *parent_info;
 
 
-	FUNCTION_TRACE_PTR ("Ds_is_result_used", op);
+	ACPI_FUNCTION_TRACE_PTR ("ds_is_result_used", op);
 
 
 	/* Must have both an Op and a Result Object */
@@ -68,29 +68,25 @@
 		return_VALUE (TRUE);
 	}
 
-
 	/*
 	 * If there is no parent, the result can't possibly be used!
 	 * (An executing method typically has no parent, since each
 	 * method is parsed separately)  However, a method that is
 	 * invoked from another method has a parent.
 	 */
-	if (!op->parent) {
+	if (!op->common.parent) {
 		return_VALUE (FALSE);
 	}
 
-
 	/*
 	 * Get info on the parent.  The root Op is AML_SCOPE
 	 */
-
-	parent_info = acpi_ps_get_opcode_info (op->parent->opcode);
+	parent_info = acpi_ps_get_opcode_info (op->common.parent->common.aml_opcode);
 	if (parent_info->class == AML_CLASS_UNKNOWN) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%p\n", op));
 		return_VALUE (FALSE);
 	}
 
-
 	/*
 	 * Decide what to do with the result based on the parent.  If
 	 * the parent opcode will not use the result, delete the object.
@@ -98,88 +94,100 @@
 	 * as an operand later.
 	 */
 	switch (parent_info->class) {
-	/*
-	 * In these cases, the parent will never use the return object
-	 */
-	case AML_CLASS_CONTROL:        /* IF, ELSE, WHILE only */
+	case AML_CLASS_CONTROL:
 
-		switch (op->parent->opcode) {
+		switch (op->common.parent->common.aml_opcode) {
 		case AML_RETURN_OP:
 
 			/* Never delete the return value associated with a return opcode */
 
-			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-				"Result used, [RETURN] opcode=%X Op=%p\n", op->opcode, op));
-			return_VALUE (TRUE);
-			break;
+			goto result_used;
 
 		case AML_IF_OP:
 		case AML_WHILE_OP:
 
 			/*
 			 * If we are executing the predicate AND this is the predicate op,
-			 * we will use the return value!
+			 * we will use the return value
 			 */
-			if ((walk_state->control_state->common.state == CONTROL_PREDICATE_EXECUTING) &&
+			if ((walk_state->control_state->common.state == ACPI_CONTROL_PREDICATE_EXECUTING) &&
 				(walk_state->control_state->control.predicate_op == op)) {
-				ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-					"Result used as a predicate, [IF/WHILE] opcode=%X Op=%p\n",
-					op->opcode, op));
-				return_VALUE (TRUE);
+				goto result_used;
 			}
+			break;
 
+		default:
+			/* Ignore other control opcodes */
 			break;
 		}
 
+		/* The general control opcode returns no result */
 
-		/* Fall through to not used case below */
+		goto result_not_used;
 
 
-	case AML_CLASS_NAMED_OBJECT:   /* Scope, method, etc. */
 	case AML_CLASS_CREATE:
 
 		/*
-		 * These opcodes allow Term_arg(s) as operands and therefore
-		 * method calls.  The result is used.
+		 * These opcodes allow term_arg(s) as operands and therefore
+		 * the operands can be method calls.  The result is used.
 		 */
-		if ((op->parent->opcode == AML_REGION_OP)               ||
-			(op->parent->opcode == AML_CREATE_FIELD_OP)         ||
-			(op->parent->opcode == AML_CREATE_BIT_FIELD_OP)     ||
-			(op->parent->opcode == AML_CREATE_BYTE_FIELD_OP)    ||
-			(op->parent->opcode == AML_CREATE_WORD_FIELD_OP)    ||
-			(op->parent->opcode == AML_CREATE_DWORD_FIELD_OP)   ||
-			(op->parent->opcode == AML_CREATE_QWORD_FIELD_OP)) {
-			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-				"Result used, [Region or Create_field] opcode=%X Op=%p\n",
-				op->opcode, op));
-			return_VALUE (TRUE);
+		goto result_used;
+
+
+	case AML_CLASS_NAMED_OBJECT:
+
+		if ((op->common.parent->common.aml_opcode == AML_REGION_OP)      ||
+			(op->common.parent->common.aml_opcode == AML_DATA_REGION_OP) ||
+			(op->common.parent->common.aml_opcode == AML_PACKAGE_OP)     ||
+			(op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP) ||
+			(op->common.parent->common.aml_opcode == AML_BUFFER_OP)      ||
+			(op->common.parent->common.aml_opcode == AML_INT_EVAL_SUBTREE_OP)) {
+			/*
+			 * These opcodes allow term_arg(s) as operands and therefore
+			 * the operands can be method calls.  The result is used.
+			 */
+			goto result_used;
 		}
 
-		ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-			"Result not used, Parent opcode=%X Op=%p\n", op->opcode, op));
+		goto result_not_used;
 
-		return_VALUE (FALSE);
-		break;
 
-	/*
-	 * In all other cases. the parent will actually use the return
-	 * object, so keep it.
-	 */
 	default:
-		break;
+
+		/*
+		 * In all other cases. the parent will actually use the return
+		 * object, so keep it.
+		 */
+		goto result_used;
 	}
 
+
+result_used:
+	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Result of [%s] used by Parent [%s] Op=%p\n",
+			acpi_ps_get_opcode_name (op->common.aml_opcode),
+			acpi_ps_get_opcode_name (op->common.parent->common.aml_opcode), op));
+
 	return_VALUE (TRUE);
+
+
+result_not_used:
+	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Result of [%s] not used by Parent [%s] Op=%p\n",
+			acpi_ps_get_opcode_name (op->common.aml_opcode),
+			acpi_ps_get_opcode_name (op->common.parent->common.aml_opcode), op));
+
+	return_VALUE (FALSE);
+
 }
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_delete_result_if_not_used
+ * FUNCTION:    acpi_ds_delete_result_if_not_used
  *
  * PARAMETERS:  Op
- *              Result_obj
- *              Walk_state
+ *              result_obj
+ *              walk_state
  *
  * RETURN:      Status
  *
@@ -192,15 +200,15 @@
 
 void
 acpi_ds_delete_result_if_not_used (
-	acpi_parse_object       *op,
-	acpi_operand_object     *result_obj,
-	acpi_walk_state         *walk_state)
+	union acpi_parse_object         *op,
+	union acpi_operand_object       *result_obj,
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_operand_object     *obj_desc;
-	acpi_status             status;
+	union acpi_operand_object       *obj_desc;
+	acpi_status                     status;
 
 
-	FUNCTION_TRACE_PTR ("Ds_delete_result_if_not_used", result_obj);
+	ACPI_FUNCTION_TRACE_PTR ("ds_delete_result_if_not_used", result_obj);
 
 
 	if (!op) {
@@ -215,7 +223,7 @@
 
 	if (!acpi_ds_is_result_used (op, walk_state)) {
 		/*
-		 * Must pop the result stack (Obj_desc should be equal to Result_obj)
+		 * Must pop the result stack (obj_desc should be equal to result_obj)
 		 */
 		status = acpi_ds_result_pop (&obj_desc, walk_state);
 		if (ACPI_SUCCESS (status)) {
@@ -229,9 +237,89 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_create_operand
+ * FUNCTION:    acpi_ds_resolve_operands
+ *
+ * PARAMETERS:  walk_state          - Current walk state with operands on stack
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Resolve all operands to their values.  Used to prepare
+ *              arguments to a control method invocation (a call from one
+ *              method to another.)
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ds_resolve_operands (
+	struct acpi_walk_state          *walk_state)
+{
+	u32                             i;
+	acpi_status                     status = AE_OK;
+
+
+	ACPI_FUNCTION_TRACE_PTR ("ds_resolve_operands", walk_state);
+
+
+	/*
+	 * Attempt to resolve each of the valid operands
+	 * Method arguments are passed by value, not by reference
+	 */
+	for (i = 0; i < walk_state->num_operands; i++) {
+		status = acpi_ex_resolve_to_value (&walk_state->operands[i], walk_state);
+		if (ACPI_FAILURE (status)) {
+			break;
+		}
+	}
+
+	return_ACPI_STATUS (status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ds_clear_operands
+ *
+ * PARAMETERS:  walk_state          - Current walk state with operands on stack
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Clear all operands on the current walk state operand stack.
+ *
+ ******************************************************************************/
+
+void
+acpi_ds_clear_operands (
+	struct acpi_walk_state          *walk_state)
+{
+	u32                             i;
+
+
+	ACPI_FUNCTION_TRACE_PTR ("acpi_ds_clear_operands", walk_state);
+
+
+	/*
+	 * Remove a reference on each operand on the stack
+	 */
+	for (i = 0; i < walk_state->num_operands; i++) {
+		/*
+		 * Remove a reference to all operands, including both
+		 * "Arguments" and "Targets".
+		 */
+		acpi_ut_remove_reference (walk_state->operands[i]);
+		walk_state->operands[i] = NULL;
+	}
+
+	walk_state->num_operands = 0;
+	return_VOID;
+}
+#endif
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ds_create_operand
  *
- * PARAMETERS:  Walk_state
+ * PARAMETERS:  walk_state
  *              Arg
  *
  * RETURN:      Status
@@ -245,34 +333,32 @@
 
 acpi_status
 acpi_ds_create_operand (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *arg,
-	u32                     arg_index)
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *arg,
+	u32                             arg_index)
 {
-	acpi_status             status = AE_OK;
-	NATIVE_CHAR             *name_string;
-	u32                     name_length;
-	acpi_object_type8       data_type;
-	acpi_operand_object     *obj_desc;
-	acpi_parse_object       *parent_op;
-	u16                     opcode;
-	u32                     flags;
-	operating_mode          interpreter_mode;
-	const acpi_opcode_info  *op_info;
+	acpi_status                     status = AE_OK;
+	char                            *name_string;
+	u32                             name_length;
+	union acpi_operand_object       *obj_desc;
+	union acpi_parse_object         *parent_op;
+	u16                             opcode;
+	acpi_interpreter_mode           interpreter_mode;
+	const struct acpi_opcode_info   *op_info;
 
 
-	FUNCTION_TRACE_PTR ("Ds_create_operand", arg);
+	ACPI_FUNCTION_TRACE_PTR ("ds_create_operand", arg);
 
 
 	/* A valid name must be looked up in the namespace */
 
-	if ((arg->opcode == AML_INT_NAMEPATH_OP) &&
-		(arg->value.string)) {
+	if ((arg->common.aml_opcode == AML_INT_NAMEPATH_OP) &&
+		(arg->common.value.string)) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Getting a name: Arg=%p\n", arg));
 
 		/* Get the entire name string from the AML stream */
 
-		status = acpi_ex_get_name_string (ACPI_TYPE_ANY, arg->value.buffer,
+		status = acpi_ex_get_name_string (ACPI_TYPE_ANY, arg->common.value.buffer,
 				  &name_string, &name_length);
 
 		if (ACPI_FAILURE (status)) {
@@ -281,7 +367,7 @@
 
 		/*
 		 * All prefixes have been handled, and the name is
-		 * in Name_string
+		 * in name_string
 		 */
 
 		/*
@@ -290,46 +376,41 @@
 		 * IMODE_EXECUTE) in order to support the creation of
 		 * namespace objects during the execution of control methods.
 		 */
-		parent_op = arg->parent;
-		op_info = acpi_ps_get_opcode_info (parent_op->opcode);
+		parent_op = arg->common.parent;
+		op_info = acpi_ps_get_opcode_info (parent_op->common.aml_opcode);
 		if ((op_info->flags & AML_NSNODE) &&
-			(parent_op->opcode != AML_INT_METHODCALL_OP) &&
-			(parent_op->opcode != AML_REGION_OP) &&
-			(parent_op->opcode != AML_INT_NAMEPATH_OP)) {
+			(parent_op->common.aml_opcode != AML_INT_METHODCALL_OP) &&
+			(parent_op->common.aml_opcode != AML_REGION_OP) &&
+			(parent_op->common.aml_opcode != AML_INT_NAMEPATH_OP)) {
 			/* Enter name into namespace if not found */
 
-			interpreter_mode = IMODE_LOAD_PASS2;
+			interpreter_mode = ACPI_IMODE_LOAD_PASS2;
 		}
 
 		else {
 			/* Return a failure if name not found */
 
-			interpreter_mode = IMODE_EXECUTE;
+			interpreter_mode = ACPI_IMODE_EXECUTE;
 		}
 
 		status = acpi_ns_lookup (walk_state->scope_info, name_string,
 				 ACPI_TYPE_ANY, interpreter_mode,
-				 NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE,
+				 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
 				 walk_state,
-				 (acpi_namespace_node **) &obj_desc);
-
-		/* Free the namestring created above */
-
-		ACPI_MEM_FREE (name_string);
-
+				 ACPI_CAST_INDIRECT_PTR (struct acpi_namespace_node, &obj_desc));
 		/*
 		 * The only case where we pass through (ignore) a NOT_FOUND
-		 * error is for the Cond_ref_of opcode.
+		 * error is for the cond_ref_of opcode.
 		 */
 		if (status == AE_NOT_FOUND) {
-			if (parent_op->opcode == AML_COND_REF_OF_OP) {
+			if (parent_op->common.aml_opcode == AML_COND_REF_OF_OP) {
 				/*
 				 * For the Conditional Reference op, it's OK if
 				 * the name is not found;  We just need a way to
 				 * indicate this to the interpreter, set the
 				 * object to the root
 				 */
-				obj_desc = (acpi_operand_object *) acpi_gbl_root_node;
+				obj_desc = ACPI_CAST_PTR (union acpi_operand_object, acpi_gbl_root_node);
 				status = AE_OK;
 			}
 
@@ -339,14 +420,17 @@
 				 * very serious error at this point
 				 */
 				status = AE_AML_NAME_NOT_FOUND;
-
-				/* TBD: Externalize Name_string and print */
-
-				ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-						"Object name was not found in namespace\n"));
 			}
 		}
 
+		if (ACPI_FAILURE (status)) {
+			ACPI_REPORT_NSERROR (name_string, status);
+		}
+
+		/* Free the namestring created above */
+
+		ACPI_MEM_FREE (name_string);
+
 		/* Check status from the lookup */
 
 		if (ACPI_FAILURE (status)) {
@@ -359,47 +443,42 @@
 		if (ACPI_FAILURE (status)) {
 			return_ACPI_STATUS (status);
 		}
-		DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state));
+		ACPI_DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state));
 	}
 
 
 	else {
 		/* Check for null name case */
 
-		if (arg->opcode == AML_INT_NAMEPATH_OP) {
+		if (arg->common.aml_opcode == AML_INT_NAMEPATH_OP) {
 			/*
 			 * If the name is null, this means that this is an
 			 * optional result parameter that was not specified
-			 * in the original ASL.  Create an Reference for a
-			 * placeholder
+			 * in the original ASL.  Create a Zero Constant for a
+			 * placeholder.  (Store to a constant is a Noop.)
 			 */
 			opcode = AML_ZERO_OP;       /* Has no arguments! */
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Null namepath: Arg=%p\n", arg));
-
-			/*
-			 * TBD: [Investigate] anything else needed for the
-			 * zero op lvalue?
-			 */
 		}
 
 		else {
-			opcode = arg->opcode;
+			opcode = arg->common.aml_opcode;
 		}
 
+		/* Get the object type of the argument */
 
-		/* Get the data type of the argument */
-
-		data_type = acpi_ds_map_opcode_to_data_type (opcode, &flags);
-		if (data_type == INTERNAL_TYPE_INVALID) {
+		op_info = acpi_ps_get_opcode_info (opcode);
+		if (op_info->object_type == ACPI_TYPE_INVALID) {
 			return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
 		}
 
-		if (flags & OP_HAS_RETURN_VALUE) {
+		if (op_info->flags & AML_HAS_RETVAL) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
 				"Argument previously created, already stacked \n"));
 
-			DEBUGGER_EXEC (acpi_db_display_argument_object (walk_state->operands [walk_state->num_operands - 1], walk_state));
+			ACPI_DEBUGGER_EXEC (acpi_db_display_argument_object (
+				walk_state->operands [walk_state->num_operands - 1], walk_state));
 
 			/*
 			 * Use value that was already previously returned
@@ -415,13 +494,11 @@
 					acpi_format_exception (status)));
 				return_ACPI_STATUS (status);
 			}
-
 		}
-
 		else {
 			/* Create an ACPI_INTERNAL_OBJECT for the argument */
 
-			obj_desc = acpi_ut_create_internal_object (data_type);
+			obj_desc = acpi_ut_create_internal_object (op_info->object_type);
 			if (!obj_desc) {
 				return_ACPI_STATUS (AE_NO_MEMORY);
 			}
@@ -434,7 +511,7 @@
 				acpi_ut_delete_object_desc (obj_desc);
 				return_ACPI_STATUS (status);
 			}
-	   }
+		}
 
 		/* Put the operand object on the object stack */
 
@@ -443,7 +520,7 @@
 			return_ACPI_STATUS (status);
 		}
 
-		DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state));
+		ACPI_DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state));
 	}
 
 	return_ACPI_STATUS (AE_OK);
@@ -452,9 +529,9 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_create_operands
+ * FUNCTION:    acpi_ds_create_operands
  *
- * PARAMETERS:  First_arg           - First argument of a parser argument tree
+ * PARAMETERS:  first_arg           - First argument of a parser argument tree
  *
  * RETURN:      Status
  *
@@ -466,15 +543,15 @@
 
 acpi_status
 acpi_ds_create_operands (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       *first_arg)
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         *first_arg)
 {
-	acpi_status             status = AE_OK;
-	acpi_parse_object       *arg;
-	u32                     arg_count = 0;
+	acpi_status                     status = AE_OK;
+	union acpi_parse_object         *arg;
+	u32                             arg_count = 0;
 
 
-	FUNCTION_TRACE_PTR ("Ds_create_operands", first_arg);
+	ACPI_FUNCTION_TRACE_PTR ("ds_create_operands", first_arg);
 
 
 	/* For all arguments in the list... */
@@ -491,7 +568,7 @@
 
 		/* Move on to next argument, if any */
 
-		arg = arg->next;
+		arg = arg->common.next;
 		arg_count++;
 	}
 
@@ -504,7 +581,7 @@
 	 * pop everything off of the operand stack and delete those
 	 * objects
 	 */
-	acpi_ds_obj_stack_pop_and_delete (arg_count, walk_state);
+	(void) acpi_ds_obj_stack_pop_and_delete (arg_count, walk_state);
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "While creating Arg %d - %s\n",
 		(arg_count + 1), acpi_format_exception (status)));
@@ -512,307 +589,3 @@
 }
 
 
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_ds_resolve_operands
- *
- * PARAMETERS:  Walk_state          - Current walk state with operands on stack
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Resolve all operands to their values.  Used to prepare
- *              arguments to a control method invocation (a call from one
- *              method to another.)
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ds_resolve_operands (
-	acpi_walk_state         *walk_state)
-{
-	u32                     i;
-	acpi_status             status = AE_OK;
-
-
-	FUNCTION_TRACE_PTR ("Ds_resolve_operands", walk_state);
-
-
-	/*
-	 * Attempt to resolve each of the valid operands
-	 * Method arguments are passed by value, not by reference
-	 */
-
-	/*
-	 * TBD: [Investigate] Note from previous parser:
-	 *   Ref_of problem with Acpi_ex_resolve_to_value() conversion.
-	 */
-	for (i = 0; i < walk_state->num_operands; i++) {
-		status = acpi_ex_resolve_to_value (&walk_state->operands[i], walk_state);
-		if (ACPI_FAILURE (status)) {
-			break;
-		}
-	}
-
-	return_ACPI_STATUS (status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_ds_map_opcode_to_data_type
- *
- * PARAMETERS:  Opcode          - AML opcode to map
- *              Out_flags       - Additional info about the opcode
- *
- * RETURN:      The ACPI type associated with the opcode
- *
- * DESCRIPTION: Convert a raw AML opcode to the associated ACPI data type,
- *              if any.  If the opcode returns a value as part of the
- *              intepreter execution, a flag is returned in Out_flags.
- *
- ******************************************************************************/
-
-acpi_object_type8
-acpi_ds_map_opcode_to_data_type (
-	u16                     opcode,
-	u32                     *out_flags)
-{
-	acpi_object_type8       data_type = INTERNAL_TYPE_INVALID;
-	const acpi_opcode_info  *op_info;
-	u32                     flags = 0;
-
-
-	PROC_NAME ("Ds_map_opcode_to_data_type");
-
-
-	op_info = acpi_ps_get_opcode_info (opcode);
-	if (op_info->class == AML_CLASS_UNKNOWN) {
-		/* Unknown opcode */
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown AML opcode: %x\n", opcode));
-		return (data_type);
-	}
-
-
-/*
- * TBD: Use op class
- */
-
-	switch (op_info->type) {
-
-	case AML_TYPE_LITERAL:
-
-		switch (opcode) {
-		case AML_BYTE_OP:
-		case AML_WORD_OP:
-		case AML_DWORD_OP:
-		case AML_QWORD_OP:
-
-			data_type = ACPI_TYPE_INTEGER;
-			break;
-
-
-		case AML_STRING_OP:
-
-			data_type = ACPI_TYPE_STRING;
-			break;
-
-		case AML_INT_NAMEPATH_OP:
-			data_type = INTERNAL_TYPE_REFERENCE;
-			break;
-
-		default:
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Unknown (type LITERAL) AML opcode: %x\n", opcode));
-			break;
-		}
-		break;
-
-
-	case AML_TYPE_DATA_TERM:
-
-		switch (opcode) {
-		case AML_BUFFER_OP:
-
-			data_type = ACPI_TYPE_BUFFER;
-			break;
-
-		case AML_PACKAGE_OP:
-		case AML_VAR_PACKAGE_OP:
-
-			data_type = ACPI_TYPE_PACKAGE;
-			break;
-
-		default:
-			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-				"Unknown (type DATA_TERM) AML opcode: %x\n", opcode));
-			break;
-		}
-		break;
-
-
-	case AML_TYPE_CONSTANT:
-	case AML_TYPE_METHOD_ARGUMENT:
-	case AML_TYPE_LOCAL_VARIABLE:
-
-		data_type = INTERNAL_TYPE_REFERENCE;
-		break;
-
-
-	case AML_TYPE_EXEC_1A_0T_1R:
-	case AML_TYPE_EXEC_1A_1T_1R:
-	case AML_TYPE_EXEC_2A_0T_1R:
-	case AML_TYPE_EXEC_2A_1T_1R:
-	case AML_TYPE_EXEC_2A_2T_1R:
-	case AML_TYPE_EXEC_3A_1T_1R:
-	case AML_TYPE_EXEC_6A_0T_1R:
-	case AML_TYPE_RETURN:
-
-		flags = OP_HAS_RETURN_VALUE;
-		data_type = ACPI_TYPE_ANY;
-		break;
-
-
-	case AML_TYPE_METHOD_CALL:
-
-		flags = OP_HAS_RETURN_VALUE;
-		data_type = ACPI_TYPE_METHOD;
-		break;
-
-
-	case AML_TYPE_NAMED_FIELD:
-	case AML_TYPE_NAMED_SIMPLE:
-	case AML_TYPE_NAMED_COMPLEX:
-	case AML_TYPE_NAMED_NO_OBJ:
-
-		data_type = acpi_ds_map_named_opcode_to_data_type (opcode);
-		break;
-
-
-	case AML_TYPE_EXEC_1A_0T_0R:
-	case AML_TYPE_EXEC_2A_0T_0R:
-	case AML_TYPE_EXEC_3A_0T_0R:
-	case AML_TYPE_EXEC_1A_1T_0R:
-	case AML_TYPE_CONTROL:
-
-		/* No mapping needed at this time */
-
-		break;
-
-
-	default:
-
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"Unimplemented data type opcode: %x\n", opcode));
-		break;
-	}
-
-	/* Return flags to caller if requested */
-
-	if (out_flags) {
-		*out_flags = flags;
-	}
-
-	return (data_type);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_ds_map_named_opcode_to_data_type
- *
- * PARAMETERS:  Opcode              - The Named AML opcode to map
- *
- * RETURN:      The ACPI type associated with the named opcode
- *
- * DESCRIPTION: Convert a raw Named AML opcode to the associated data type.
- *              Named opcodes are a subsystem of the AML opcodes.
- *
- ******************************************************************************/
-
-acpi_object_type8
-acpi_ds_map_named_opcode_to_data_type (
-	u16                     opcode)
-{
-	acpi_object_type8       data_type;
-
-
-	FUNCTION_ENTRY ();
-
-
-	/* Decode Opcode */
-
-	switch (opcode) {
-	case AML_SCOPE_OP:
-		data_type = INTERNAL_TYPE_SCOPE;
-		break;
-
-	case AML_DEVICE_OP:
-		data_type = ACPI_TYPE_DEVICE;
-		break;
-
-	case AML_THERMAL_ZONE_OP:
-		data_type = ACPI_TYPE_THERMAL;
-		break;
-
-	case AML_METHOD_OP:
-		data_type = ACPI_TYPE_METHOD;
-		break;
-
-	case AML_POWER_RES_OP:
-		data_type = ACPI_TYPE_POWER;
-		break;
-
-	case AML_PROCESSOR_OP:
-		data_type = ACPI_TYPE_PROCESSOR;
-		break;
-
-	case AML_FIELD_OP:                              /* Field_op */
-		data_type = INTERNAL_TYPE_FIELD_DEFN;
-		break;
-
-	case AML_INDEX_FIELD_OP:                        /* Index_field_op */
-		data_type = INTERNAL_TYPE_INDEX_FIELD_DEFN;
-		break;
-
-	case AML_BANK_FIELD_OP:                         /* Bank_field_op */
-		data_type = INTERNAL_TYPE_BANK_FIELD_DEFN;
-		break;
-
-	case AML_INT_NAMEDFIELD_OP:                     /* NO CASE IN ORIGINAL  */
-		data_type = ACPI_TYPE_ANY;
-		break;
-
-	case AML_NAME_OP:                               /* Name_op - special code in original */
-	case AML_INT_NAMEPATH_OP:
-		data_type = ACPI_TYPE_ANY;
-		break;
-
-	case AML_ALIAS_OP:
-		data_type = INTERNAL_TYPE_ALIAS;
-		break;
-
-	case AML_MUTEX_OP:
-		data_type = ACPI_TYPE_MUTEX;
-		break;
-
-	case AML_EVENT_OP:
-		data_type = ACPI_TYPE_EVENT;
-		break;
-
-	case AML_DATA_REGION_OP:
-	case AML_REGION_OP:
-		data_type = ACPI_TYPE_REGION;
-		break;
-
-
-	default:
-		data_type = ACPI_TYPE_ANY;
-		break;
-
-	}
-
-	return (data_type);
-}
-
-
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
--- a/drivers/acpi/dispatcher/dswexec.c	2003-01-25 01:26:39.000000000 -0800
+++ b/drivers/acpi/dispatcher/dswexec.c	2003-01-25 01:30:52.000000000 -0800
@@ -2,12 +2,11 @@
  *
  * Module Name: dswexec - Dispatcher method execution callbacks;
  *                        dispatch to interpreter.
- *              $Revision: 79 $
  *
  *****************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -35,12 +34,12 @@
 
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dswexec")
+	 ACPI_MODULE_NAME    ("dswexec")
 
 /*
- * Dispatch tables for opcode classes
+ * Dispatch table for opcode classes
  */
-ACPI_EXECUTE_OP         acpi_gbl_op_type_dispatch [] = {
+static ACPI_EXECUTE_OP      acpi_gbl_op_type_dispatch [] = {
 			 acpi_ex_opcode_1A_0T_0R,
 			 acpi_ex_opcode_1A_0T_1R,
 			 acpi_ex_opcode_1A_1T_0R,
@@ -55,9 +54,9 @@
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_get_predicate_value
+ * FUNCTION:    acpi_ds_get_predicate_value
  *
- * PARAMETERS:  Walk_state      - Current state of the parse tree walk
+ * PARAMETERS:  walk_state      - Current state of the parse tree walk
  *
  * RETURN:      Status
  *
@@ -67,18 +66,18 @@
 
 acpi_status
 acpi_ds_get_predicate_value (
-	acpi_walk_state         *walk_state,
-	u32                     has_result_obj) {
-	acpi_status             status = AE_OK;
-	acpi_operand_object     *obj_desc;
+	struct acpi_walk_state          *walk_state,
+	union acpi_operand_object       *result_obj) {
+	acpi_status                     status = AE_OK;
+	union acpi_operand_object       *obj_desc;
 
 
-	FUNCTION_TRACE_PTR ("Ds_get_predicate_value", walk_state);
+	ACPI_FUNCTION_TRACE_PTR ("ds_get_predicate_value", walk_state);
 
 
 	walk_state->control_state->common.state = 0;
 
-	if (has_result_obj) {
+	if (result_obj) {
 		status = acpi_ds_result_pop (&obj_desc, walk_state);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
@@ -88,7 +87,6 @@
 			return_ACPI_STATUS (status);
 		}
 	}
-
 	else {
 		status = acpi_ds_create_operand (walk_state, walk_state->op, 0);
 		if (ACPI_FAILURE (status)) {
@@ -104,30 +102,28 @@
 	}
 
 	if (!obj_desc) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate Obj_desc=%p State=%p\n",
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate obj_desc=%p State=%p\n",
 			obj_desc, walk_state));
 
 		return_ACPI_STATUS (AE_AML_NO_OPERAND);
 	}
 
-
 	/*
 	 * Result of predicate evaluation currently must
 	 * be a number
 	 */
-	if (obj_desc->common.type != ACPI_TYPE_INTEGER) {
+	if (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_INTEGER) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-			"Bad predicate (not a number) Obj_desc=%p State=%p Type=%X\n",
-			obj_desc, walk_state, obj_desc->common.type));
+			"Bad predicate (not a number) obj_desc=%p State=%p Type=%X\n",
+			obj_desc, walk_state, ACPI_GET_OBJECT_TYPE (obj_desc)));
 
 		status = AE_AML_OPERAND_TYPE;
 		goto cleanup;
 	}
 
-
 	/* Truncate the predicate to 32-bits if necessary */
 
-	acpi_ex_truncate_for32bit_table (obj_desc, walk_state);
+	acpi_ex_truncate_for32bit_table (obj_desc);
 
 	/*
 	 * Save the result of the predicate evaluation on
@@ -136,7 +132,6 @@
 	if (obj_desc->integer.value) {
 		walk_state->control_state->common.value = TRUE;
 	}
-
 	else {
 		/*
 		 * Predicate is FALSE, we will just toss the
@@ -149,12 +144,12 @@
 
 cleanup:
 
-	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%pn",
+	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
 		walk_state->control_state->common.value, walk_state->op));
 
 	 /* Break to debugger to display result */
 
-	DEBUGGER_EXEC (acpi_db_display_result_object (obj_desc, walk_state));
+	ACPI_DEBUGGER_EXEC (acpi_db_display_result_object (obj_desc, walk_state));
 
 	/*
 	 * Delete the predicate result object (we know that
@@ -162,17 +157,17 @@
 	 */
 	acpi_ut_remove_reference (obj_desc);
 
-	walk_state->control_state->common.state = CONTROL_NORMAL;
+	walk_state->control_state->common.state = ACPI_CONTROL_NORMAL;
 	return_ACPI_STATUS (status);
 }
 
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_exec_begin_op
+ * FUNCTION:    acpi_ds_exec_begin_op
  *
- * PARAMETERS:  Walk_state      - Current state of the parse tree walk
- *              Out_op          - Return op if a new one is created
+ * PARAMETERS:  walk_state      - Current state of the parse tree walk
+ *              out_op          - Return op if a new one is created
  *
  * RETURN:      Status
  *
@@ -184,15 +179,15 @@
 
 acpi_status
 acpi_ds_exec_begin_op (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       **out_op)
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         **out_op)
 {
-	acpi_parse_object       *op;
-	acpi_status             status = AE_OK;
-	u32                     opcode_class;
+	union acpi_parse_object         *op;
+	acpi_status                     status = AE_OK;
+	u32                             opcode_class;
 
 
-	FUNCTION_TRACE_PTR ("Ds_exec_begin_op", walk_state);
+	ACPI_FUNCTION_TRACE_PTR ("ds_exec_begin_op", walk_state);
 
 
 	op = walk_state->op;
@@ -204,8 +199,18 @@
 
 		op = *out_op;
 		walk_state->op = op;
-		walk_state->op_info = acpi_ps_get_opcode_info (op->opcode);
-		walk_state->opcode = op->opcode;
+		walk_state->opcode = op->common.aml_opcode;
+		walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
+
+		if (acpi_ns_opens_scope (walk_state->op_info->object_type)) {
+			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
+				acpi_ut_get_type_name (walk_state->op_info->object_type), op));
+
+			status = acpi_ds_scope_stack_pop (walk_state);
+			if (ACPI_FAILURE (status)) {
+				return_ACPI_STATUS (status);
+			}
+		}
 	}
 
 	if (op == walk_state->origin) {
@@ -223,11 +228,11 @@
 	 */
 	if ((walk_state->control_state) &&
 		(walk_state->control_state->common.state ==
-			CONTROL_CONDITIONAL_EXECUTING)) {
+			ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
 		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
 				  op, walk_state));
 
-		walk_state->control_state->common.state = CONTROL_PREDICATE_EXECUTING;
+		walk_state->control_state->common.state = ACPI_CONTROL_PREDICATE_EXECUTING;
 
 		/* Save start of predicate */
 
@@ -239,7 +244,7 @@
 
 	/* We want to send namepaths to the load code */
 
-	if (op->opcode == AML_INT_NAMEPATH_OP) {
+	if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
 		opcode_class = AML_CLASS_NAMED_OBJECT;
 	}
 
@@ -260,7 +265,7 @@
 
 	case AML_CLASS_NAMED_OBJECT:
 
-		if (walk_state->walk_type == WALK_METHOD) {
+		if (walk_state->walk_type == ACPI_WALK_METHOD) {
 			/*
 			 * Found a named object declaration during method
 			 * execution;  we must enter this object into the
@@ -271,19 +276,16 @@
 			status = acpi_ds_load2_begin_op (walk_state, NULL);
 		}
 
-
-		if (op->opcode == AML_REGION_OP) {
+		if (op->common.aml_opcode == AML_REGION_OP) {
 			status = acpi_ds_result_stack_push (walk_state);
 		}
-
 		break;
 
 
-	/* most operators with arguments */
-
 	case AML_CLASS_EXECUTE:
 	case AML_CLASS_CREATE:
 
+		/* most operators with arguments */
 		/* Start a new result/operand state */
 
 		status = acpi_ds_result_stack_push (walk_state);
@@ -302,9 +304,9 @@
 
 /*****************************************************************************
  *
- * FUNCTION:    Acpi_ds_exec_end_op
+ * FUNCTION:    acpi_ds_exec_end_op
  *
- * PARAMETERS:  Walk_state      - Current state of the parse tree walk
+ * PARAMETERS:  walk_state      - Current state of the parse tree walk
  *              Op              - Op that has been just been completed in the
  *                                walk;  Arguments have now been evaluated.
  *
@@ -318,18 +320,17 @@
 
 acpi_status
 acpi_ds_exec_end_op (
-	acpi_walk_state         *walk_state)
+	struct acpi_walk_state          *walk_state)
 {
-	acpi_parse_object       *op;
-	acpi_status             status = AE_OK;
-	u32                     op_type;
-	u32                     op_class;
-	acpi_parse_object       *next_op;
-	acpi_parse_object       *first_arg;
-	u32                     i;
+	union acpi_parse_object         *op;
+	acpi_status                     status = AE_OK;
+	u32                             op_type;
+	u32                             op_class;
+	union acpi_parse_object         *next_op;
+	union acpi_parse_object         *first_arg;
 
 
-	FUNCTION_TRACE_PTR ("Ds_exec_end_op", walk_state);
+	ACPI_FUNCTION_TRACE_PTR ("ds_exec_end_op", walk_state);
 
 
 	op      = walk_state->op;
@@ -337,11 +338,11 @@
 	op_class = walk_state->op_info->class;
 
 	if (op_class == AML_CLASS_UNKNOWN) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", op->opcode));
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", op->common.aml_opcode));
 		return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
 	}
 
-	first_arg = op->value.arg;
+	first_arg = op->common.value.arg;
 
 	/* Init the walk state */
 
@@ -349,22 +350,19 @@
 	walk_state->return_desc = NULL;
 	walk_state->result_obj = NULL;
 
-
 	/* Call debugger for single step support (DEBUG build only) */
 
-	DEBUGGER_EXEC (status = acpi_db_single_step (walk_state, op, op_class));
-	DEBUGGER_EXEC (if (ACPI_FAILURE (status)) {return_ACPI_STATUS (status);});
-
+	ACPI_DEBUGGER_EXEC (status = acpi_db_single_step (walk_state, op, op_class));
+	ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (status)) {return_ACPI_STATUS (status);});
 
-	switch (op_class) {
 	/* Decode the Opcode Class */
 
-	case AML_CLASS_ARGUMENT: /* constants, literals, etc.  do nothing */
+	switch (op_class) {
+	case AML_CLASS_ARGUMENT:    /* constants, literals, etc. -- do nothing */
 		break;
 
-	/* most operators with arguments */
 
-	case AML_CLASS_EXECUTE:
+	case AML_CLASS_EXECUTE:     /* most operators with arguments */
 
 		/* Build resolved operand stack */
 
@@ -385,48 +383,28 @@
 		status = acpi_ex_resolve_operands (walk_state->opcode,
 				  &(walk_state->operands [walk_state->num_operands -1]),
 				  walk_state);
-		if (ACPI_FAILURE (status)) {
-			/* TBD: must pop and delete operands */
-
-			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)));
+		if (ACPI_SUCCESS (status)) {
+			ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
+					  acpi_ps_get_opcode_name (walk_state->opcode),
+					  walk_state->num_operands, "after ex_resolve_operands");
 
 			/*
-			 * On error, we must delete all the operands and clear the
-			 * operand stack
+			 * Dispatch the request to the appropriate interpreter handler
+			 * routine.  There is one routine per opcode "type" based upon the
+			 * number of opcode arguments and return type.
 			 */
-			for (i = 0; i < walk_state->num_operands; i++) {
-				acpi_ut_remove_reference (walk_state->operands[i]);
-				walk_state->operands[i] = NULL;
-			}
-
-			walk_state->num_operands = 0;
-			goto cleanup;
+			status = acpi_gbl_op_type_dispatch [op_type] (walk_state);
 		}
-
-		DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, acpi_ps_get_opcode_name (walk_state->opcode),
-				  walk_state->num_operands, "after Ex_resolve_operands");
-
-		/*
-		 * Dispatch the request to the appropriate interpreter handler
-		 * routine.  There is one routine per opcode "type" based upon the
-		 * number of opcode arguments and return type.
-		 */
-		status = acpi_gbl_op_type_dispatch [op_type] (walk_state);
-
-
-		/* Delete argument objects and clear the operand stack */
-
-		for (i = 0; i < walk_state->num_operands; i++) {
-			/*
-			 * Remove a reference to all operands, including both
-			 * "Arguments" and "Targets".
-			 */
-			acpi_ut_remove_reference (walk_state->operands[i]);
-			walk_state->operands[i] = NULL;
+		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)));
 		}
 
-		walk_state->num_operands = 0;
+		/* Always delete the argument objects and clear the operand stack */
+
+		acpi_ds_clear_operands (walk_state);
 
 		/*
 		 * If a result object was returned from above, push it on the
@@ -445,11 +423,14 @@
 		switch (op_type) {
 		case AML_TYPE_CONTROL:    /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
 
-			/* 1 Operand, 0 External_result, 0 Internal_result */
+			/* 1 Operand, 0 external_result, 0 internal_result */
 
 			status = acpi_ds_exec_end_control_op (walk_state, op);
+			if (ACPI_FAILURE (status)) {
+				break;
+			}
 
-			acpi_ds_result_stack_pop (walk_state);
+			status = acpi_ds_result_stack_pop (walk_state);
 			break;
 
 
@@ -461,13 +442,13 @@
 			 * (AML_METHODCALL) Op->Value->Arg->Node contains
 			 * the method Node pointer
 			 */
-			/* Next_op points to the op that holds the method name */
+			/* next_op points to the op that holds the method name */
 
 			next_op = first_arg;
 
-			/* Next_op points to first argument op */
+			/* next_op points to first argument op */
 
-			next_op = next_op->next;
+			next_op = next_op->common.next;
 
 			/*
 			 * Get the method's arguments and put them on the operand stack
@@ -478,13 +459,15 @@
 			}
 
 			/*
-			 * Since the operands will be passed to another
-			 * control method, we must resolve all local
-			 * references here (Local variables, arguments
-			 * to *this* method, etc.)
+			 * Since the operands will be passed to another control method,
+			 * we must resolve all local references here (Local variables,
+			 * arguments to *this* method, etc.)
 			 */
 			status = acpi_ds_resolve_operands (walk_state);
 			if (ACPI_FAILURE (status)) {
+				/* On error, clear all resolved operands */
+
+				acpi_ds_clear_operands (walk_state);
 				break;
 			}
 
@@ -499,13 +482,12 @@
 			 * especially the operand count!
 			 */
 			return_ACPI_STATUS (status);
-			break;
 
 
 		case AML_TYPE_CREATE_FIELD:
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-				"Executing Create_field Buffer/Index Op=%p\n", op));
+				"Executing create_field Buffer/Index Op=%p\n", op));
 
 			status = acpi_ds_load2_end_op (walk_state);
 			if (ACPI_FAILURE (status)) {
@@ -516,18 +498,65 @@
 			break;
 
 
+		case AML_TYPE_CREATE_OBJECT:
+
+			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+				"Executing create_object (Buffer/Package) Op=%p\n", op));
+
+			switch (op->common.parent->common.aml_opcode) {
+			case AML_NAME_OP:
+
+				/*
+				 * Put the Node on the object stack (Contains the ACPI Name of
+				 * this object)
+				 */
+				walk_state->operands[0] = (void *) op->common.parent->common.node;
+				walk_state->num_operands = 1;
+
+				status = acpi_ds_create_node (walk_state, op->common.parent->common.node, op->common.parent);
+				if (ACPI_FAILURE (status)) {
+					break;
+				}
+
+				/* Fall through */
+				/*lint -fallthrough */
+
+			case AML_INT_EVAL_SUBTREE_OP:
+
+				status = acpi_ds_eval_data_object_operands (walk_state, op,
+						  acpi_ns_get_attached_object (op->common.parent->common.node));
+				break;
+
+			default:
+
+				status = acpi_ds_eval_data_object_operands (walk_state, op, NULL);
+				break;
+			}
+
+			/*
+			 * If a result object was returned from above, push it on the
+			 * current result stack
+			 */
+			if (ACPI_SUCCESS (status) &&
+				walk_state->result_obj) {
+				status = acpi_ds_result_push (walk_state->result_obj, walk_state);
+			}
+			break;
+
+
 		case AML_TYPE_NAMED_FIELD:
 		case AML_TYPE_NAMED_COMPLEX:
 		case AML_TYPE_NAMED_SIMPLE:
+		case AML_TYPE_NAMED_NO_OBJ:
 
 			status = acpi_ds_load2_end_op (walk_state);
 			if (ACPI_FAILURE (status)) {
 				break;
 			}
 
-			if (op->opcode == AML_REGION_OP) {
+			if (op->common.aml_opcode == AML_REGION_OP) {
 				ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-					"Executing Op_region Address/Length Op=%p\n", op));
+					"Executing op_region Address/Length Op=%p\n", op));
 
 				status = acpi_ds_eval_region_operands (walk_state, op);
 				if (ACPI_FAILURE (status)) {
@@ -539,23 +568,26 @@
 
 			break;
 
+
 		case AML_TYPE_UNDEFINED:
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%p\n", op));
 			return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
-			break;
 
 
 		case AML_TYPE_BOGUS:
-			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Internal opcode=%X type Op=%p\n",
+
+			ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+				"Internal opcode=%X type Op=%p\n",
 				walk_state->opcode, op));
 			break;
 
+
 		default:
 
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
 				"Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n",
-				op_class, op_type, op->opcode, op));
+				op_class, op_type, op->common.aml_opcode, op));
 
 			status = AE_NOT_IMPLEMENTED;
 			break;
@@ -563,10 +595,10 @@
 	}
 
 	/*
-	 * ACPI 2.0 support for 64-bit integers:
-	 * Truncate numeric result value if we are executing from a 32-bit ACPI table
+	 * ACPI 2.0 support for 64-bit integers: Truncate numeric
+	 * result value if we are executing from a 32-bit ACPI table
 	 */
-	acpi_ex_truncate_for32bit_table (walk_state->result_obj, walk_state);
+	acpi_ex_truncate_for32bit_table (walk_state->result_obj);
 
 	/*
 	 * Check if we just completed the evaluation of a
@@ -575,9 +607,9 @@
 
 	if ((walk_state->control_state) &&
 		(walk_state->control_state->common.state ==
-			CONTROL_PREDICATE_EXECUTING) &&
+			ACPI_CONTROL_PREDICATE_EXECUTING) &&
 		(walk_state->control_state->control.predicate_op == op)) {
-		status = acpi_ds_get_predicate_value (walk_state, !! walk_state->result_obj);
+		status = acpi_ds_get_predicate_value (walk_state, walk_state->result_obj);
 		walk_state->result_obj = NULL;
 	}
 
@@ -586,7 +618,7 @@
 	if (walk_state->result_obj) {
 		/* Break to debugger to display result */
 
-		DEBUGGER_EXEC (acpi_db_display_result_object (walk_state->result_obj, walk_state));
+		ACPI_DEBUGGER_EXEC (acpi_db_display_result_object (walk_state->result_obj, walk_state));
 
 		/*
 		 * Delete the result op if and only if:
@@ -596,12 +628,16 @@
 		acpi_ds_delete_result_if_not_used (op, walk_state->result_obj, walk_state);
 	}
 
+#if _UNDER_DEVELOPMENT
+
+	if (walk_state->parser_state.aml == walk_state->parser_state.aml_end) {
+		acpi_db_method_end (walk_state);
+	}
+#endif
+
 	/* Always clear the object stack */
 
-	/* TBD: [Investigate] Clear stack of return value,
-	but don't delete it */
 	walk_state->num_operands = 0;
-
 	return_ACPI_STATUS (status);
 }
 
diff -Naur -X /root/bin/dontdiff a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
--- a/drivers/acpi/dispatcher/dswload.c	2003-01-25 01:24:43.000000000 -0800
+++ b/drivers/acpi/dispatcher/dswload.c	2003-01-25 01:30:08.000000000 -0800
@@ -1,12 +1,11 @@
 /******************************************************************************
  *
  * Module Name: dswload - Dispatcher namespace load callbacks
- *              $Revision: 50 $
  *
  *****************************************************************************/
 
 /*
- *  Copyright (C) 2000, 2001 R. Byron Moore
+ *  Copyright (C) 2000 - 2003, R. Byron Moore
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -34,15 +33,15 @@
 
 
 #define _COMPONENT          ACPI_DISPATCHER
-	 MODULE_NAME         ("dswload")
+	 ACPI_MODULE_NAME    ("dswload")
 
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_init_callbacks
+ * FUNCTION:    acpi_ds_init_callbacks
  *
- * PARAMETERS:  Walk_state      - Current state of the parse tree walk
- *              Pass_number     - 1, 2, or 3
+ * PARAMETERS:  walk_state      - Current state of the parse tree walk
+ *              pass_number     - 1, 2, or 3
  *
  * RETURN:      Status
  *
@@ -52,8 +51,8 @@
 
 acpi_status
 acpi_ds_init_callbacks (
-	acpi_walk_state         *walk_state,
-	u32                     pass_number)
+	struct acpi_walk_state          *walk_state,
+	u32                             pass_number)
 {
 
 	switch (pass_number) {
@@ -70,14 +69,15 @@
 		break;
 
 	case 3:
+#ifndef ACPI_NO_METHOD_EXECUTION
 		walk_state->parse_flags      |= ACPI_PARSE_EXECUTE  | ACPI_PARSE_DELETE_TREE;
 		walk_state->descending_callback = acpi_ds_exec_begin_op;
 		walk_state->ascending_callback = acpi_ds_exec_end_op;
+#endif
 		break;
 
 	default:
 		return (AE_BAD_PARAMETER);
-		break;
 	}
 
 	return (AE_OK);
@@ -86,9 +86,9 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    Acpi_ds_load1_begin_op
+ * FUNCTION:    acpi_ds_load1_begin_op
  *
- * PARAMETERS:  Walk_state      - Current state of the parse tree walk
+ * PARAMETERS:  walk_state      - Current state of the parse tree walk
  *              Op              - Op that has been just been reached in the
  *                                walk;  Arguments have not been evaluated yet.
  *
@@ -100,33 +100,42 @@
 
 acpi_status
 acpi_ds_load1_begin_op (
-	acpi_walk_state         *walk_state,
-	acpi_parse_object       **out_op)
+	struct acpi_walk_state          *walk_state,
+	union acpi_parse_object         **out_op)
 {
-	acpi_parse_object       *op;
-	acpi_namespace_node     *node;
-	acpi_status             status;
-	acpi_object_type8       data_type;
-	NATIVE_CHAR             *path;
+	union acpi_parse_object         *op;
+	struct acpi_namespace_node      *node;
+	acpi_status                     status;
+	acpi_object_type                object_type;
+	char                            *path;
+	u32                             flags;
+
 
+	ACPI_FUNCTION_NAME ("ds_load1_begin_op");
 
-	PROC_NAME ("Ds_load1_begin_op");
 
 	op = walk_state->op;
 	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
 
-
 	/* We are only interested in opcodes that have an associated name */
 
-	if (walk_state->op) {
-	   if (!(walk_state->op_info->flags & AML_NAMED)) {
+	if (op) {
+		if (!(walk_state->op_info->flags & AML_NAMED)) {
+#if 0
+			if ((walk_state->op_info->class == AML_CLASS_EXECUTE) ||
+				(walk_state->op_info->class == AML_CLASS_CONTROL)) {
+				acpi_os_printf ("\n\n***EXECUTABLE OPCODE %s***\n\n", walk_state->op_info->name);
+				*out_op = op;
+				return (AE_CTRL_SKIP);
+			}
+#endif
 			*out_op = op;
 			return (AE_OK);
 		}
 
 		/* Check if this object has already been installed in the namespace */
 
-		if (op->node) {
+		if (op->common.node) {
 			*out_op = op;
 			return (AE_OK);
 		}
@@ -136,30 +145,117 @@
 
 	/* Map the raw opcode into an internal object type */
 
-	data_type = acpi_ds_map_named_opcode_to_data_type (walk_state->opcode);
-
+	object_type = walk_state->op_info->object_type;
 
 	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-		"State=%p Op=%p Type=%x\n", walk_state, op, data_type));
+		"State=%p Op=%p [%s] ", walk_state, op, acpi_ut_get_type_name (object_type)));
 
+	switch (walk_state->opcode) {
+	case AML_SCOPE_OP:
 
-	if (walk_state->opcode == AML_SCOPE_OP) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-			"State=%p Op=%p Type=%x\n", walk_state, op, data_type));
-	}
+		/*
+		 * The target name of the Scope() operator must exist at this point so
+		 * that we can actually open the scope to 