25-akpm/arch/i386/kernel/setup.c          |    4 -
 25-akpm/drivers/acpi/executer/exutils.c   |    2 
 25-akpm/drivers/acpi/hardware/hwregs.c    |   21 +++---
 25-akpm/drivers/acpi/osl.c                |   14 ++--
 25-akpm/drivers/acpi/processor.c          |    4 -
 25-akpm/drivers/acpi/tables.c             |   99 ++++++++++++++++--------------
 25-akpm/drivers/acpi/tables/tbconvrt.c    |    6 -
 25-akpm/drivers/acpi/tables/tbget.c       |    4 -
 25-akpm/drivers/acpi/tables/tbinstal.c    |   42 +++++++++---
 25-akpm/drivers/acpi/tables/tbrsdt.c      |    2 
 25-akpm/drivers/acpi/tables/tbxfroot.c    |    6 -
 25-akpm/drivers/acpi/thermal.c            |   12 +--
 25-akpm/drivers/acpi/utilities/utglobal.c |    6 -
 25-akpm/include/acpi/acconfig.h           |    2 
 25-akpm/include/acpi/platform/acenv.h     |    6 +
 15 files changed, 131 insertions(+), 99 deletions(-)

diff -puN arch/i386/kernel/setup.c~acpi-20030714 arch/i386/kernel/setup.c
--- 25/arch/i386/kernel/setup.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/arch/i386/kernel/setup.c	Tue Jul 15 14:37:27 2003
@@ -520,7 +520,7 @@ static void __init parse_cmdline_early (
 			acpi_disabled = 1;
 
 		/* "acpismp=force" turns on ACPI again */
-		else if (!memcmp(from, "acpismp=force", 14))
+		if (c == ' ' && !memcmp(from, "acpismp=force", 13))
 			acpi_disabled = 0;
 
 		/*
@@ -977,7 +977,7 @@ void __init setup_arch(char **cmdline_p)
 	generic_apic_probe(*cmdline_p);
 #endif	
 
-#ifdef CONFIG_ACPI_BOOT
+#ifdef CONFIG_ACPI
 	/*
 	 * Parse the ACPI tables for possible boot-time SMP configuration.
 	 */
diff -puN drivers/acpi/executer/exutils.c~acpi-20030714 drivers/acpi/executer/exutils.c
--- 25/drivers/acpi/executer/exutils.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/executer/exutils.c	Tue Jul 15 14:37:27 2003
@@ -290,7 +290,7 @@ acpi_ex_digits_needed (
 	 * acpi_integer is unsigned, so we don't worry about a '-'
 	 */
 	if ((current_value = value) == 0) {
-	    return_VALUE (1);
+		return_VALUE (1);
 	}
 
 	num_digits = 0;
diff -puN drivers/acpi/hardware/hwregs.c~acpi-20030714 drivers/acpi/hardware/hwregs.c
--- 25/drivers/acpi/hardware/hwregs.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/hardware/hwregs.c	Tue Jul 15 14:37:27 2003
@@ -357,9 +357,9 @@ acpi_set_register (
 
 	/*
 	 * Decode the Register ID
-	 * Register id = Register block id | bit id
+	 * Register ID = [Register block ID] | [bit ID]
 	 *
-	 * Check bit id to fine locate Register offset.
+	 * Check bit ID to fine locate Register offset.
 	 * Check Mask to determine Register offset, and then read-write.
 	 */
 	switch (bit_reg_info->parent_register) {
@@ -367,9 +367,9 @@ acpi_set_register (
 
 		/*
 		 * Status Registers are different from the rest.  Clear by
-		 * writing 1, writing 0 has no effect.  So, the only relevant
+		 * writing 1, and writing 0 has no effect.  So, the only relevant
 		 * information is the single bit we're interested in, all others should
-		 * be written as 0 so they will be left unchanged
+		 * be written as 0 so they will be left unchanged.
 		 */
 		value = ACPI_REGISTER_PREPARE_BITS (value,
 				 bit_reg_info->bit_position, bit_reg_info->access_bit_mask);
@@ -394,17 +394,17 @@ acpi_set_register (
 	case ACPI_REGISTER_PM1_CONTROL:
 
 		/*
-		 * Read the PM1 Control register.
+		 * Write the PM1 Control register.
 		 * Note that at this level, the fact that there are actually TWO
-		 * registers (A and B - and that B may not exist) is abstracted.
+		 * registers (A and B - and B may not exist) is abstracted.
 		 */
 		ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM1 control: Read %X\n", register_value));
 
 		ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position,
 				bit_reg_info->access_bit_mask, value);
 
-		status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, register_id,
-				(u16) register_value);
+		status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
+				  ACPI_REGISTER_PM1_CONTROL, (u16) register_value);
 		break;
 
 
@@ -724,7 +724,7 @@ acpi_hw_low_level_read (
 
 	/*
 	 * Three address spaces supported:
-	 * Memory, Io, or PCI config.
+	 * Memory, IO, or PCI_Config.
 	 */
 	switch (reg->address_space_id) {
 	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
@@ -808,9 +808,10 @@ acpi_hw_low_level_write (
 		(!reg->address)) {
 		return (AE_OK);
 	}
+
 	/*
 	 * Three address spaces supported:
-	 * Memory, Io, or PCI config.
+	 * Memory, IO, or PCI_Config.
 	 */
 	switch (reg->address_space_id) {
 	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
diff -puN drivers/acpi/osl.c~acpi-20030714 drivers/acpi/osl.c
--- 25/drivers/acpi/osl.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/osl.c	Tue Jul 15 14:37:27 2003
@@ -35,6 +35,7 @@
 #include <linux/kmod.h>
 #include <linux/delay.h>
 #include <linux/workqueue.h>
+#include <linux/nmi.h>
 #include <acpi/acpi.h>
 #include <asm/io.h>
 #include <acpi/acpi_bus.h>
@@ -291,11 +292,14 @@ acpi_os_sleep(u32 sec, u32 ms)
 void
 acpi_os_stall(u32 us)
 {
-	if (us > 10000) {
-		mdelay(us / 1000);
-	}
-	else {
-		udelay(us);
+	while (us) {
+		u32 delay = 1000;
+
+		if (delay > us)
+			delay = us;
+		udelay(delay);
+		touch_nmi_watchdog();
+		us -= delay;
 	}
 }
 
diff -puN drivers/acpi/processor.c~acpi-20030714 drivers/acpi/processor.c
--- 25/drivers/acpi/processor.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/processor.c	Tue Jul 15 14:37:27 2003
@@ -1351,7 +1351,7 @@ static int acpi_processor_throttling_ope
 						PDE(inode)->data);
 }
 
-static int
+static ssize_t
 acpi_processor_write_throttling (
         struct file		*file,
         const char		*buffer,
@@ -1414,7 +1414,7 @@ static int acpi_processor_limit_open_fs(
 						PDE(inode)->data);
 }
 
-static int
+static ssize_t
 acpi_processor_write_limit (
 	struct file		*file,
 	const char		*buffer,
diff -puN drivers/acpi/tables.c~acpi-20030714 drivers/acpi/tables.c
--- 25/drivers/acpi/tables.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/tables.c	Tue Jul 15 14:37:27 2003
@@ -33,6 +33,7 @@
 #include <linux/irq.h>
 #include <linux/errno.h>
 #include <linux/acpi.h>
+#include <linux/bootmem.h>
 
 #define PREFIX			"ACPI: "
 
@@ -61,16 +62,14 @@ static char *acpi_table_signatures[ACPI_
 
 /* System Description Table (RSDT/XSDT) */
 struct acpi_table_sdt {
-	unsigned long		pa;		/* Physical Address */
-	unsigned long		count;		/* Table count */
-	struct {
-		unsigned long		pa;
-		enum acpi_table_id	id;
-		unsigned long		size;
-	}			entry[ACPI_MAX_TABLES];
+	unsigned long		pa;
+	enum acpi_table_id	id;
+	unsigned long		size;
 } __attribute__ ((packed));
 
-static struct acpi_table_sdt	sdt;
+static unsigned long		sdt_pa;		/* Physical Address */
+static unsigned long		sdt_count;	/* Table count */
+static struct acpi_table_sdt	*sdt_entry;
 
 void
 acpi_table_print (
@@ -236,11 +235,11 @@ acpi_get_table_header_early (
 
 	/* Locate the table. */
 
-	for (i = 0; i < sdt.count; i++) {
-		if (sdt.entry[i].id != temp_id)
+	for (i = 0; i < sdt_count; i++) {
+		if (sdt_entry[i].id != temp_id)
 			continue;
 		*header = (void *)
-			__acpi_map_table(sdt.entry[i].pa, sdt.entry[i].size);
+			__acpi_map_table(sdt_entry[i].pa, sdt_entry[i].size);
 		if (!*header) {
 			printk(KERN_WARNING PREFIX "Unable to map %s\n",
 			       acpi_table_signatures[temp_id]);
@@ -289,11 +288,11 @@ acpi_table_parse_madt_family (
 
 	/* Locate the MADT (if exists). There should only be one. */
 
-	for (i = 0; i < sdt.count; i++) {
-		if (sdt.entry[i].id != id)
+	for (i = 0; i < sdt_count; i++) {
+		if (sdt_entry[i].id != id)
 			continue;
 		madt = (void *)
-			__acpi_map_table(sdt.entry[i].pa, sdt.entry[i].size);
+			__acpi_map_table(sdt_entry[i].pa, sdt_entry[i].size);
 		if (!madt) {
 			printk(KERN_WARNING PREFIX "Unable to map %s\n",
 			       acpi_table_signatures[id]);
@@ -308,7 +307,7 @@ acpi_table_parse_madt_family (
 		return -ENODEV;
 	}
 
-	madt_end = (unsigned long) madt + sdt.entry[i].size;
+	madt_end = (unsigned long) madt + sdt_entry[i].size;
 
 	/* Parse all entries looking for a match. */
 
@@ -349,10 +348,10 @@ acpi_table_parse (
 	if (!handler)
 		return -EINVAL;
 
-	for (i = 0; i < sdt.count; i++) {
-		if (sdt.entry[i].id != id)
+	for (i = 0; i < sdt_count; i++) {
+		if (sdt_entry[i].id != id)
 			continue;
-		handler(sdt.entry[i].pa, sdt.entry[i].size);
+		handler(sdt_entry[i].pa, sdt_entry[i].size);
 		count++;
 	}
 
@@ -377,11 +376,11 @@ acpi_table_get_sdt (
 			
 		struct acpi_table_xsdt	*mapped_xsdt = NULL;
 
-		sdt.pa = ((struct acpi20_table_rsdp*)rsdp)->xsdt_address;
+		sdt_pa = ((struct acpi20_table_rsdp*)rsdp)->xsdt_address;
 
 		/* map in just the header */
 		header = (struct acpi_table_header *)
-			__acpi_map_table(sdt.pa, sizeof(struct acpi_table_header));
+			__acpi_map_table(sdt_pa, sizeof(struct acpi_table_header));
 
 		if (!header) {
 			printk(KERN_WARNING PREFIX "Unable to map XSDT header\n");
@@ -390,7 +389,7 @@ acpi_table_get_sdt (
 
 		/* remap in the entire table before processing */
 		mapped_xsdt = (struct acpi_table_xsdt *)
-			__acpi_map_table(sdt.pa, header->length);
+			__acpi_map_table(sdt_pa, header->length);
 		if (!mapped_xsdt) {
 			printk(KERN_WARNING PREFIX "Unable to map XSDT\n");
 			return -ENODEV;
@@ -407,15 +406,21 @@ acpi_table_get_sdt (
 			return -ENODEV;
 		}
 
-		sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 3;
-		if (sdt.count > ACPI_MAX_TABLES) {
+		sdt_count = (header->length - sizeof(struct acpi_table_header)) >> 3;
+		if (sdt_count > ACPI_MAX_TABLES) {
 			printk(KERN_WARNING PREFIX "Truncated %lu XSDT entries\n",
-				(sdt.count - ACPI_MAX_TABLES));
-			sdt.count = ACPI_MAX_TABLES;
+				(sdt_count - ACPI_MAX_TABLES));
+			sdt_count = ACPI_MAX_TABLES;
 		}
 
-		for (i = 0; i < sdt.count; i++)
-			sdt.entry[i].pa = (unsigned long) mapped_xsdt->entry[i];
+		sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt));
+		if (!sdt_entry) {
+			printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n");
+			return -ENOMEM;
+		}
+
+		for (i = 0; i < sdt_count; i++)
+			sdt_entry[i].pa = (unsigned long) mapped_xsdt->entry[i];
 	}
 
 	/* Then check RSDT */
@@ -424,11 +429,11 @@ acpi_table_get_sdt (
 
 		struct acpi_table_rsdt	*mapped_rsdt = NULL;
 
-		sdt.pa = rsdp->rsdt_address;
+		sdt_pa = rsdp->rsdt_address;
 
 		/* map in just the header */
 		header = (struct acpi_table_header *)
-			__acpi_map_table(sdt.pa, sizeof(struct acpi_table_header));
+			__acpi_map_table(sdt_pa, sizeof(struct acpi_table_header));
 		if (!header) {
 			printk(KERN_WARNING PREFIX "Unable to map RSDT header\n");
 			return -ENODEV;
@@ -436,7 +441,7 @@ acpi_table_get_sdt (
 
 		/* remap in the entire table before processing */
 		mapped_rsdt = (struct acpi_table_rsdt *)
-			__acpi_map_table(sdt.pa, header->length);
+			__acpi_map_table(sdt_pa, header->length);
 		if (!mapped_rsdt) {
 			printk(KERN_WARNING PREFIX "Unable to map RSDT\n");
 			return -ENODEV;
@@ -453,15 +458,21 @@ acpi_table_get_sdt (
 			return -ENODEV;
 		}
 
-		sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 2;
-		if (sdt.count > ACPI_MAX_TABLES) {
+		sdt_count = (header->length - sizeof(struct acpi_table_header)) >> 2;
+		if (sdt_count > ACPI_MAX_TABLES) {
 			printk(KERN_WARNING PREFIX "Truncated %lu RSDT entries\n",
-				(sdt.count - ACPI_TABLE_COUNT));
-			sdt.count = ACPI_MAX_TABLES;
+				(sdt_count - ACPI_MAX_TABLES));
+			sdt_count = ACPI_MAX_TABLES;
 		}
 
-		for (i = 0; i < sdt.count; i++)
-			sdt.entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
+		sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt));
+		if (!sdt_entry) {
+			printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n");
+			return -ENOMEM;
+		}
+
+		for (i = 0; i < sdt_count; i++)
+			sdt_entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
 	}
 
 	else {
@@ -469,38 +480,38 @@ acpi_table_get_sdt (
 		return -ENODEV;
 	}
 
-	acpi_table_print(header, sdt.pa);
+	acpi_table_print(header, sdt_pa);
 
-	for (i = 0; i < sdt.count; i++) {
+	for (i = 0; i < sdt_count; i++) {
 
 		/* map in just the header */
 		header = (struct acpi_table_header *)
-			__acpi_map_table(sdt.entry[i].pa,
+			__acpi_map_table(sdt_entry[i].pa,
 				sizeof(struct acpi_table_header));
 		if (!header)
 			continue;
 
 		/* remap in the entire table before processing */
 		header = (struct acpi_table_header *)
-			__acpi_map_table(sdt.entry[i].pa,
+			__acpi_map_table(sdt_entry[i].pa,
 				header->length);
 		if (!header)
 			continue;
 	               
-		acpi_table_print(header, sdt.entry[i].pa);
+		acpi_table_print(header, sdt_entry[i].pa);
 
 		if (acpi_table_compute_checksum(header, header->length)) {
 			printk(KERN_WARNING "  >>> ERROR: Invalid checksum\n");
 			continue;
 		}
 
-		sdt.entry[i].size = header->length;
+		sdt_entry[i].size = header->length;
 
 		for (id = 0; id < ACPI_TABLE_COUNT; id++) {
 			if (!strncmp((char *) &header->signature,
 				acpi_table_signatures[id],
 				sizeof(header->signature))) {
-				sdt.entry[i].id = id;
+				sdt_entry[i].id = id;
 			}
 		}
 	}
@@ -525,8 +536,6 @@ acpi_table_init (void)
 	unsigned long		rsdp_phys = 0;
 	int			result = 0;
 
-	memset(&sdt, 0, sizeof(struct acpi_table_sdt));
-
 	/* Locate and map the Root System Description Table (RSDP) */
 
 	rsdp_phys = acpi_find_rsdp();
diff -puN drivers/acpi/tables/tbconvrt.c~acpi-20030714 drivers/acpi/tables/tbconvrt.c
--- 25/drivers/acpi/tables/tbconvrt.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/tables/tbconvrt.c	Tue Jul 15 14:37:27 2003
@@ -75,14 +75,10 @@ acpi_tb_get_table_count (
 	ACPI_FUNCTION_ENTRY ();
 
 
-#if ACPI_MACHINE_WIDTH != 64
-
 	if (RSDP->revision < 2) {
 		pointer_size = sizeof (u32);
 	}
-	else
-#endif
-	{
+	else {
 		pointer_size = sizeof (u64);
 	}
 
diff -puN drivers/acpi/tables/tbget.c~acpi-20030714 drivers/acpi/tables/tbget.c
--- 25/drivers/acpi/tables/tbget.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/tables/tbget.c	Tue Jul 15 14:37:27 2003
@@ -145,7 +145,7 @@ acpi_tb_get_table_header (
 		/* Create a logical address for the physical pointer*/
 
 		status = acpi_os_map_memory (address->pointer.physical, sizeof (struct acpi_table_header),
-				  (void **) &header);
+				  (void *) &header);
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR (("Could not map memory at %8.8X%8.8X for length %X\n",
 				ACPI_HIDWORD (address->pointer.physical),
@@ -361,7 +361,7 @@ acpi_tb_get_this_table (
 		 * into our address space.
 		 */
 		status = acpi_os_map_memory (address->pointer.physical, (acpi_size) header->length,
-				  (void **) &full_table);
+				  (void *) &full_table);
 		if (ACPI_FAILURE (status)) {
 			ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n",
 				header->signature,
diff -puN drivers/acpi/tables/tbinstal.c~acpi-20030714 drivers/acpi/tables/tbinstal.c
--- 25/drivers/acpi/tables/tbinstal.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/tables/tbinstal.c	Tue Jul 15 14:37:27 2003
@@ -271,22 +271,40 @@ acpi_tb_init_table_descriptor (
 		if (list_head->next) {
 			return_ACPI_STATUS (AE_ALREADY_EXISTS);
 		}
-	}
 
-	/*
-	 * Link the new table in to the list of tables of this type.
-	 * Just insert at the start of the list, order unimportant.
-	 *
-	 * table_desc->Prev is already NULL from calloc()
-	 */
-	table_desc->next = list_head->next;
-	list_head->next = table_desc;
+		table_desc->next = list_head->next;
+		list_head->next = table_desc;
+
+		if (table_desc->next) {
+			table_desc->next->prev = table_desc;
+		}
 
-	if (table_desc->next) {
-		table_desc->next->prev = table_desc;
+		list_head->count++;
 	}
+	else {
+		/*
+		 * Link the new table in to the list of tables of this type.
+		 * Insert at the end of the list, order IS IMPORTANT.
+		 *
+		 * table_desc->Prev & Next are already NULL from calloc()
+		 */
+		list_head->count++;
+
+		if (!list_head->next) {
+			list_head->next = table_desc;
+		}
+		else {
+			table_desc->next = list_head->next;
+
+			while (table_desc->next->next) {
+				table_desc->next = table_desc->next->next;
+			}
 
-	list_head->count++;
+			table_desc->next->next = table_desc;
+			table_desc->prev = table_desc->next;
+			table_desc->next = NULL;
+		}
+	}
 
 	/* Finish initialization of the table descriptor */
 
diff -puN drivers/acpi/tables/tbrsdt.c~acpi-20030714 drivers/acpi/tables/tbrsdt.c
--- 25/drivers/acpi/tables/tbrsdt.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/tables/tbrsdt.c	Tue Jul 15 14:37:27 2003
@@ -85,7 +85,7 @@ acpi_tb_verify_rsdp (
 		 * Obtain access to the RSDP structure
 		 */
 		status = acpi_os_map_memory (address->pointer.physical, sizeof (struct rsdp_descriptor),
-				  (void **) &rsdp);
+				  (void *) &rsdp);
 		if (ACPI_FAILURE (status)) {
 			return_ACPI_STATUS (status);
 		}
diff -puN drivers/acpi/tables/tbxfroot.c~acpi-20030714 drivers/acpi/tables/tbxfroot.c
--- 25/drivers/acpi/tables/tbxfroot.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/tables/tbxfroot.c	Tue Jul 15 14:37:27 2003
@@ -179,7 +179,7 @@ acpi_get_firmware_table (
 
 		if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) {
 			status = acpi_os_map_memory (rsdp_address.pointer.physical, sizeof (struct rsdp_descriptor),
-					  (void **) &acpi_gbl_RSDP);
+					  (void *) &acpi_gbl_RSDP);
 			if (ACPI_FAILURE (status)) {
 				return_ACPI_STATUS (status);
 			}
@@ -423,7 +423,7 @@ acpi_tb_find_rsdp (
 		 * 1) Search EBDA (low memory) paragraphs
 		 */
 		status = acpi_os_map_memory ((u64) ACPI_LO_RSDP_WINDOW_BASE, ACPI_LO_RSDP_WINDOW_SIZE,
-				  (void **) &table_ptr);
+				  (void *) &table_ptr);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %X for length %X\n",
 				ACPI_LO_RSDP_WINDOW_BASE, ACPI_LO_RSDP_WINDOW_SIZE));
@@ -447,7 +447,7 @@ acpi_tb_find_rsdp (
 		 * 2) Search upper memory: 16-byte boundaries in E0000h-F0000h
 		 */
 		status = acpi_os_map_memory ((u64) ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE,
-				  (void **) &table_ptr);
+				  (void *) &table_ptr);
 		if (ACPI_FAILURE (status)) {
 			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %X for length %X\n",
 				ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE));
diff -puN drivers/acpi/thermal.c~acpi-20030714 drivers/acpi/thermal.c
--- 25/drivers/acpi/thermal.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/thermal.c	Tue Jul 15 14:37:27 2003
@@ -84,11 +84,11 @@ static int acpi_thermal_remove (struct a
 static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file);
 static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file);
 static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file);
-static int acpi_thermal_write_trip_points (struct file*,const char *,size_t,loff_t *);
+static ssize_t acpi_thermal_write_trip_points (struct file*,const char *,size_t,loff_t *);
 static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file);
-static int acpi_thermal_write_cooling_mode (struct file*,const char *,size_t,loff_t *);
+static ssize_t acpi_thermal_write_cooling_mode (struct file*,const char *,size_t,loff_t *);
 static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file);
-static int acpi_thermal_write_polling(struct file*,const char *,size_t,loff_t *);
+static ssize_t acpi_thermal_write_polling(struct file*,const char *,size_t,loff_t *);
 
 static struct acpi_driver acpi_thermal_driver = {
 	.name =		ACPI_THERMAL_DRIVER_NAME,
@@ -881,7 +881,7 @@ static int acpi_thermal_trip_open_fs(str
 	return single_open(file, acpi_thermal_trip_seq_show, PDE(inode)->data);
 }
 
-static int
+static ssize_t
 acpi_thermal_write_trip_points (
         struct file		*file,
         const char		*buffer,
@@ -950,7 +950,7 @@ static int acpi_thermal_cooling_open_fs(
 							PDE(inode)->data);
 }
 
-static int
+static ssize_t
 acpi_thermal_write_cooling_mode (
 	struct file		*file,
 	const char		*buffer,
@@ -1011,7 +1011,7 @@ static int acpi_thermal_polling_open_fs(
 							PDE(inode)->data);
 }
 
-static int
+static ssize_t
 acpi_thermal_write_polling (
 	struct file		*file,
 	const char		*buffer,
diff -puN drivers/acpi/utilities/utglobal.c~acpi-20030714 drivers/acpi/utilities/utglobal.c
--- 25/drivers/acpi/utilities/utglobal.c~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/drivers/acpi/utilities/utglobal.c	Tue Jul 15 14:37:27 2003
@@ -307,9 +307,9 @@ struct acpi_table_support           acpi
 	/***********    Name,   Signature, Global typed pointer     Signature size,      Type                  How many allowed?,    Contains valid AML? */
 
 	/* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL,                    sizeof (RSDP_SIG)-1, ACPI_TABLE_ROOT     | ACPI_TABLE_SINGLE},
-	/* DSDT 1 */ {DSDT_SIG,  DSDT_SIG, (void **) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE  | ACPI_TABLE_EXECUTABLE},
-	/* FADT 2 */ {FADT_SIG,  FADT_SIG, (void **) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE},
-	/* FACS 3 */ {FACS_SIG,  FACS_SIG, (void **) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE},
+	/* DSDT 1 */ {DSDT_SIG,  DSDT_SIG, (void *) &acpi_gbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE  | ACPI_TABLE_EXECUTABLE},
+	/* FADT 2 */ {FADT_SIG,  FADT_SIG, (void *) &acpi_gbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE},
+	/* FACS 3 */ {FACS_SIG,  FACS_SIG, (void *) &acpi_gbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE},
 	/* PSDT 4 */ {PSDT_SIG,  PSDT_SIG, NULL,                    sizeof (PSDT_SIG)-1, ACPI_TABLE_PRIMARY  | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE},
 	/* SSDT 5 */ {SSDT_SIG,  SSDT_SIG, NULL,                    sizeof (SSDT_SIG)-1, ACPI_TABLE_PRIMARY  | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE},
 	/* XSDT 6 */ {XSDT_SIG,  XSDT_SIG, NULL,                    sizeof (RSDT_SIG)-1, ACPI_TABLE_ROOT     | ACPI_TABLE_SINGLE},
diff -puN include/acpi/acconfig.h~acpi-20030714 include/acpi/acconfig.h
--- 25/include/acpi/acconfig.h~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/include/acpi/acconfig.h	Tue Jul 15 14:37:27 2003
@@ -64,7 +64,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION                 0x20030619
+#define ACPI_CA_VERSION                 0x20030714
 
 /* Maximum objects in the various object caches */
 
diff -puN include/acpi/platform/acenv.h~acpi-20030714 include/acpi/platform/acenv.h
--- 25/include/acpi/platform/acenv.h~acpi-20030714	Tue Jul 15 14:37:27 2003
+++ 25-akpm/include/acpi/platform/acenv.h	Tue Jul 15 14:37:27 2003
@@ -134,6 +134,9 @@
 #elif defined(__FreeBSD__)
 #include "acfreebsd.h"
 
+#elif defined(__NetBSD__)
+#include "acnetbsd.h"
+
 #elif defined(MODESTO)
 #include "acmodesto.h"
 
@@ -187,13 +190,14 @@
 #define DEBUGGER_SINGLE_THREADED    0
 #define DEBUGGER_MULTI_THREADED     1
 
+#ifndef DEBUGGER_THREADING
 #ifdef ACPI_APPLICATION
 #define DEBUGGER_THREADING          DEBUGGER_SINGLE_THREADED
 
 #else
 #define DEBUGGER_THREADING          DEBUGGER_MULTI_THREADED
 #endif
-
+#endif /* !DEBUGGER_THREADING */
 
 /******************************************************************************
  *

_