diff options
Diffstat (limited to 'drivers/acpi/utilities')
| -rw-r--r-- | drivers/acpi/utilities/utalloc.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/utilities/utdebug.c | 4 | ||||
| -rw-r--r-- | drivers/acpi/utilities/utdelete.c | 13 | ||||
| -rw-r--r-- | drivers/acpi/utilities/utmisc.c | 25 | ||||
| -rw-r--r-- | drivers/acpi/utilities/utmutex.c | 8 | ||||
| -rw-r--r-- | drivers/acpi/utilities/utstate.c | 7 |
6 files changed, 43 insertions, 16 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c index 5cff17dc78b3..f6cbc0b1bfd0 100644 --- a/drivers/acpi/utilities/utalloc.c +++ b/drivers/acpi/utilities/utalloc.c | |||
| @@ -285,6 +285,7 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer, | |||
| 285 | return (status); | 285 | return (status); |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | #ifdef NOT_USED_BY_LINUX | ||
| 288 | /******************************************************************************* | 289 | /******************************************************************************* |
| 289 | * | 290 | * |
| 290 | * FUNCTION: acpi_ut_allocate | 291 | * FUNCTION: acpi_ut_allocate |
| @@ -360,3 +361,4 @@ void *acpi_ut_allocate_zeroed(acpi_size size, | |||
| 360 | 361 | ||
| 361 | return (allocation); | 362 | return (allocation); |
| 362 | } | 363 | } |
| 364 | #endif | ||
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c index 5ec1cfcc611d..bb1eaf9aa653 100644 --- a/drivers/acpi/utilities/utdebug.c +++ b/drivers/acpi/utilities/utdebug.c | |||
| @@ -47,7 +47,7 @@ | |||
| 47 | ACPI_MODULE_NAME("utdebug") | 47 | ACPI_MODULE_NAME("utdebug") |
| 48 | 48 | ||
| 49 | #ifdef ACPI_DEBUG_OUTPUT | 49 | #ifdef ACPI_DEBUG_OUTPUT |
| 50 | static u32 acpi_gbl_prev_thread_id = 0xFFFFFFFF; | 50 | static acpi_thread_id acpi_gbl_prev_thread_id; |
| 51 | static char *acpi_gbl_fn_entry_str = "----Entry"; | 51 | static char *acpi_gbl_fn_entry_str = "----Entry"; |
| 52 | static char *acpi_gbl_fn_exit_str = "----Exit-"; | 52 | static char *acpi_gbl_fn_exit_str = "----Exit-"; |
| 53 | 53 | ||
| @@ -181,7 +181,7 @@ acpi_ut_debug_print(u32 requested_debug_level, | |||
| 181 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 181 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
| 182 | acpi_os_printf | 182 | acpi_os_printf |
| 183 | ("\n**** Context Switch from TID %X to TID %X ****\n\n", | 183 | ("\n**** Context Switch from TID %X to TID %X ****\n\n", |
| 184 | acpi_gbl_prev_thread_id, thread_id); | 184 | (u32) acpi_gbl_prev_thread_id, (u32) thread_id); |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | acpi_gbl_prev_thread_id = thread_id; | 187 | acpi_gbl_prev_thread_id = thread_id; |
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c index 38ebe1c54330..9d3f1149ba21 100644 --- a/drivers/acpi/utilities/utdelete.c +++ b/drivers/acpi/utilities/utdelete.c | |||
| @@ -447,11 +447,16 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
| 447 | */ | 447 | */ |
| 448 | switch (ACPI_GET_OBJECT_TYPE(object)) { | 448 | switch (ACPI_GET_OBJECT_TYPE(object)) { |
| 449 | case ACPI_TYPE_DEVICE: | 449 | case ACPI_TYPE_DEVICE: |
| 450 | case ACPI_TYPE_PROCESSOR: | ||
| 451 | case ACPI_TYPE_POWER: | ||
| 452 | case ACPI_TYPE_THERMAL: | ||
| 450 | 453 | ||
| 451 | acpi_ut_update_ref_count(object->device.system_notify, | 454 | /* Update the notify objects for these types (if present) */ |
| 452 | action); | 455 | |
| 453 | acpi_ut_update_ref_count(object->device.device_notify, | 456 | acpi_ut_update_ref_count(object->common_notify. |
| 454 | action); | 457 | system_notify, action); |
| 458 | acpi_ut_update_ref_count(object->common_notify. | ||
| 459 | device_notify, action); | ||
| 455 | break; | 460 | break; |
| 456 | 461 | ||
| 457 | case ACPI_TYPE_PACKAGE: | 462 | case ACPI_TYPE_PACKAGE: |
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index 33268310c738..6d8a8211be90 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c | |||
| @@ -65,7 +65,7 @@ ACPI_MODULE_NAME("utmisc") | |||
| 65 | u8 acpi_ut_is_aml_table(struct acpi_table_header *table) | 65 | u8 acpi_ut_is_aml_table(struct acpi_table_header *table) |
| 66 | { | 66 | { |
| 67 | 67 | ||
| 68 | /* Ignore tables that contain AML */ | 68 | /* These are the only tables that contain executable AML */ |
| 69 | 69 | ||
| 70 | if (ACPI_COMPARE_NAME(table->signature, DSDT_SIG) || | 70 | if (ACPI_COMPARE_NAME(table->signature, DSDT_SIG) || |
| 71 | ACPI_COMPARE_NAME(table->signature, PSDT_SIG) || | 71 | ACPI_COMPARE_NAME(table->signature, PSDT_SIG) || |
| @@ -419,10 +419,15 @@ void acpi_ut_set_integer_width(u8 revision) | |||
| 419 | { | 419 | { |
| 420 | 420 | ||
| 421 | if (revision <= 1) { | 421 | if (revision <= 1) { |
| 422 | |||
| 423 | /* 32-bit case */ | ||
| 424 | |||
| 422 | acpi_gbl_integer_bit_width = 32; | 425 | acpi_gbl_integer_bit_width = 32; |
| 423 | acpi_gbl_integer_nybble_width = 8; | 426 | acpi_gbl_integer_nybble_width = 8; |
| 424 | acpi_gbl_integer_byte_width = 4; | 427 | acpi_gbl_integer_byte_width = 4; |
| 425 | } else { | 428 | } else { |
| 429 | /* 64-bit case (ACPI 2.0+) */ | ||
| 430 | |||
| 426 | acpi_gbl_integer_bit_width = 64; | 431 | acpi_gbl_integer_bit_width = 64; |
| 427 | acpi_gbl_integer_nybble_width = 16; | 432 | acpi_gbl_integer_nybble_width = 16; |
| 428 | acpi_gbl_integer_byte_width = 8; | 433 | acpi_gbl_integer_byte_width = 8; |
| @@ -502,6 +507,7 @@ acpi_ut_display_init_pathname(u8 type, | |||
| 502 | * FUNCTION: acpi_ut_valid_acpi_char | 507 | * FUNCTION: acpi_ut_valid_acpi_char |
| 503 | * | 508 | * |
| 504 | * PARAMETERS: Char - The character to be examined | 509 | * PARAMETERS: Char - The character to be examined |
| 510 | * Position - Byte position (0-3) | ||
| 505 | * | 511 | * |
| 506 | * RETURN: TRUE if the character is valid, FALSE otherwise | 512 | * RETURN: TRUE if the character is valid, FALSE otherwise |
| 507 | * | 513 | * |
| @@ -609,7 +615,9 @@ acpi_name acpi_ut_repair_name(acpi_name name) | |||
| 609 | * | 615 | * |
| 610 | * RETURN: Status and Converted value | 616 | * RETURN: Status and Converted value |
| 611 | * | 617 | * |
| 612 | * DESCRIPTION: Convert a string into an unsigned value. | 618 | * DESCRIPTION: Convert a string into an unsigned value. Performs either a |
| 619 | * 32-bit or 64-bit conversion, depending on the current mode | ||
| 620 | * of the interpreter. | ||
| 613 | * NOTE: Does not support Octal strings, not needed. | 621 | * NOTE: Does not support Octal strings, not needed. |
| 614 | * | 622 | * |
| 615 | ******************************************************************************/ | 623 | ******************************************************************************/ |
| @@ -627,7 +635,7 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) | |||
| 627 | u8 sign_of0x = 0; | 635 | u8 sign_of0x = 0; |
| 628 | u8 term = 0; | 636 | u8 term = 0; |
| 629 | 637 | ||
| 630 | ACPI_FUNCTION_TRACE(ut_stroul64); | 638 | ACPI_FUNCTION_TRACE_STR(ut_stroul64, string); |
| 631 | 639 | ||
| 632 | switch (base) { | 640 | switch (base) { |
| 633 | case ACPI_ANY_BASE: | 641 | case ACPI_ANY_BASE: |
| @@ -675,11 +683,13 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) | |||
| 675 | } | 683 | } |
| 676 | } | 684 | } |
| 677 | 685 | ||
| 686 | /* | ||
| 687 | * Perform a 32-bit or 64-bit conversion, depending upon the current | ||
| 688 | * execution mode of the interpreter | ||
| 689 | */ | ||
| 678 | dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; | 690 | dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; |
| 679 | 691 | ||
| 680 | /* At least one character in the string here */ | 692 | /* Main loop: convert the string to a 32- or 64-bit integer */ |
| 681 | |||
| 682 | /* Main loop: convert the string to a 64-bit integer */ | ||
| 683 | 693 | ||
| 684 | while (*string) { | 694 | while (*string) { |
| 685 | if (ACPI_IS_DIGIT(*string)) { | 695 | if (ACPI_IS_DIGIT(*string)) { |
| @@ -754,6 +764,9 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) | |||
| 754 | 764 | ||
| 755 | all_done: | 765 | all_done: |
| 756 | 766 | ||
| 767 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n", | ||
| 768 | ACPI_FORMAT_UINT64(return_value))); | ||
| 769 | |||
| 757 | *ret_integer = return_value; | 770 | *ret_integer = return_value; |
| 758 | return_ACPI_STATUS(AE_OK); | 771 | return_ACPI_STATUS(AE_OK); |
| 759 | 772 | ||
diff --git a/drivers/acpi/utilities/utmutex.c b/drivers/acpi/utilities/utmutex.c index dfc8f30ca892..c39062a047cd 100644 --- a/drivers/acpi/utilities/utmutex.c +++ b/drivers/acpi/utilities/utmutex.c | |||
| @@ -244,14 +244,14 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) | |||
| 244 | 244 | ||
| 245 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, | 245 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, |
| 246 | "Thread %X attempting to acquire Mutex [%s]\n", | 246 | "Thread %X attempting to acquire Mutex [%s]\n", |
| 247 | this_thread_id, acpi_ut_get_mutex_name(mutex_id))); | 247 | (u32) this_thread_id, acpi_ut_get_mutex_name(mutex_id))); |
| 248 | 248 | ||
| 249 | status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, | 249 | status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, |
| 250 | ACPI_WAIT_FOREVER); | 250 | ACPI_WAIT_FOREVER); |
| 251 | if (ACPI_SUCCESS(status)) { | 251 | if (ACPI_SUCCESS(status)) { |
| 252 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, | 252 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, |
| 253 | "Thread %X acquired Mutex [%s]\n", | 253 | "Thread %X acquired Mutex [%s]\n", |
| 254 | this_thread_id, | 254 | (u32) this_thread_id, |
| 255 | acpi_ut_get_mutex_name(mutex_id))); | 255 | acpi_ut_get_mutex_name(mutex_id))); |
| 256 | 256 | ||
| 257 | acpi_gbl_mutex_info[mutex_id].use_count++; | 257 | acpi_gbl_mutex_info[mutex_id].use_count++; |
| @@ -259,7 +259,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) | |||
| 259 | } else { | 259 | } else { |
| 260 | ACPI_EXCEPTION((AE_INFO, status, | 260 | ACPI_EXCEPTION((AE_INFO, status, |
| 261 | "Thread %X could not acquire Mutex [%X]", | 261 | "Thread %X could not acquire Mutex [%X]", |
| 262 | this_thread_id, mutex_id)); | 262 | (u32) this_thread_id, mutex_id)); |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | return (status); | 265 | return (status); |
| @@ -285,7 +285,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) | |||
| 285 | 285 | ||
| 286 | this_thread_id = acpi_os_get_thread_id(); | 286 | this_thread_id = acpi_os_get_thread_id(); |
| 287 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, | 287 | ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, |
| 288 | "Thread %X releasing Mutex [%s]\n", this_thread_id, | 288 | "Thread %X releasing Mutex [%s]\n", (u32) this_thread_id, |
| 289 | acpi_ut_get_mutex_name(mutex_id))); | 289 | acpi_ut_get_mutex_name(mutex_id))); |
| 290 | 290 | ||
| 291 | if (mutex_id > ACPI_MAX_MUTEX) { | 291 | if (mutex_id > ACPI_MAX_MUTEX) { |
diff --git a/drivers/acpi/utilities/utstate.c b/drivers/acpi/utilities/utstate.c index 0f5c5bb5deff..eaa13d05c859 100644 --- a/drivers/acpi/utilities/utstate.c +++ b/drivers/acpi/utilities/utstate.c | |||
| @@ -199,6 +199,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) | |||
| 199 | state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD; | 199 | state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD; |
| 200 | state->thread.thread_id = acpi_os_get_thread_id(); | 200 | state->thread.thread_id = acpi_os_get_thread_id(); |
| 201 | 201 | ||
| 202 | /* Check for invalid thread ID - zero is very bad, it will break things */ | ||
| 203 | |||
| 204 | if (!state->thread.thread_id) { | ||
| 205 | ACPI_ERROR((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId")); | ||
| 206 | state->thread.thread_id = (acpi_thread_id) 1; | ||
| 207 | } | ||
| 208 | |||
| 202 | return_PTR((struct acpi_thread_state *)state); | 209 | return_PTR((struct acpi_thread_state *)state); |
| 203 | } | 210 | } |
| 204 | 211 | ||
