From c5f0231ee6b0441e4c45f461f2b6652b10195494 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 6 Aug 2010 08:57:53 +0800 Subject: ACPICA: Fix acpi_os_read_pci_configuration prototype Prototype in acpiosxf.h had the output value pointer as a (u32 *). Should be a (u64 *). Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpiosxf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/acpi') diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 29bf945143e8..5e2257796448 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -223,7 +223,7 @@ acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width); */ acpi_status acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, - u32 reg, u32 *value, u32 width); + u32 reg, u64 *value, u32 width); acpi_status acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, -- cgit v1.2.3 From b0ed7a915abac309fcb5a51bccd3782e3daa7417 Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Fri, 6 Aug 2010 09:35:51 +0800 Subject: ACPICA/ACPI: Add new host interfaces for _OSI support Adds install/remove interfaces so that the host can dynamically alter the global _OSI table. Also adds support for _OSI handlers. Additional support: new debugger command (osi), and test support in the acpiexec utility. Adds new file, utilities/utosi.c. ACPICA bugzilla 836. The Linux OSL _OSI code is also changed. acpi_osi_setup can't call acpi_install/remove_interface because ACPICA is not initialized yet at this early time. So we just save the osi string in acpi_osi_setup and will handle it later in a new function acpi_osi_setup_late. http://www.acpica.org/bugzilla/show_bug.cgi?id=836 Signed-off-by: Lin Ming Signed-off-by: Bob Moore --- include/acpi/acpiosxf.h | 3 --- include/acpi/acpixf.h | 6 ++++++ include/acpi/actypes.h | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 5e2257796448..c29b0afc651a 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -239,9 +239,6 @@ acpi_os_derive_pci_id(acpi_handle device, /* * Miscellaneous */ -acpi_status acpi_os_validate_interface(char *interface); -acpi_status acpi_osi_invalidate(char* interface); - acpi_status acpi_os_validate_address(u8 space_id, acpi_physical_address address, acpi_size length, char *name); diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index c0786d446a00..e4d6cc8074e4 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -105,6 +105,10 @@ const char *acpi_format_exception(acpi_status exception); acpi_status acpi_purge_cached_objects(void); +acpi_status acpi_install_interface(acpi_string interface_name); + +acpi_status acpi_remove_interface(acpi_string interface_name); + /* * ACPI Memory management */ @@ -263,6 +267,8 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, acpi_status acpi_install_exception_handler(acpi_exception_handler handler); #endif +acpi_status acpi_install_interface_handler(acpi_interface_handler handler); + /* * Event interfaces */ diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 5db8f472fec9..332d076f3f10 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -950,6 +950,9 @@ acpi_status(*acpi_walk_callback) (acpi_handle object, u32 nesting_level, void *context, void **return_value); +typedef +u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported); + /* Interrupt handler return values */ #define ACPI_INTERRUPT_NOT_HANDLED 0x00 -- cgit v1.2.3 From 6087658d7d576b8aeed8f9188cd9917db29aa0dd Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 11 Aug 2010 10:14:35 +0800 Subject: ACPICA: Update version to 20100806 Version 20100806. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/acpi') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index e4d6cc8074e4..bfa252ba110b 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -47,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20100702 +#define ACPI_CA_VERSION 0x20100806 #include "actypes.h" #include "actbl.h" -- cgit v1.2.3 From 95abccb576c44bc593e05fa1245d0ad26ce6107b Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 15 Sep 2010 13:22:46 +0800 Subject: ACPICA: Obsolete the acpi_os_derive_pci_id OSL interface This function is not OS-dependent and has been replaced by acpi_hw_derive_pci_id, which is now in the ACPICA core code. Local implementations of acpi_os_derive_pci_id are no longer necessary and are removed. ACPICA BZ 857. http://www.acpica.org/bugzilla/show_bug.cgi?id=857 Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpiosxf.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index c29b0afc651a..43027432a055 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -229,13 +229,6 @@ acpi_status acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, u32 reg, u64 value, u32 width); -/* - * Interim function needed for PCI IRQ routing - */ -void -acpi_os_derive_pci_id(acpi_handle device, - acpi_handle region, struct acpi_pci_id **pci_id); - /* * Miscellaneous */ -- cgit v1.2.3 From 8f40f171a29d0d2ae1ca8bd4a0c3fc9f514d1e20 Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Wed, 15 Sep 2010 13:36:55 +0800 Subject: ACPICA: Add ACPI_INLINE configuration parameter The C inline keyword is not standardized, ACPI_INLINE allows this to be configured on a per-compiler basis. Signed-off-by: Lin Ming Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/platform/acenv.h | 6 ++++++ include/acpi/platform/acgcc.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'include/acpi') diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index c05aeba9e8f0..a3e334ab1119 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -193,6 +193,12 @@ #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE #endif +/* "inline" keywords - configurable since inline is not standardized */ + +#ifndef ACPI_INLINE +#define ACPI_INLINE +#endif + /* * Debugger threading model * Use single threaded if the entire subsystem is contained in an application diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 0cd53e3cd1a3..5dcb9537343c 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -44,6 +44,8 @@ #ifndef __ACGCC_H__ #define __ACGCC_H__ +#define ACPI_INLINE __inline__ + /* Function name is used for debug output. Non-ANSI, compiler-dependent */ #define ACPI_GET_FUNCTION_NAME __func__ -- cgit v1.2.3 From 28eb3fcf8762a3b52f4fef5af29dce50d23c7151 Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Wed, 15 Sep 2010 13:55:13 +0800 Subject: ACPICA: Make acpi_thread_id no longer configurable, always u64 Change definition of acpi_thread_id to always be a u64. This simplifies the code, especially any printf output. u64 is the only common data type for all thread_id types across all operating systems. We now force the OSL to cast the native thread_id type to u64 before returning the value to ACPICA (via acpi_os_get_thread_id). Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/actypes.h | 17 ++++++++++------- include/acpi/platform/aclinux.h | 7 +++---- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 332d076f3f10..864cfae337f3 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -115,7 +115,6 @@ * * ACPI_SIZE 16/32/64-bit unsigned value * ACPI_NATIVE_INT 16/32/64-bit signed value - * */ /******************************************************************************* @@ -132,6 +131,16 @@ typedef COMPILER_DEPENDENT_INT64 INT64; /*! [End] no source code translation !*/ +/* + * Value returned by acpi_os_get_thread_id. There is no standard "thread_id" + * across operating systems or even the various UNIX systems. Since ACPICA + * only needs the thread ID as a unique thread identifier, we use a u64 + * as the only common data type - it will accommodate any type of pointer or + * any type of integer. It is up to the host-dependent OSL to cast the + * native thread ID type to a u64 (in acpi_os_get_thread_id). + */ +#define acpi_thread_id u64 + /******************************************************************************* * * Types specific to 64-bit targets @@ -211,12 +220,6 @@ typedef u32 acpi_physical_address; * ******************************************************************************/ -/* Value returned by acpi_os_get_thread_id */ - -#ifndef acpi_thread_id -#define acpi_thread_id acpi_size -#endif - /* Flags for acpi_os_acquire_lock/acpi_os_release_lock */ #ifndef acpi_cpu_flags diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 103f08aca764..572189e37133 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -75,7 +75,6 @@ #define acpi_cache_t struct kmem_cache #define acpi_spinlock spinlock_t * #define acpi_cpu_flags unsigned long -#define acpi_thread_id struct task_struct * #else /* !__KERNEL__ */ @@ -88,7 +87,7 @@ /* Host-dependent types and defines for user-space ACPICA */ #define ACPI_FLUSH_CPU_CACHE() -#define acpi_thread_id pthread_t +#define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread)) #if defined(__ia64__) || defined(__x86_64__) #define ACPI_MACHINE_WIDTH 64 @@ -113,12 +112,13 @@ #ifdef __KERNEL__ +#include /* * Overrides for in-kernel ACPICA */ static inline acpi_thread_id acpi_os_get_thread_id(void) { - return current; + return (acpi_thread_id)(unsigned long)current; } /* @@ -127,7 +127,6 @@ static inline acpi_thread_id acpi_os_get_thread_id(void) * However, boot has (system_state != SYSTEM_RUNNING) * to quiet __might_sleep() in kmalloc() and resume does not. */ -#include static inline void *acpi_os_allocate(acpi_size size) { return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); -- cgit v1.2.3 From e786db75406b30fa74dea095c571c8c164a2f3dd Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 15 Sep 2010 14:00:53 +0800 Subject: ACPICA: Update math module; no functional change Move the 64-bit overlay structures to the utmath module since they are used nowhere else. Update module comment. ACPICA BZ 829. http://www.acpica.org/bugzilla/show_bug.cgi?id=829 Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/actypes.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 864cfae337f3..2b134b691e34 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -378,16 +378,6 @@ typedef void *acpi_handle; /* Actually a ptr to a NS Node */ typedef u8 acpi_owner_id; #define ACPI_OWNER_ID_MAX 0xFF -struct uint64_struct { - u32 lo; - u32 hi; -}; - -union uint64_overlay { - u64 full; - struct uint64_struct part; -}; - #define ACPI_INTEGER_BIT_SIZE 64 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ -- cgit v1.2.3 From 31b3d4c3b3c599a2329c3e66ffab7a045b169c85 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 15 Sep 2010 14:02:56 +0800 Subject: ACPICA: Make acpi_gbl_system_awake_and_running publically available Added extern for this boolean in acpixf.h. Some hosts utilize this value during suspend/restore operations. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpixf.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/acpi') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index bfa252ba110b..c156e5ec388d 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -72,6 +72,7 @@ extern u8 acpi_gbl_truncate_io_addresses; extern u32 acpi_current_gpe_count; extern struct acpi_table_fadt acpi_gbl_FADT; +extern u8 acpi_gbl_system_awake_and_running; extern u32 acpi_rsdt_forced; /* -- cgit v1.2.3 From 846b44ad4ed11fe4dc1bddd484dde71c272bcf1b Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 17 Sep 2010 08:15:02 +0800 Subject: ACPICA: Update version to 20100915 Version 20100915. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/acpi') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index c156e5ec388d..c6bc60403de8 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -47,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20100806 +#define ACPI_CA_VERSION 0x20100915 #include "actypes.h" #include "actbl.h" -- cgit v1.2.3 From 8af2cdeaeefb2712b752e223c6d3396b9894b80d Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 18 Oct 2010 09:10:58 +0800 Subject: ACPICA: Update version to 20101013 Version 20101013. Signed-off-by: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/acpi') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index c6bc60403de8..12fe9797c0b1 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -47,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20100915 +#define ACPI_CA_VERSION 0x20101013 #include "actypes.h" #include "actbl.h" -- cgit v1.2.3