aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2010-09-15 01:55:13 -0400
committerLen Brown <len.brown@intel.com>2010-10-01 01:47:55 -0400
commit28eb3fcf8762a3b52f4fef5af29dce50d23c7151 (patch)
treec3ccfc3008b7bd9a41c3637003f180a50b843fa0 /include/acpi
parent8f40f171a29d0d2ae1ca8bd4a0c3fc9f514d1e20 (diff)
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 <ming.m.lin@intel.com Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/actypes.h17
-rw-r--r--include/acpi/platform/aclinux.h7
2 files changed, 13 insertions, 11 deletions
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 @@
115 * 115 *
116 * ACPI_SIZE 16/32/64-bit unsigned value 116 * ACPI_SIZE 16/32/64-bit unsigned value
117 * ACPI_NATIVE_INT 16/32/64-bit signed value 117 * ACPI_NATIVE_INT 16/32/64-bit signed value
118 *
119 */ 118 */
120 119
121/******************************************************************************* 120/*******************************************************************************
@@ -132,6 +131,16 @@ typedef COMPILER_DEPENDENT_INT64 INT64;
132 131
133/*! [End] no source code translation !*/ 132/*! [End] no source code translation !*/
134 133
134/*
135 * Value returned by acpi_os_get_thread_id. There is no standard "thread_id"
136 * across operating systems or even the various UNIX systems. Since ACPICA
137 * only needs the thread ID as a unique thread identifier, we use a u64
138 * as the only common data type - it will accommodate any type of pointer or
139 * any type of integer. It is up to the host-dependent OSL to cast the
140 * native thread ID type to a u64 (in acpi_os_get_thread_id).
141 */
142#define acpi_thread_id u64
143
135/******************************************************************************* 144/*******************************************************************************
136 * 145 *
137 * Types specific to 64-bit targets 146 * Types specific to 64-bit targets
@@ -211,12 +220,6 @@ typedef u32 acpi_physical_address;
211 * 220 *
212 ******************************************************************************/ 221 ******************************************************************************/
213 222
214/* Value returned by acpi_os_get_thread_id */
215
216#ifndef acpi_thread_id
217#define acpi_thread_id acpi_size
218#endif
219
220/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */ 223/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
221 224
222#ifndef acpi_cpu_flags 225#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 @@
75#define acpi_cache_t struct kmem_cache 75#define acpi_cache_t struct kmem_cache
76#define acpi_spinlock spinlock_t * 76#define acpi_spinlock spinlock_t *
77#define acpi_cpu_flags unsigned long 77#define acpi_cpu_flags unsigned long
78#define acpi_thread_id struct task_struct *
79 78
80#else /* !__KERNEL__ */ 79#else /* !__KERNEL__ */
81 80
@@ -88,7 +87,7 @@
88/* Host-dependent types and defines for user-space ACPICA */ 87/* Host-dependent types and defines for user-space ACPICA */
89 88
90#define ACPI_FLUSH_CPU_CACHE() 89#define ACPI_FLUSH_CPU_CACHE()
91#define acpi_thread_id pthread_t 90#define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread))
92 91
93#if defined(__ia64__) || defined(__x86_64__) 92#if defined(__ia64__) || defined(__x86_64__)
94#define ACPI_MACHINE_WIDTH 64 93#define ACPI_MACHINE_WIDTH 64
@@ -113,12 +112,13 @@
113 112
114 113
115#ifdef __KERNEL__ 114#ifdef __KERNEL__
115#include <acpi/actypes.h>
116/* 116/*
117 * Overrides for in-kernel ACPICA 117 * Overrides for in-kernel ACPICA
118 */ 118 */
119static inline acpi_thread_id acpi_os_get_thread_id(void) 119static inline acpi_thread_id acpi_os_get_thread_id(void)
120{ 120{
121 return current; 121 return (acpi_thread_id)(unsigned long)current;
122} 122}
123 123
124/* 124/*
@@ -127,7 +127,6 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)
127 * However, boot has (system_state != SYSTEM_RUNNING) 127 * However, boot has (system_state != SYSTEM_RUNNING)
128 * to quiet __might_sleep() in kmalloc() and resume does not. 128 * to quiet __might_sleep() in kmalloc() and resume does not.
129 */ 129 */
130#include <acpi/actypes.h>
131static inline void *acpi_os_allocate(acpi_size size) 130static inline void *acpi_os_allocate(acpi_size size)
132{ 131{
133 return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); 132 return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);