From a0ad05c75aa362c91f4d9cd91ff375a739574dd8 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Mon, 1 Sep 2008 14:27:02 +0200 Subject: Introduce FW_BUG, FW_WARN and FW_INFO to consistenly tell users about BIOS bugs The idea is to add this to printk after the severity: printk(KERN_ERR FW_BUG "This is not our fault, BIOS developer: fix it by simply add ...\n"); If a Firmware issue should be hidden, because it is work-arounded, but you still want to see something popping up e.g. for info only: printk(KERN_INFO FW_INFO "This is done stupid, we can handle it, but it should better be avoided in future\n"); or on the Linuxfirmwarekit to tell vendors that they did something stupid or wrong without bothering the user: printk(KERN_INFO FW_BUG "This is done stupid, we can handle it, but it should better be avoided in future\n"); Some use cases: - If a user sees a [Firmware Bug] message in the kernel he should first update the BIOS before wasting time with debugging and submiting on old firmware code to mailing lists. - The linuxfirmwarekit (http://www.linuxfirmwarekit.org) tries to detect firmware bugs. It currently is doing that in userspace which results in: - Huge test scripts that could be a one liner in the kernel - A lot of BIOS bugs are already absorbed by the kernel What do we need such a stupid linuxfirmwarekit for? - Vendors: Can test their BIOSes for Linux compatibility. There will be the time when vendors realize that the test utils on Linux are more strict and using them increases the qualitity and stability of their products. - Vendors: Can easily fix up their BIOSes and be more Linux compatible by: dmesg |grep "Firmware Bug" and send the result to their BIOS developer colleagues who should know what the messages are about and how to fix them, without the need of studying kernel code. - Distributions: can do a first automated HW/BIOS checks. This can then be done without the need of asking kernel developers who need to dig down the code and explain the details. Certification can/will just be rejected until dmesg |grep "Firmware Bug" is empty. - Thus this can be used as an instrument to enforce cleaner BIOS code. Currently every stupid Windows ACPI bug is re-implemented in Linux which is a rather unfortunate situation. We already have the power to avoid this in e.g. memory or cpu hot-plug ACPI implementations, because Linux certification is a must for most vendors in the server area. Working towards being able to do that in the laptop area (vendors are starting to look at Linux here also and will use this tool) is the goal. At least provide them a tool to make it as easy for this guys (e.g. not needing to browse kernel code) as possible. - The ordinary Linux user: can go into the next shop, boots the firmwarekit on his most preferred machines. He chooses one without BIOS bugs. Unsupported HW is ok, he likes to try out latest projects which might support them or likes to dig on it on his own, but he hates to workaround broken BIOSes like hell. I double checked with the firmwarekit. There they have: So the mapping generally is (also depending on how likely the BIOS is to blame, this could sometimes be difficult): FW_INFO = INFO FW_WARN = WARN FW_BUG = FAIL For more info about the linuxfirmwarekit and why this is needed can be found here: http://www.linuxfirmwarekit.org While severity matches with the firmwarekit, it might be tricky to hide messages from the user. E.g. we recently found out that on HP BIOSes negative temperatures are returned, which seem to indicate that the thermal zone is invalid. We can work around that gracefully by ignoring the thermal zone and we do not want to bother the ordinary user with a frightening message: Firmware Bug: thermal management absolutely broken but want to hide it from the user. But in the linuxfirmwarekit this should be shown as a real show stopper (the temperatures could really be wrong, broken thermal management is one of the worst things that can happen and the BIOS guys of the machine must implement this properly). It is intended to do that (hide it from the user with KERN_INFO msg, but still print it as a BIOS bug) by: printk(KERN_INFO FW_BUG "Negativ temperature values detected. Try to workarounded, BIOS must get fixed\n"); Hope that works out..., no idea how to better hide it as printk is the only way to easily provide this functionality. Signed-off-by: Thomas Renninger Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/linux/kernel.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'include') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 2651f805ba6..0b19848e380 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -190,6 +190,30 @@ extern int kernel_text_address(unsigned long addr); struct pid; extern struct pid *session_of_pgrp(struct pid *pgrp); +/* + * FW_BUG + * Add this to a message where you are sure the firmware is buggy or behaves + * really stupid or out of spec. Be aware that the responsible BIOS developer + * should be able to fix this issue or at least get a concrete idea of the + * problem by reading your message without the need of looking at the kernel + * code. + * + * Use it for definite and high priority BIOS bugs. + * + * FW_WARN + * Use it for not that clear (e.g. could the kernel messed up things already?) + * and medium priority BIOS bugs. + * + * FW_INFO + * Use this one if you want to tell the user or vendor about something + * suspicious, but generally harmless related to the firmware. + * + * Use it for information or very low priority BIOS bugs. + */ +#define FW_BUG "[Firmware Bug]: " +#define FW_WARN "[Firmware Warn]: " +#define FW_INFO "[Firmware Info]: " + #ifdef CONFIG_PRINTK asmlinkage int vprintk(const char *fmt, va_list args) __attribute__ ((format (printf, 1, 0))); -- cgit v1.2.3 From 6bd00a61ab63d4ceb635ae0316353c11c900b8d8 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Thu, 28 Aug 2008 10:04:29 +0800 Subject: ACPI: introduce notifier change to avoid duplicates The battery driver already registers notification handler. To avoid registering notification handler again, introduce a notifier chain in global system notifier handler and use it in dock driver. Signed-off-by: Shaohua Li Signed-off-by: Len Brown --- include/acpi/acpi_bus.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index a5ac0bc7f52..f74f882609f 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -327,6 +327,9 @@ int acpi_bus_get_private_data(acpi_handle, void **); extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); extern int register_acpi_notifier(struct notifier_block *); extern int unregister_acpi_notifier(struct notifier_block *); + +extern int register_acpi_bus_notifier(struct notifier_block *nb); +extern void unregister_acpi_bus_notifier(struct notifier_block *nb); /* * External Functions */ -- cgit v1.2.3 From 19cd847ab24fefe9e50101ec94479e0400a08650 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 28 Aug 2008 10:05:06 +0800 Subject: ACPI: fix hotplug race The hotplug notification handler and drivers' notification handler all run in one workqueue. Before hotplug removes an acpi device, the device driver's notification handler is already be recorded to run just after global notification handler. After hotplug notification handler runs, acpica will notice a NULL notification handler and crash. So now we run run hotplug in another workqueue and wait for all acpi notication handlers finish. This was found in battery hotplug, but actually all hotplug can be affected. Signed-off-by: Zhang Rui Signed-off-by: Shaohua Li Signed-off-by: Len Brown --- include/acpi/acpiosxf.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 3f93a6b4e17..b91440ac0d1 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -193,6 +193,9 @@ acpi_status acpi_os_execute(acpi_execute_type type, acpi_osd_exec_callback function, void *context); +acpi_status +acpi_os_hotplug_execute(acpi_osd_exec_callback function, void *context); + void acpi_os_wait_events_complete(void *context); void acpi_os_sleep(acpi_integer milliseconds); -- cgit v1.2.3 From 1253f7aabfebc51446dbec5c8895c5c8846dfe06 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Thu, 28 Aug 2008 10:06:16 +0800 Subject: dock: introduce .uevent for devices in dock, eg libata dock's uevent reported itself, not ata. It might be difficult to find an ata device just according to a dock. This patch introduces docking ops for each device in a dock. when docking, dock driver can send device specific uevent. This should help dock station too (not just bay) Signed-off-by: Shaohua Li Acked-by: Tejun Heo Signed-off-by: Len Brown --- include/acpi/acpi_drivers.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index e5f38e5ce86..4f5042a0ef8 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -115,12 +115,17 @@ int acpi_processor_set_thermal_limit(acpi_handle handle, int type); /*-------------------------------------------------------------------------- Dock Station -------------------------------------------------------------------------- */ +struct acpi_dock_ops { + acpi_notify_handler handler; + acpi_notify_handler uevent; +}; + #if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE) extern int is_dock_device(acpi_handle handle); extern int register_dock_notifier(struct notifier_block *nb); extern void unregister_dock_notifier(struct notifier_block *nb); extern int register_hotplug_dock_device(acpi_handle handle, - acpi_notify_handler handler, + struct acpi_dock_ops *ops, void *context); extern void unregister_hotplug_dock_device(acpi_handle handle); #else @@ -136,7 +141,7 @@ static inline void unregister_dock_notifier(struct notifier_block *nb) { } static inline int register_hotplug_dock_device(acpi_handle handle, - acpi_notify_handler handler, + struct acpi_dock_ops *ops, void *context) { return -ENODEV; -- cgit v1.2.3 From db89b4f0dbab837d0f3de2c3e9427a8d5393afa3 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 22 Sep 2008 14:37:34 -0700 Subject: ACPI: catch calls of acpi_driver_data on pointer of wrong type Catch attempts to use of acpi_driver_data on pointers of wrong type. akpm: rewritten to use proper C typechecking and remove the "function"-used-as-lvalue thing. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/acpi/acpi_bus.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index a5ac0bc7f52..47682465f1f 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -300,7 +300,11 @@ struct acpi_device { enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ }; -#define acpi_driver_data(d) ((d)->driver_data) +static inline void *acpi_driver_data(struct acpi_device *d) +{ + return d->driver_data; +} + #define to_acpi_device(d) container_of(d, struct acpi_device, dev) #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) -- cgit v1.2.3 From c865d2f6eb160c15b74245b4891c8e945d67d96c Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 19 Aug 2008 16:53:26 -0600 Subject: PNP: convert the last few pnp_info() uses to printk() There are only a few remaining uses of pnp_info(), so I just converted them to printk and removed the pnp_err(), pnp_info(), pnp_warn(), and pnp_dbg() wrappers. I also removed a couple debug messages that don't seem useful any more ("driver registered", "driver unregistered", "driver attached"). Signed-off-by: Bjorn Helgaas Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/linux/pnp.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include') diff --git a/include/linux/pnp.h b/include/linux/pnp.h index be764e514e3..05daecec16c 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -483,14 +483,4 @@ static inline void pnp_unregister_driver(struct pnp_driver *drv) { } #endif /* CONFIG_PNP */ -#define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg) -#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) -#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) - -#ifdef CONFIG_PNP_DEBUG -#define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg) -#else -#define pnp_dbg(format, arg...) do {} while (0) -#endif - #endif /* _LINUX_PNP_H */ -- cgit v1.2.3 From fa89b6089b5f4c7a5244b642caaca3e72b06ebe4 Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Wed, 24 Sep 2008 19:04:32 -0700 Subject: ACPI: remove unused have_arch_parse_srat This was a workaround for 32bit numa SRAT processing, and we removed those workarounds, making 32 bit more like 64 bit. HAVE_ARCH_PARSE_SRAT is no longer defined anywhere. Signed-off-by: Yinghai Lu Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/linux/acpi.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 702f79dad16..fd6a452b0ce 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -94,18 +94,10 @@ int acpi_parse_mcfg (struct acpi_table_header *header); void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); /* the following four functions are architecture-dependent */ -#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT -#define NR_NODE_MEMBLKS MAX_NUMNODES -#define acpi_numa_slit_init(slit) do {} while (0) -#define acpi_numa_processor_affinity_init(pa) do {} while (0) -#define acpi_numa_memory_affinity_init(ma) do {} while (0) -#define acpi_numa_arch_fixup() do {} while (0) -#else void acpi_numa_slit_init (struct acpi_table_slit *slit); void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa); void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma); void acpi_numa_arch_fixup(void); -#endif #ifdef CONFIG_ACPI_HOTPLUG_CPU /* Arch dependent functions for cpu hotplug support */ -- cgit v1.2.3 From 455c8793d2c49eaecad038c8de83dade9fc3759f Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Mon, 6 Oct 2008 10:31:36 +0800 Subject: ACPI: Enable EC device immediately after ACPI full initialization when there is no ECDT table and no _INI object for EC device, it will be enabled before scanning ACPI device. But it is too late after the following the commit is merged. >commit 7752d5cfe3d11ca0bb9c673ec38bd78ba6578f8e > Author: Robert Hancock > Date: Fri Feb 15 01:27:20 2008 -0800 >x86: validate against acpi motherboard resources After the above commit is merged, OS will check whether MCFG area is reserved in ACPI motherboard resources by calling the function of acpi_get_devices when there exists MCFG table. In the acpi_get_devices the _STA object will be evaluated to check the status of the ACPI device. On some broken BIOS the MYEC object of EC device is initialized as one, which indicates that EC operation region is already accessible before enabling EC device.So on these broken BIOS the EC operation region will be accessed in course of evaluating the _STA object before enabling EC device, which causes that OS will print the following warning messages: >ACPI Error (evregion-0315): No handler for Region [EC__] (ffff88007f8145e8) [EmbeddedControl] [20080609] >ACPI Error (exfldio-0290): Region EmbeddedControl(3) has no handler [20080321] >ACPI Error (psparse-0530): Method parse/execution failed [\_SB_.PCI0.SBRG. EC__.BAT1._STA] (Node ffff81013fc17a00), AE_NOT_EXIST >ACPI Error (uteval-0233): Method execution failed [\_SB_.PCI0.SBRG.EC__.BAT1. _STA] (Node ffff81013fc17a00), AE_NOT_EXIST Although the above warning message is harmless, it looks confusing. So it is necessary to enable EC device as early as possible.Maybe it is appropriate to enable it immediately after ACPI full initialization. http://bugzilla.kernel.org/show_bug.cgi?id=11255 http://bugzilla.kernel.org/show_bug.cgi?id=11374 http://bugzilla.kernel.org/show_bug.cgi?id=11660 Signed-off-by: Zhao Yakui Acked-by: Alexey Starikovskiy Signed-off-by: Len Brown --- include/acpi/acpi_drivers.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index e5f38e5ce86..ab926a70b39 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -100,6 +100,7 @@ int acpi_power_transition(struct acpi_device *device, int state); -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_EC int acpi_ec_ecdt_probe(void); +int acpi_boot_ec_enable(void); #endif /* -------------------------------------------------------------------------- -- cgit v1.2.3 From 27663c5855b10af9ec67bc7dfba001426ba21222 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 10 Oct 2008 02:22:59 -0400 Subject: ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit kernels As of version 2.0, ACPI can return 64-bit integers. The current acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms. Change the argument to take a pointer to an acpi_integer so we support 64-bit integers on all platforms. lenb: replaced use of "acpi_integer" with "unsigned long long" lenb: fixed bug in acpi_thermal_trips_update() Signed-off-by: Matthew Wilcox Signed-off-by: Len Brown --- include/acpi/acpi_bus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index a5ac0bc7f52..c52f10dee36 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -46,7 +46,7 @@ acpi_extract_package(union acpi_object *package, acpi_status acpi_evaluate_integer(acpi_handle handle, acpi_string pathname, - struct acpi_object_list *arguments, unsigned long *data); + struct acpi_object_list *arguments, unsigned long long *data); acpi_status acpi_evaluate_reference(acpi_handle handle, acpi_string pathname, -- cgit v1.2.3 From 27471fdb32e77ecb92f09d4ac5757785b4dc33bc Mon Sep 17 00:00:00 2001 From: Andy Henroid Date: Thu, 9 Oct 2008 11:45:22 -0700 Subject: i7300_idle driver v1.55 The Intel 7300 Memory Controller supports dynamic throttling of memory which can be used to save power when system is idle. This driver does the memory throttling when all CPUs are idle on such a system. Refer to "Intel 7300 Memory Controller Hub (MCH)" datasheet for the config space description. Signed-off-by: Andy Henroid Signed-off-by: Len Brown Signed-off-by: Venkatesh Pallipadi --- include/asm-x86/idle.h | 1 + include/linux/pci_ids.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-x86/idle.h b/include/asm-x86/idle.h index cbb64912361..54ce018d4b6 100644 --- a/include/asm-x86/idle.h +++ b/include/asm-x86/idle.h @@ -6,6 +6,7 @@ struct notifier_block; void idle_notifier_register(struct notifier_block *n); +void idle_notifier_unregister(struct notifier_block *n); void enter_idle(void); void exit_idle(void); diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f1624b39675..efb786d11f2 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2422,6 +2422,7 @@ #define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e #define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b +#define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c #define PCI_DEVICE_ID_INTEL_ICH10_0 0x3a14 #define PCI_DEVICE_ID_INTEL_ICH10_1 0x3a16 #define PCI_DEVICE_ID_INTEL_ICH10_2 0x3a18 -- cgit v1.2.3 From f5adfaa372c76423b6e8e4727a9701330374f364 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Mon, 11 Aug 2008 14:57:50 +0800 Subject: ACPI: Add "acpi.power_nocheck=1" to disable power state check in power transition Maybe the incorrect power state is returned on the bogus bios, which is different with the real power state. For example: the bios returns D0 state and the real power state is D3. OS expects to set the device to D0 state. In such case if OS uses the power state returned by the BIOS and checks the device power state very strictly in power transition, the device can't be transited to the correct power state. So the boot option of "acpi.power_nocheck=1" is added to avoid checking the device power in the course of device power transition. http://bugzilla.kernel.org/show_bug.cgi?id=8049 http://bugzilla.kernel.org/show_bug.cgi?id=11000 Signed-off-by: Zhao Yakui Signed-off-by: Zhang Rui Signed-off-by: Li Shaohua Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/acpi_drivers.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index e5f38e5ce86..efbaa271ee1 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -93,6 +93,7 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state); int acpi_disable_wakeup_device_power(struct acpi_device *dev); int acpi_power_get_inferred_state(struct acpi_device *device); int acpi_power_transition(struct acpi_device *device, int state); +extern int acpi_power_nocheck; #endif /* -------------------------------------------------------------------------- -- cgit v1.2.3 From 9db4fcd99f7ef886ded97cd26a8642c70fbe34df Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 4 Jul 2008 10:56:13 +0800 Subject: ACPICA: Fix wrong resource descriptor length for 64-bit build The "minimal" descriptors such as EndTag are calculated as 12 bytes long, but the actual length in the internal descriptor is 16 because of the round-up to 8 on 64-bit build. http://www.acpica.org/bugzilla/show_bug.cgi?id=728 Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/actypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 4ea4f40bf89..73d6b1cb07f 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -1225,8 +1225,8 @@ struct acpi_resource { #pragma pack() -#define ACPI_RS_SIZE_MIN 12 #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */ +#define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) -- cgit v1.2.3 From b417d40b9a850f12f69aa9d785d2af39c9463bb8 Mon Sep 17 00:00:00 2001 From: Yi Yang Date: Mon, 4 Aug 2008 10:30:09 +0800 Subject: ACPICA: Return status from global init function Return status from acpi_ut_init_globals. This is used by both the kernel subsystem and the utilities such as iASL compiler. The function could possibly fail when the caches are initialized. Yang Yi. Signed-off-by: Yi Yang Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/acutils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 69f8888771f..10ce81406f9 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -110,7 +110,7 @@ struct acpi_pkg_info { /* * utglobal - Global data structures and procedures */ -void acpi_ut_init_globals(void); +acpi_status acpi_ut_init_globals(void); #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) -- cgit v1.2.3 From c9bdd8057d706a972d804d2d8614a283641a5660 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 4 Aug 2008 09:54:17 +0800 Subject: ACPICA: Cleanup macro definition file. Removed unused macros. Ensure that multiple parameters always have a space after a comma. Cleanup some comments. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/acmacros.h | 248 ++++++++++++++++++++++-------------------------- 1 file changed, 115 insertions(+), 133 deletions(-) (limited to 'include') diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 57ab9e9d759..2106f9136cc 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -62,7 +62,7 @@ #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) /* - * Extract data using a pointer. Any more than a byte and we + * Extract data using a pointer. Any more than a byte and we * get into potential aligment issues -- see the STORE macros below. * Use with care. */ @@ -80,21 +80,21 @@ */ #define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p)) #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p)) -#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_size)(b))) -#define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b))) +#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_size)(b))) +#define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR (u8, (a)) - ACPI_CAST_PTR (u8, (b))) /* Pointer/Integer type conversions */ #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL, (acpi_size) i) -#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) -#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) +#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL) +#define ACPI_OFFSET(d, f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL) #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED -#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) +#define ACPI_COMPARE_NAME(a, b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) #else -#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char,(a)), ACPI_CAST_PTR (char,(b)), ACPI_NAME_SIZE)) +#define ACPI_COMPARE_NAME(a, b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) #endif /* @@ -114,7 +114,7 @@ struct acpi_integer_overlay { /* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */ -#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) +#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) #if ACPI_MACHINE_WIDTH == 64 #define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i) @@ -132,37 +132,33 @@ struct acpi_integer_overlay { * Macros for big-endian machines */ -/* This macro sets a buffer index, starting from the end of the buffer */ - -#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) ((buf_len) - (((buf_offset)+1) * (byte_gran))) - /* These macros reverse the bytes during the move, converting little-endian to big endian */ /* Big Endian <== Little Endian */ /* Hi...Lo Lo...Hi */ /* 16-bit source, 16/32/64 destination */ -#define ACPI_MOVE_16_TO_16(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[1];\ +#define ACPI_MOVE_16_TO_16(d, s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[1];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[0];} -#define ACPI_MOVE_16_TO_32(d,s) {(*(u32 *)(void *)(d))=0;\ +#define ACPI_MOVE_16_TO_32(d, s) {(*(u32 *)(void *)(d))=0;\ ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\ ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];} -#define ACPI_MOVE_16_TO_64(d,s) {(*(u64 *)(void *)(d))=0;\ +#define ACPI_MOVE_16_TO_64(d, s) {(*(u64 *)(void *)(d))=0;\ ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\ ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[0];} /* 32-bit source, 16/32/64 destination */ -#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ -#define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ +#define ACPI_MOVE_32_TO_32(d, s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\ (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\ (( u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];} -#define ACPI_MOVE_32_TO_64(d,s) {(*(u64 *)(void *)(d))=0;\ +#define ACPI_MOVE_32_TO_64(d, s) {(*(u64 *)(void *)(d))=0;\ ((u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[3];\ ((u8 *)(void *)(d))[5] = ((u8 *)(void *)(s))[2];\ ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\ @@ -170,11 +166,11 @@ struct acpi_integer_overlay { /* 64-bit source, 16/32/64 destination */ -#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ -#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ +#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */ -#define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\ +#define ACPI_MOVE_64_TO_64(d, s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\ (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[5];\ (( u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[4];\ @@ -187,63 +183,59 @@ struct acpi_integer_overlay { * Macros for little-endian machines */ -/* This macro sets a buffer index, starting from the beginning of the buffer */ - -#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) - #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED /* The hardware supports unaligned transfers, just do the little-endian move */ /* 16-bit source, 16/32/64 destination */ -#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) -#define ACPI_MOVE_16_TO_32(d,s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s) -#define ACPI_MOVE_16_TO_64(d,s) *(u64 *)(void *)(d) = *(u16 *)(void *)(s) +#define ACPI_MOVE_16_TO_16(d, s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) +#define ACPI_MOVE_16_TO_32(d, s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s) +#define ACPI_MOVE_16_TO_64(d, s) *(u64 *)(void *)(d) = *(u16 *)(void *)(s) /* 32-bit source, 16/32/64 destination */ -#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ -#define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) -#define ACPI_MOVE_32_TO_64(d,s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s) +#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ +#define ACPI_MOVE_32_TO_32(d, s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) +#define ACPI_MOVE_32_TO_64(d, s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s) /* 64-bit source, 16/32/64 destination */ -#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ -#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ -#define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) +#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ +#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */ +#define ACPI_MOVE_64_TO_64(d, s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) #else /* - * The hardware does not support unaligned transfers. We must move the - * data one byte at a time. These macros work whether the source or + * The hardware does not support unaligned transfers. We must move the + * data one byte at a time. These macros work whether the source or * the destination (or both) is/are unaligned. (Little-endian move) */ /* 16-bit source, 16/32/64 destination */ -#define ACPI_MOVE_16_TO_16(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ +#define ACPI_MOVE_16_TO_16(d, s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];} -#define ACPI_MOVE_16_TO_32(d,s) {(*(u32 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d,s);} -#define ACPI_MOVE_16_TO_64(d,s) {(*(u64 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d,s);} +#define ACPI_MOVE_16_TO_32(d, s) {(*(u32 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);} +#define ACPI_MOVE_16_TO_64(d, s) {(*(u64 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);} /* 32-bit source, 16/32/64 destination */ -#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ -#define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ +#define ACPI_MOVE_32_TO_32(d, s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ (( u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];} -#define ACPI_MOVE_32_TO_64(d,s) {(*(u64 *)(void *)(d)) = 0; ACPI_MOVE_32_TO_32(d,s);} +#define ACPI_MOVE_32_TO_64(d, s) {(*(u64 *)(void *)(d)) = 0; ACPI_MOVE_32_TO_32(d, s);} /* 64-bit source, 16/32/64 destination */ -#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ -#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ -#define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ +#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */ +#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */ +#define ACPI_MOVE_64_TO_64(d, s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ (( u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[3];\ @@ -257,10 +249,10 @@ struct acpi_integer_overlay { /* Macros based on machine integer width */ #if ACPI_MACHINE_WIDTH == 32 -#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_32_TO_16(d,s) +#define ACPI_MOVE_SIZE_TO_16(d, s) ACPI_MOVE_32_TO_16(d, s) #elif ACPI_MACHINE_WIDTH == 64 -#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_64_TO_16(d,s) +#define ACPI_MOVE_SIZE_TO_16(d, s) ACPI_MOVE_64_TO_16(d, s) #else #error unknown ACPI_MACHINE_WIDTH @@ -269,29 +261,29 @@ struct acpi_integer_overlay { /* * Fast power-of-two math macros for non-optimized compilers */ -#define _ACPI_DIV(value,power_of2) ((u32) ((value) >> (power_of2))) -#define _ACPI_MUL(value,power_of2) ((u32) ((value) << (power_of2))) -#define _ACPI_MOD(value,divisor) ((u32) ((value) & ((divisor) -1))) +#define _ACPI_DIV(value, power_of2) ((u32) ((value) >> (power_of2))) +#define _ACPI_MUL(value, power_of2) ((u32) ((value) << (power_of2))) +#define _ACPI_MOD(value, divisor) ((u32) ((value) & ((divisor) -1))) -#define ACPI_DIV_2(a) _ACPI_DIV(a,1) -#define ACPI_MUL_2(a) _ACPI_MUL(a,1) -#define ACPI_MOD_2(a) _ACPI_MOD(a,2) +#define ACPI_DIV_2(a) _ACPI_DIV(a, 1) +#define ACPI_MUL_2(a) _ACPI_MUL(a, 1) +#define ACPI_MOD_2(a) _ACPI_MOD(a, 2) -#define ACPI_DIV_4(a) _ACPI_DIV(a,2) -#define ACPI_MUL_4(a) _ACPI_MUL(a,2) -#define ACPI_MOD_4(a) _ACPI_MOD(a,4) +#define ACPI_DIV_4(a) _ACPI_DIV(a, 2) +#define ACPI_MUL_4(a) _ACPI_MUL(a, 2) +#define ACPI_MOD_4(a) _ACPI_MOD(a, 4) -#define ACPI_DIV_8(a) _ACPI_DIV(a,3) -#define ACPI_MUL_8(a) _ACPI_MUL(a,3) -#define ACPI_MOD_8(a) _ACPI_MOD(a,8) +#define ACPI_DIV_8(a) _ACPI_DIV(a, 3) +#define ACPI_MUL_8(a) _ACPI_MUL(a, 3) +#define ACPI_MOD_8(a) _ACPI_MOD(a, 8) -#define ACPI_DIV_16(a) _ACPI_DIV(a,4) -#define ACPI_MUL_16(a) _ACPI_MUL(a,4) -#define ACPI_MOD_16(a) _ACPI_MOD(a,16) +#define ACPI_DIV_16(a) _ACPI_DIV(a, 4) +#define ACPI_MUL_16(a) _ACPI_MUL(a, 4) +#define ACPI_MOD_16(a) _ACPI_MOD(a, 16) -#define ACPI_DIV_32(a) _ACPI_DIV(a,5) -#define ACPI_MUL_32(a) _ACPI_MUL(a,5) -#define ACPI_MOD_32(a) _ACPI_MOD(a,32) +#define ACPI_DIV_32(a) _ACPI_DIV(a, 5) +#define ACPI_MUL_32(a) _ACPI_MUL(a, 5) +#define ACPI_MOD_32(a) _ACPI_MOD(a, 32) /* * Rounding macros (Power of two boundaries only) @@ -305,13 +297,13 @@ struct acpi_integer_overlay { /* Note: sizeof(acpi_size) evaluates to either 4 or 8 (32- vs 64-bit mode) */ -#define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4) -#define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8) -#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_size)) +#define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a, 4) +#define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a, 8) +#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a, sizeof(acpi_size)) -#define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4) -#define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8) -#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_size)) +#define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a, 4) +#define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a, 8) +#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a, sizeof(acpi_size)) #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) @@ -320,9 +312,9 @@ struct acpi_integer_overlay { /* Generic (non-power-of-two) rounding */ -#define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) +#define ACPI_ROUND_UP_TO(value, boundary) (((value) + ((boundary)-1)) / (boundary)) -#define ACPI_IS_MISALIGNED(value) (((acpi_size)value) & (sizeof(acpi_size)-1)) +#define ACPI_IS_MISALIGNED(value) (((acpi_size) value) & (sizeof(acpi_size)-1)) /* * Bitmask creation @@ -333,8 +325,6 @@ struct acpi_integer_overlay { #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) #define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) -#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) - /* Bitfields within ACPI registers */ #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) @@ -342,39 +332,29 @@ struct acpi_integer_overlay { #define ACPI_INSERT_BITS(target, mask, source) target = ((target & (~(mask))) | (source & mask)) -/* Generate a UUID */ - -#define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ - (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ - (b) & 0xFF, ((b) >> 8) & 0xFF, \ - (c) & 0xFF, ((c) >> 8) & 0xFF, \ - (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) - /* - * An struct acpi_namespace_node * can appear in some contexts, - * where a pointer to an union acpi_operand_object can also - * appear. This macro is used to distinguish them. + * An struct acpi_namespace_node can appear in some contexts + * where a pointer to an union acpi_operand_object can also + * appear. This macro is used to distinguish them. * * The "Descriptor" field is the first field in both structures. */ #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type) -#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) +#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) /* Macro to test the object type */ #define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) -/* Macro to check the table flags for SINGLE or MULTIPLE tables are allowed */ - -#define ACPI_IS_SINGLE_TABLE(x) (((x) & 0x01) == ACPI_TABLE_SINGLE ? 1 : 0) - /* * Macros for the master AML opcode table */ -#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT) -#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {name,(u32)(Pargs),(u32)(Iargs),(u32)(flags),obj_type,class,type} +#if defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT) +#define ACPI_OP(name, Pargs, Iargs, obj_type, class, type, flags) \ + {name, (u32)(Pargs), (u32)(Iargs), (u32)(flags), obj_type, class, type} #else -#define ACPI_OP(name,Pargs,Iargs,obj_type,class,type,flags) {(u32)(Pargs),(u32)(Iargs),(u32)(flags),obj_type,class,type} +#define ACPI_OP(name, Pargs, Iargs, obj_type, class, type, flags) \ + {(u32)(Pargs), (u32)(Iargs), (u32)(flags), obj_type, class, type} #endif #ifdef ACPI_DISASSEMBLER @@ -392,18 +372,18 @@ struct acpi_integer_overlay { #define ARG_6(x) ((u32)(x) << (5 * ARG_TYPE_WIDTH)) #define ARGI_LIST1(a) (ARG_1(a)) -#define ARGI_LIST2(a,b) (ARG_1(b)|ARG_2(a)) -#define ARGI_LIST3(a,b,c) (ARG_1(c)|ARG_2(b)|ARG_3(a)) -#define ARGI_LIST4(a,b,c,d) (ARG_1(d)|ARG_2(c)|ARG_3(b)|ARG_4(a)) -#define ARGI_LIST5(a,b,c,d,e) (ARG_1(e)|ARG_2(d)|ARG_3(c)|ARG_4(b)|ARG_5(a)) -#define ARGI_LIST6(a,b,c,d,e,f) (ARG_1(f)|ARG_2(e)|ARG_3(d)|ARG_4(c)|ARG_5(b)|ARG_6(a)) +#define ARGI_LIST2(a, b) (ARG_1(b)|ARG_2(a)) +#define ARGI_LIST3(a, b, c) (ARG_1(c)|ARG_2(b)|ARG_3(a)) +#define ARGI_LIST4(a, b, c, d) (ARG_1(d)|ARG_2(c)|ARG_3(b)|ARG_4(a)) +#define ARGI_LIST5(a, b, c, d, e) (ARG_1(e)|ARG_2(d)|ARG_3(c)|ARG_4(b)|ARG_5(a)) +#define ARGI_LIST6(a, b, c, d, e, f) (ARG_1(f)|ARG_2(e)|ARG_3(d)|ARG_4(c)|ARG_5(b)|ARG_6(a)) #define ARGP_LIST1(a) (ARG_1(a)) -#define ARGP_LIST2(a,b) (ARG_1(a)|ARG_2(b)) -#define ARGP_LIST3(a,b,c) (ARG_1(a)|ARG_2(b)|ARG_3(c)) -#define ARGP_LIST4(a,b,c,d) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)) -#define ARGP_LIST5(a,b,c,d,e) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)|ARG_5(e)) -#define ARGP_LIST6(a,b,c,d,e,f) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)|ARG_5(e)|ARG_6(f)) +#define ARGP_LIST2(a, b) (ARG_1(a)|ARG_2(b)) +#define ARGP_LIST3(a, b, c) (ARG_1(a)|ARG_2(b)|ARG_3(c)) +#define ARGP_LIST4(a, b, c, d) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)) +#define ARGP_LIST5(a, b, c, d, e) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)|ARG_5(e)) +#define ARGP_LIST6(a, b, c, d, e, f) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)|ARG_5(e)|ARG_6(f)) #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) @@ -434,8 +414,8 @@ struct acpi_integer_overlay { #define ACPI_WARNING(plist) acpi_ut_warning plist #define ACPI_EXCEPTION(plist) acpi_ut_exception plist #define ACPI_ERROR(plist) acpi_ut_error plist -#define ACPI_ERROR_NAMESPACE(s,e) acpi_ns_report_error (AE_INFO, s, e); -#define ACPI_ERROR_METHOD(s,n,p,e) acpi_ns_report_method_error (AE_INFO, s, n, p, e); +#define ACPI_ERROR_NAMESPACE(s, e) acpi_ns_report_error (AE_INFO, s, e); +#define ACPI_ERROR_METHOD(s, n, p, e) acpi_ns_report_method_error (AE_INFO, s, n, p, e); #else @@ -445,8 +425,8 @@ struct acpi_integer_overlay { #define ACPI_WARNING(plist) #define ACPI_EXCEPTION(plist) #define ACPI_ERROR(plist) -#define ACPI_ERROR_NAMESPACE(s,e) -#define ACPI_ERROR_METHOD(s,n,p,e) +#define ACPI_ERROR_NAMESPACE(s, e) +#define ACPI_ERROR_METHOD(s, n, p, e) #endif /* @@ -489,18 +469,18 @@ struct acpi_integer_overlay { #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ acpi_ut_trace(ACPI_DEBUG_PARAMETERS) -#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ - acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) -#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ - acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) -#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ - acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) +#define ACPI_FUNCTION_TRACE_PTR(a, b) ACPI_FUNCTION_NAME(a) \ + acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS, (void *)b) +#define ACPI_FUNCTION_TRACE_U32(a, b) ACPI_FUNCTION_NAME(a) \ + acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS, (u32)b) +#define ACPI_FUNCTION_TRACE_STR(a, b) ACPI_FUNCTION_NAME(a) \ + acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS, (char *)b) #define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() /* * Function exit tracing. - * WARNING: These macros include a return statement. This is usually considered + * WARNING: These macros include a return statement. This is usually considered * bad form, but having a separate exit macro is very ugly and difficult to maintain. * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros * so that "_AcpiFunctionName" is defined. @@ -596,13 +576,13 @@ struct acpi_integer_overlay { /* Stack and buffer dumping */ -#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) -#define ACPI_DUMP_OPERANDS(a,b,c) acpi_ex_dump_operands(a,b,c) +#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0) +#define ACPI_DUMP_OPERANDS(a, b, c) acpi_ex_dump_operands(a, b, c) -#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) -#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) +#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b) +#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d) #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) -#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) +#define ACPI_DUMP_BUFFER(a, b) acpi_ut_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) /* * Master debug print macros @@ -625,20 +605,20 @@ struct acpi_integer_overlay { #define ACPI_DEBUG_ONLY_MEMBERS(a) do { } while(0) #define ACPI_FUNCTION_NAME(a) do { } while(0) #define ACPI_FUNCTION_TRACE(a) do { } while(0) -#define ACPI_FUNCTION_TRACE_PTR(a,b) do { } while(0) -#define ACPI_FUNCTION_TRACE_U32(a,b) do { } while(0) -#define ACPI_FUNCTION_TRACE_STR(a,b) do { } while(0) +#define ACPI_FUNCTION_TRACE_PTR(a, b) do { } while(0) +#define ACPI_FUNCTION_TRACE_U32(a, b) do { } while(0) +#define ACPI_FUNCTION_TRACE_STR(a, b) do { } while(0) #define ACPI_FUNCTION_EXIT do { } while(0) #define ACPI_FUNCTION_STATUS_EXIT(s) do { } while(0) #define ACPI_FUNCTION_VALUE_EXIT(s) do { } while(0) #define ACPI_FUNCTION_ENTRY() do { } while(0) #define ACPI_DUMP_STACK_ENTRY(a) do { } while(0) -#define ACPI_DUMP_OPERANDS(a,b,c) do { } while(0) -#define ACPI_DUMP_ENTRY(a,b) do { } while(0) -#define ACPI_DUMP_TABLES(a,b) do { } while(0) -#define ACPI_DUMP_PATHNAME(a,b,c,d) do { } while(0) +#define ACPI_DUMP_OPERANDS(a, b, c) do { } while(0) +#define ACPI_DUMP_ENTRY(a, b) do { } while(0) +#define ACPI_DUMP_TABLES(a, b) do { } while(0) +#define ACPI_DUMP_PATHNAME(a, b, c, d) do { } while(0) #define ACPI_DUMP_RESOURCE_LIST(a) do { } while(0) -#define ACPI_DUMP_BUFFER(a,b) do { } while(0) +#define ACPI_DUMP_BUFFER(a, b) do { } while(0) #define ACPI_DEBUG_PRINT(pl) do { } while(0) #define ACPI_DEBUG_PRINT_RAW(pl) do { } while(0) @@ -677,15 +657,17 @@ struct acpi_integer_overlay { /* * Memory allocation tracking (DEBUG ONLY) */ +#define ACPI_MEM_PARAMETERS _COMPONENT, _acpi_module_name, __LINE__ + #ifndef ACPI_DBG_TRACK_ALLOCATIONS /* Memory allocation */ #ifndef ACPI_ALLOCATE -#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) +#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a), ACPI_MEM_PARAMETERS) #endif #ifndef ACPI_ALLOCATE_ZEROED -#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) +#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), ACPI_MEM_PARAMETERS) #endif #ifndef ACPI_FREE #define ACPI_FREE(a) acpio_os_free(a) @@ -696,9 +678,9 @@ struct acpi_integer_overlay { /* Memory allocation */ -#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) -#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) -#define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) +#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a), ACPI_MEM_PARAMETERS) +#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size)(a), ACPI_MEM_PARAMETERS) +#define ACPI_FREE(a) acpi_ut_free_and_track(a, ACPI_MEM_PARAMETERS) #define ACPI_MEM_TRACKING(a) a #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ -- cgit v1.2.3 From 0a1fbf2db0d275f0f8160bb9c3e51c4df5bafdc2 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 4 Jul 2008 10:53:58 +0800 Subject: ACPICA: Return method arg count from acpi_get_object_info Also update the debugger so that the correct number of arguments is passed to the method. Prevents a warning message from the debugger. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/actypes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 73d6b1cb07f..6bd08e83f31 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -859,6 +859,7 @@ struct acpi_obj_info_header { struct acpi_device_info { ACPI_COMMON_OBJ_INFO; + u32 param_count; /* If a method, required parameter count */ u32 valid; /* Indicates which fields below are valid */ u32 current_status; /* _STA value */ acpi_integer address; /* _ADR value if any */ -- cgit v1.2.3 From d00d23651d17a2848f6923f3b1ec4efe19f5f2f1 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 4 Aug 2008 10:12:31 +0800 Subject: ACPICA: Update version to 20080701 Update version to 20080701. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 4eb75a88795..328caeee821 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20080609 +#define ACPI_CA_VERSION 0x20080701 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, -- cgit v1.2.3 From f02a99ac66748f8b62477c86f6df04d3ec6169fd Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 4 Aug 2008 10:40:09 +0800 Subject: ACPICA: Add function to decode reference obj types to strings Created for improved error messages. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/acutils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 10ce81406f9..d8307b2987e 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -126,6 +126,8 @@ char *acpi_ut_get_node_name(void *object); char *acpi_ut_get_descriptor_name(void *object); +const char *acpi_ut_get_reference_name(union acpi_operand_object *object); + char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc); char *acpi_ut_get_region_name(u8 space_id); -- cgit v1.2.3 From 1d7cc03049f7c9c5cced9208a39316c5245ef314 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 4 Aug 2008 10:42:47 +0800 Subject: ACPICA: x2APIC support: changes for MADT and SRAT ACPI tables Support for the x2APIC. There are 2 new subtables for the MADT and one new subtable for the SRAT. Includes disassembler and acpisrc support. Data from the Intel 64 Architecture x2APIC Specification, June 2008. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/acdisasm.h | 4 ++++ include/acpi/actbl1.h | 51 +++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index f53faca8ec8..0c1ed387073 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -186,6 +186,8 @@ extern struct acpi_dmtable_info acpi_dm_table_info_madt5[]; extern struct acpi_dmtable_info acpi_dm_table_info_madt6[]; extern struct acpi_dmtable_info acpi_dm_table_info_madt7[]; extern struct acpi_dmtable_info acpi_dm_table_info_madt8[]; +extern struct acpi_dmtable_info acpi_dm_table_info_madt9[]; +extern struct acpi_dmtable_info acpi_dm_table_info_madt10[]; extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[]; extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[]; extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[]; @@ -197,8 +199,10 @@ extern struct acpi_dmtable_info acpi_dm_table_info_slit[]; extern struct acpi_dmtable_info acpi_dm_table_info_spcr[]; extern struct acpi_dmtable_info acpi_dm_table_info_spmi[]; extern struct acpi_dmtable_info acpi_dm_table_info_srat[]; +extern struct acpi_dmtable_info acpi_dm_table_info_srat_hdr[]; extern struct acpi_dmtable_info acpi_dm_table_info_srat0[]; extern struct acpi_dmtable_info acpi_dm_table_info_srat1[]; +extern struct acpi_dmtable_info acpi_dm_table_info_srat2[]; extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[]; extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[]; diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index d38f9be2f6e..63f5b4cf4de 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -908,7 +908,9 @@ enum acpi_madt_type { ACPI_MADT_TYPE_IO_SAPIC = 6, ACPI_MADT_TYPE_LOCAL_SAPIC = 7, ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, - ACPI_MADT_TYPE_RESERVED = 9 /* 9 and greater are reserved */ + ACPI_MADT_TYPE_LOCAL_X2APIC = 9, + ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, + ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */ }; /* @@ -1009,6 +1011,26 @@ struct acpi_madt_interrupt_source { #define ACPI_MADT_CPEI_OVERRIDE (1) +/* 9: Processor Local X2_APIC (07/2008) */ + +struct acpi_madt_local_x2apic { + struct acpi_subtable_header header; + u16 reserved; /* Reserved - must be zero */ + u32 local_apic_id; /* Processor X2_APIC ID */ + u32 lapic_flags; + u32 uid; /* Extended X2_APIC processor ID */ +}; + +/* 10: Local X2APIC NMI (07/2008) */ + +struct acpi_madt_local_x2apic_nmi { + struct acpi_subtable_header header; + u16 inti_flags; + u32 uid; /* Processor X2_APIC ID */ + u8 lint; /* LINTn to which NMI is connected */ + u8 reserved[3]; +}; + /* * Common flags fields for MADT subtables */ @@ -1150,10 +1172,15 @@ struct acpi_table_srat { enum acpi_srat_type { ACPI_SRAT_TYPE_CPU_AFFINITY = 0, ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1, - ACPI_SRAT_TYPE_RESERVED = 2 + ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2, + ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ }; -/* SRAT sub-tables */ +/* + * SRAT Sub-tables, correspond to Type in struct acpi_subtable_header + */ + +/* 0: Processor Local APIC/SAPIC Affinity */ struct acpi_srat_cpu_affinity { struct acpi_subtable_header header; @@ -1165,9 +1192,7 @@ struct acpi_srat_cpu_affinity { u32 reserved; /* Reserved, must be zero */ }; -/* Flags */ - -#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */ +/* 1: Memory Affinity */ struct acpi_srat_mem_affinity { struct acpi_subtable_header header; @@ -1186,6 +1211,20 @@ struct acpi_srat_mem_affinity { #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */ #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */ +/* 2: Processor Local X2_APIC Affinity (07/2008) */ + +struct acpi_srat_x2apic_cpu_affinity { + struct acpi_subtable_header header; + u16 reserved; /* Reserved, must be zero */ + u32 proximity_domain; + u32 apic_id; + u32 flags; +}; + +/* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */ + +#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */ + /******************************************************************************* * * TCPA - Trusted Computing Platform Alliance table -- cgit v1.2.3 From eec935490172dbfa1a32647f9deb2b66a66f2741 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 4 Aug 2008 11:15:11 +0800 Subject: ACPICA: Update version to 20080729 Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 328caeee821..4da88b165b5 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20080701 +#define ACPI_CA_VERSION 0x20080729 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, -- cgit v1.2.3 From 8bd108d14604d9c95000751e6c6ecbd11ea6ed40 Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Thu, 25 Sep 2008 21:40:30 +0400 Subject: ACPICA: add preemption point after each opcode parse Reference: http://marc.info/?l=linux-acpi&m=122236382701062&w=2 Signed-off-by: Alexey Starikovskiy Tested-by: Sitsofe Wheeler Signed-off-by: Len Brown --- include/acpi/acmacros.h | 5 +++++ include/acpi/platform/aclinux.h | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'include') diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 2106f9136cc..a1e3240bf46 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -685,4 +685,9 @@ struct acpi_integer_overlay { #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ +/* Preemption point */ +#ifndef ACPI_PREEMPTION_POINT +#define ACPI_PREEMPTION_POINT() /* no preemption */ +#endif + #endif /* ACMACROS_H */ diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 9af46459868..029c8c06c15 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -137,4 +138,9 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) #define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) #define ACPI_FREE(a) kfree(a) +/* + * We need to show where it is safe to preempt execution of ACPICA + */ +#define ACPI_PREEMPTION_POINT() cond_resched() + #endif /* __ACLINUX_H__ */ -- cgit v1.2.3 From 23d3e055beb12db2a3b91dfeee474c4d5ecc13b9 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sun, 28 Sep 2008 15:00:47 +0800 Subject: ACPICA: Remove obsolete debug levels (WARN and ERROR) Removed ACPI_DB_WARN and ACPI_DB_ERROR. These debug levels were made obsolete by the ACPI_WARNING and ACPI_ERROR/ACPI_EXCEPTION interfaces. Also added ACPI_DB_EVENTS to correspond with the existing ACPI_LV_EVENTS. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acoutput.h | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index e17873defce..09d33c7740f 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h @@ -80,12 +80,10 @@ /* * Raw debug output levels, do not use these in the DEBUG_PRINT macros */ -#define ACPI_LV_ERROR 0x00000001 -#define ACPI_LV_WARN 0x00000002 -#define ACPI_LV_INIT 0x00000004 -#define ACPI_LV_DEBUG_OBJECT 0x00000008 -#define ACPI_LV_INFO 0x00000010 -#define ACPI_LV_ALL_EXCEPTIONS 0x0000001F +#define ACPI_LV_INIT 0x00000001 +#define ACPI_LV_DEBUG_OBJECT 0x00000002 +#define ACPI_LV_INFO 0x00000004 +#define ACPI_LV_ALL_EXCEPTIONS 0x00000007 /* Trace verbosity level 1 [Standard Trace Level] */ @@ -127,7 +125,6 @@ #define ACPI_LV_VERBOSE_INFO 0x20000000 #define ACPI_LV_FULL_TABLES 0x40000000 #define ACPI_LV_EVENTS 0x80000000 - #define ACPI_LV_VERBOSE 0xF0000000 /* @@ -135,21 +132,17 @@ */ #define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS -/* Exception level -- used in the global "DebugLevel" */ - +/* + * Exception level -- used in the global "DebugLevel" + * + * Note: For errors, use the ACPI_ERROR or ACPI_EXCEPTION interfaces. + * For warnings, use ACPI_WARNING. + */ #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) -/* - * These two levels are essentially obsolete, all instances in the - * ACPICA core code have been replaced by ACPI_ERROR and ACPI_WARNING - * (Kept here because some drivers may still use them) - */ -#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) -#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) - /* Trace level -- also used in the global "DebugLevel" */ #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) @@ -173,13 +166,14 @@ #define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS) #define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE) #define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX) +#define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS) #define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL) /* Defaults for debug_level, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) +#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) #endif /* __ACOUTPUT_H__ */ -- cgit v1.2.3 From 8d5c54b65b20bf81fa9841a27143e2f71f3a7756 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sat, 27 Sep 2008 10:22:09 +0800 Subject: ACPICA: Add namespace node to operand object union Add ACPI_NAMESPACE_NODE to the ACPI_OPERAND_OBJECT in order to simplify code that accepts both of these objects. A common type field is used to differentiate them. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acobject.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index e9657dac69b..0ca39265bb0 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -379,6 +379,13 @@ union acpi_operand_object { struct acpi_object_extra extra; struct acpi_object_data data; struct acpi_object_cache_list cache; + + /* + * Add namespace node to union in order to simplify code that accepts both + * ACPI_OPERAND_OBJECTs and ACPI_NAMESPACE_NODEs. The structures share + * a common descriptor_type field in order to differentiate them. + */ + struct acpi_namespace_node node; }; /****************************************************************************** -- cgit v1.2.3 From 65f4692c5220330e1ea044796c4cfa603e349c84 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sat, 27 Sep 2008 10:28:07 +0800 Subject: ACPICA: Remove obsolete exception codes Removed 10 exception codes (and corresponding name strings) that were obsolete for various reasons. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acexcep.h | 128 +++++++++++++++++++++---------------------------- 1 file changed, 55 insertions(+), 73 deletions(-) (limited to 'include') diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index e5a890ffeb0..84f5cb24286 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h @@ -76,25 +76,21 @@ #define AE_STACK_OVERFLOW (acpi_status) (0x000C | AE_CODE_ENVIRONMENTAL) #define AE_STACK_UNDERFLOW (acpi_status) (0x000D | AE_CODE_ENVIRONMENTAL) #define AE_NOT_IMPLEMENTED (acpi_status) (0x000E | AE_CODE_ENVIRONMENTAL) -#define AE_VERSION_MISMATCH (acpi_status) (0x000F | AE_CODE_ENVIRONMENTAL) -#define AE_SUPPORT (acpi_status) (0x0010 | AE_CODE_ENVIRONMENTAL) -#define AE_SHARE (acpi_status) (0x0011 | AE_CODE_ENVIRONMENTAL) -#define AE_LIMIT (acpi_status) (0x0012 | AE_CODE_ENVIRONMENTAL) -#define AE_TIME (acpi_status) (0x0013 | AE_CODE_ENVIRONMENTAL) -#define AE_UNKNOWN_STATUS (acpi_status) (0x0014 | AE_CODE_ENVIRONMENTAL) -#define AE_ACQUIRE_DEADLOCK (acpi_status) (0x0015 | AE_CODE_ENVIRONMENTAL) -#define AE_RELEASE_DEADLOCK (acpi_status) (0x0016 | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_ACQUIRED (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL) -#define AE_ALREADY_ACQUIRED (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_HARDWARE_RESPONSE (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_GLOBAL_LOCK (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) -#define AE_LOGICAL_ADDRESS (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) -#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL) -#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL) -#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL) -#define AE_OWNER_ID_LIMIT (acpi_status) (0x001F | AE_CODE_ENVIRONMENTAL) +#define AE_SUPPORT (acpi_status) (0x000F | AE_CODE_ENVIRONMENTAL) +#define AE_LIMIT (acpi_status) (0x0010 | AE_CODE_ENVIRONMENTAL) +#define AE_TIME (acpi_status) (0x0011 | AE_CODE_ENVIRONMENTAL) +#define AE_ACQUIRE_DEADLOCK (acpi_status) (0x0012 | AE_CODE_ENVIRONMENTAL) +#define AE_RELEASE_DEADLOCK (acpi_status) (0x0013 | AE_CODE_ENVIRONMENTAL) +#define AE_NOT_ACQUIRED (acpi_status) (0x0014 | AE_CODE_ENVIRONMENTAL) +#define AE_ALREADY_ACQUIRED (acpi_status) (0x0015 | AE_CODE_ENVIRONMENTAL) +#define AE_NO_HARDWARE_RESPONSE (acpi_status) (0x0016 | AE_CODE_ENVIRONMENTAL) +#define AE_NO_GLOBAL_LOCK (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL) +#define AE_ABORT_METHOD (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL) +#define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) +#define AE_WAKE_ONLY_GPE (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) +#define AE_OWNER_ID_LIMIT (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) -#define AE_CODE_ENV_MAX 0x001F +#define AE_CODE_ENV_MAX 0x001B /* * Programmer exceptions @@ -103,14 +99,12 @@ #define AE_BAD_CHARACTER (acpi_status) (0x0002 | AE_CODE_PROGRAMMER) #define AE_BAD_PATHNAME (acpi_status) (0x0003 | AE_CODE_PROGRAMMER) #define AE_BAD_DATA (acpi_status) (0x0004 | AE_CODE_PROGRAMMER) -#define AE_BAD_ADDRESS (acpi_status) (0x0005 | AE_CODE_PROGRAMMER) -#define AE_ALIGNMENT (acpi_status) (0x0006 | AE_CODE_PROGRAMMER) -#define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER) -#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER) -#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER) -#define AE_MISSING_ARGUMENTS (acpi_status) (0x000A | AE_CODE_PROGRAMMER) +#define AE_BAD_HEX_CONSTANT (acpi_status) (0x0005 | AE_CODE_PROGRAMMER) +#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0006 | AE_CODE_PROGRAMMER) +#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER) +#define AE_MISSING_ARGUMENTS (acpi_status) (0x0008 | AE_CODE_PROGRAMMER) -#define AE_CODE_PGM_MAX 0x000A +#define AE_CODE_PGM_MAX 0x0008 /* * Acpi table exceptions @@ -119,51 +113,48 @@ #define AE_BAD_HEADER (acpi_status) (0x0002 | AE_CODE_ACPI_TABLES) #define AE_BAD_CHECKSUM (acpi_status) (0x0003 | AE_CODE_ACPI_TABLES) #define AE_BAD_VALUE (acpi_status) (0x0004 | AE_CODE_ACPI_TABLES) -#define AE_TABLE_NOT_SUPPORTED (acpi_status) (0x0005 | AE_CODE_ACPI_TABLES) -#define AE_INVALID_TABLE_LENGTH (acpi_status) (0x0006 | AE_CODE_ACPI_TABLES) +#define AE_INVALID_TABLE_LENGTH (acpi_status) (0x0005 | AE_CODE_ACPI_TABLES) -#define AE_CODE_TBL_MAX 0x0006 +#define AE_CODE_TBL_MAX 0x0005 /* * AML exceptions. These are caused by problems with * the actual AML byte stream */ -#define AE_AML_ERROR (acpi_status) (0x0001 | AE_CODE_AML) -#define AE_AML_PARSE (acpi_status) (0x0002 | AE_CODE_AML) -#define AE_AML_BAD_OPCODE (acpi_status) (0x0003 | AE_CODE_AML) -#define AE_AML_NO_OPERAND (acpi_status) (0x0004 | AE_CODE_AML) -#define AE_AML_OPERAND_TYPE (acpi_status) (0x0005 | AE_CODE_AML) -#define AE_AML_OPERAND_VALUE (acpi_status) (0x0006 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_LOCAL (acpi_status) (0x0007 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_ARG (acpi_status) (0x0008 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_ELEMENT (acpi_status) (0x0009 | AE_CODE_AML) -#define AE_AML_NUMERIC_OVERFLOW (acpi_status) (0x000A | AE_CODE_AML) -#define AE_AML_REGION_LIMIT (acpi_status) (0x000B | AE_CODE_AML) -#define AE_AML_BUFFER_LIMIT (acpi_status) (0x000C | AE_CODE_AML) -#define AE_AML_PACKAGE_LIMIT (acpi_status) (0x000D | AE_CODE_AML) -#define AE_AML_DIVIDE_BY_ZERO (acpi_status) (0x000E | AE_CODE_AML) -#define AE_AML_BAD_NAME (acpi_status) (0x000F | AE_CODE_AML) -#define AE_AML_NAME_NOT_FOUND (acpi_status) (0x0010 | AE_CODE_AML) -#define AE_AML_INTERNAL (acpi_status) (0x0011 | AE_CODE_AML) -#define AE_AML_INVALID_SPACE_ID (acpi_status) (0x0012 | AE_CODE_AML) -#define AE_AML_STRING_LIMIT (acpi_status) (0x0013 | AE_CODE_AML) -#define AE_AML_NO_RETURN_VALUE (acpi_status) (0x0014 | AE_CODE_AML) -#define AE_AML_METHOD_LIMIT (acpi_status) (0x0015 | AE_CODE_AML) -#define AE_AML_NOT_OWNER (acpi_status) (0x0016 | AE_CODE_AML) -#define AE_AML_MUTEX_ORDER (acpi_status) (0x0017 | AE_CODE_AML) -#define AE_AML_MUTEX_NOT_ACQUIRED (acpi_status) (0x0018 | AE_CODE_AML) -#define AE_AML_INVALID_RESOURCE_TYPE (acpi_status) (0x0019 | AE_CODE_AML) -#define AE_AML_INVALID_INDEX (acpi_status) (0x001A | AE_CODE_AML) -#define AE_AML_REGISTER_LIMIT (acpi_status) (0x001B | AE_CODE_AML) -#define AE_AML_NO_WHILE (acpi_status) (0x001C | AE_CODE_AML) -#define AE_AML_ALIGNMENT (acpi_status) (0x001D | AE_CODE_AML) -#define AE_AML_NO_RESOURCE_END_TAG (acpi_status) (0x001E | AE_CODE_AML) -#define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) -#define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML) -#define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x0021 | AE_CODE_AML) -#define AE_AML_ILLEGAL_ADDRESS (acpi_status) (0x0022 | AE_CODE_AML) +#define AE_AML_BAD_OPCODE (acpi_status) (0x0001 | AE_CODE_AML) +#define AE_AML_NO_OPERAND (acpi_status) (0x0002 | AE_CODE_AML) +#define AE_AML_OPERAND_TYPE (acpi_status) (0x0003 | AE_CODE_AML) +#define AE_AML_OPERAND_VALUE (acpi_status) (0x0004 | AE_CODE_AML) +#define AE_AML_UNINITIALIZED_LOCAL (acpi_status) (0x0005 | AE_CODE_AML) +#define AE_AML_UNINITIALIZED_ARG (acpi_status) (0x0006 | AE_CODE_AML) +#define AE_AML_UNINITIALIZED_ELEMENT (acpi_status) (0x0007 | AE_CODE_AML) +#define AE_AML_NUMERIC_OVERFLOW (acpi_status) (0x0008 | AE_CODE_AML) +#define AE_AML_REGION_LIMIT (acpi_status) (0x0009 | AE_CODE_AML) +#define AE_AML_BUFFER_LIMIT (acpi_status) (0x000A | AE_CODE_AML) +#define AE_AML_PACKAGE_LIMIT (acpi_status) (0x000B | AE_CODE_AML) +#define AE_AML_DIVIDE_BY_ZERO (acpi_status) (0x000C | AE_CODE_AML) +#define AE_AML_BAD_NAME (acpi_status) (0x000D | AE_CODE_AML) +#define AE_AML_NAME_NOT_FOUND (acpi_status) (0x000E | AE_CODE_AML) +#define AE_AML_INTERNAL (acpi_status) (0x000F | AE_CODE_AML) +#define AE_AML_INVALID_SPACE_ID (acpi_status) (0x0010 | AE_CODE_AML) +#define AE_AML_STRING_LIMIT (acpi_status) (0x0011 | AE_CODE_AML) +#define AE_AML_NO_RETURN_VALUE (acpi_status) (0x0012 | AE_CODE_AML) +#define AE_AML_METHOD_LIMIT (acpi_status) (0x0013 | AE_CODE_AML) +#define AE_AML_NOT_OWNER (acpi_status) (0x0014 | AE_CODE_AML) +#define AE_AML_MUTEX_ORDER (acpi_status) (0x0015 | AE_CODE_AML) +#define AE_AML_MUTEX_NOT_ACQUIRED (acpi_status) (0x0016 | AE_CODE_AML) +#define AE_AML_INVALID_RESOURCE_TYPE (acpi_status) (0x0017 | AE_CODE_AML) +#define AE_AML_INVALID_INDEX (acpi_status) (0x0018 | AE_CODE_AML) +#define AE_AML_REGISTER_LIMIT (acpi_status) (0x0019 | AE_CODE_AML) +#define AE_AML_NO_WHILE (acpi_status) (0x001A | AE_CODE_AML) +#define AE_AML_ALIGNMENT (acpi_status) (0x001B | AE_CODE_AML) +#define AE_AML_NO_RESOURCE_END_TAG (acpi_status) (0x001C | AE_CODE_AML) +#define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001D | AE_CODE_AML) +#define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x001E | AE_CODE_AML) +#define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x001F | AE_CODE_AML) +#define AE_AML_ILLEGAL_ADDRESS (acpi_status) (0x0020 | AE_CODE_AML) -#define AE_CODE_AML_MAX 0x0022 +#define AE_CODE_AML_MAX 0x0020 /* * Internal exceptions used for control @@ -206,19 +197,15 @@ char const *acpi_gbl_exception_names_env[] = { "AE_STACK_OVERFLOW", "AE_STACK_UNDERFLOW", "AE_NOT_IMPLEMENTED", - "AE_VERSION_MISMATCH", "AE_SUPPORT", - "AE_SHARE", "AE_LIMIT", "AE_TIME", - "AE_UNKNOWN_STATUS", "AE_ACQUIRE_DEADLOCK", "AE_RELEASE_DEADLOCK", "AE_NOT_ACQUIRED", "AE_ALREADY_ACQUIRED", "AE_NO_HARDWARE_RESPONSE", "AE_NO_GLOBAL_LOCK", - "AE_LOGICAL_ADDRESS", "AE_ABORT_METHOD", "AE_SAME_HANDLER", "AE_WAKE_ONLY_GPE", @@ -231,8 +218,6 @@ char const *acpi_gbl_exception_names_pgm[] = { "AE_BAD_CHARACTER", "AE_BAD_PATHNAME", "AE_BAD_DATA", - "AE_BAD_ADDRESS", - "AE_ALIGNMENT", "AE_BAD_HEX_CONSTANT", "AE_BAD_OCTAL_CONSTANT", "AE_BAD_DECIMAL_CONSTANT", @@ -245,14 +230,11 @@ char const *acpi_gbl_exception_names_tbl[] = { "AE_BAD_HEADER", "AE_BAD_CHECKSUM", "AE_BAD_VALUE", - "AE_TABLE_NOT_SUPPORTED", "AE_INVALID_TABLE_LENGTH" }; char const *acpi_gbl_exception_names_aml[] = { NULL, - "AE_AML_ERROR", - "AE_AML_PARSE", "AE_AML_BAD_OPCODE", "AE_AML_NO_OPERAND", "AE_AML_OPERAND_TYPE", @@ -284,7 +266,7 @@ char const *acpi_gbl_exception_names_aml[] = { "AE_AML_BAD_RESOURCE_VALUE", "AE_AML_CIRCULAR_REFERENCE", "AE_AML_BAD_RESOURCE_LENGTH", - "AE_AML_ILLEGAL_ADDRESS" + "AE_AML_ILLEGAL_ADDRESS", }; char const *acpi_gbl_exception_names_ctrl[] = { -- cgit v1.2.3 From 57e664cfd968ec8e4b0bfd80a5e8f903307e598b Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sat, 27 Sep 2008 10:40:39 +0800 Subject: ACPICA: Update for Reference ACPI_OPERAND_OBJECT 1) Add new field for use by DdbHandle (Value) 2) Use ACPI_CAST_INDIRECT_PTR to eliminate strict type warnings 3) Cleanup debug output Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acobject.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 0ca39265bb0..7a8a652ffb7 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -318,6 +318,7 @@ struct acpi_object_reference { struct acpi_namespace_node *node; union acpi_operand_object **where; u32 offset; /* Used for arg_op, local_op, and index_op */ + u32 value; /* Used for ddb_handle */ }; /* -- cgit v1.2.3 From 1044f1f65b7df2aae979e397904c4985eeb99ba2 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sat, 27 Sep 2008 11:08:41 +0800 Subject: ACPICA: Cleanup for internal Reference Object Fix some sloppiness in the Reference object. No longer use AML opcodes to differentiate the types, introduce new reference Class. Cleanup the debug output code. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acdebug.h | 4 ++++ include/acpi/acdispat.h | 6 +++--- include/acpi/acobject.h | 31 +++++++++++++++++++++++-------- 3 files changed, 30 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h index c5a1b50d8d9..a4fb001d96f 100644 --- a/include/acpi/acdebug.h +++ b/include/acpi/acdebug.h @@ -123,6 +123,10 @@ void acpi_db_check_integrity(void); void acpi_db_generate_gpe(char *gpe_arg, char *block_arg); +void acpi_db_check_predefined_names(void); + +void acpi_db_batch_execute(void); + /* * dbdisply - debug display commands */ diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 21a73a105d0..6291904be01 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -157,7 +157,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number); * dsmthdat - method data (locals/args) */ acpi_status -acpi_ds_store_object_to_local(u16 opcode, +acpi_ds_store_object_to_local(u8 type, u32 index, union acpi_operand_object *src_desc, struct acpi_walk_state *walk_state); @@ -173,7 +173,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state); u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc); acpi_status -acpi_ds_method_data_get_value(u16 opcode, +acpi_ds_method_data_get_value(u8 type, u32 index, struct acpi_walk_state *walk_state, union acpi_operand_object **dest_desc); @@ -184,7 +184,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params, struct acpi_walk_state *walk_state); acpi_status -acpi_ds_method_data_get_node(u16 opcode, +acpi_ds_method_data_get_node(u8 type, u32 index, struct acpi_walk_state *walk_state, struct acpi_namespace_node **node); diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 7a8a652ffb7..eb6f038b03d 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -308,19 +308,34 @@ struct acpi_object_addr_handler { *****************************************************************************/ /* - * The Reference object type is used for these opcodes: - * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op + * The Reference object is used for these opcodes: + * Arg[0-6], Local[0-7], index_op, name_op, ref_of_op, load_op, load_table_op, debug_op + * The Reference.Class differentiates these types. */ struct acpi_object_reference { - ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ - u16 opcode; + ACPI_OBJECT_COMMON_HEADER u8 class; /* Reference Class */ + u8 target_type; /* Used for Index Op */ + u8 reserved; void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ - struct acpi_namespace_node *node; - union acpi_operand_object **where; - u32 offset; /* Used for arg_op, local_op, and index_op */ - u32 value; /* Used for ddb_handle */ + struct acpi_namespace_node *node; /* ref_of or Namepath */ + union acpi_operand_object **where; /* Target of Index */ + u32 value; /* Used for Local/Arg/Index/ddb_handle */ }; +/* Values for Reference.Class above */ + +typedef enum { + ACPI_REFCLASS_LOCAL = 0, /* Method local */ + ACPI_REFCLASS_ARG = 1, /* Method argument */ + ACPI_REFCLASS_REFOF = 2, /* Result of ref_of() TBD: Split to Ref/Node and Ref/operand_obj? */ + ACPI_REFCLASS_INDEX = 3, /* Result of Index() */ + ACPI_REFCLASS_TABLE = 4, /* ddb_handle - Load(), load_table() */ + ACPI_REFCLASS_NAME = 5, /* Reference to a named object */ + ACPI_REFCLASS_DEBUG = 6, /* Debug object */ + + ACPI_REFCLASS_MAX = 6 +} ACPI_REFERENCE_CLASSES; + /* * Extra object is used as additional storage for types that * have AML code in their declarations (term_args) that must be -- cgit v1.2.3 From 51f52819bd02112a1f61f0741231f14bdb0cae7b Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sat, 27 Sep 2008 11:14:04 +0800 Subject: ACPICA: Update version to 20080829 Update version to 20080829. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 4da88b165b5..2b737e510b1 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20080729 +#define ACPI_CA_VERSION 0x20080829 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, -- cgit v1.2.3 From bbbbeb8e31af97f11b84294b2e7e5607125829d2 Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Sat, 27 Sep 2008 11:26:59 +0800 Subject: ACPICA: Remove unused ACPI register bit definition Removed the ACPI_BITREG_WAKE_ENABLE definition and entry in the global register table. This bit does not exist and is unused. http://www.acpica.org/bugzilla/show_bug.cgi?id=442 Signed-off-by: Lin Ming Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/actypes.h | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 6bd08e83f31..e8936ab5962 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -607,8 +607,15 @@ typedef u8 acpi_adr_space_type; /* * bit_register IDs - * These are bitfields defined within the full ACPI registers + * + * These values are intended to be used by the hardware interfaces + * and are mapped to individual bitfields defined within the ACPI + * registers. See the acpi_gbl_bit_register_info global table in utglobal.c + * for this mapping. */ + +/* PM1 Status register */ + #define ACPI_BITREG_TIMER_STATUS 0x00 #define ACPI_BITREG_BUS_MASTER_STATUS 0x01 #define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02 @@ -618,24 +625,29 @@ typedef u8 acpi_adr_space_type; #define ACPI_BITREG_WAKE_STATUS 0x06 #define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07 +/* PM1 Enable register */ + #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_PCIEXP_WAKE_DISABLE 0x0D + +/* PM1 Control register */ + +#define ACPI_BITREG_SCI_ENABLE 0x0E +#define ACPI_BITREG_BUS_MASTER_RLD 0x0F +#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x10 +#define ACPI_BITREG_SLEEP_TYPE_A 0x11 +#define ACPI_BITREG_SLEEP_TYPE_B 0x12 +#define ACPI_BITREG_SLEEP_ENABLE 0x13 -#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 +/* PM2 Control register */ -#define ACPI_BITREG_ARB_DISABLE 0x15 +#define ACPI_BITREG_ARB_DISABLE 0x14 -#define ACPI_BITREG_MAX 0x15 +#define ACPI_BITREG_MAX 0x14 #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 /* -- cgit v1.2.3 From e8707b340fb5b6313cde784b944a568dfd770ddd Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sun, 28 Sep 2008 15:26:17 +0800 Subject: ACPICA: New: Validation for predefined ACPI methods/objects Validates predefined ACPI objects that appear in the namespace, at the time they are evaluated. The argument count and the type of the returned object are validated. The purpose of this validation is to detect problems with the BIOS-exposed predefined ACPI objects before the results are returned to the ACPI-related drivers. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acdebug.h | 4 + include/acpi/aclocal.h | 77 ++++++++++ include/acpi/acnamesp.h | 16 +++ include/acpi/acpredef.h | 371 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 468 insertions(+) create mode 100644 include/acpi/acpredef.h (limited to 'include') diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h index a4fb001d96f..62c59df3b86 100644 --- a/include/acpi/acdebug.h +++ b/include/acpi/acdebug.h @@ -154,6 +154,10 @@ void acpi_db_display_argument_object(union acpi_operand_object *obj_desc, struct acpi_walk_state *walk_state); +void acpi_db_check_predefined_names(void); + +void acpi_db_batch_execute(void); + /* * dbexec - debugger control method execution */ diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index b221c8583dd..ecab527cf78 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -208,6 +208,7 @@ struct acpi_namespace_node { #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ +#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */ #define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */ #define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */ @@ -340,6 +341,82 @@ acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF +/* + * Information structure for ACPI predefined names. + * Each entry in the table contains the following items: + * + * Name - The ACPI reserved name + * param_count - Number of arguments to the method + * expected_return_btypes - Allowed type(s) for the return value + */ +struct acpi_name_info { + char name[ACPI_NAME_SIZE]; + u8 param_count; + u8 expected_btypes; +}; + +/* + * Secondary information structures for ACPI predefined objects that return + * package objects. This structure appears as the next entry in the table + * after the NAME_INFO structure above. + * + * The reason for this is to minimize the size of the predefined name table. + */ + +/* + * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, + * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT + */ +struct acpi_package_info { + u8 type; + u8 object_type1; + u8 count1; + u8 object_type2; + u8 count2; + u8 reserved; +}; + +/* Used for ACPI_PTYPE2_FIXED */ + +struct acpi_package_info2 { + u8 type; + u8 count; + u8 object_type[4]; +}; + +/* Used for ACPI_PTYPE1_OPTION */ + +struct acpi_package_info3 { + u8 type; + u8 count; + u8 object_type[2]; + u8 tail_object_type; + u8 reserved; +}; + +union acpi_predefined_info { + struct acpi_name_info info; + struct acpi_package_info ret_info; + struct acpi_package_info2 ret_info2; + struct acpi_package_info3 ret_info3; +}; + +/* + * Bitmapped return value types + * Note: the actual data types must be contiguous, a loop in nspredef.c + * depends on this. + */ +#define ACPI_RTYPE_ANY 0x00 +#define ACPI_RTYPE_NONE 0x01 +#define ACPI_RTYPE_INTEGER 0x02 +#define ACPI_RTYPE_STRING 0x04 +#define ACPI_RTYPE_BUFFER 0x08 +#define ACPI_RTYPE_PACKAGE 0x10 +#define ACPI_RTYPE_REFERENCE 0x20 +#define ACPI_RTYPE_ALL 0x3F + +#define ACPI_NUM_RTYPES 5 /* Number of actual object types */ + /***************************************************************************** * * Event typedefs and structs diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index c34008507b6..db4e6f67785 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h @@ -177,6 +177,22 @@ acpi_ns_dump_objects(acpi_object_type type, */ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info); +/* + * nspredef - Support for predefined/reserved names + */ +acpi_status +acpi_ns_check_predefined_names(struct acpi_namespace_node *node, + union acpi_operand_object *return_object); + +const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct + acpi_namespace_node + *node); + +void +acpi_ns_check_parameter_count(char *pathname, + struct acpi_namespace_node *node, + const union acpi_predefined_info *info); + /* * nsnames - Name and Scope manipulation */ diff --git a/include/acpi/acpredef.h b/include/acpi/acpredef.h new file mode 100644 index 00000000000..619fb75f886 --- /dev/null +++ b/include/acpi/acpredef.h @@ -0,0 +1,371 @@ +/****************************************************************************** + * + * Name: acpredef - Information table for ACPI predefined methods and objects + * $Revision: 1.1 $ + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2008, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef __ACPREDEF_H__ +#define __ACPREDEF_H__ + +/****************************************************************************** + * + * Return Package types + * + * 1) PTYPE1 packages do not contain sub-packages. + * + * ACPI_PTYPE1_FIXED: Fixed length, 1 or 2 object types: + * object type + * count + * object type + * count + * + * ACPI_PTYPE1_VAR: Variable length: + * object type (Int/Buf/Ref) + * + * ACPI_PTYPE1_OPTION: Package has some required and some optional elements: + * Used for _PRW + * + * + * 2) PTYPE2 packages contain a variable number of sub-packages. Each of the + * different types describe the contents of each of the sub-packages. + * + * ACPI_PTYPE2: Each subpackage contains 1 or 2 object types: + * object type + * count + * object type + * count + * + * ACPI_PTYPE2_COUNT: Each subpackage has a count as first element: + * object type + * + * ACPI_PTYPE2_PKG_COUNT: Count of subpackages at start, 1 or 2 object types: + * object type + * count + * object type + * count + * + * ACPI_PTYPE2_FIXED: Each subpackage is of fixed length: + * Used for _PRT + * + * ACPI_PTYPE2_MIN: Each subpackage has a variable but minimum length + * Used for _HPX + * + *****************************************************************************/ + +enum acpi_return_package_types { + ACPI_PTYPE1_FIXED = 1, + ACPI_PTYPE1_VAR = 2, + ACPI_PTYPE1_OPTION = 3, + ACPI_PTYPE2 = 4, + ACPI_PTYPE2_COUNT = 5, + ACPI_PTYPE2_PKG_COUNT = 6, + ACPI_PTYPE2_FIXED = 7, + ACPI_PTYPE2_MIN = 8 +}; + +/* + * Predefined method/object information table. + * + * These are the names that can actually be evaluated via acpi_evaluate_object. + * Not present in this table are the following: + * + * 1) Predefined/Reserved names that are never evaluated via acpi_evaluate_object: + * _Lxx and _Exx GPE methods + * _Qxx EC methods + * _T_x compiler temporary variables + * + * 2) Predefined names that never actually exist within the AML code: + * Predefined resource descriptor field names + * + * 3) Predefined names that are implemented within ACPICA: + * _OSI + * + * 4) Some predefined names that are not documented within the ACPI spec. + * _WDG, _WED + * + * The main entries in the table each contain the following items: + * + * Name - The ACPI reserved name + * param_count - Number of arguments to the method + * expected_btypes - Allowed type(s) for the return value. + * 0 means that no return value is expected. + * + * For methods that return packages, the next entry in the table contains + * information about the expected structure of the package. This information + * is saved here (rather than in a separate table) in order to minimize the + * overall size of the stored data. + */ +static const union acpi_predefined_info predefined_names[] = { + {.info = {"_AC0", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC1", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC2", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC3", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC4", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC5", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC6", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC7", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC8", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AC9", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_ADR", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_AL0", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL1", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL2", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL3", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL4", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL5", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL6", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL7", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL8", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_AL9", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_ALC", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_ALI", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_ALP", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_ALR", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 2, 0, 0, 0}}, /* variable (Pkgs) each 2 (Ints) */ + {.info = {"_ALT", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_BBN", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_BCL", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0}}, /* variable (Ints) */ + {.info = {"_BCM", 1, 0}}, + {.info = {"_BDN", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_BFS", 1, 0}}, + {.info = {"_BIF", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, + 9, + ACPI_RTYPE_STRING, 4, 0}}, /* fixed (9 Int),(4 Str) */ + {.info = {"_BLT", 3, 0}}, + {.info = {"_BMC", 1, 0}}, + {.info = {"_BMD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5, 0, 0, 0}}, /* fixed (5 Int) */ + {.info = {"_BQC", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_BST", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0}}, /* fixed (4 Int) */ + {.info = {"_BTM", 1, ACPI_RTYPE_INTEGER}}, + {.info = {"_BTP", 1, 0}}, + {.info = {"_CBA", 0, ACPI_RTYPE_INTEGER}}, /* see PCI firmware spec 3.0 */ + {.info = {"_CID", 0, + ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, + {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0, 0, 0, 0}}, /* variable (Ints/Strs) */ + {.info = {"_CRS", 0, ACPI_RTYPE_BUFFER}}, + {.info = {"_CRT", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_CSD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER, 0, 0, 0, 0}}, /* variable (1 Int(n), n-1 Int) */ + {.info = {"_CST", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2_PKG_COUNT, + ACPI_RTYPE_BUFFER, 1, + ACPI_RTYPE_INTEGER, 3, 0}}, /* variable (1 Int(n), n Pkg (1 Buf/3 Int) */ + {.info = {"_DCK", 1, ACPI_RTYPE_INTEGER}}, + {.info = {"_DCS", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_DDC", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER}}, + {.info = {"_DDN", 0, ACPI_RTYPE_STRING}}, + {.info = {"_DGS", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_DIS", 0, 0}}, + {.info = {"_DMA", 0, ACPI_RTYPE_BUFFER}}, + {.info = {"_DOD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0}}, /* variable (Ints) */ + {.info = {"_DOS", 1, 0}}, + {.info = {"_DSM", 4, ACPI_RTYPE_ALL}}, /* Must return a type, but it can be of any type */ + {.info = {"_DSS", 1, 0}}, + {.info = {"_DSW", 3, 0}}, + {.info = {"_EC_", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_EDL", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_EJ0", 1, 0}}, + {.info = {"_EJ1", 1, 0}}, + {.info = {"_EJ2", 1, 0}}, + {.info = {"_EJ3", 1, 0}}, + {.info = {"_EJ4", 1, 0}}, + {.info = {"_EJD", 0, ACPI_RTYPE_STRING}}, + {.info = {"_FDE", 0, ACPI_RTYPE_BUFFER}}, + {.info = {"_FDI", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, 0, 0, 0}}, /* fixed (16 Int) */ + {.info = {"_FDM", 1, 0}}, + {.info = {"_FIX", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0}}, /* variable (Ints) */ + {.info = {"_GLK", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_GPD", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */ + {.info = {"_GSB", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_GTF", 0, ACPI_RTYPE_BUFFER}}, + {.info = {"_GTM", 0, ACPI_RTYPE_BUFFER}}, + {.info = {"_GTS", 1, 0}}, + {.info = {"_HID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}}, + {.info = {"_HOT", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_HPP", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0}}, /* fixed (4 Int) */ + + /* + * For _HPX, a single package is returned, containing a variable number of sub-packages. + * Each sub-package contains a PCI record setting. There are several different type of + * record settings, of different lengths, but all elements of all settings are Integers. + */ + {.info = {"_HPX", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5, 0, 0, 0}}, /* variable (Pkgs) each (var Ints) */ + {.info = {"_IFT", 0, ACPI_RTYPE_INTEGER}}, /* see IPMI spec */ + {.info = {"_INI", 0, 0}}, + {.info = {"_IRC", 0, 0}}, + {.info = {"_LCK", 1, 0}}, + {.info = {"_LID", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_MAT", 0, ACPI_RTYPE_BUFFER}}, + {.info = {"_MLS", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2, ACPI_RTYPE_STRING, 2, 0, 0, 0}}, /* variable (Pkgs) each (2 Str) */ + {.info = {"_MSG", 1, 0}}, + {.info = {"_OFF", 0, 0}}, + {.info = {"_ON_", 0, 0}}, + {.info = {"_OS_", 0, ACPI_RTYPE_STRING}}, + {.info = {"_OSC", 4, ACPI_RTYPE_BUFFER}}, + {.info = {"_OST", 3, 0}}, + {.info = {"_PCL", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_PCT", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2, 0, 0, 0}}, /* fixed (2 Buf) */ + {.info = {"_PDC", 1, 0}}, + {.info = {"_PIC", 1, 0}}, + {.info = {"_PLD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_BUFFER, 0, 0, 0, 0}}, /* variable (Bufs) */ + {.info = {"_PPC", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_PPE", 0, ACPI_RTYPE_INTEGER}}, /* see dig64 spec */ + {.info = {"_PR0", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_PR1", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_PR2", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_PRS", 0, ACPI_RTYPE_BUFFER}}, + + /* + * For _PRT, many BIOSs reverse the 2nd and 3rd Package elements. This bug is so prevalent that there + * is code in the ACPICA Resource Manager to detect this and switch them back. For now, do not allow + * and issue a warning. To allow this and eliminate the warning, add the ACPI_RTYPE_REFERENCE + * type to the 2nd element (index 1) in the statement below. + */ + {.info = {"_PRT", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2_FIXED, 4, + ACPI_RTYPE_INTEGER, + ACPI_RTYPE_INTEGER, + ACPI_RTYPE_INTEGER | ACPI_RTYPE_REFERENCE, ACPI_RTYPE_INTEGER}}, /* variable (Pkgs) each (4): Int,Int,Int/Ref,Int */ + + {.info = {"_PRW", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_OPTION, 2, + ACPI_RTYPE_INTEGER | + ACPI_RTYPE_PACKAGE, + ACPI_RTYPE_INTEGER, ACPI_RTYPE_REFERENCE, 0}}, /* variable (Pkgs) each: Pkg/Int,Int,[variable Refs] (Pkg is Ref/Int) */ + + {.info = {"_PS0", 0, 0}}, + {.info = {"_PS1", 0, 0}}, + {.info = {"_PS2", 0, 0}}, + {.info = {"_PS3", 0, 0}}, + {.info = {"_PSC", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_PSD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER, 0, 0, 0, 0}}, /* variable (Pkgs) each (5 Int) with count */ + {.info = {"_PSL", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_PSR", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_PSS", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 6, 0, 0, 0}}, /* variable (Pkgs) each (6 Int) */ + {.info = {"_PSV", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_PSW", 1, 0}}, + {.info = {"_PTC", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2, 0, 0, 0}}, /* fixed (2 Buf) */ + {.info = {"_PTS", 1, 0}}, + {.info = {"_PXM", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_REG", 2, 0}}, + {.info = {"_REV", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_RMV", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_ROM", 2, ACPI_RTYPE_BUFFER}}, + {.info = {"_RTV", 0, ACPI_RTYPE_INTEGER}}, + + /* + * For _S0_ through _S5_, the ACPI spec defines a return Package containing 1 Integer, + * but most DSDTs have it wrong - 2,3, or 4 integers. Allow this by making the objects "variable length", + * but all elements must be Integers. + */ + {.info = {"_S0_", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1, 0, 0, 0}}, /* fixed (1 Int) */ + {.info = {"_S1_", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1, 0, 0, 0}}, /* fixed (1 Int) */ + {.info = {"_S2_", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1, 0, 0, 0}}, /* fixed (1 Int) */ + {.info = {"_S3_", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1, 0, 0, 0}}, /* fixed (1 Int) */ + {.info = {"_S4_", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1, 0, 0, 0}}, /* fixed (1 Int) */ + {.info = {"_S5_", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1, 0, 0, 0}}, /* fixed (1 Int) */ + + {.info = {"_S1D", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_S2D", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_S3D", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_S4D", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_S0W", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_S1W", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_S2W", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_S3W", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_S4W", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_SBS", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_SCP", 0x13, 0}}, /* Acpi 1.0 allowed 1 arg. Acpi 3.0 expanded to 3 args. Allow both. */ + /* Note: the 3-arg definition may be removed for ACPI 4.0 */ + {.info = {"_SDD", 1, 0}}, + {.info = {"_SEG", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_SLI", 0, ACPI_RTYPE_BUFFER}}, + {.info = {"_SPD", 1, ACPI_RTYPE_INTEGER}}, + {.info = {"_SRS", 1, 0}}, + {.info = {"_SRV", 0, ACPI_RTYPE_INTEGER}}, /* see IPMI spec */ + {.info = {"_SST", 1, 0}}, + {.info = {"_STA", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_STM", 3, 0}}, + {.info = {"_STR", 0, ACPI_RTYPE_BUFFER}}, + {.info = {"_SUN", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_SWS", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_TC1", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_TC2", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_TMP", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_TPC", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_TPT", 1, 0}}, + {.info = {"_TRT", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2, + ACPI_RTYPE_INTEGER, 6, 0}}, /* variable (Pkgs) each 2_ref/6_int */ + {.info = {"_TSD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER, 5, 0, 0, 0}}, /* variable (Pkgs) each 5_int with count */ + {.info = {"_TSP", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_TSS", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5, 0, 0, 0}}, /* variable (Pkgs) each 5_int */ + {.info = {"_TST", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_TTS", 1, 0}}, + {.info = {"_TZD", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0, 0, 0}}, /* variable (Refs) */ + {.info = {"_TZM", 0, ACPI_RTYPE_REFERENCE}}, + {.info = {"_TZP", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_UID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}}, + {.info = {"_UPC", 0, ACPI_RTYPE_PACKAGE}}, {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0}}, /* fixed (4 Int) */ + {.info = {"_UPD", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_UPP", 0, ACPI_RTYPE_INTEGER}}, + {.info = {"_VPO", 0, ACPI_RTYPE_INTEGER}}, + + /* Acpi 1.0 defined _WAK with no return value. Later, it was changed to return a package */ + + {.info = {"_WAK", 1, ACPI_RTYPE_NONE | ACPI_RTYPE_PACKAGE}}, + {.ret_info = {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2, 0, 0, 0}}, /* fixed (2 Int), but is optional */ + {.ret_info = {0, 0, 0, 0, 0, 0}} /* Table terminator */ +}; + +#if 0 + /* Not implemented */ + +{ +"_WDG", 0, ACPI_RTYPE_BUFFER}, /* MS Extension */ + +{ +"_WED", 1, ACPI_RTYPE_PACKAGE}, /* MS Extension */ + + /* This is an internally implemented control method, no need to check */ +{ +"_OSI", 1, ACPI_RTYPE_INTEGER}, + + /* TBD: */ + _PRT - currently ignore reversed entries.attempt to fix here ? + think about code that attempts to fix package elements like _BIF, etc. +#endif +#endif -- cgit v1.2.3 From ed37a71eac8ba375d85ab10ed5f5e8bdf1cd72e0 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sat, 27 Sep 2008 13:39:20 +0800 Subject: ACPICA: Update version to 20080926 Update version to 20080926. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 2b737e510b1..29feee27f0e 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20080829 +#define ACPI_CA_VERSION 0x20080926 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, -- cgit v1.2.3