aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/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 /drivers/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 'drivers/acpi')
-rw-r--r--drivers/acpi/acpica/achware.h2
-rw-r--r--drivers/acpi/acpica/aclocal.h2
-rw-r--r--drivers/acpi/acpica/dsmethod.c2
-rw-r--r--drivers/acpi/acpica/evmisc.c2
-rw-r--r--drivers/acpi/acpica/exmutex.c10
-rw-r--r--drivers/acpi/acpica/utdebug.c7
-rw-r--r--drivers/acpi/acpica/utmutex.c29
7 files changed, 28 insertions, 26 deletions
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h
index e7c5545d8597..167470ad2d21 100644
--- a/drivers/acpi/acpica/achware.h
+++ b/drivers/acpi/acpica/achware.h
@@ -121,7 +121,6 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
121 struct acpi_gpe_block_info *gpe_block, 121 struct acpi_gpe_block_info *gpe_block,
122 void *context); 122 void *context);
123 123
124#ifdef ACPI_FUTURE_USAGE
125/* 124/*
126 * hwpci - PCI configuration support 125 * hwpci - PCI configuration support
127 */ 126 */
@@ -129,6 +128,7 @@ acpi_status
129acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, 128acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
130 acpi_handle root_pci_device, acpi_handle pci_region); 129 acpi_handle root_pci_device, acpi_handle pci_region);
131 130
131#ifdef ACPI_FUTURE_USAGE
132/* 132/*
133 * hwtimer - ACPI Timer prototypes 133 * hwtimer - ACPI Timer prototypes
134 */ 134 */
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 53f7512b060f..04ce32272546 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -1001,7 +1001,7 @@ struct acpi_port_info {
1001struct acpi_db_method_info { 1001struct acpi_db_method_info {
1002 acpi_handle main_thread_gate; 1002 acpi_handle main_thread_gate;
1003 acpi_handle thread_complete_gate; 1003 acpi_handle thread_complete_gate;
1004 u32 *threads; 1004 acpi_thread_id *threads;
1005 u32 num_threads; 1005 u32 num_threads;
1006 u32 num_created; 1006 u32 num_created;
1007 u32 num_completed; 1007 u32 num_completed;
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 64750ee96e20..d94dd8974b55 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -573,7 +573,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
573 573
574 acpi_os_release_mutex(method_desc->method. 574 acpi_os_release_mutex(method_desc->method.
575 mutex->mutex.os_mutex); 575 mutex->mutex.os_mutex);
576 method_desc->method.mutex->mutex.thread_id = NULL; 576 method_desc->method.mutex->mutex.thread_id = 0;
577 } 577 }
578 } 578 }
579 579
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index df0aea9a8cfd..fcaed9fb44ff 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -553,7 +553,7 @@ acpi_status acpi_ev_release_global_lock(void)
553 acpi_gbl_global_lock_acquired = FALSE; 553 acpi_gbl_global_lock_acquired = FALSE;
554 554
555 /* Release the local GL mutex */ 555 /* Release the local GL mutex */
556 acpi_ev_global_lock_thread_id = NULL; 556 acpi_ev_global_lock_thread_id = 0;
557 acpi_ev_global_lock_acquired = 0; 557 acpi_ev_global_lock_acquired = 0;
558 acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex); 558 acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex);
559 return_ACPI_STATUS(status); 559 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c
index f73be97043c0..6af14e43f839 100644
--- a/drivers/acpi/acpica/exmutex.c
+++ b/drivers/acpi/acpica/exmutex.c
@@ -336,7 +336,7 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
336 336
337 /* Clear mutex info */ 337 /* Clear mutex info */
338 338
339 obj_desc->mutex.thread_id = NULL; 339 obj_desc->mutex.thread_id = 0;
340 return_ACPI_STATUS(status); 340 return_ACPI_STATUS(status);
341} 341}
342 342
@@ -393,10 +393,10 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
393 if ((owner_thread->thread_id != walk_state->thread->thread_id) && 393 if ((owner_thread->thread_id != walk_state->thread->thread_id) &&
394 (obj_desc != acpi_gbl_global_lock_mutex)) { 394 (obj_desc != acpi_gbl_global_lock_mutex)) {
395 ACPI_ERROR((AE_INFO, 395 ACPI_ERROR((AE_INFO,
396 "Thread %p cannot release Mutex [%4.4s] acquired by thread %p", 396 "Thread %u cannot release Mutex [%4.4s] acquired by thread %u",
397 ACPI_CAST_PTR(void, walk_state->thread->thread_id), 397 (u32)walk_state->thread->thread_id,
398 acpi_ut_get_node_name(obj_desc->mutex.node), 398 acpi_ut_get_node_name(obj_desc->mutex.node),
399 ACPI_CAST_PTR(void, owner_thread->thread_id))); 399 (u32)owner_thread->thread_id));
400 return_ACPI_STATUS(AE_AML_NOT_OWNER); 400 return_ACPI_STATUS(AE_AML_NOT_OWNER);
401 } 401 }
402 402
@@ -488,7 +488,7 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
488 /* Mark mutex unowned */ 488 /* Mark mutex unowned */
489 489
490 obj_desc->mutex.owner_thread = NULL; 490 obj_desc->mutex.owner_thread = NULL;
491 obj_desc->mutex.thread_id = NULL; 491 obj_desc->mutex.thread_id = 0;
492 492
493 /* Update Thread sync_level (Last mutex is the important one) */ 493 /* Update Thread sync_level (Last mutex is the important one) */
494 494
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 983510640059..f21c486929a5 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -179,9 +179,8 @@ acpi_debug_print(u32 requested_debug_level,
179 if (thread_id != acpi_gbl_prev_thread_id) { 179 if (thread_id != acpi_gbl_prev_thread_id) {
180 if (ACPI_LV_THREADS & acpi_dbg_level) { 180 if (ACPI_LV_THREADS & acpi_dbg_level) {
181 acpi_os_printf 181 acpi_os_printf
182 ("\n**** Context Switch from TID %p to TID %p ****\n\n", 182 ("\n**** Context Switch from TID %u to TID %u ****\n\n",
183 ACPI_CAST_PTR(void, acpi_gbl_prev_thread_id), 183 (u32)acpi_gbl_prev_thread_id, (u32)thread_id);
184 ACPI_CAST_PTR(void, thread_id));
185 } 184 }
186 185
187 acpi_gbl_prev_thread_id = thread_id; 186 acpi_gbl_prev_thread_id = thread_id;
@@ -194,7 +193,7 @@ acpi_debug_print(u32 requested_debug_level,
194 acpi_os_printf("%8s-%04ld ", module_name, line_number); 193 acpi_os_printf("%8s-%04ld ", module_name, line_number);
195 194
196 if (ACPI_LV_THREADS & acpi_dbg_level) { 195 if (ACPI_LV_THREADS & acpi_dbg_level) {
197 acpi_os_printf("[%p] ", ACPI_CAST_PTR(void, thread_id)); 196 acpi_os_printf("[%u] ", (u32)thread_id);
198 } 197 }
199 198
200 acpi_os_printf("[%02ld] %-22.22s: ", 199 acpi_os_printf("[%02ld] %-22.22s: ",
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c
index b07b425e2113..d9efa495b433 100644
--- a/drivers/acpi/acpica/utmutex.c
+++ b/drivers/acpi/acpica/utmutex.c
@@ -228,18 +228,17 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
228 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 228 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
229 if (i == mutex_id) { 229 if (i == mutex_id) {
230 ACPI_ERROR((AE_INFO, 230 ACPI_ERROR((AE_INFO,
231 "Mutex [%s] already acquired by this thread [%p]", 231 "Mutex [%s] already acquired by this thread [%u]",
232 acpi_ut_get_mutex_name 232 acpi_ut_get_mutex_name
233 (mutex_id), 233 (mutex_id),
234 ACPI_CAST_PTR(void, 234 (u32)this_thread_id));
235 this_thread_id)));
236 235
237 return (AE_ALREADY_ACQUIRED); 236 return (AE_ALREADY_ACQUIRED);
238 } 237 }
239 238
240 ACPI_ERROR((AE_INFO, 239 ACPI_ERROR((AE_INFO,
241 "Invalid acquire order: Thread %p owns [%s], wants [%s]", 240 "Invalid acquire order: Thread %u owns [%s], wants [%s]",
242 ACPI_CAST_PTR(void, this_thread_id), 241 (u32)this_thread_id,
243 acpi_ut_get_mutex_name(i), 242 acpi_ut_get_mutex_name(i),
244 acpi_ut_get_mutex_name(mutex_id))); 243 acpi_ut_get_mutex_name(mutex_id)));
245 244
@@ -250,24 +249,24 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
250#endif 249#endif
251 250
252 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, 251 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
253 "Thread %p attempting to acquire Mutex [%s]\n", 252 "Thread %u attempting to acquire Mutex [%s]\n",
254 ACPI_CAST_PTR(void, this_thread_id), 253 (u32)this_thread_id,
255 acpi_ut_get_mutex_name(mutex_id))); 254 acpi_ut_get_mutex_name(mutex_id)));
256 255
257 status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, 256 status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
258 ACPI_WAIT_FOREVER); 257 ACPI_WAIT_FOREVER);
259 if (ACPI_SUCCESS(status)) { 258 if (ACPI_SUCCESS(status)) {
260 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, 259 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
261 "Thread %p acquired Mutex [%s]\n", 260 "Thread %u acquired Mutex [%s]\n",
262 ACPI_CAST_PTR(void, this_thread_id), 261 (u32)this_thread_id,
263 acpi_ut_get_mutex_name(mutex_id))); 262 acpi_ut_get_mutex_name(mutex_id)));
264 263
265 acpi_gbl_mutex_info[mutex_id].use_count++; 264 acpi_gbl_mutex_info[mutex_id].use_count++;
266 acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id; 265 acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id;
267 } else { 266 } else {
268 ACPI_EXCEPTION((AE_INFO, status, 267 ACPI_EXCEPTION((AE_INFO, status,
269 "Thread %p could not acquire Mutex [0x%X]", 268 "Thread %u could not acquire Mutex [0x%X]",
270 ACPI_CAST_PTR(void, this_thread_id), mutex_id)); 269 (u32)this_thread_id, mutex_id));
271 } 270 }
272 271
273 return (status); 272 return (status);
@@ -287,10 +286,14 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
287 286
288acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) 287acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
289{ 288{
289 acpi_thread_id this_thread_id;
290
290 ACPI_FUNCTION_NAME(ut_release_mutex); 291 ACPI_FUNCTION_NAME(ut_release_mutex);
291 292
292 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n", 293 this_thread_id = acpi_os_get_thread_id();
293 ACPI_CAST_PTR(void, acpi_os_get_thread_id()), 294
295 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n",
296 (u32)this_thread_id,
294 acpi_ut_get_mutex_name(mutex_id))); 297 acpi_ut_get_mutex_name(mutex_id)));
295 298
296 if (mutex_id > ACPI_MAX_MUTEX) { 299 if (mutex_id > ACPI_MAX_MUTEX) {