aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-31 15:37:13 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-31 15:37:13 -0800
commit63b61eadc2c4fd8ef6932e3a31370927b2e4951f (patch)
tree14790cf4060971e6df1c6561eaf9df19427e0aeb
parente1cccd684e70ddcba500fb14712d55c0ebe459e0 (diff)
parent175bc146b9a93cc743a64914c8d1adafafda7a87 (diff)
downloadhistory-63b61eadc2c4fd8ef6932e3a31370927b2e4951f.tar.gz
Merge bk://linux-acpi.bkbits.net/to-linus
into ppc970.osdl.org:/home/torvalds/v2.6/linux
-rw-r--r--arch/i386/kernel/acpi/sleep.c3
-rw-r--r--arch/ia64/kernel/acpi.c2
-rw-r--r--drivers/acpi/Kconfig20
-rw-r--r--drivers/acpi/Makefile1
-rw-r--r--drivers/acpi/ac.c18
-rw-r--r--drivers/acpi/acpi_memhotplug.c542
-rw-r--r--drivers/acpi/battery.c2
-rw-r--r--drivers/acpi/button.c4
-rw-r--r--drivers/acpi/container.c15
-rw-r--r--drivers/acpi/debug.c4
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c11
-rw-r--r--drivers/acpi/dispatcher/dsopcode.c8
-rw-r--r--drivers/acpi/dispatcher/dsutils.c166
-rw-r--r--drivers/acpi/dispatcher/dswexec.c61
-rw-r--r--drivers/acpi/ec.c2
-rw-r--r--drivers/acpi/events/evxface.c4
-rw-r--r--drivers/acpi/executer/exmisc.c5
-rw-r--r--drivers/acpi/executer/exoparg2.c6
-rw-r--r--drivers/acpi/executer/exresolv.c6
-rw-r--r--drivers/acpi/executer/exstoren.c7
-rw-r--r--drivers/acpi/executer/exstorob.c27
-rw-r--r--drivers/acpi/fan.c33
-rw-r--r--drivers/acpi/ibm_acpi.c4
-rw-r--r--drivers/acpi/numa.c2
-rw-r--r--drivers/acpi/osl.c10
-rw-r--r--drivers/acpi/parser/psopcode.c2
-rw-r--r--drivers/acpi/parser/psparse.c42
-rw-r--r--drivers/acpi/parser/pswalk.c254
-rw-r--r--drivers/acpi/pci_irq.c38
-rw-r--r--drivers/acpi/pci_link.c14
-rw-r--r--drivers/acpi/pci_root.c4
-rw-r--r--drivers/acpi/power.c10
-rw-r--r--drivers/acpi/processor_core.c6
-rw-r--r--drivers/acpi/processor_thermal.c2
-rw-r--r--drivers/acpi/processor_throttling.c2
-rw-r--r--drivers/acpi/resources/rsaddr.c146
-rw-r--r--drivers/acpi/resources/rscalc.c14
-rw-r--r--drivers/acpi/resources/rsdump.c23
-rw-r--r--drivers/acpi/resources/rslist.c1
-rw-r--r--drivers/acpi/scan.c47
-rw-r--r--drivers/acpi/thermal.c2
-rw-r--r--drivers/acpi/toshiba_acpi.c2
-rw-r--r--drivers/acpi/utilities/utcopy.c19
-rw-r--r--drivers/acpi/utilities/utdelete.c18
-rw-r--r--drivers/acpi/utilities/utglobal.c10
-rw-r--r--drivers/acpi/utilities/utmisc.c44
-rw-r--r--drivers/acpi/video.c2
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c9
-rw-r--r--include/acpi/acconfig.h4
-rw-r--r--include/acpi/acdisasm.h5
-rw-r--r--include/acpi/acdispat.h10
-rw-r--r--include/acpi/acinterp.h1
-rw-r--r--include/acpi/aclocal.h4
-rw-r--r--include/acpi/acpi_bus.h1
-rw-r--r--include/acpi/acpi_drivers.h3
-rw-r--r--include/acpi/acstruct.h1
-rw-r--r--include/acpi/actbl.h4
-rw-r--r--include/acpi/actbl2.h79
-rw-r--r--include/acpi/actypes.h39
-rw-r--r--include/acpi/platform/acenv.h2
-rw-r--r--include/acpi/processor.h2
-rw-r--r--include/linux/acpi.h2
62 files changed, 1304 insertions, 527 deletions
diff --git a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c
index 0b7e2d381a3ebd..28bb0514bb6e1c 100644
--- a/arch/i386/kernel/acpi/sleep.c
+++ b/arch/i386/kernel/acpi/sleep.c
@@ -8,7 +8,7 @@
#include <linux/acpi.h>
#include <linux/bootmem.h>
#include <asm/smp.h>
-
+#include <asm/tlbflush.h>
/* address in low memory of the wakeup routine. */
unsigned long acpi_wakeup_address = 0;
@@ -27,6 +27,7 @@ static void init_low_mapping(pgd_t *pgd, int pgd_limit)
set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD));
pgd_ofs++, pgd++;
}
+ flush_tlb_all();
}
/**
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index ca062b9628ab3c..a8e99c56a76894 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -771,7 +771,7 @@ EXPORT_SYMBOL(acpi_unmap_lsapic);
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
-#ifdef CONFIG_NUMA
+#ifdef CONFIG_ACPI_NUMA
acpi_status __init
acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
{
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 894128bffc58c3..0400a52d508557 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -331,6 +331,26 @@ config ACPI_CONTAINER
This is the ACPI generic container driver which supports
ACPI0004, PNP0A05 and PNP0A06 devices
+config ACPI_HOTPLUG_MEMORY
+ tristate "Memory Hotplug"
+ depends on ACPI
+ depends on MEMORY_HOTPLUG
+ default n
+ help
+ This driver adds supports for ACPI Memory Hotplug. This driver
+ provides support for fielding notifications on ACPI memory
+ devices (PNP0C80) which represent memory ranges that may be
+ onlined or offlined during runtime.
+
+ Enabling this driver assumes that your platform hardware
+ and firmware have support for hot-plugging physical memory. If
+ your system does not support physically adding or ripping out
+ memory DIMMs at some platfrom defined granularity (individually
+ or as a bank) at runtime, then you need not enable this driver.
+
+ If one selects "m," this driver can be loaded using the following
+ command:
+ $>modprobe acpi_memhotplug
endif # ACPI
endmenu
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 1ae0d89c2d3fbc..65c92e20566d58 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -55,3 +55,4 @@ obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o
obj-$(CONFIG_ACPI_IBM) += ibm_acpi.o
obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
obj-$(CONFIG_ACPI_BUS) += scan.o motherboard.o
+obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index e0f498c7b343c7..23ab761dd72176 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -51,8 +51,8 @@ MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME);
MODULE_LICENSE("GPL");
-int acpi_ac_add (struct acpi_device *device);
-int acpi_ac_remove (struct acpi_device *device, int type);
+static int acpi_ac_add (struct acpi_device *device);
+static int acpi_ac_remove (struct acpi_device *device, int type);
static int acpi_ac_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_ac_driver = {
@@ -108,9 +108,9 @@ acpi_ac_get_state (
FS Interface (/proc)
-------------------------------------------------------------------------- */
-struct proc_dir_entry *acpi_ac_dir;
+static struct proc_dir_entry *acpi_ac_dir;
-int acpi_ac_seq_show(struct seq_file *seq, void *offset)
+static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_ac *ac = (struct acpi_ac *) seq->private;
@@ -200,7 +200,7 @@ acpi_ac_remove_fs (
Driver Model
-------------------------------------------------------------------------- */
-void
+static void
acpi_ac_notify (
acpi_handle handle,
u32 event,
@@ -232,7 +232,7 @@ acpi_ac_notify (
}
-int
+static int
acpi_ac_add (
struct acpi_device *device)
{
@@ -286,7 +286,7 @@ end:
}
-int
+static int
acpi_ac_remove (
struct acpi_device *device,
int type)
@@ -315,7 +315,7 @@ acpi_ac_remove (
}
-int __init
+static int __init
acpi_ac_init (void)
{
int result = 0;
@@ -337,7 +337,7 @@ acpi_ac_init (void)
}
-void __exit
+static void __exit
acpi_ac_exit (void)
{
ACPI_FUNCTION_TRACE("acpi_ac_exit");
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
new file mode 100644
index 00000000000000..77285ffe41c5cb
--- /dev/null
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -0,0 +1,542 @@
+/*
+ * Copyright (C) 2004 Intel Corporation <naveen.b.s@intel.com>
+ *
+ * All rights reserved.
+ *
+ * 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, GOOD TITLE or
+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *
+ * ACPI based HotPlug driver that supports Memory Hotplug
+ * This driver fields notifications from firmare for memory add
+ * and remove operations and alerts the VM of the affected memory
+ * ranges.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/memory_hotplug.h>
+#include <acpi/acpi_drivers.h>
+
+
+#define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000UL
+#define ACPI_MEMORY_DEVICE_CLASS "memory"
+#define ACPI_MEMORY_DEVICE_HID "PNP0C80"
+#define ACPI_MEMORY_DEVICE_DRIVER_NAME "Hotplug Mem Driver"
+#define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device"
+
+#define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT
+
+ACPI_MODULE_NAME ("acpi_memory")
+MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
+MODULE_DESCRIPTION(ACPI_MEMORY_DEVICE_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+
+/* ACPI _STA method values */
+#define ACPI_MEMORY_STA_PRESENT (0x00000001UL)
+#define ACPI_MEMORY_STA_ENABLED (0x00000002UL)
+#define ACPI_MEMORY_STA_FUNCTIONAL (0x00000008UL)
+
+/* Memory Device States */
+#define MEMORY_INVALID_STATE 0
+#define MEMORY_POWER_ON_STATE 1
+#define MEMORY_POWER_OFF_STATE 2
+
+static int acpi_memory_device_add (struct acpi_device *device);
+static int acpi_memory_device_remove (struct acpi_device *device, int type);
+
+static struct acpi_driver acpi_memory_device_driver = {
+ .name = ACPI_MEMORY_DEVICE_DRIVER_NAME,
+ .class = ACPI_MEMORY_DEVICE_CLASS,
+ .ids = ACPI_MEMORY_DEVICE_HID,
+ .ops = {
+ .add = acpi_memory_device_add,
+ .remove = acpi_memory_device_remove,
+ },
+};
+
+struct acpi_memory_device {
+ acpi_handle handle;
+ unsigned int state; /* State of the memory device */
+ unsigned short cache_attribute; /* memory cache attribute */
+ unsigned short read_write_attribute;/* memory read/write attribute */
+ u64 start_addr; /* Memory Range start physical addr */
+ u64 end_addr; /* Memory Range end physical addr */
+};
+
+
+static int
+acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
+{
+ acpi_status status;
+ struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+ struct acpi_resource *resource = NULL;
+ struct acpi_resource_address64 address64;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_get_device_resources");
+
+ /* Get the range from the _CRS */
+ status = acpi_get_current_resources(mem_device->handle, &buffer);
+ if (ACPI_FAILURE(status))
+ return_VALUE(-EINVAL);
+
+ resource = (struct acpi_resource *) buffer.pointer;
+ status = acpi_resource_to_address64(resource, &address64);
+ if (ACPI_SUCCESS(status)) {
+ if (address64.resource_type == ACPI_MEMORY_RANGE) {
+ /* Populate the structure */
+ mem_device->cache_attribute =
+ address64.attribute.memory.cache_attribute;
+ mem_device->read_write_attribute =
+ address64.attribute.memory.read_write_attribute;
+ mem_device->start_addr = address64.min_address_range;
+ mem_device->end_addr = address64.max_address_range;
+ }
+ }
+
+ acpi_os_free(buffer.pointer);
+ return_VALUE(0);
+}
+
+static int
+acpi_memory_get_device(acpi_handle handle,
+ struct acpi_memory_device **mem_device)
+{
+ acpi_status status;
+ acpi_handle phandle;
+ struct acpi_device *device = NULL;
+ struct acpi_device *pdevice = NULL;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_get_device");
+
+ if (!acpi_bus_get_device(handle, &device) && device)
+ goto end;
+
+ status = acpi_get_parent(handle, &phandle);
+ if (ACPI_FAILURE(status)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Error in acpi_get_parent\n"));
+ return_VALUE(-EINVAL);
+ }
+
+ /* Get the parent device */
+ status = acpi_bus_get_device(phandle, &pdevice);
+ if (ACPI_FAILURE(status)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Error in acpi_bus_get_device\n"));
+ return_VALUE(-EINVAL);
+ }
+
+ /*
+ * Now add the notified device. This creates the acpi_device
+ * and invokes .add function
+ */
+ status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
+ if (ACPI_FAILURE(status)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Error in acpi_bus_add\n"));
+ return_VALUE(-EINVAL);
+ }
+
+end:
+ *mem_device = acpi_driver_data(device);
+ if (!(*mem_device)) {
+ printk(KERN_ERR "\n driver data not found" );
+ return_VALUE(-ENODEV);
+ }
+
+ return_VALUE(0);
+}
+
+static int
+acpi_memory_check_device(struct acpi_memory_device *mem_device)
+{
+ unsigned long current_status;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_check_device");
+
+ /* Get device present/absent information from the _STA */
+ if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
+ NULL, &current_status)))
+ return_VALUE(-ENODEV);
+ /*
+ * Check for device status. Device should be
+ * present/enabled/functioning.
+ */
+ if (!((current_status & ACPI_MEMORY_STA_PRESENT)
+ && (current_status & ACPI_MEMORY_STA_ENABLED)
+ && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
+ return_VALUE(-ENODEV);
+
+ return_VALUE(0);
+}
+
+static int
+acpi_memory_enable_device(struct acpi_memory_device *mem_device)
+{
+ int result;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_enable_device");
+
+ /* Get the range from the _CRS */
+ result = acpi_memory_get_device_resources(mem_device);
+ if (result) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "\nget_device_resources failed\n"));
+ mem_device->state = MEMORY_INVALID_STATE;
+ return result;
+ }
+
+ /*
+ * Tell the VM there is more memory here...
+ * Note: Assume that this function returns zero on success
+ */
+ result = add_memory(mem_device->start_addr,
+ (mem_device->end_addr - mem_device->start_addr) + 1,
+ mem_device->read_write_attribute);
+ if (result) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "\nadd_memory failed\n"));
+ mem_device->state = MEMORY_INVALID_STATE;
+ return result;
+ }
+
+ return result;
+}
+
+static int
+acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
+{
+ acpi_status status;
+ struct acpi_object_list arg_list;
+ union acpi_object arg;
+ unsigned long current_status;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_powerdown_device");
+
+ /* Issue the _EJ0 command */
+ arg_list.count = 1;
+ arg_list.pointer = &arg;
+ arg.type = ACPI_TYPE_INTEGER;
+ arg.integer.value = 1;
+ status = acpi_evaluate_object(mem_device->handle,
+ "_EJ0", &arg_list, NULL);
+ /* Return on _EJ0 failure */
+ if (ACPI_FAILURE(status)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"_EJ0 failed.\n"));
+ return_VALUE(-ENODEV);
+ }
+
+ /* Evalute _STA to check if the device is disabled */
+ status = acpi_evaluate_integer(mem_device->handle, "_STA",
+ NULL, &current_status);
+ if (ACPI_FAILURE(status))
+ return_VALUE(-ENODEV);
+
+ /* Check for device status. Device should be disabled */
+ if (current_status & ACPI_MEMORY_STA_ENABLED)
+ return_VALUE(-EINVAL);
+
+ return_VALUE(0);
+}
+
+static int
+acpi_memory_disable_device(struct acpi_memory_device *mem_device)
+{
+ int result;
+ u64 start = mem_device->start_addr;
+ u64 len = mem_device->end_addr - start + 1;
+ unsigned long attr = mem_device->read_write_attribute;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_disable_device");
+
+ /*
+ * Ask the VM to offline this memory range.
+ * Note: Assume that this function returns zero on success
+ */
+ result = remove_memory(start, len, attr);
+ if (result) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Hot-Remove failed.\n"));
+ return_VALUE(result);
+ }
+
+ /* Power-off and eject the device */
+ result = acpi_memory_powerdown_device(mem_device);
+ if (result) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Device Power Down failed.\n"));
+ /* Set the status of the device to invalid */
+ mem_device->state = MEMORY_INVALID_STATE;
+ return result;
+ }
+
+ mem_device->state = MEMORY_POWER_OFF_STATE;
+ return result;
+}
+
+static void
+acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
+{
+ struct acpi_memory_device *mem_device;
+ struct acpi_device *device;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_device_notify");
+
+ switch (event) {
+ case ACPI_NOTIFY_BUS_CHECK:
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+ "\nReceived BUS CHECK notification for device\n"));
+ /* Fall Through */
+ case ACPI_NOTIFY_DEVICE_CHECK:
+ if (event == ACPI_NOTIFY_DEVICE_CHECK)
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+ "\nReceived DEVICE CHECK notification for device\n"));
+ if (acpi_memory_get_device(handle, &mem_device)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Error in finding driver data\n"));
+ return_VOID;
+ }
+
+ if (!acpi_memory_check_device(mem_device)) {
+ if (acpi_memory_enable_device(mem_device))
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Error in acpi_memory_enable_device\n"));
+ }
+ break;
+ case ACPI_NOTIFY_EJECT_REQUEST:
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+ "\nReceived EJECT REQUEST notification for device\n"));
+
+ if (acpi_bus_get_device(handle, &device)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Device doesn't exist\n"));
+ break;
+ }
+ mem_device = acpi_driver_data(device);
+ if (!mem_device) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Driver Data is NULL\n"));
+ break;
+ }
+
+ /*
+ * Currently disabling memory device from kernel mode
+ * TBD: Can also be disabled from user mode scripts
+ * TBD: Can also be disabled by Callback registration
+ * with generic sysfs driver
+ */
+ if (acpi_memory_disable_device(mem_device))
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Error in acpi_memory_disable_device\n"));
+ /*
+ * TBD: Invoke acpi_bus_remove to cleanup data structures
+ */
+ break;
+ default:
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+ "Unsupported event [0x%x]\n", event));
+ break;
+ }
+
+ return_VOID;
+}
+
+static int
+acpi_memory_device_add(struct acpi_device *device)
+{
+ int result;
+ struct acpi_memory_device *mem_device = NULL;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_device_add");
+
+ if (!device)
+ return_VALUE(-EINVAL);
+
+ mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
+ if (!mem_device)
+ return_VALUE(-ENOMEM);
+ memset(mem_device, 0, sizeof(struct acpi_memory_device));
+
+ mem_device->handle = device->handle;
+ sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
+ sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
+ acpi_driver_data(device) = mem_device;
+
+ /* Get the range from the _CRS */
+ result = acpi_memory_get_device_resources(mem_device);
+ if (result) {
+ kfree(mem_device);
+ return_VALUE(result);
+ }
+
+ /* Set the device state */
+ mem_device->state = MEMORY_POWER_ON_STATE;
+
+ printk(KERN_INFO "%s \n", acpi_device_name(device));
+
+ return_VALUE(result);
+}
+
+static int
+acpi_memory_device_remove (struct acpi_device *device, int type)
+{
+ struct acpi_memory_device *mem_device = NULL;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_device_remove");
+
+ if (!device || !acpi_driver_data(device))
+ return_VALUE(-EINVAL);
+
+ mem_device = (struct acpi_memory_device *) acpi_driver_data(device);
+ kfree(mem_device);
+
+ return_VALUE(0);
+}
+
+/*
+ * Helper function to check for memory device
+ */
+static acpi_status
+is_memory_device(acpi_handle handle)
+{
+ char *hardware_id;
+ acpi_status status;
+ struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+ struct acpi_device_info *info;
+
+ ACPI_FUNCTION_TRACE("is_memory_device");
+
+ status = acpi_get_object_info(handle, &buffer);
+ if (ACPI_FAILURE(status))
+ return_ACPI_STATUS(AE_ERROR);
+
+ info = buffer.pointer;
+ if (!(info->valid & ACPI_VALID_HID)) {
+ acpi_os_free(buffer.pointer);
+ return_ACPI_STATUS(AE_ERROR);
+ }
+
+ hardware_id = info->hardware_id.value;
+ if ((hardware_id == NULL) ||
+ (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
+ status = AE_ERROR;
+
+ acpi_os_free(buffer.pointer);
+ return_ACPI_STATUS(status);
+}
+
+static acpi_status
+acpi_memory_register_notify_handler (acpi_handle handle,
+ u32 level, void *ctxt, void **retv)
+{
+ acpi_status status;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_register_notify_handler");
+
+ status = is_memory_device(handle);
+ if (ACPI_FAILURE(status))
+ return_ACPI_STATUS(AE_OK); /* continue */
+
+ status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+ acpi_memory_device_notify, NULL);
+ if (ACPI_FAILURE(status)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Error installing notify handler\n"));
+ return_ACPI_STATUS(AE_OK); /* continue */
+ }
+
+ return_ACPI_STATUS(status);
+}
+
+static acpi_status
+acpi_memory_deregister_notify_handler (acpi_handle handle,
+ u32 level, void *ctxt, void **retv)
+{
+ acpi_status status;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_deregister_notify_handler");
+
+ status = is_memory_device(handle);
+ if (ACPI_FAILURE(status))
+ return_ACPI_STATUS(AE_OK); /* continue */
+
+ status = acpi_remove_notify_handler(handle,
+ ACPI_SYSTEM_NOTIFY, acpi_memory_device_notify);
+ if (ACPI_FAILURE(status)) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "Error removing notify handler\n"));
+ return_ACPI_STATUS(AE_OK); /* continue */
+ }
+
+ return_ACPI_STATUS(status);
+}
+
+static int __init
+acpi_memory_device_init (void)
+{
+ int result;
+ acpi_status status;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_device_init");
+
+ result = acpi_bus_register_driver(&acpi_memory_device_driver);
+
+ if (result < 0)
+ return_VALUE(-ENODEV);
+
+ status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX,
+ acpi_memory_register_notify_handler,
+ NULL, NULL);
+
+ if (ACPI_FAILURE (status)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed\n"));
+ acpi_bus_unregister_driver(&acpi_memory_device_driver);
+ return_VALUE(-ENODEV);
+ }
+
+ return_VALUE(0);
+}
+
+static void __exit
+acpi_memory_device_exit (void)
+{
+ acpi_status status;
+
+ ACPI_FUNCTION_TRACE("acpi_memory_device_exit");
+
+ /*
+ * Adding this to un-install notification handlers for all the device
+ * handles.
+ */
+ status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX,
+ acpi_memory_deregister_notify_handler,
+ NULL, NULL);
+
+ if (ACPI_FAILURE (status))
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed\n"));
+
+ acpi_bus_unregister_driver(&acpi_memory_device_driver);
+
+ return_VOID;
+}
+
+module_init(acpi_memory_device_init);
+module_exit(acpi_memory_device_exit);
+
+
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index a10de067dbb631..c55feca9b7d5e0 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -341,7 +341,7 @@ acpi_battery_check (
FS Interface (/proc)
-------------------------------------------------------------------------- */
-struct proc_dir_entry *acpi_battery_dir;
+static struct proc_dir_entry *acpi_battery_dir;
static int acpi_battery_read_info(struct seq_file *seq, void *offset)
{
int result = 0;
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 31aded126ce88c..ec4430e3053ffb 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -275,7 +275,7 @@ acpi_button_remove_fs (
Driver Interface
-------------------------------------------------------------------------- */
-void
+static void
acpi_button_notify (
acpi_handle handle,
u32 event,
@@ -302,7 +302,7 @@ acpi_button_notify (
}
-acpi_status
+static acpi_status
acpi_button_notify_fixed (
void *data)
{
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 060251b5e49c83..5a0adbf8bc0454 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -177,13 +177,18 @@ container_notify_cb(acpi_handle handle, u32 type, void *context)
printk("Container driver received %s event\n",
(type == ACPI_NOTIFY_BUS_CHECK)?
"ACPI_NOTIFY_BUS_CHECK":"ACPI_NOTIFY_DEVICE_CHECK");
+ status = acpi_bus_get_device(handle, &device);
if (present) {
- status = acpi_bus_get_device(handle, &device);
if (ACPI_FAILURE(status) || !device) {
result = container_device_add(&device, handle);
if (!result)
- kobject_hotplug(&device->kobj, KOBJ_ONLINE);
- } else {
+ kobject_hotplug(&device->kobj,
+ KOBJ_ONLINE);
+ else
+ printk("Failed to add container\n");
+ }
+ } else {
+ if (ACPI_SUCCESS(status)) {
/* device exist and this is a remove request */
kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
}
@@ -255,7 +260,7 @@ end:
}
-int __init
+static int __init
acpi_container_init(void)
{
int result = 0;
@@ -276,7 +281,7 @@ acpi_container_init(void)
return(0);
}
-void __exit
+static void __exit
acpi_container_exit(void)
{
int action = UNINSTALL_NOTIFY_HANDLER;
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c
index d947e2a0a46291..2c0dac559f1636 100644
--- a/drivers/acpi/debug.c
+++ b/drivers/acpi/debug.c
@@ -35,7 +35,7 @@ struct acpi_dlevel {
};
#define ACPI_DEBUG_INIT(v) { .name = #v, .value = v }
-const struct acpi_dlayer acpi_debug_layers[] =
+static const struct acpi_dlayer acpi_debug_layers[] =
{
ACPI_DEBUG_INIT(ACPI_UTILITIES),
ACPI_DEBUG_INIT(ACPI_HARDWARE),
@@ -53,7 +53,7 @@ const struct acpi_dlayer acpi_debug_layers[] =
ACPI_DEBUG_INIT(ACPI_TOOLS),
};
-const struct acpi_dlevel acpi_debug_levels[] =
+static const struct acpi_dlevel acpi_debug_levels[] =
{
ACPI_DEBUG_INIT(ACPI_LV_ERROR),
ACPI_DEBUG_INIT(ACPI_LV_WARN),
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index fac39ba4a7b44d..9f0456cb9bb55c 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -448,7 +448,16 @@ acpi_ds_restart_control_method (
*/
walk_state->return_desc = return_desc;
}
- else {
+
+ /*
+ * The following code is the
+ * optional support for a so-called "implicit return". Some AML code
+ * assumes that the last value of the method is "implicitly" returned
+ * to the caller. Just save the last result as the return value.
+ * NOTE: this is optional because the ASL language does not actually
+ * support this behavior.
+ */
+ else if (!acpi_ds_do_implicit_return (return_desc, walk_state, FALSE)) {
/*
* Delete the return value if it will not be used by the
* calling method
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index 66fc7549c68830..5c987a0e7b75e8 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -1010,6 +1010,10 @@ acpi_ds_exec_end_control_op (
* has been bubbled up the tree
*/
if (op->common.value.arg) {
+ /* Since we have a real Return(), delete any implicit return */
+
+ acpi_ds_clear_implicit_return (walk_state);
+
/* Return statement has an immediate operand */
status = acpi_ds_create_operands (walk_state, op->common.value.arg);
@@ -1036,6 +1040,10 @@ acpi_ds_exec_end_control_op (
}
else if ((walk_state->results) &&
(walk_state->results->results.num_results > 0)) {
+ /* Since we have a real Return(), delete any implicit return */
+
+ acpi_ds_clear_implicit_return (walk_state);
+
/*
* The return value has come from a previous calculation.
*
diff --git a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c
index df6b0018677905..462c5d83e747fe 100644
--- a/drivers/acpi/dispatcher/dsutils.c
+++ b/drivers/acpi/dispatcher/dsutils.c
@@ -54,10 +54,120 @@
ACPI_MODULE_NAME ("dsutils")
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ds_clear_implicit_return
+ *
+ * PARAMETERS: walk_state - Current State
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Clear and remove a reference on an implicit return value. Used
+ * to delete "stale" return values (if enabled, the return value
+ * from every operator is saved at least momentarily, in case the
+ * parent method exits.)
+ *
+ ******************************************************************************/
+
+void
+acpi_ds_clear_implicit_return (
+ struct acpi_walk_state *walk_state)
+{
+ ACPI_FUNCTION_NAME ("ds_clear_implicit_return");
+
+
+ /*
+ * Slack must be enabled for this feature
+ */
+ if (!acpi_gbl_enable_interpreter_slack) {
+ return;
+ }
+
+ if (walk_state->implicit_return_obj) {
+ /*
+ * Delete any "stale" implicit return. However, in
+ * complex statements, the implicit return value can be
+ * bubbled up several levels.
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Removing reference on stale implicit return obj %p\n",
+ walk_state->implicit_return_obj));
+
+ acpi_ut_remove_reference (walk_state->implicit_return_obj);
+ walk_state->implicit_return_obj = NULL;
+ }
+}
+
+
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
+ * FUNCTION: acpi_ds_do_implicit_return
+ *
+ * PARAMETERS: return_desc - The return value
+ * walk_state - Current State
+ * add_reference - True if a reference should be added to the
+ * return object
+ *
+ * RETURN: TRUE if implicit return enabled, FALSE otherwise
+ *
+ * DESCRIPTION: Implements the optional "implicit return". We save the result
+ * of every ASL operator and control method invocation in case the
+ * parent method exit. Before storing a new return value, we
+ * delete the previous return value.
+ *
+ ******************************************************************************/
+
+u8
+acpi_ds_do_implicit_return (
+ union acpi_operand_object *return_desc,
+ struct acpi_walk_state *walk_state,
+ u8 add_reference)
+{
+ ACPI_FUNCTION_NAME ("ds_do_implicit_return");
+
+
+ /*
+ * Slack must be enabled for this feature, and we must
+ * have a valid return object
+ */
+ if ((!acpi_gbl_enable_interpreter_slack) ||
+ (!return_desc)) {
+ return (FALSE);
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Result %p will be implicitly returned; Prev=%p\n",
+ return_desc,
+ walk_state->implicit_return_obj));
+
+ /*
+ * Delete any "stale" implicit return value first. However, in
+ * complex statements, the implicit return value can be
+ * bubbled up several levels, so we don't clear the value if it
+ * is the same as the return_desc.
+ */
+ if (walk_state->implicit_return_obj) {
+ if (walk_state->implicit_return_obj == return_desc) {
+ return (TRUE);
+ }
+ acpi_ds_clear_implicit_return (walk_state);
+ }
+
+ /* Save the implicit return value, add a reference if requested */
+
+ walk_state->implicit_return_obj = return_desc;
+ if (add_reference) {
+ acpi_ut_add_reference (return_desc);
+ }
+
+ return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_ds_is_result_used
*
* PARAMETERS: Op - Current Op
@@ -76,7 +186,6 @@ acpi_ds_is_result_used (
{
const struct acpi_opcode_info *parent_info;
-
ACPI_FUNCTION_TRACE_PTR ("ds_is_result_used", op);
@@ -88,6 +197,19 @@ acpi_ds_is_result_used (
}
/*
+ * We know that this operator is not a
+ * Return() operator (would not come here.) The following code is the
+ * optional support for a so-called "implicit return". Some AML code
+ * assumes that the last value of the method is "implicitly" returned
+ * to the caller. Just save the last result as the return value.
+ * NOTE: this is optional because the ASL language does not actually
+ * support this behavior.
+ */
+ acpi_ds_do_implicit_return (walk_state->result_obj, walk_state, TRUE);
+
+ /*
+ * Now determine if the parent will use the result
+ *
* If there is no parent, or the parent is a scope_op, we are executing
* at the method level. An executing method typically has no parent,
* since each method is parsed separately. A method invoked externally
@@ -95,29 +217,10 @@ acpi_ds_is_result_used (
*/
if ((!op->common.parent) ||
(op->common.parent->common.aml_opcode == AML_SCOPE_OP)) {
- /*
- * If this is the last statement in the method, we know it is not a
- * Return() operator (would not come here.) The following code is the
- * optional support for a so-called "implicit return". Some AML code
- * assumes that the last value of the method is "implicitly" returned
- * to the caller. Just save the last result as the return value.
- * NOTE: this is optional because the ASL language does not actually
- * support this behavior.
- */
- if ((acpi_gbl_enable_interpreter_slack) &&
- (walk_state->parser_state.aml >= walk_state->parser_state.aml_end)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Result of [%s] will be implicitly returned\n",
- acpi_ps_get_opcode_name (op->common.aml_opcode)));
-
- /* Use the top of the result stack as the implicit return value */
-
- walk_state->return_desc = walk_state->results->results.obj_desc[0];
- return_VALUE (TRUE);
- }
-
/* No parent, the return value cannot possibly be used */
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "At Method level, result of [%s] not used\n",
+ acpi_ps_get_opcode_name (op->common.aml_opcode)));
return_VALUE (FALSE);
}
@@ -262,9 +365,8 @@ acpi_ds_delete_result_if_not_used (
}
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)) {
acpi_ut_remove_reference (result_obj);
@@ -338,9 +440,8 @@ acpi_ds_clear_operands (
ACPI_FUNCTION_TRACE_PTR ("ds_clear_operands", walk_state);
- /*
- * Remove a reference on each operand on the stack
- */
+ /* 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
@@ -407,11 +508,7 @@ acpi_ds_create_operand (
return_ACPI_STATUS (status);
}
- /*
- * All prefixes have been handled, and the name is
- * in name_string
- */
-
+ /* All prefixes have been handled, and the name is in name_string */
/*
* Special handling for buffer_field declarations. This is a deferred
@@ -586,7 +683,8 @@ acpi_ds_create_operand (
*
* FUNCTION: acpi_ds_create_operands
*
- * PARAMETERS: first_arg - First argument of a parser argument tree
+ * PARAMETERS: walk_state - Current state
+ * first_arg - First argument of a parser argument tree
*
* RETURN: Status
*
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index b02322e213de9d..2071a0d2bbbb95 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -91,6 +91,7 @@ acpi_ds_get_predicate_value (
union acpi_operand_object *result_obj) {
acpi_status status = AE_OK;
union acpi_operand_object *obj_desc;
+ union acpi_operand_object *local_obj_desc = NULL;
ACPI_FUNCTION_TRACE_PTR ("ds_get_predicate_value", walk_state);
@@ -130,12 +131,17 @@ acpi_ds_get_predicate_value (
}
/*
- * Result of predicate evaluation currently must
- * be a number
+ * Result of predicate evaluation must be an Integer
+ * object. Implicitly convert the argument if necessary.
*/
- if (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_INTEGER) {
+ status = acpi_ex_convert_to_integer (obj_desc, &local_obj_desc, 16);
+ if (ACPI_FAILURE (status)) {
+ goto cleanup;
+ }
+
+ if (ACPI_GET_OBJECT_TYPE (local_obj_desc) != ACPI_TYPE_INTEGER) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Bad predicate (not a number) obj_desc=%p State=%p Type=%X\n",
+ "Bad predicate (not an integer) obj_desc=%p State=%p Type=%X\n",
obj_desc, walk_state, ACPI_GET_OBJECT_TYPE (obj_desc)));
status = AE_AML_OPERAND_TYPE;
@@ -144,13 +150,13 @@ acpi_ds_get_predicate_value (
/* Truncate the predicate to 32-bits if necessary */
- acpi_ex_truncate_for32bit_table (obj_desc);
+ acpi_ex_truncate_for32bit_table (local_obj_desc);
/*
* Save the result of the predicate evaluation on
* the control stack
*/
- if (obj_desc->integer.value) {
+ if (local_obj_desc->integer.value) {
walk_state->control_state->common.value = TRUE;
}
else {
@@ -170,12 +176,15 @@ cleanup:
/* Break to debugger to display result */
- ACPI_DEBUGGER_EXEC (acpi_db_display_result_object (obj_desc, walk_state));
+ ACPI_DEBUGGER_EXEC (acpi_db_display_result_object (local_obj_desc, walk_state));
/*
* Delete the predicate result object (we know that
* we don't need it anymore)
*/
+ if (local_obj_desc != obj_desc) {
+ acpi_ut_remove_reference (local_obj_desc);
+ }
acpi_ut_remove_reference (obj_desc);
walk_state->control_state->common.state = ACPI_CONTROL_NORMAL;
@@ -306,9 +315,10 @@ acpi_ds_exec_begin_op (
case AML_CLASS_EXECUTE:
case AML_CLASS_CREATE:
- /* most operators with arguments */
- /* Start a new result/operand state */
-
+ /*
+ * Most operators with arguments.
+ * Start a new result/operand state
+ */
status = acpi_ds_result_stack_push (walk_state);
break;
@@ -471,20 +481,41 @@ acpi_ds_exec_end_op (
/* 1 Operand, 0 external_result, 0 internal_result */
status = acpi_ds_exec_end_control_op (walk_state, op);
- if (ACPI_FAILURE (status)) {
- break;
- }
- status = acpi_ds_result_stack_pop (walk_state);
+ /* Make sure to properly pop the result stack */
+
+ if (ACPI_SUCCESS (status)) {
+ status = acpi_ds_result_stack_pop (walk_state);
+ }
+ else if (status == AE_CTRL_PENDING) {
+ status = acpi_ds_result_stack_pop (walk_state);
+ if (ACPI_SUCCESS (status)) {
+ status = AE_CTRL_PENDING;
+ }
+ }
break;
case AML_TYPE_METHOD_CALL:
+ /*
+ * If the method is referenced from within a package
+ * declaration, it is not a invocation of the method, just
+ * a reference to it.
+ */
+ if ((op->asl.parent) &&
+ ((op->asl.parent->asl.aml_opcode == AML_PACKAGE_OP) ||
+ (op->asl.parent->asl.aml_opcode == AML_VAR_PACKAGE_OP))) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method Reference in a Package, Op=%p\n", op));
+ op->common.node = (struct acpi_namespace_node *) op->asl.value.arg->asl.node->object;
+ acpi_ut_add_reference (op->asl.value.arg->asl.node->object);
+ return_ACPI_STATUS (AE_OK);
+ }
+
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", op));
/*
- * (AML_METHODCALL) Op->Value->Arg->Node contains
+ * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
* the method Node pointer
*/
/* next_op points to the op that holds the method name */
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 8d4219388c9a8d..fdf143b405be7f 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -514,7 +514,7 @@ out:
FS Interface (/proc)
-------------------------------------------------------------------------- */
-struct proc_dir_entry *acpi_ec_dir;
+static struct proc_dir_entry *acpi_ec_dir;
static int
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index a48820152ccdc8..0bfec10a5f1e90 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -149,7 +149,9 @@ acpi_install_fixed_event_handler (
acpi_gbl_fixed_event_handlers[event].handler = handler;
acpi_gbl_fixed_event_handlers[event].context = context;
- status = acpi_enable_event (event, 0);
+ status = acpi_clear_event (event);
+ if (ACPI_SUCCESS(status))
+ status = acpi_enable_event (event, 0);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not enable fixed event.\n"));
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c
index fc54d4d0ccabea..b542dcd58c0742 100644
--- a/drivers/acpi/executer/exmisc.c
+++ b/drivers/acpi/executer/exmisc.c
@@ -95,6 +95,7 @@ acpi_ex_get_object_reference (
switch (obj_desc->reference.opcode) {
case AML_LOCAL_OP:
case AML_ARG_OP:
+ case AML_DEBUG_OP:
/* The referenced object is the pseudo-node for the local/arg */
@@ -103,7 +104,7 @@ acpi_ex_get_object_reference (
default:
- ACPI_REPORT_ERROR (("Unknown Reference subtype in get ref %X\n",
+ ACPI_REPORT_ERROR (("Unknown Reference opcode in get_reference %X\n",
obj_desc->reference.opcode));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -121,7 +122,7 @@ acpi_ex_get_object_reference (
default:
- ACPI_REPORT_ERROR (("Invalid descriptor type in get ref: %X\n",
+ ACPI_REPORT_ERROR (("Invalid descriptor type in get_reference: %X\n",
ACPI_GET_DESCRIPTOR_TYPE (obj_desc)));
return_ACPI_STATUS (AE_TYPE);
}
diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
index 23964e70a89bf5..8be4d80ceed594 100644
--- a/drivers/acpi/executer/exoparg2.c
+++ b/drivers/acpi/executer/exoparg2.c
@@ -442,6 +442,12 @@ acpi_ex_opcode_2A_1T_1R (
return_desc->reference.object = operand[0];
}
+ /*
+ * Add a reference to the target package/buffer/string for the life
+ * of the index.
+ */
+ acpi_ut_add_reference (operand[0]);
+
/* Complete the Index reference object */
return_desc->reference.opcode = AML_INDEX_OP;
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 9cccf8299dd835..7be60491115684 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -422,6 +422,12 @@ acpi_ex_resolve_multiple (
* This could of course in turn be another reference object.
*/
obj_desc = *(obj_desc->reference.where);
+ if (!obj_desc) {
+ /* NULL package elements are allowed */
+
+ type = 0; /* Uninitialized */
+ goto exit;
+ }
break;
diff --git a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c
index e663a48f8a1cb6..d3677feb07fd9b 100644
--- a/drivers/acpi/executer/exstoren.c
+++ b/drivers/acpi/executer/exstoren.c
@@ -206,7 +206,6 @@ acpi_ex_store_object_to_object (
{
union acpi_operand_object *actual_src_desc;
acpi_status status = AE_OK;
- acpi_object_type original_src_type;
ACPI_FUNCTION_TRACE_PTR ("ex_store_object_to_object", source_desc);
@@ -223,8 +222,7 @@ acpi_ex_store_object_to_object (
return_ACPI_STATUS (status);
}
- original_src_type = ACPI_GET_OBJECT_TYPE (source_desc);
- if (original_src_type != ACPI_GET_OBJECT_TYPE (dest_desc)) {
+ if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_GET_OBJECT_TYPE (dest_desc)) {
/*
* The source type does not match the type of the destination.
* Perform the "implicit conversion" of the source to the current type
@@ -275,8 +273,7 @@ acpi_ex_store_object_to_object (
* Note: There is different store behavior depending on the original
* source type
*/
- status = acpi_ex_store_buffer_to_buffer (original_src_type, actual_src_desc,
- dest_desc);
+ status = acpi_ex_store_buffer_to_buffer (actual_src_desc, dest_desc);
break;
case ACPI_TYPE_PACKAGE:
diff --git a/drivers/acpi/executer/exstorob.c b/drivers/acpi/executer/exstorob.c
index 4e2b442ee5a391..05e1ecae8d92be 100644
--- a/drivers/acpi/executer/exstorob.c
+++ b/drivers/acpi/executer/exstorob.c
@@ -66,7 +66,6 @@
acpi_status
acpi_ex_store_buffer_to_buffer (
- acpi_object_type original_src_type,
union acpi_operand_object *source_desc,
union acpi_operand_object *target_desc)
{
@@ -77,9 +76,8 @@ acpi_ex_store_buffer_to_buffer (
ACPI_FUNCTION_TRACE_PTR ("ex_store_buffer_to_buffer", source_desc);
- /*
- * We know that source_desc is a buffer by now
- */
+ /* We know that source_desc is a buffer by now */
+
buffer = (u8 *) source_desc->buffer.pointer;
length = source_desc->buffer.length;
@@ -105,7 +103,17 @@ acpi_ex_store_buffer_to_buffer (
ACPI_MEMSET (target_desc->buffer.pointer, 0, target_desc->buffer.length);
ACPI_MEMCPY (target_desc->buffer.pointer, buffer, length);
+#ifdef ACPI_OBSOLETE_BEHAVIOR
+ /*
+ * NOTE: ACPI versions up to 3.0 specified that the buffer must be
+ * truncated if the string is smaller than the buffer. However, "other"
+ * implementations of ACPI never did this and thus became the defacto
+ * standard. ACPi 3.0_a changes this behavior such that the buffer
+ * is no longer truncated.
+ */
+
/*
+ * OBSOLETE BEHAVIOR:
* If the original source was a string, we must truncate the buffer,
* according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer
* copy must not truncate the original buffer.
@@ -115,6 +123,7 @@ acpi_ex_store_buffer_to_buffer (
target_desc->buffer.length = length;
}
+#endif
}
else {
/* Truncate the source, copy only what will fit */
@@ -159,9 +168,8 @@ acpi_ex_store_string_to_string (
ACPI_FUNCTION_TRACE_PTR ("ex_store_string_to_string", source_desc);
- /*
- * We know that source_desc is a string by now.
- */
+ /* We know that source_desc is a string by now */
+
buffer = (u8 *) source_desc->string.pointer;
length = source_desc->string.length;
@@ -185,9 +193,8 @@ acpi_ex_store_string_to_string (
*/
if (target_desc->string.pointer &&
(!(target_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
- /*
- * Only free if not a pointer into the DSDT
- */
+ /* Only free if not a pointer into the DSDT */
+
ACPI_MEM_FREE (target_desc->string.pointer);
}
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 2c5422dfecb5af..14192ee55f8f1d 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -50,8 +50,8 @@ MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION(ACPI_FAN_DRIVER_NAME);
MODULE_LICENSE("GPL");
-int acpi_fan_add (struct acpi_device *device);
-int acpi_fan_remove (struct acpi_device *device, int type);
+static int acpi_fan_add (struct acpi_device *device);
+static int acpi_fan_remove (struct acpi_device *device, int type);
static struct acpi_driver acpi_fan_driver = {
.name = ACPI_FAN_DRIVER_NAME,
@@ -72,27 +72,24 @@ struct acpi_fan {
FS Interface (/proc)
-------------------------------------------------------------------------- */
-struct proc_dir_entry *acpi_fan_dir;
+static struct proc_dir_entry *acpi_fan_dir;
static int
acpi_fan_read_state (struct seq_file *seq, void *offset)
{
- struct acpi_fan *fan = (struct acpi_fan *) seq->private;
+ struct acpi_fan *fan = seq->private;
int state = 0;
ACPI_FUNCTION_TRACE("acpi_fan_read_state");
- if (!fan)
- goto end;
-
- if (acpi_bus_get_power(fan->handle, &state))
- goto end;
-
- seq_printf(seq, "status: %s\n",
- !state?"on":"off");
-
-end:
+ if (fan) {
+ if (acpi_bus_get_power(fan->handle, &state))
+ seq_printf(seq, "status: ERROR\n");
+ else
+ seq_printf(seq, "status: %s\n",
+ !state?"on":"off");
+ }
return_VALUE(0);
}
@@ -197,7 +194,7 @@ acpi_fan_remove_fs (
Driver Interface
-------------------------------------------------------------------------- */
-int
+static int
acpi_fan_add (
struct acpi_device *device)
{
@@ -243,7 +240,7 @@ end:
}
-int
+static int
acpi_fan_remove (
struct acpi_device *device,
int type)
@@ -265,7 +262,7 @@ acpi_fan_remove (
}
-int __init
+static int __init
acpi_fan_init (void)
{
int result = 0;
@@ -287,7 +284,7 @@ acpi_fan_init (void)
}
-void __exit
+static void __exit
acpi_fan_exit (void)
{
ACPI_FUNCTION_TRACE("acpi_fan_exit");
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 94a76e520e213e..0fb731a470dce9 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -155,7 +155,7 @@ struct ibm_struct {
int experimental;
};
-struct proc_dir_entry *proc_dir = NULL;
+static struct proc_dir_entry *proc_dir = NULL;
#define onoff(status,bit) ((status) & (1 << (bit)) ? "on" : "off")
#define enabled(status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled")
@@ -856,7 +856,7 @@ static int beep_write(struct ibm_struct *ibm, char *buf)
return 0;
}
-struct ibm_struct ibms[] = {
+static struct ibm_struct ibms[] = {
{
.name = "driver",
.init = driver_init,
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 9bfce46cd435e2..a82834b32752b0 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -170,7 +170,7 @@ acpi_table_parse_srat (
int __init
-acpi_numa_init()
+acpi_numa_init(void)
{
int result;
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 94a511315c8ba9..5a9128de62261f 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -563,7 +563,7 @@ acpi_os_write_pci_configuration (struct acpi_pci_id *pci_id, u32 reg, acpi_integ
}
/* TODO: Change code to take advantage of driver model more */
-void
+static void
acpi_os_derive_pci_id_2 (
acpi_handle rhandle, /* upper bound */
acpi_handle chandle, /* current node */
@@ -1071,7 +1071,7 @@ acpi_os_signal (
}
EXPORT_SYMBOL(acpi_os_signal);
-int __init
+static int __init
acpi_os_name_setup(char *str)
{
char *p = acpi_os_name;
@@ -1101,7 +1101,7 @@ __setup("acpi_os_name=", acpi_os_name_setup);
* empty string disables _OSI
* TBD additional string adds to _OSI
*/
-int __init
+static int __init
acpi_osi_setup(char *str)
{
if (str == NULL || *str == '\0') {
@@ -1119,7 +1119,7 @@ acpi_osi_setup(char *str)
__setup("acpi_osi=", acpi_osi_setup);
/* enable serialization to combat AE_ALREADY_EXISTS errors */
-int __init
+static int __init
acpi_serialize_setup(char *str)
{
printk(KERN_INFO PREFIX "serialize enabled\n");
@@ -1140,7 +1140,7 @@ __setup("acpi_serialize", acpi_serialize_setup);
* Run-time events on the same GPE this flag is available
* to tell Linux to keep the wake-time GPEs enabled at run-time.
*/
-int __init
+static int __init
acpi_wake_gpes_always_on_setup(char *str)
{
printk(KERN_INFO PREFIX "wake GPEs not disabled\n");
diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c
index c1360fc23cee18..03e33fedc11a2f 100644
--- a/drivers/acpi/parser/psopcode.c
+++ b/drivers/acpi/parser/psopcode.c
@@ -522,7 +522,7 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] =
/* 2E */ ACPI_OP ("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 2F */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R),
/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
-/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
+/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R),
/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R | AML_CONSTANT),
/* 33 */ ACPI_OP ("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index fd2751f512e37d..e79edb53cb3b96 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -1187,8 +1187,8 @@ acpi_ps_parse_aml (
previous_walk_state = walk_state;
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "return_value=%p, State=%p\n",
- walk_state->return_desc, walk_state));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "return_value=%p, implicit_value=%p State=%p\n",
+ walk_state->return_desc, walk_state->implicit_return_obj, walk_state));
/* Check if we have restarted a preempted walk */
@@ -1200,8 +1200,20 @@ acpi_ps_parse_aml (
* If the method return value is not used by the parent,
* The object is deleted
*/
- status = acpi_ds_restart_control_method (walk_state,
- previous_walk_state->return_desc);
+ if (!previous_walk_state->return_desc) {
+ status = acpi_ds_restart_control_method (walk_state,
+ previous_walk_state->implicit_return_obj);
+ }
+ else {
+ /*
+ * We have a valid return value, delete any implicit
+ * return value.
+ */
+ acpi_ds_clear_implicit_return (previous_walk_state);
+
+ status = acpi_ds_restart_control_method (walk_state,
+ previous_walk_state->return_desc);
+ }
if (ACPI_SUCCESS (status)) {
walk_state->walk_type |= ACPI_WALK_METHOD_RESTART;
}
@@ -1218,12 +1230,26 @@ acpi_ps_parse_aml (
* value (if any)
*/
else if (previous_walk_state->caller_return_desc) {
- *(previous_walk_state->caller_return_desc) = previous_walk_state->return_desc; /* NULL if no return value */
+ if (previous_walk_state->implicit_return_obj) {
+ *(previous_walk_state->caller_return_desc) = previous_walk_state->implicit_return_obj;
+ }
+ else {
+ /* NULL if no return value */
+
+ *(previous_walk_state->caller_return_desc) = previous_walk_state->return_desc;
+ }
}
- else if (previous_walk_state->return_desc) {
- /* Caller doesn't want it, must delete it */
+ else {
+ if (previous_walk_state->return_desc) {
+ /* Caller doesn't want it, must delete it */
- acpi_ut_remove_reference (previous_walk_state->return_desc);
+ acpi_ut_remove_reference (previous_walk_state->return_desc);
+ }
+ if (previous_walk_state->implicit_return_obj) {
+ /* Caller doesn't want it, must delete it */
+
+ acpi_ut_remove_reference (previous_walk_state->implicit_return_obj);
+ }
}
acpi_ds_delete_walk_state (previous_walk_state);
diff --git a/drivers/acpi/parser/pswalk.c b/drivers/acpi/parser/pswalk.c
index e04b1b73606b95..110d2ce917b643 100644
--- a/drivers/acpi/parser/pswalk.c
+++ b/drivers/acpi/parser/pswalk.c
@@ -44,7 +44,6 @@
#include <acpi/acpi.h>
#include <acpi/acparser.h>
-#include <acpi/acdispat.h>
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("pswalk")
@@ -52,256 +51,65 @@
/*******************************************************************************
*
- * FUNCTION: acpi_ps_get_next_walk_op
+ * FUNCTION: acpi_ps_delete_parse_tree
*
- * PARAMETERS: walk_state - Current state of the walk
- * Op - Current Op to be walked
- * ascending_callback - Procedure called when Op is complete
+ * PARAMETERS: subtree_root - Root of tree (or subtree) to delete
*
- * RETURN: Status
+ * RETURN: None
*
- * DESCRIPTION: Get the next Op in a walk of the parse tree.
+ * DESCRIPTION: Delete a portion of or an entire parse tree.
*
******************************************************************************/
-acpi_status
-acpi_ps_get_next_walk_op (
- struct acpi_walk_state *walk_state,
- union acpi_parse_object *op,
- acpi_parse_upwards ascending_callback)
+void
+acpi_ps_delete_parse_tree (
+ union acpi_parse_object *subtree_root)
{
- union acpi_parse_object *next;
- union acpi_parse_object *parent;
- union acpi_parse_object *grand_parent;
- acpi_status status;
+ union acpi_parse_object *op = subtree_root;
+ union acpi_parse_object *next = NULL;
+ union acpi_parse_object *parent = NULL;
- ACPI_FUNCTION_TRACE_PTR ("ps_get_next_walk_op", op);
+ ACPI_FUNCTION_TRACE_PTR ("ps_delete_parse_tree", subtree_root);
- /* Check for a argument only if we are descending in the tree */
+ /* Visit all nodes in the subtree */
- if (walk_state->next_op_info != ACPI_NEXT_OP_UPWARD) {
- /* Look for an argument or child of the current op */
+ while (op) {
+ /* Check if we are not ascending */
- next = acpi_ps_get_arg (op, 0);
- if (next) {
- /* Still going downward in tree (Op is not completed yet) */
+ if (op != parent) {
+ /* Look for an argument or child of the current op */
- walk_state->prev_op = op;
- walk_state->next_op = next;
- walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD;
+ next = acpi_ps_get_arg (op, 0);
+ if (next) {
+ /* Still going downward in tree (Op is not completed yet) */
- return_ACPI_STATUS (AE_OK);
+ op = next;
+ continue;
+ }
}
/*
- * No more children, this Op is complete. Save Next and Parent
- * in case the Op object gets deleted by the callback routine
+ * No more children, this Op is complete.
*/
- next = op->common.next;
- parent = op->common.parent;
-
- walk_state->op = op;
- walk_state->op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
- walk_state->opcode = op->common.aml_opcode;
+ next = op->common.next;
+ parent = op->common.parent;
- status = ascending_callback (walk_state);
+ acpi_ps_free_op (op);
/*
* If we are back to the starting point, the walk is complete.
*/
- if (op == walk_state->origin) {
- /* Reached the point of origin, the walk is complete */
-
- walk_state->prev_op = op;
- walk_state->next_op = NULL;
-
- return_ACPI_STATUS (status);
+ if (op == subtree_root) {
+ return_VOID;
}
-
- /*
- * Check for a sibling to the current op. A sibling means
- * we are still going "downward" in the tree.
- */
if (next) {
- /* There is a sibling, it will be next */
-
- walk_state->prev_op = op;
- walk_state->next_op = next;
- walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD;
-
- /* Continue downward */
-
- return_ACPI_STATUS (status);
+ op = next;
}
-
- /*
- * Drop into the loop below because we are moving upwards in
- * the tree
- */
- }
- else {
- /*
- * We are resuming a walk, and we were (are) going upward in the tree.
- * So, we want to drop into the parent loop below.
- */
- parent = op;
- }
-
- /*
- * Look for a sibling of the current Op's parent
- * Continue moving up the tree until we find a node that has not been
- * visited, or we get back to where we started.
- */
- while (parent) {
- /* We are moving up the tree, therefore this parent Op is complete */
-
- grand_parent = parent->common.parent;
- next = parent->common.next;
-
- walk_state->op = parent;
- walk_state->op_info = acpi_ps_get_opcode_info (parent->common.aml_opcode);
- walk_state->opcode = parent->common.aml_opcode;
-
- status = ascending_callback (walk_state);
-
- /*
- * If we are back to the starting point, the walk is complete.
- */
- if (parent == walk_state->origin) {
- /* Reached the point of origin, the walk is complete */
-
- walk_state->prev_op = parent;
- walk_state->next_op = NULL;
-
- return_ACPI_STATUS (status);
- }
-
- /*
- * If there is a sibling to this parent (it is not the starting point
- * Op), then we will visit it.
- */
- if (next) {
- /* found sibling of parent */
-
- walk_state->prev_op = parent;
- walk_state->next_op = next;
- walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD;
-
- return_ACPI_STATUS (status);
+ else {
+ op = parent;
}
-
- /* No siblings, no errors, just move up one more level in the tree */
-
- op = parent;
- parent = grand_parent;
- walk_state->prev_op = op;
}
-
-
- /*
- * Got all the way to the top of the tree, we must be done!
- * However, the code should have terminated in the loop above
- */
- walk_state->next_op = NULL;
-
- return_ACPI_STATUS (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_ps_delete_completed_op
- *
- * PARAMETERS: State - Walk state
- * Op - Completed op
- *
- * RETURN: AE_OK
- *
- * DESCRIPTION: Callback function for acpi_ps_get_next_walk_op(). Used during
- * acpi_ps_delete_parse tree to delete Op objects when all sub-objects
- * have been visited (and deleted.)
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ps_delete_completed_op (
- struct acpi_walk_state *walk_state)
-{
-
- acpi_ps_free_op (walk_state->op);
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_ps_delete_parse_tree
- *
- * PARAMETERS: subtree_root - Root of tree (or subtree) to delete
- *
- * RETURN: None
- *
- * DESCRIPTION: Delete a portion of or an entire parse tree.
- *
- ******************************************************************************/
-
-void
-acpi_ps_delete_parse_tree (
- union acpi_parse_object *subtree_root)
-{
- struct acpi_walk_state *walk_state;
- struct acpi_thread_state *thread;
- acpi_status status;
-
-
- ACPI_FUNCTION_TRACE_PTR ("ps_delete_parse_tree", subtree_root);
-
-
- if (!subtree_root) {
- return_VOID;
- }
-
- /* Create and initialize a new walk list */
-
- thread = acpi_ut_create_thread_state ();
- if (!thread) {
- return_VOID;
- }
-
- walk_state = acpi_ds_create_walk_state (0, NULL, NULL, thread);
- if (!walk_state) {
- return_VOID;
- }
-
- walk_state->parse_flags = 0;
- walk_state->descending_callback = NULL;
- walk_state->ascending_callback = NULL;
-
- walk_state->origin = subtree_root;
- walk_state->next_op = subtree_root;
-
- /* Head downward in the tree */
-
- walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD;
-
- /* Visit all nodes in the subtree */
-
- while (walk_state->next_op) {
- status = acpi_ps_get_next_walk_op (walk_state, walk_state->next_op,
- acpi_ps_delete_completed_op);
- if (ACPI_FAILURE (status)) {
- break;
- }
- }
-
- /* We are done with this walk */
-
- acpi_ut_delete_generic_state (ACPI_CAST_PTR (union acpi_generic_state, thread));
- acpi_ds_delete_walk_state (walk_state);
-
return_VOID;
}
-
-
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index a4750192a31995..12b0eea6340733 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -42,8 +42,8 @@
#define _COMPONENT ACPI_PCI_COMPONENT
ACPI_MODULE_NAME ("pci_irq")
-struct acpi_prt_list acpi_prt;
-DEFINE_SPINLOCK(acpi_prt_lock);
+static struct acpi_prt_list acpi_prt;
+static DEFINE_SPINLOCK(acpi_prt_lock);
/* --------------------------------------------------------------------------
PCI IRQ Routing Table (PRT) Support
@@ -281,7 +281,8 @@ acpi_pci_irq_lookup (
int device,
int pin,
int *edge_level,
- int *active_high_low)
+ int *active_high_low,
+ char **link)
{
struct acpi_prt_entry *entry = NULL;
int segment = pci_domain_nr(bus);
@@ -301,7 +302,8 @@ acpi_pci_irq_lookup (
}
if (entry->link.handle) {
- irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, edge_level, active_high_low);
+ irq = acpi_pci_link_get_irq(entry->link.handle,
+ entry->link.index, edge_level, active_high_low, link);
if (irq < 0) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n"));
return_VALUE(-1);
@@ -327,7 +329,8 @@ acpi_pci_irq_derive (
struct pci_dev *dev,
int pin,
int *edge_level,
- int *active_high_low)
+ int *active_high_low,
+ char **link)
{
struct pci_dev *bridge = dev;
int irq = -1;
@@ -360,7 +363,7 @@ acpi_pci_irq_derive (
}
irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
- pin, edge_level, active_high_low);
+ pin, edge_level, active_high_low, link);
}
if (irq < 0) {
@@ -389,6 +392,7 @@ acpi_pci_irq_enable (
int edge_level = ACPI_LEVEL_SENSITIVE;
int active_high_low = ACPI_ACTIVE_LOW;
extern int via_interrupt_line_quirk;
+ char *link = NULL;
ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
@@ -411,21 +415,23 @@ acpi_pci_irq_enable (
* First we check the PCI IRQ routing table (PRT) for an IRQ. PRT
* values override any BIOS-assigned IRQs set during boot.
*/
- irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, &edge_level, &active_high_low);
+ irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
+ &edge_level, &active_high_low, &link);
/*
* If no PRT entry was found, we'll try to derive an IRQ from the
* device's parent bridge.
*/
if (irq < 0)
- irq = acpi_pci_irq_derive(dev, pin, &edge_level, &active_high_low);
+ irq = acpi_pci_irq_derive(dev, pin, &edge_level,
+ &active_high_low, &link);
/*
* No IRQ known to the ACPI subsystem - maybe the BIOS /
* driver reported one, then use it. Exit in any case.
*/
if (irq < 0) {
- printk(KERN_WARNING PREFIX "PCI interrupt %s[%c]: no GSI",
+ printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI",
pci_name(dev), ('A' + pin));
/* Interrupt Line values above 0xF are forbidden */
if (dev->irq >= 0 && (dev->irq <= 0xF)) {
@@ -443,9 +449,13 @@ acpi_pci_irq_enable (
dev->irq = acpi_register_gsi(irq, edge_level, active_high_low);
- printk(KERN_INFO PREFIX "PCI interrupt %s[%c] -> GSI %u "
- "(%s, %s) -> IRQ %d\n",
- pci_name(dev), 'A' + pin, irq,
+ printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ",
+ pci_name(dev), 'A' + pin);
+
+ if (link)
+ printk("Link [%s] -> ", link);
+
+ printk("GSI %u (%s, %s) -> IRQ %d\n", irq,
(edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
(active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high",
dev->irq);
@@ -482,14 +492,14 @@ acpi_pci_irq_disable (
* First we check the PCI IRQ routing table (PRT) for an IRQ.
*/
gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
- &edge_level, &active_high_low);
+ &edge_level, &active_high_low, NULL);
/*
* If no PRT entry was found, we'll try to derive an IRQ from the
* device's parent bridge.
*/
if (gsi < 0)
gsi = acpi_pci_irq_derive(dev, pin,
- &edge_level, &active_high_low);
+ &edge_level, &active_high_low, NULL);
if (gsi < 0)
return_VOID;
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 3191b5ff105e1a..520b28ad0740e6 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -522,9 +522,11 @@ acpi_irq_penalty_init(void)
static int acpi_irq_balance; /* 0: static, 1: balance */
-static int acpi_pci_link_allocate(struct acpi_pci_link* link) {
- int irq;
- int i;
+static int acpi_pci_link_allocate(
+ struct acpi_pci_link *link)
+{
+ int irq;
+ int i;
ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");
@@ -597,8 +599,9 @@ int
acpi_pci_link_get_irq (
acpi_handle handle,
int index,
- int* edge_level,
- int* active_high_low)
+ int *edge_level,
+ int *active_high_low,
+ char **name)
{
int result = 0;
struct acpi_device *device = NULL;
@@ -634,6 +637,7 @@ acpi_pci_link_get_irq (
if (edge_level) *edge_level = link->irq.edge_level;
if (active_high_low) *active_high_low = link->irq.active_high_low;
+ if (name) *name = acpi_device_bid(link->device);
return_VALUE(link->irq.active);
}
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 2adaba68b85b7f..7e6b8e3b2ed418 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -258,7 +258,7 @@ acpi_pci_root_add (
/* TBD: Locking */
list_add_tail(&root->node, &acpi_pci_roots);
- printk(KERN_INFO PREFIX "%s [%s] (%02x:%02x)\n",
+ printk(KERN_INFO PREFIX "%s [%s] (%04x:%02x)\n",
acpi_device_name(device), acpi_device_bid(device),
root->id.segment, root->id.bus);
@@ -272,7 +272,7 @@ acpi_pci_root_add (
root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus);
if (!root->bus) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Bus %02x:%02x not present in PCI namespace\n",
+ "Bus %04x:%02x not present in PCI namespace\n",
root->id.segment, root->id.bus));
result = -ENODEV;
goto end;
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 419b371d95ad83..373a3a95bb4e1b 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -58,8 +58,8 @@ ACPI_MODULE_NAME ("acpi_power")
#define ACPI_POWER_RESOURCE_STATE_ON 0x01
#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF
-int acpi_power_add (struct acpi_device *device);
-int acpi_power_remove (struct acpi_device *device, int type);
+static int acpi_power_add (struct acpi_device *device);
+static int acpi_power_remove (struct acpi_device *device, int type);
static int acpi_power_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_power_driver = {
@@ -479,7 +479,7 @@ end:
FS Interface (/proc)
-------------------------------------------------------------------------- */
-struct proc_dir_entry *acpi_power_dir;
+static struct proc_dir_entry *acpi_power_dir;
static int acpi_power_seq_show(struct seq_file *seq, void *offset)
{
@@ -576,7 +576,7 @@ acpi_power_remove_fs (
Driver Interface
-------------------------------------------------------------------------- */
-int
+static int
acpi_power_add (
struct acpi_device *device)
{
@@ -642,7 +642,7 @@ end:
}
-int
+static int
acpi_power_remove (
struct acpi_device *device,
int type)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index e517a11dc9c688..f4778747e889bd 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -105,7 +105,7 @@ static struct acpi_driver acpi_processor_driver = {
#define UNINSTALL_NOTIFY_HANDLER 2
-struct file_operations acpi_processor_info_fops = {
+static struct file_operations acpi_processor_info_fops = {
.open = acpi_processor_info_open_fs,
.read = seq_read,
.llseek = seq_lseek,
@@ -121,7 +121,7 @@ struct acpi_processor_errata errata;
Errata Handling
-------------------------------------------------------------------------- */
-int
+static int
acpi_processor_errata_piix4 (
struct pci_dev *dev)
{
@@ -259,7 +259,7 @@ acpi_processor_errata (
FS Interface (/proc)
-------------------------------------------------------------------------- */
-struct proc_dir_entry *acpi_processor_dir = NULL;
+static struct proc_dir_entry *acpi_processor_dir = NULL;
static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
{
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index 8711236d28b665..12bd980a12e940 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -345,7 +345,7 @@ end:
return_VALUE(0);
}
-int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
+static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_processor_limit_seq_show,
PDE(inode)->data);
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index db0b31d2b3eb3b..be9f569d39d33f 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -308,7 +308,7 @@ end:
return_VALUE(0);
}
-int acpi_processor_throttling_open_fs(struct inode *inode, struct file *file)
+static int acpi_processor_throttling_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_processor_throttling_seq_show,
PDE(inode)->data);
diff --git a/drivers/acpi/resources/rsaddr.c b/drivers/acpi/resources/rsaddr.c
index ec4ae9a15cb0c5..4788c079735d8a 100644
--- a/drivers/acpi/resources/rsaddr.c
+++ b/drivers/acpi/resources/rsaddr.c
@@ -110,13 +110,13 @@ acpi_rs_address16_resource (
buffer += 2;
temp8 = *buffer;
- /* Values 0-2 are valid */
+ /* Values 0-2 and 0xC0-0xFF are valid */
- if (temp8 > 2) {
+ if ((temp8 > 2) && (temp8 < 0xC0)) {
return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
}
- output_struct->data.address16.resource_type = temp8 & 0x03;
+ output_struct->data.address16.resource_type = temp8;
/*
* Get the General Flags (Byte4)
@@ -496,12 +496,13 @@ acpi_rs_address32_resource (
buffer += 2;
temp8 = *buffer;
- /* Values 0-2 are valid */
- if(temp8 > 2) {
+ /* Values 0-2 and 0xC0-0xFF are valid */
+
+ if ((temp8 > 2) && (temp8 < 0xC0)) {
return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
}
- output_struct->data.address32.resource_type = temp8 & 0x03;
+ output_struct->data.address32.resource_type = temp8;
/*
* Get the General Flags (Byte4)
@@ -850,6 +851,7 @@ acpi_rs_address64_resource (
struct acpi_resource *output_struct = (void *) *output_buffer;
u16 temp16;
u8 temp8;
+ u8 resource_type;
u8 *temp_ptr;
acpi_size struct_size;
u32 index;
@@ -860,6 +862,7 @@ acpi_rs_address64_resource (
buffer = byte_stream_buffer;
struct_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address64);
+ resource_type = *buffer;
/*
* Point past the Descriptor to get the number of bytes consumed
@@ -882,13 +885,13 @@ acpi_rs_address64_resource (
buffer += 2;
temp8 = *buffer;
- /* Values 0-2 are valid */
+ /* Values 0-2 and 0xC0-0xFF are valid */
- if(temp8 > 2) {
+ if ((temp8 > 2) && (temp8 < 0xC0)) {
return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
}
- output_struct->data.address64.resource_type = temp8 & 0x03;
+ output_struct->data.address64.resource_type = temp8;
/*
* Get the General Flags (Byte4)
@@ -942,98 +945,113 @@ acpi_rs_address64_resource (
}
}
+ if (resource_type == ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE) {
+ /* Move past revision_id and Reserved byte */
+
+ buffer += 2;
+ }
+
/*
- * Get Granularity (Bytes 6-13)
+ * Get Granularity (Bytes 6-13) or (Bytes 8-15)
*/
buffer += 1;
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.granularity, buffer);
/*
- * Get min_address_range (Bytes 14-21)
+ * Get min_address_range (Bytes 14-21) or (Bytes 16-23)
*/
buffer += 8;
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.min_address_range, buffer);
/*
- * Get max_address_range (Bytes 22-29)
+ * Get max_address_range (Bytes 22-29) or (Bytes 24-31)
*/
buffer += 8;
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.max_address_range, buffer);
/*
- * Get address_translation_offset (Bytes 30-37)
+ * Get address_translation_offset (Bytes 30-37) or (Bytes 32-39)
*/
buffer += 8;
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_translation_offset, buffer);
/*
- * Get address_length (Bytes 38-45)
+ * Get address_length (Bytes 38-45) or (Bytes 40-47)
*/
buffer += 8;
ACPI_MOVE_64_TO_64 (&output_struct->data.address64.address_length, buffer);
- /*
- * Resource Source Index (if present)
- */
- buffer += 8;
+ output_struct->data.address64.resource_source.index = 0x00;
+ output_struct->data.address64.resource_source.string_length = 0;
+ output_struct->data.address64.resource_source.string_ptr = NULL;
- /*
- * This will leave us pointing to the Resource Source Index
- * If it is present, then save it off and calculate the
- * pointer to where the null terminated string goes:
- * Each Interrupt takes 32-bits + the 5 bytes of the
- * stream that are default.
- *
- * Note: Some resource descriptors will have an additional null, so
- * we add 1 to the length.
- */
- if (*bytes_consumed > (46 + 1)) {
- /* Dereference the Index */
+ if (resource_type == ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE) {
+ /* Get type_specific_attribute (Bytes 48-55) */
- temp8 = *buffer;
- output_struct->data.address64.resource_source.index =
- (u32) temp8;
+ buffer += 8;
+ ACPI_MOVE_64_TO_64 (&output_struct->data.address64.type_specific_attributes, buffer);
+ }
+ else {
+ output_struct->data.address64.type_specific_attributes = 0;
- /* Point to the String */
+ /*
+ * Resource Source Index (if present)
+ */
+ buffer += 8;
- buffer += 1;
+ /*
+ * This will leave us pointing to the Resource Source Index
+ * If it is present, then save it off and calculate the
+ * pointer to where the null terminated string goes:
+ * Each Interrupt takes 32-bits + the 5 bytes of the
+ * stream that are default.
+ *
+ * Note: Some resource descriptors will have an additional null, so
+ * we add 1 to the length.
+ */
+ if (*bytes_consumed > (46 + 1)) {
+ /* Dereference the Index */
- /* Point the String pointer to the end of this structure */
+ temp8 = *buffer;
+ output_struct->data.address64.resource_source.index =
+ (u32) temp8;
- output_struct->data.address64.resource_source.string_ptr =
- (char *)((u8 *)output_struct + struct_size);
+ /* Point to the String */
- temp_ptr = (u8 *) output_struct->data.address64.resource_source.string_ptr;
+ buffer += 1;
- /* Copy the string into the buffer */
+ /* Point the String pointer to the end of this structure */
- index = 0;
- while (0x00 != *buffer) {
- *temp_ptr = *buffer;
+ output_struct->data.address64.resource_source.string_ptr =
+ (char *)((u8 *)output_struct + struct_size);
- temp_ptr += 1;
- buffer += 1;
- index += 1;
- }
+ temp_ptr = (u8 *) output_struct->data.address64.resource_source.string_ptr;
- /*
- * Add the terminating null
- */
- *temp_ptr = 0x00;
- output_struct->data.address64.resource_source.string_length = index + 1;
+ /* Copy the string into the buffer */
- /*
- * In order for the struct_size to fall on a 32-bit boundary,
- * calculate the length of the string and expand the
- * struct_size to the next 32-bit boundary.
- */
- temp8 = (u8) (index + 1);
- struct_size += ACPI_ROUND_UP_to_32_bITS (temp8);
- }
- else {
- output_struct->data.address64.resource_source.index = 0x00;
- output_struct->data.address64.resource_source.string_length = 0;
- output_struct->data.address64.resource_source.string_ptr = NULL;
+ index = 0;
+ while (0x00 != *buffer) {
+ *temp_ptr = *buffer;
+
+ temp_ptr += 1;
+ buffer += 1;
+ index += 1;
+ }
+
+ /*
+ * Add the terminating null
+ */
+ *temp_ptr = 0x00;
+ output_struct->data.address64.resource_source.string_length = index + 1;
+
+ /*
+ * In order for the struct_size to fall on a 32-bit boundary,
+ * calculate the length of the string and expand the
+ * struct_size to the next 32-bit boundary.
+ */
+ temp8 = (u8) (index + 1);
+ struct_size += ACPI_ROUND_UP_to_32_bITS (temp8);
+ }
}
/*
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index 1113af74693954..8a5f0a52371d49 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -376,6 +376,20 @@ acpi_rs_get_list_length (
break;
+ case ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE:
+ /*
+ * 64-Bit Address Resource
+ */
+ buffer = byte_stream_buffer;
+
+ ++buffer;
+ ACPI_MOVE_16_TO_16 (&temp16, buffer);
+
+ bytes_consumed = temp16 + 3;
+ structure_size = ACPI_SIZEOF_RESOURCE (struct acpi_resource_address64);
+ break;
+
+
case ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE:
/*
* 64-Bit Address Resource
diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index a869980f7fe454..eef1b1f2c68596 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -571,7 +571,7 @@ acpi_rs_dump_address16 (
break;
}
- acpi_os_printf (" Type Specific: %s Translation\n",
+ acpi_os_printf (" Type Specific: %s Translation\n",
ACPI_SPARSE_TRANSLATION ==
address16_data->attribute.io.translation_attribute ?
"Sparse" : "Dense");
@@ -584,8 +584,8 @@ acpi_rs_dump_address16 (
default:
- acpi_os_printf ("Invalid resource type. Exiting.\n");
- return;
+ acpi_os_printf ("0x%2.2X\n", address16_data->resource_type);
+ break;
}
acpi_os_printf (" Resource %s\n",
@@ -718,7 +718,7 @@ acpi_rs_dump_address32 (
break;
}
- acpi_os_printf (" Type Specific: %s Translation\n",
+ acpi_os_printf (" Type Specific: %s Translation\n",
ACPI_SPARSE_TRANSLATION ==
address32_data->attribute.io.translation_attribute ?
"Sparse" : "Dense");
@@ -731,8 +731,8 @@ acpi_rs_dump_address32 (
default:
- acpi_os_printf (" Invalid Resource Type..exiting.\n");
- return;
+ acpi_os_printf (" Resource Type: 0x%2.2X\n", address32_data->resource_type);
+ break;
}
acpi_os_printf (" Resource %s\n",
@@ -865,7 +865,7 @@ acpi_rs_dump_address64 (
break;
}
- acpi_os_printf (" Type Specific: %s Translation\n",
+ acpi_os_printf (" Type Specific: %s Translation\n",
ACPI_SPARSE_TRANSLATION ==
address64_data->attribute.io.translation_attribute ?
"Sparse" : "Dense");
@@ -878,8 +878,8 @@ acpi_rs_dump_address64 (
default:
- acpi_os_printf (" Invalid Resource Type..exiting.\n");
- return;
+ acpi_os_printf (" Resource Type: 0x%2.2X\n", address64_data->resource_type);
+ break;
}
acpi_os_printf (" Resource %s\n",
@@ -913,7 +913,10 @@ acpi_rs_dump_address64 (
acpi_os_printf (" Address Length: %8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (address64_data->address_length));
- if(0xFF != address64_data->resource_source.index) {
+ acpi_os_printf (" Type Specific Attributes: %8.8X%8.8X\n",
+ ACPI_FORMAT_UINT64 (address64_data->type_specific_attributes));
+
+ if (0xFF != address64_data->resource_source.index) {
acpi_os_printf (" Resource Source Index: %X\n",
address64_data->resource_source.index);
acpi_os_printf (" Resource Source: %s\n",
diff --git a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c
index 1297589d792f53..e49c1e030f99f7 100644
--- a/drivers/acpi/resources/rslist.c
+++ b/drivers/acpi/resources/rslist.c
@@ -178,6 +178,7 @@ acpi_rs_byte_stream_to_list (
case ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE:
+ case ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE:
/*
* 64-Bit Address Resource
*/
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index f20d88d3c554bb..e7ca06626566e5 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -27,6 +27,10 @@ static LIST_HEAD(acpi_device_list);
DEFINE_SPINLOCK(acpi_device_lock);
LIST_HEAD(acpi_wakeup_device_list);
+static int
+acpi_bus_trim(struct acpi_device *start,
+ int rmdevice);
+
static void acpi_device_release(struct kobject * kobj)
{
struct acpi_device * dev = container_of(kobj,struct acpi_device,kobj);
@@ -81,12 +85,37 @@ static struct kobj_type ktype_acpi_ns = {
.release = acpi_device_release,
};
+static int namespace_hotplug(struct kset *kset, struct kobject *kobj,
+ char **envp, int num_envp, char *buffer,
+ int buffer_size)
+{
+ struct acpi_device *dev = to_acpi_device(kobj);
+ int i = 0;
+ int len = 0;
+
+ if (!dev->driver)
+ return 0;
+
+ if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len,
+ "PHYSDEVDRIVER=%s", dev->driver->name))
+ return -ENOMEM;
+
+ envp[i] = NULL;
+
+ return 0;
+}
+
+static struct kset_hotplug_ops namespace_hotplug_ops = {
+ .hotplug = &namespace_hotplug,
+};
+
static struct kset acpi_namespace_kset = {
.kobj = {
.name = "namespace",
},
.subsys = &acpi_subsys,
.ktype = &ktype_acpi_ns,
+ .hotplug_ops = &namespace_hotplug_ops,
};
@@ -358,7 +387,15 @@ setup_sys_fs_device_files (
struct acpi_device *dev,
acpi_device_sysfs_files *func)
{
- if (dev->flags.ejectable == 1)
+ acpi_status status;
+ acpi_handle temp = NULL;
+
+ /*
+ * If device has _EJ0, 'eject' file is created that is used to trigger
+ * hot-removal function from userland.
+ */
+ status = acpi_get_handle(dev->handle, "_EJ0", &temp);
+ if (ACPI_SUCCESS(status))
(*(func))(&dev->kobj,&acpi_device_attr_eject.attr);
}
@@ -857,7 +894,7 @@ static void acpi_device_set_id(struct acpi_device * device, struct acpi_device *
acpi_os_free(buffer.pointer);
}
-int acpi_device_set_context(struct acpi_device * device, int type)
+static int acpi_device_set_context(struct acpi_device * device, int type)
{
acpi_status status = AE_OK;
int result = 0;
@@ -882,7 +919,7 @@ int acpi_device_set_context(struct acpi_device * device, int type)
return result;
}
-void acpi_device_get_debug_info(struct acpi_device * device, acpi_handle handle, int type)
+static void acpi_device_get_debug_info(struct acpi_device * device, acpi_handle handle, int type)
{
#ifdef CONFIG_ACPI_DEBUG_OUTPUT
char *type_string = NULL;
@@ -925,7 +962,7 @@ void acpi_device_get_debug_info(struct acpi_device * device, acpi_handle handle,
}
-int
+static int
acpi_bus_remove (
struct acpi_device *dev,
int rmdevice)
@@ -1223,7 +1260,7 @@ int acpi_bus_scan (struct acpi_device *start)
EXPORT_SYMBOL(acpi_bus_scan);
-int
+static int
acpi_bus_trim(struct acpi_device *start,
int rmdevice)
{
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index be97f286957924..79c3a686bc4421 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -774,7 +774,7 @@ acpi_thermal_check (
FS Interface (/proc)
-------------------------------------------------------------------------- */
-struct proc_dir_entry *acpi_thermal_dir;
+static struct proc_dir_entry *acpi_thermal_dir;
static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)
{
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index c0c9ea1084aa34..c84997c9f9640b 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -481,7 +481,7 @@ read_version(char* p)
#define PROC_TOSHIBA "toshiba"
-ProcItem proc_items[] =
+static ProcItem proc_items[] =
{
{ "lcd" , read_lcd , write_lcd },
{ "video" , read_video , write_video },
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 0b366d3b48667a..0fcd98bde0d105 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -659,15 +659,17 @@ acpi_ut_copy_simple_object (
/* Create an actual buffer only if length > 0 */
if (source_desc->buffer.length) {
- dest_desc->buffer.pointer = ACPI_MEM_ALLOCATE (source_desc->buffer.length);
+ dest_desc->buffer.pointer =
+ ACPI_MEM_ALLOCATE (source_desc->buffer.length);
if (!dest_desc->buffer.pointer) {
return (AE_NO_MEMORY);
}
/* Copy the actual buffer data */
- ACPI_MEMCPY (dest_desc->buffer.pointer, source_desc->buffer.pointer,
- source_desc->buffer.length);
+ ACPI_MEMCPY (dest_desc->buffer.pointer,
+ source_desc->buffer.pointer,
+ source_desc->buffer.length);
}
}
break;
@@ -682,7 +684,8 @@ acpi_ut_copy_simple_object (
*/
if ((source_desc->string.pointer) &&
(!(source_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
- dest_desc->string.pointer = ACPI_MEM_ALLOCATE ((acpi_size) source_desc->string.length + 1);
+ dest_desc->string.pointer =
+ ACPI_MEM_ALLOCATE ((acpi_size) source_desc->string.length + 1);
if (!dest_desc->string.pointer) {
return (AE_NO_MEMORY);
}
@@ -692,6 +695,14 @@ acpi_ut_copy_simple_object (
}
break;
+ case ACPI_TYPE_LOCAL_REFERENCE:
+ /*
+ * We copied the reference object, so we now must add a reference
+ * to the object pointed to by the reference
+ */
+ acpi_ut_add_reference (source_desc->reference.object);
+ break;
+
default:
/* Nothing to do for other simple objects */
break;
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index e8ee13280bbf16..9a52ad52a23aea 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -46,6 +46,7 @@
#include <acpi/acinterp.h>
#include <acpi/acnamesp.h>
#include <acpi/acevents.h>
+#include <acpi/amlcode.h>
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utdelete")
@@ -562,8 +563,23 @@ acpi_ut_update_object_reference (
break;
- case ACPI_TYPE_REGION:
case ACPI_TYPE_LOCAL_REFERENCE:
+
+ /*
+ * The target of an Index (a package, string, or buffer) must track
+ * changes to the ref count of the index.
+ */
+ if (object->reference.opcode == AML_INDEX_OP) {
+ status = acpi_ut_create_update_state_and_push (
+ object->reference.object, action, &state_list);
+ if (ACPI_FAILURE (status)) {
+ goto error_exit;
+ }
+ }
+ break;
+
+
+ case ACPI_TYPE_REGION:
default:
/* No subobjects */
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index d3eb4db38f75ce..25b0f8ae1bc6fc 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -194,6 +194,8 @@ const char *acpi_gbl_highest_dstate_names[4] =
*/
const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] =
{
+ /* Operating System Vendor Strings */
+
"Linux",
"Windows 2000",
"Windows 2001",
@@ -202,7 +204,11 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STR
"Windows 2001 SP1",
"Windows 2001 SP2",
"Windows 2001 SP3",
- "Windows 2001 SP4"
+ "Windows 2001 SP4",
+
+ /* Feature Group Strings */
+
+ "Extended Address Space Descriptor"
};
@@ -355,6 +361,7 @@ struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG]
/* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS},
/* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS},
/* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS},
+ /* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_STATUS},
/* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE},
/* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
@@ -362,6 +369,7 @@ struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG]
/* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
/* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE},
/* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0},
+ /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_DISABLE},
/* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE},
/* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD},
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 4d32f6d18f648f..f6598547389b87 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -372,7 +372,7 @@ acpi_ut_strtoul64 (
u32 base,
acpi_integer *ret_integer)
{
- u32 this_digit;
+ u32 this_digit = 0;
acpi_integer return_value = 0;
acpi_integer quotient;
@@ -380,6 +380,10 @@ acpi_ut_strtoul64 (
ACPI_FUNCTION_TRACE ("ut_stroul64");
+ if ((!string) || !(*string)) {
+ goto error_exit;
+ }
+
switch (base) {
case ACPI_ANY_BASE:
case 10:
@@ -394,7 +398,7 @@ acpi_ut_strtoul64 (
/* Skip over any white space in the buffer */
while (ACPI_IS_SPACE (*string) || *string == '\t') {
- ++string;
+ string++;
}
/*
@@ -403,9 +407,9 @@ acpi_ut_strtoul64 (
*/
if (base == 0) {
if ((*string == '0') &&
- (ACPI_TOLOWER (*(++string)) == 'x')) {
+ (ACPI_TOLOWER (*(string + 1)) == 'x')) {
base = 16;
- ++string;
+ string += 2;
}
else {
base = 10;
@@ -416,10 +420,10 @@ acpi_ut_strtoul64 (
* For hexadecimal base, skip over the leading
* 0 or 0x, if they are present.
*/
- if (base == 16 &&
- *string == '0' &&
- ACPI_TOLOWER (*(++string)) == 'x') {
- string++;
+ if ((base == 16) &&
+ (*string == '0') &&
+ (ACPI_TOLOWER (*(string + 1)) == 'x')) {
+ string += 2;
}
/* Any string left? */
@@ -437,23 +441,27 @@ acpi_ut_strtoul64 (
this_digit = ((u8) *string) - '0';
}
else {
+ if (base == 10) {
+ /* Digit is out of range */
+
+ goto error_exit;
+ }
+
this_digit = (u8) ACPI_TOUPPER (*string);
- if (ACPI_IS_UPPER ((char) this_digit)) {
+ if (ACPI_IS_XDIGIT ((char) this_digit)) {
/* Convert ASCII Hex char to value */
this_digit = this_digit - 'A' + 10;
}
else {
- goto error_exit;
+ /*
+ * We allow non-hex chars, just stop now, same as end-of-string.
+ * See ACPI spec, string-to-integer conversion.
+ */
+ break;
}
}
- /* Check to see if digit is out of range */
-
- if (this_digit >= base) {
- goto error_exit;
- }
-
/* Divide the digit into the correct position */
(void) acpi_ut_short_divide ((ACPI_INTEGER_MAX - (acpi_integer) this_digit),
@@ -464,9 +472,11 @@ acpi_ut_strtoul64 (
return_value *= base;
return_value += this_digit;
- ++string;
+ string++;
}
+ /* All done, normal exit */
+
*ret_integer = return_value;
return_ACPI_STATUS (AE_OK);
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index bd311c2076acc4..71fa1011715f36 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -683,7 +683,7 @@ acpi_video_bus_check (
FS Interface (/proc)
-------------------------------------------------------------------------- */
-struct proc_dir_entry *acpi_video_dir;
+static struct proc_dir_entry *acpi_video_dir;
/* video devices */
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index df102f9301e71e..c0ddb1eb8c4d68 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -219,9 +219,10 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
res->data.address64.min_address_range,
res->data.address64.address_length);
break;
+ case ACPI_RSTYPE_VENDOR:
+ break;
default:
- pnp_warn("PnPACPI: Alloc type : %d not handle",
- res->id);
+ pnp_warn("PnPACPI: unknown resource type %d", res->id);
return AE_ERROR;
}
@@ -508,7 +509,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
case ACPI_RSTYPE_END_DPF:
return AE_CTRL_TERMINATE;
default:
- pnp_warn("PnPACPI:Option type: %d not handle", res->id);
+ pnp_warn("PnPACPI: unknown resource type %d", res->id);
return AE_ERROR;
}
@@ -810,7 +811,7 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
mem ++;
break;
default: /* other type */
- pnp_warn("Invalid type");
+ pnp_warn("unknown resource type %d", resource->id);
return -EINVAL;
}
resource ++;
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 6701c11b406b3f..2b41e47b7d8094 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -64,7 +64,7 @@
/* Version string */
-#define ACPI_CA_VERSION 0x20050211
+#define ACPI_CA_VERSION 0x20050309
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -198,7 +198,7 @@
/* Number of strings associated with the _OSI reserved method */
-#define ACPI_NUM_OSI_STRINGS 9
+#define ACPI_NUM_OSI_STRINGS 10
/******************************************************************************
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 6a5da01e46fcde..26d907eae6fe3b 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -75,6 +75,11 @@ extern const char *acpi_gbl_SHRdecode[2];
extern const char *acpi_gbl_TYPdecode[4];
extern const char *acpi_gbl_BMdecode[2];
extern const char *acpi_gbl_SIZdecode[4];
+extern const char *acpi_gbl_TTPdecode[2];
+extern const char *acpi_gbl_MTPdecode[4];
+extern const char *acpi_gbl_TRSdecode[2];
+
+
extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 4efbb8d7e704b7..237d63433581cf 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -374,6 +374,16 @@ acpi_ds_create_node (
/* dsutils - Parser/Interpreter interface utility routines */
+void
+acpi_ds_clear_implicit_return (
+ struct acpi_walk_state *walk_state);
+
+u8
+acpi_ds_do_implicit_return (
+ union acpi_operand_object *return_desc,
+ struct acpi_walk_state *walk_state,
+ u8 add_reference);
+
u8
acpi_ds_is_result_used (
union acpi_parse_object *op,
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 78395916e4cfbf..c5301f5ffaf4fd 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -617,7 +617,6 @@ acpi_ex_store_object_to_object (
acpi_status
acpi_ex_store_buffer_to_buffer (
- acpi_object_type original_src_type,
union acpi_operand_object *source_desc,
union acpi_operand_object *target_desc);
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index f2b96f6be45b5b..01d3b4bc0c857a 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -774,6 +774,7 @@ struct acpi_bit_register_info
#define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
#define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
#define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
+#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
#define ACPI_BITMASK_WAKE_STATUS 0x8000
#define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \
@@ -789,6 +790,7 @@ struct acpi_bit_register_info
#define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
#define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
#define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
+#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
#define ACPI_BITMASK_SCI_ENABLE 0x0001
#define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
@@ -807,6 +809,7 @@ struct acpi_bit_register_info
#define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
#define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
#define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
+#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
#define ACPI_BITPOSITION_WAKE_STATUS 0x0F
#define ACPI_BITPOSITION_TIMER_ENABLE 0x00
@@ -814,6 +817,7 @@ struct acpi_bit_register_info
#define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
#define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
#define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
+#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
#define ACPI_BITPOSITION_SCI_ENABLE 0x00
#define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index b4479061b8f905..c627bc408a6b11 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -328,7 +328,6 @@ int acpi_bus_receive_event (struct acpi_bus_event *event);
int acpi_bus_register_driver (struct acpi_driver *driver);
int acpi_bus_unregister_driver (struct acpi_driver *driver);
int acpi_bus_scan (struct acpi_device *start);
-int acpi_bus_trim(struct acpi_device *start, int rmdevice);
int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent,
acpi_handle handle, int type);
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 0c964592a2c34b..c62e92ec43b289 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -56,7 +56,8 @@
/* ACPI PCI Interrupt Link (pci_link.c) */
int acpi_irq_penalty_init (void);
-int acpi_pci_link_get_irq (acpi_handle handle, int index, int* edge_level, int* active_high_low);
+int acpi_pci_link_get_irq (acpi_handle handle, int index, int *edge_level,
+ int *active_high_low, char **name);
/* ACPI PCI Interrupt Routing (pci_irq.c) */
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 6b2284c9e8949f..c97843f6bcbc23 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -94,6 +94,7 @@ struct acpi_walk_state
union acpi_generic_state *control_state; /* List of control states (nested IFs) */
struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
+ union acpi_operand_object *implicit_return_obj;
struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
struct acpi_namespace_node *method_call_node; /* Called method Node*/
union acpi_parse_object *method_call_op; /* method_call Op if running a method */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index f39ed91b5bc885..7eee731112b18f 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -261,6 +261,8 @@ struct madt_local_sapic
u8 local_sapic_eid; /* SAPIC EID */
u8 reserved [3]; /* Reserved - must be zero */
LOCAL_APIC_FLAGS
+ u32 processor_uID; /* Numeric UID - ACPI 3.0 */
+ char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
};
struct madt_interrupt_source
@@ -272,7 +274,7 @@ struct madt_interrupt_source
u8 processor_eid; /* Processor EID */
u8 io_sapic_vector; /* Vector value for PMI interrupts */
u32 interrupt; /* Global system interrupt */
- u32 reserved; /* Reserved - must be zero */
+ u32 flags; /* Interrupt Source Flags */
};
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index ea3ca08d88aa85..e1729c967e052a 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -108,7 +108,7 @@ struct facs_descriptor_rev2
/*
- * ACPI 2.0 Generic Address Structure (GAS)
+ * ACPI 2.0+ Generic Address Structure (GAS)
*/
struct acpi_generic_address
{
@@ -159,7 +159,7 @@ struct acpi_generic_address
u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/
/*
- * ACPI 2.0 Fixed ACPI Description Table (FADT)
+ * ACPI 2.0+ Fixed ACPI Description Table (FADT)
*/
struct fadt_descriptor_rev2
{
@@ -174,17 +174,25 @@ struct fadt_descriptor_rev2
u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */
u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */
u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */
- u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits*/
+ u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits */
u32 dock_cap : 1; /* Supports Docking */
- u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG*/
- u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed. */
- u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices.*/
+ u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG */
+ u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed */
+ u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices */
u32 cpu_sw_sleep : 1; /* Indicates to OSPM that a processor native instruction */
- /* Must be executed after writing the SLP_TYPx register. */
- u32 reserved6 : 18; /* Reserved - must be zero */
+ /* must be executed after writing the SLP_TYPx register */
+ /* ACPI 3.0 flag bits */
+
+ u32 pci_exp_wak : 1; /* System supports PCIEXP_WAKE (STS/EN) bits */
+ u32 use_platform_clock : 1; /* OSPM should use platform-provided timer */
+ u32 S4rtc_sts_valid : 1; /* Contents of RTC_STS valid after S4 wake */
+ u32 remote_power_on_capable : 1; /* System is compatible with remote power on */
+ u32 force_apic_cluster_model : 1; /* All local APICs must use cluster model */
+ u32 force_apic_physical_destination_mode : 1; /* all local x_aPICs must use physical dest mode */
+ u32 reserved6 : 12;/* Reserved - must be zero */
struct acpi_generic_address reset_register; /* Reset register address in GAS format */
- u8 reset_value; /* Value to write to the reset_register port to reset the system. */
+ u8 reset_value; /* Value to write to the reset_register port to reset the system */
u8 reserved7[3]; /* These three bytes must be zero */
u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
u64 Xdsdt; /* 64-bit physical address of DSDT */
@@ -199,7 +207,7 @@ struct fadt_descriptor_rev2
};
-/* "Downrevved" ACPI 2.0 FADT descriptor */
+/* "Down-revved" ACPI 2.0 FADT descriptor */
struct fadt_descriptor_rev2_minus
{
@@ -213,7 +221,7 @@ struct fadt_descriptor_rev2_minus
};
-/* Embedded Controller */
+/* ECDT - Embedded Controller Boot Resources Table */
struct ec_boot_resources
{
@@ -226,6 +234,55 @@ struct ec_boot_resources
};
+/* SRAT - System Resource Affinity Table */
+
+struct static_resource_alloc
+{
+ u8 type;
+ u8 length;
+ u8 proximity_domain_lo;
+ u8 apic_id;
+ u32 enabled :1;
+ u32 reserved3 :31;
+ u8 local_sapic_eid;
+ u8 proximity_domain_hi[3];
+ u32 reserved4;
+};
+
+struct memory_affinity
+{
+ u8 type;
+ u8 length;
+ u32 proximity_domain;
+ u16 reserved3;
+ u64 base_address;
+ u64 address_length;
+ u32 reserved4;
+ u32 enabled :1;
+ u32 hot_pluggable :1;
+ u32 non_volatile :1;
+ u32 reserved5 :29;
+ u64 reserved6;
+};
+
+struct system_resource_affinity
+{
+ ACPI_TABLE_HEADER_DEF
+ u32 reserved1; /* Must be value '1' */
+ u64 reserved2;
+};
+
+
+/* SLIT - System Locality Distance Information Table */
+
+struct system_locality_info
+{
+ ACPI_TABLE_HEADER_DEF
+ u64 locality_count;
+ u8 entry[1][1];
+};
+
+
#pragma pack()
#endif /* __ACTBL2_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 51cb780c241e9c..7acb550af3eb9f 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -653,24 +653,26 @@ typedef u8 acpi_adr_space_type;
#define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04
#define ACPI_BITREG_RT_CLOCK_STATUS 0x05
#define ACPI_BITREG_WAKE_STATUS 0x06
-
-#define ACPI_BITREG_TIMER_ENABLE 0x07
-#define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x08
-#define ACPI_BITREG_POWER_BUTTON_ENABLE 0x09
-#define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0A
-#define ACPI_BITREG_RT_CLOCK_ENABLE 0x0B
-#define ACPI_BITREG_WAKE_ENABLE 0x0C
-
-#define ACPI_BITREG_SCI_ENABLE 0x0D
-#define ACPI_BITREG_BUS_MASTER_RLD 0x0E
-#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x0F
-#define ACPI_BITREG_SLEEP_TYPE_A 0x10
-#define ACPI_BITREG_SLEEP_TYPE_B 0x11
-#define ACPI_BITREG_SLEEP_ENABLE 0x12
-
-#define ACPI_BITREG_ARB_DISABLE 0x13
-
-#define ACPI_BITREG_MAX 0x13
+#define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07
+
+#define ACPI_BITREG_TIMER_ENABLE 0x08
+#define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x09
+#define ACPI_BITREG_POWER_BUTTON_ENABLE 0x0A
+#define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0B
+#define ACPI_BITREG_RT_CLOCK_ENABLE 0x0C
+#define ACPI_BITREG_WAKE_ENABLE 0x0D
+#define ACPI_BITREG_PCIEXP_WAKE_DISABLE 0x0E
+
+#define ACPI_BITREG_SCI_ENABLE 0x0F
+#define ACPI_BITREG_BUS_MASTER_RLD 0x10
+#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x11
+#define ACPI_BITREG_SLEEP_TYPE_A 0x12
+#define ACPI_BITREG_SLEEP_TYPE_B 0x13
+#define ACPI_BITREG_SLEEP_ENABLE 0x14
+
+#define ACPI_BITREG_ARB_DISABLE 0x15
+
+#define ACPI_BITREG_MAX 0x15
#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1
@@ -1206,6 +1208,7 @@ struct acpi_resource_address64
u64 max_address_range;
u64 address_translation_offset;
u64 address_length;
+ u64 type_specific_attributes;
struct acpi_resource_source resource_source;
};
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 5a956b549b1e58..57bf9362335dc4 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -226,6 +226,7 @@
*/
#define ACPI_STRSTR(s1,s2) strstr((s1), (s2))
+#define ACPI_STRCHR(s1,c) strchr((s1), (c))
#ifdef ACPI_FUTURE_USAGE
#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
@@ -294,6 +295,7 @@ typedef char *va_list;
#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2))
+#define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c))
#ifdef ACPI_FUTURE_USAGE
#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index d1c8a8b98f6a6e..2f50a5bb0c781d 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -201,7 +201,6 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) {
/* in processor_throttling.c */
int acpi_processor_get_throttling_info (struct acpi_processor *pr);
int acpi_processor_set_throttling (struct acpi_processor *pr, int state);
-int acpi_processor_throttling_open_fs(struct inode *inode, struct file *file);
ssize_t acpi_processor_write_throttling (
struct file *file,
const char __user *buffer,
@@ -217,7 +216,6 @@ int acpi_processor_power_exit(struct acpi_processor *pr, struct acpi_device *dev
/* in processor_thermal.c */
int acpi_processor_get_limit_info (struct acpi_processor *pr);
-int acpi_processor_limit_open_fs(struct inode *inode, struct file *file);
ssize_t acpi_processor_write_limit (
struct file *file,
const char __user *buffer,
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 5cbf3486926f51..aefe6d051ace16 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -455,8 +455,6 @@ struct acpi_prt_list {
struct list_head entries;
};
-extern struct acpi_prt_list acpi_prt;
-
struct pci_dev;
int acpi_pci_irq_enable (struct pci_dev *dev);