diff options
author | Bob Moore <robert.moore@intel.com> | 2006-06-23 17:04:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-06-28 03:11:38 -0400 |
commit | 967440e3be1af06ad4dc7bb18d2e3c16130fe067 (patch) | |
tree | c9bbf70475333f4f169838ed88233f8410010677 /drivers/acpi/executer | |
parent | 95b38b3f453c16de0f8cddcde3e71050bbfb37b9 (diff) |
ACPI: ACPICA 20060623
Implemented a new acpi_spinlock type for the OSL lock
interfaces. This allows the type to be customized to
the host OS for improved efficiency (since a spinlock is
usually a very small object.)
Implemented support for "ignored" bits in the ACPI
registers. According to the ACPI specification, these
bits should be preserved when writing the registers via
a read/modify/write cycle. There are 3 bits preserved
in this manner: PM1_CONTROL[0] (SCI_EN), PM1_CONTROL[9],
and PM1_STATUS[11].
http://bugzilla.kernel.org/show_bug.cgi?id=3691
Implemented the initial deployment of new OSL mutex
interfaces. Since some host operating systems have
separate mutex and semaphore objects, this feature was
requested. The base code now uses mutexes (and the new
mutex interfaces) wherever a binary semaphore was used
previously. However, for the current release, the mutex
interfaces are defined as macros to map them to the
existing semaphore interfaces.
Fixed several problems with the support for the control
method SyncLevel parameter. The SyncLevel now works
according to the ACPI specification and in concert with the
Mutex SyncLevel parameter, since the current SyncLevel is
a property of the executing thread. Mutual exclusion for
control methods is now implemented with a mutex instead
of a semaphore.
Fixed three instances of the use of the C shift operator
in the bitfield support code (exfldio.c) to avoid the use
of a shift value larger than the target data width. The
behavior of C compilers is undefined in this case and can
cause unpredictable results, and therefore the case must
be detected and avoided. (Fiodor Suietov)
Added an info message whenever an SSDT or OEM table
is loaded dynamically via the Load() or LoadTable()
ASL operators. This should improve debugging capability
since it will show exactly what tables have been loaded
(beyond the tables present in the RSDT/XSDT.)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r-- | drivers/acpi/executer/exconfig.c | 8 | ||||
-rw-r--r-- | drivers/acpi/executer/excreate.c | 27 | ||||
-rw-r--r-- | drivers/acpi/executer/exdump.c | 8 | ||||
-rw-r--r-- | drivers/acpi/executer/exfldio.c | 71 | ||||
-rw-r--r-- | drivers/acpi/executer/exmutex.c | 12 | ||||
-rw-r--r-- | drivers/acpi/executer/exsystem.c | 82 |
6 files changed, 152 insertions, 56 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c index 823352435e08..83fed079a276 100644 --- a/drivers/acpi/executer/exconfig.c +++ b/drivers/acpi/executer/exconfig.c | |||
@@ -266,6 +266,10 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, | |||
266 | } | 266 | } |
267 | } | 267 | } |
268 | 268 | ||
269 | ACPI_INFO((AE_INFO, | ||
270 | "Dynamic OEM Table Load - [%4.4s] OemId [%6.6s] OemTableId [%8.8s]", | ||
271 | table->signature, table->oem_id, table->oem_table_id)); | ||
272 | |||
269 | *return_desc = ddb_handle; | 273 | *return_desc = ddb_handle; |
270 | return_ACPI_STATUS(status); | 274 | return_ACPI_STATUS(status); |
271 | } | 275 | } |
@@ -446,6 +450,10 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
446 | return_ACPI_STATUS(status); | 450 | return_ACPI_STATUS(status); |
447 | } | 451 | } |
448 | 452 | ||
453 | ACPI_INFO((AE_INFO, | ||
454 | "Dynamic SSDT Load - OemId [%6.6s] OemTableId [%8.8s]", | ||
455 | table_ptr->oem_id, table_ptr->oem_table_id)); | ||
456 | |||
449 | cleanup: | 457 | cleanup: |
450 | if (ACPI_FAILURE(status)) { | 458 | if (ACPI_FAILURE(status)) { |
451 | ACPI_FREE(table_ptr); | 459 | ACPI_FREE(table_ptr); |
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c index 106dc7219df7..34eec82c1b1e 100644 --- a/drivers/acpi/executer/excreate.c +++ b/drivers/acpi/executer/excreate.c | |||
@@ -177,7 +177,7 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state) | |||
177 | * that the event is created in an unsignalled state | 177 | * that the event is created in an unsignalled state |
178 | */ | 178 | */ |
179 | status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, | 179 | status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, |
180 | &obj_desc->event.semaphore); | 180 | &obj_desc->event.os_semaphore); |
181 | if (ACPI_FAILURE(status)) { | 181 | if (ACPI_FAILURE(status)) { |
182 | goto cleanup; | 182 | goto cleanup; |
183 | } | 183 | } |
@@ -226,12 +226,9 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state) | |||
226 | goto cleanup; | 226 | goto cleanup; |
227 | } | 227 | } |
228 | 228 | ||
229 | /* | 229 | /* Create the actual OS Mutex */ |
230 | * Create the actual OS semaphore. | 230 | |
231 | * One unit max to make it a mutex, with one initial unit to allow | 231 | status = acpi_os_create_mutex(&obj_desc->mutex.os_mutex); |
232 | * the mutex to be acquired. | ||
233 | */ | ||
234 | status = acpi_os_create_semaphore(1, 1, &obj_desc->mutex.semaphore); | ||
235 | if (ACPI_FAILURE(status)) { | 232 | if (ACPI_FAILURE(status)) { |
236 | goto cleanup; | 233 | goto cleanup; |
237 | } | 234 | } |
@@ -565,7 +562,7 @@ acpi_ex_create_method(u8 * aml_start, | |||
565 | obj_desc->method.aml_length = aml_length; | 562 | obj_desc->method.aml_length = aml_length; |
566 | 563 | ||
567 | /* | 564 | /* |
568 | * Disassemble the method flags. Split off the Arg Count | 565 | * Disassemble the method flags. Split off the Arg Count |
569 | * for efficiency | 566 | * for efficiency |
570 | */ | 567 | */ |
571 | method_flags = (u8) operand[1]->integer.value; | 568 | method_flags = (u8) operand[1]->integer.value; |
@@ -576,21 +573,19 @@ acpi_ex_create_method(u8 * aml_start, | |||
576 | (u8) (method_flags & AML_METHOD_ARG_COUNT); | 573 | (u8) (method_flags & AML_METHOD_ARG_COUNT); |
577 | 574 | ||
578 | /* | 575 | /* |
579 | * Get the concurrency count. If required, a semaphore will be | 576 | * Get the sync_level. If method is serialized, a mutex will be |
580 | * created for this method when it is parsed. | 577 | * created for this method when it is parsed. |
581 | */ | 578 | */ |
582 | if (acpi_gbl_all_methods_serialized) { | 579 | if (acpi_gbl_all_methods_serialized) { |
583 | obj_desc->method.concurrency = 1; | 580 | obj_desc->method.sync_level = 0; |
584 | obj_desc->method.method_flags |= AML_METHOD_SERIALIZED; | 581 | obj_desc->method.method_flags |= AML_METHOD_SERIALIZED; |
585 | } else if (method_flags & AML_METHOD_SERIALIZED) { | 582 | } else if (method_flags & AML_METHOD_SERIALIZED) { |
586 | /* | 583 | /* |
587 | * ACPI 1.0: Concurrency = 1 | 584 | * ACPI 1.0: sync_level = 0 |
588 | * ACPI 2.0: Concurrency = (sync_level (in method declaration) + 1) | 585 | * ACPI 2.0: sync_level = sync_level in method declaration |
589 | */ | 586 | */ |
590 | obj_desc->method.concurrency = (u8) | 587 | obj_desc->method.sync_level = (u8) |
591 | (((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4) + 1); | 588 | ((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4); |
592 | } else { | ||
593 | obj_desc->method.concurrency = ACPI_INFINITE_CONCURRENCY; | ||
594 | } | 589 | } |
595 | 590 | ||
596 | /* Attach the new object to the method Node */ | 591 | /* Attach the new object to the method Node */ |
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c index 7b9718e976bf..2450943add33 100644 --- a/drivers/acpi/executer/exdump.c +++ b/drivers/acpi/executer/exdump.c | |||
@@ -118,14 +118,14 @@ static struct acpi_exdump_info acpi_ex_dump_device[4] = { | |||
118 | 118 | ||
119 | static struct acpi_exdump_info acpi_ex_dump_event[2] = { | 119 | static struct acpi_exdump_info acpi_ex_dump_event[2] = { |
120 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL}, | 120 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL}, |
121 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.semaphore), "Semaphore"} | 121 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.os_semaphore), "OsSemaphore"} |
122 | }; | 122 | }; |
123 | 123 | ||
124 | static struct acpi_exdump_info acpi_ex_dump_method[8] = { | 124 | static struct acpi_exdump_info acpi_ex_dump_method[8] = { |
125 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL}, | 125 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL}, |
126 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "ParamCount"}, | 126 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "ParamCount"}, |
127 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.concurrency), "Concurrency"}, | 127 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"}, |
128 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.semaphore), "Semaphore"}, | 128 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"}, |
129 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"}, | 129 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"}, |
130 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"}, | 130 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"}, |
131 | {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"}, | 131 | {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"}, |
@@ -138,7 +138,7 @@ static struct acpi_exdump_info acpi_ex_dump_mutex[5] = { | |||
138 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"}, | 138 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"}, |
139 | {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth), | 139 | {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth), |
140 | "Acquire Depth"}, | 140 | "Acquire Depth"}, |
141 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.semaphore), "Semaphore"} | 141 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"} |
142 | }; | 142 | }; |
143 | 143 | ||
144 | static struct acpi_exdump_info acpi_ex_dump_region[7] = { | 144 | static struct acpi_exdump_info acpi_ex_dump_region[7] = { |
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c index 051053f7cccb..40f0bee6faa5 100644 --- a/drivers/acpi/executer/exfldio.c +++ b/drivers/acpi/executer/exfldio.c | |||
@@ -727,11 +727,23 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, | |||
727 | return_ACPI_STATUS(status); | 727 | return_ACPI_STATUS(status); |
728 | } | 728 | } |
729 | 729 | ||
730 | /* Merge with previous datum if necessary */ | 730 | /* |
731 | 731 | * Merge with previous datum if necessary. | |
732 | merged_datum |= raw_datum << | 732 | * |
733 | (obj_desc->common_field.access_bit_width - | 733 | * Note: Before the shift, check if the shift value will be larger than |
734 | obj_desc->common_field.start_field_bit_offset); | 734 | * the integer size. If so, there is no need to perform the operation. |
735 | * This avoids the differences in behavior between different compilers | ||
736 | * concerning shift values larger than the target data width. | ||
737 | */ | ||
738 | if ((obj_desc->common_field.access_bit_width - | ||
739 | obj_desc->common_field.start_field_bit_offset) < | ||
740 | ACPI_INTEGER_BIT_SIZE) { | ||
741 | merged_datum |= | ||
742 | raw_datum << (obj_desc->common_field. | ||
743 | access_bit_width - | ||
744 | obj_desc->common_field. | ||
745 | start_field_bit_offset); | ||
746 | } | ||
735 | 747 | ||
736 | if (i == datum_count) { | 748 | if (i == datum_count) { |
737 | break; | 749 | break; |
@@ -808,13 +820,23 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, | |||
808 | return_ACPI_STATUS(AE_BUFFER_OVERFLOW); | 820 | return_ACPI_STATUS(AE_BUFFER_OVERFLOW); |
809 | } | 821 | } |
810 | 822 | ||
811 | /* Compute the number of datums (access width data items) */ | 823 | /* |
824 | * Create the bitmasks used for bit insertion. | ||
825 | * Note: This if/else is used to bypass compiler differences with the | ||
826 | * shift operator | ||
827 | */ | ||
828 | if (obj_desc->common_field.access_bit_width == ACPI_INTEGER_BIT_SIZE) { | ||
829 | width_mask = ACPI_INTEGER_MAX; | ||
830 | } else { | ||
831 | width_mask = | ||
832 | ACPI_MASK_BITS_ABOVE(obj_desc->common_field. | ||
833 | access_bit_width); | ||
834 | } | ||
812 | 835 | ||
813 | width_mask = | 836 | mask = width_mask & |
814 | ACPI_MASK_BITS_ABOVE(obj_desc->common_field.access_bit_width); | 837 | ACPI_MASK_BITS_BELOW(obj_desc->common_field.start_field_bit_offset); |
815 | mask = | 838 | |
816 | width_mask & ACPI_MASK_BITS_BELOW(obj_desc->common_field. | 839 | /* Compute the number of datums (access width data items) */ |
817 | start_field_bit_offset); | ||
818 | 840 | ||
819 | datum_count = ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length, | 841 | datum_count = ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length, |
820 | obj_desc->common_field.access_bit_width); | 842 | obj_desc->common_field.access_bit_width); |
@@ -848,12 +870,29 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, | |||
848 | return_ACPI_STATUS(status); | 870 | return_ACPI_STATUS(status); |
849 | } | 871 | } |
850 | 872 | ||
851 | /* Start new output datum by merging with previous input datum */ | ||
852 | |||
853 | field_offset += obj_desc->common_field.access_byte_width; | 873 | field_offset += obj_desc->common_field.access_byte_width; |
854 | merged_datum = raw_datum >> | 874 | |
855 | (obj_desc->common_field.access_bit_width - | 875 | /* |
856 | obj_desc->common_field.start_field_bit_offset); | 876 | * Start new output datum by merging with previous input datum |
877 | * if necessary. | ||
878 | * | ||
879 | * Note: Before the shift, check if the shift value will be larger than | ||
880 | * the integer size. If so, there is no need to perform the operation. | ||
881 | * This avoids the differences in behavior between different compilers | ||
882 | * concerning shift values larger than the target data width. | ||
883 | */ | ||
884 | if ((obj_desc->common_field.access_bit_width - | ||
885 | obj_desc->common_field.start_field_bit_offset) < | ||
886 | ACPI_INTEGER_BIT_SIZE) { | ||
887 | merged_datum = | ||
888 | raw_datum >> (obj_desc->common_field. | ||
889 | access_bit_width - | ||
890 | obj_desc->common_field. | ||
891 | start_field_bit_offset); | ||
892 | } else { | ||
893 | merged_datum = 0; | ||
894 | } | ||
895 | |||
857 | mask = width_mask; | 896 | mask = width_mask; |
858 | 897 | ||
859 | if (i == datum_count) { | 898 | if (i == datum_count) { |
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c index 93098d68cadf..d8ac2877cf05 100644 --- a/drivers/acpi/executer/exmutex.c +++ b/drivers/acpi/executer/exmutex.c | |||
@@ -161,12 +161,13 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, | |||
161 | 161 | ||
162 | /* | 162 | /* |
163 | * Current Sync must be less than or equal to the sync level of the | 163 | * Current Sync must be less than or equal to the sync level of the |
164 | * mutex. This mechanism provides some deadlock prevention | 164 | * mutex. This mechanism provides some deadlock prevention |
165 | */ | 165 | */ |
166 | if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { | 166 | if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { |
167 | ACPI_ERROR((AE_INFO, | 167 | ACPI_ERROR((AE_INFO, |
168 | "Cannot acquire Mutex [%4.4s], incorrect SyncLevel", | 168 | "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%d)", |
169 | acpi_ut_get_node_name(obj_desc->mutex.node))); | 169 | acpi_ut_get_node_name(obj_desc->mutex.node), |
170 | walk_state->thread->current_sync_level)); | ||
170 | return_ACPI_STATUS(AE_AML_MUTEX_ORDER); | 171 | return_ACPI_STATUS(AE_AML_MUTEX_ORDER); |
171 | } | 172 | } |
172 | 173 | ||
@@ -178,8 +179,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, | |||
178 | 179 | ||
179 | if ((obj_desc->mutex.owner_thread->thread_id == | 180 | if ((obj_desc->mutex.owner_thread->thread_id == |
180 | walk_state->thread->thread_id) || | 181 | walk_state->thread->thread_id) || |
181 | (obj_desc->mutex.semaphore == | 182 | (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK)) { |
182 | acpi_gbl_global_lock_semaphore)) { | ||
183 | /* | 183 | /* |
184 | * The mutex is already owned by this thread, | 184 | * The mutex is already owned by this thread, |
185 | * just increment the acquisition depth | 185 | * just increment the acquisition depth |
@@ -264,7 +264,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
264 | */ | 264 | */ |
265 | if ((obj_desc->mutex.owner_thread->thread_id != | 265 | if ((obj_desc->mutex.owner_thread->thread_id != |
266 | walk_state->thread->thread_id) | 266 | walk_state->thread->thread_id) |
267 | && (obj_desc->mutex.semaphore != acpi_gbl_global_lock_semaphore)) { | 267 | && (obj_desc->mutex.os_mutex != ACPI_GLOBAL_LOCK)) { |
268 | ACPI_ERROR((AE_INFO, | 268 | ACPI_ERROR((AE_INFO, |
269 | "Thread %X cannot release Mutex [%4.4s] acquired by thread %X", | 269 | "Thread %X cannot release Mutex [%4.4s] acquired by thread %X", |
270 | walk_state->thread->thread_id, | 270 | walk_state->thread->thread_id, |
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c index 52beee3674a0..6b5d1e6ce94b 100644 --- a/drivers/acpi/executer/exsystem.c +++ b/drivers/acpi/executer/exsystem.c | |||
@@ -63,14 +63,14 @@ ACPI_MODULE_NAME("exsystem") | |||
63 | * interpreter is released. | 63 | * interpreter is released. |
64 | * | 64 | * |
65 | ******************************************************************************/ | 65 | ******************************************************************************/ |
66 | acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout) | 66 | acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) |
67 | { | 67 | { |
68 | acpi_status status; | 68 | acpi_status status; |
69 | acpi_status status2; | 69 | acpi_status status2; |
70 | 70 | ||
71 | ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); | 71 | ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); |
72 | 72 | ||
73 | status = acpi_os_wait_semaphore(semaphore, 1, 0); | 73 | status = acpi_os_wait_semaphore(semaphore, 1, ACPI_DO_NOT_WAIT); |
74 | if (ACPI_SUCCESS(status)) { | 74 | if (ACPI_SUCCESS(status)) { |
75 | return_ACPI_STATUS(status); | 75 | return_ACPI_STATUS(status); |
76 | } | 76 | } |
@@ -103,6 +103,59 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout) | |||
103 | 103 | ||
104 | /******************************************************************************* | 104 | /******************************************************************************* |
105 | * | 105 | * |
106 | * FUNCTION: acpi_ex_system_wait_mutex | ||
107 | * | ||
108 | * PARAMETERS: Mutex - Mutex to wait on | ||
109 | * Timeout - Max time to wait | ||
110 | * | ||
111 | * RETURN: Status | ||
112 | * | ||
113 | * DESCRIPTION: Implements a semaphore wait with a check to see if the | ||
114 | * semaphore is available immediately. If it is not, the | ||
115 | * interpreter is released. | ||
116 | * | ||
117 | ******************************************************************************/ | ||
118 | |||
119 | acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) | ||
120 | { | ||
121 | acpi_status status; | ||
122 | acpi_status status2; | ||
123 | |||
124 | ACPI_FUNCTION_TRACE(ex_system_wait_mutex); | ||
125 | |||
126 | status = acpi_os_acquire_mutex(mutex, ACPI_DO_NOT_WAIT); | ||
127 | if (ACPI_SUCCESS(status)) { | ||
128 | return_ACPI_STATUS(status); | ||
129 | } | ||
130 | |||
131 | if (status == AE_TIME) { | ||
132 | |||
133 | /* We must wait, so unlock the interpreter */ | ||
134 | |||
135 | acpi_ex_exit_interpreter(); | ||
136 | |||
137 | status = acpi_os_acquire_mutex(mutex, timeout); | ||
138 | |||
139 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | ||
140 | "*** Thread awake after blocking, %s\n", | ||
141 | acpi_format_exception(status))); | ||
142 | |||
143 | /* Reacquire the interpreter */ | ||
144 | |||
145 | status2 = acpi_ex_enter_interpreter(); | ||
146 | if (ACPI_FAILURE(status2)) { | ||
147 | |||
148 | /* Report fatal error, could not acquire interpreter */ | ||
149 | |||
150 | return_ACPI_STATUS(status2); | ||
151 | } | ||
152 | } | ||
153 | |||
154 | return_ACPI_STATUS(status); | ||
155 | } | ||
156 | |||
157 | /******************************************************************************* | ||
158 | * | ||
106 | * FUNCTION: acpi_ex_system_do_stall | 159 | * FUNCTION: acpi_ex_system_do_stall |
107 | * | 160 | * |
108 | * PARAMETERS: how_long - The amount of time to stall, | 161 | * PARAMETERS: how_long - The amount of time to stall, |
@@ -176,7 +229,7 @@ acpi_status acpi_ex_system_do_suspend(acpi_integer how_long) | |||
176 | * | 229 | * |
177 | * FUNCTION: acpi_ex_system_acquire_mutex | 230 | * FUNCTION: acpi_ex_system_acquire_mutex |
178 | * | 231 | * |
179 | * PARAMETERS: time_desc - The 'time to delay' object descriptor | 232 | * PARAMETERS: time_desc - Maximum time to wait for the mutex |
180 | * obj_desc - The object descriptor for this op | 233 | * obj_desc - The object descriptor for this op |
181 | * | 234 | * |
182 | * RETURN: Status | 235 | * RETURN: Status |
@@ -201,14 +254,14 @@ acpi_ex_system_acquire_mutex(union acpi_operand_object * time_desc, | |||
201 | 254 | ||
202 | /* Support for the _GL_ Mutex object -- go get the global lock */ | 255 | /* Support for the _GL_ Mutex object -- go get the global lock */ |
203 | 256 | ||
204 | if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) { | 257 | if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) { |
205 | status = | 258 | status = |
206 | acpi_ev_acquire_global_lock((u16) time_desc->integer.value); | 259 | acpi_ev_acquire_global_lock((u16) time_desc->integer.value); |
207 | return_ACPI_STATUS(status); | 260 | return_ACPI_STATUS(status); |
208 | } | 261 | } |
209 | 262 | ||
210 | status = acpi_ex_system_wait_semaphore(obj_desc->mutex.semaphore, | 263 | status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex, |
211 | (u16) time_desc->integer.value); | 264 | (u16) time_desc->integer.value); |
212 | return_ACPI_STATUS(status); | 265 | return_ACPI_STATUS(status); |
213 | } | 266 | } |
214 | 267 | ||
@@ -239,13 +292,13 @@ acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc) | |||
239 | 292 | ||
240 | /* Support for the _GL_ Mutex object -- release the global lock */ | 293 | /* Support for the _GL_ Mutex object -- release the global lock */ |
241 | 294 | ||
242 | if (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore) { | 295 | if (obj_desc->mutex.os_mutex == ACPI_GLOBAL_LOCK) { |
243 | status = acpi_ev_release_global_lock(); | 296 | status = acpi_ev_release_global_lock(); |
244 | return_ACPI_STATUS(status); | 297 | return_ACPI_STATUS(status); |
245 | } | 298 | } |
246 | 299 | ||
247 | status = acpi_os_signal_semaphore(obj_desc->mutex.semaphore, 1); | 300 | acpi_os_release_mutex(obj_desc->mutex.os_mutex); |
248 | return_ACPI_STATUS(status); | 301 | return_ACPI_STATUS(AE_OK); |
249 | } | 302 | } |
250 | 303 | ||
251 | /******************************************************************************* | 304 | /******************************************************************************* |
@@ -268,7 +321,8 @@ acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc) | |||
268 | ACPI_FUNCTION_TRACE(ex_system_signal_event); | 321 | ACPI_FUNCTION_TRACE(ex_system_signal_event); |
269 | 322 | ||
270 | if (obj_desc) { | 323 | if (obj_desc) { |
271 | status = acpi_os_signal_semaphore(obj_desc->event.semaphore, 1); | 324 | status = |
325 | acpi_os_signal_semaphore(obj_desc->event.os_semaphore, 1); | ||
272 | } | 326 | } |
273 | 327 | ||
274 | return_ACPI_STATUS(status); | 328 | return_ACPI_STATUS(status); |
@@ -299,7 +353,7 @@ acpi_ex_system_wait_event(union acpi_operand_object *time_desc, | |||
299 | 353 | ||
300 | if (obj_desc) { | 354 | if (obj_desc) { |
301 | status = | 355 | status = |
302 | acpi_ex_system_wait_semaphore(obj_desc->event.semaphore, | 356 | acpi_ex_system_wait_semaphore(obj_desc->event.os_semaphore, |
303 | (u16) time_desc->integer. | 357 | (u16) time_desc->integer. |
304 | value); | 358 | value); |
305 | } | 359 | } |
@@ -322,7 +376,7 @@ acpi_ex_system_wait_event(union acpi_operand_object *time_desc, | |||
322 | acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc) | 376 | acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc) |
323 | { | 377 | { |
324 | acpi_status status = AE_OK; | 378 | acpi_status status = AE_OK; |
325 | void *temp_semaphore; | 379 | acpi_semaphore temp_semaphore; |
326 | 380 | ||
327 | ACPI_FUNCTION_ENTRY(); | 381 | ACPI_FUNCTION_ENTRY(); |
328 | 382 | ||
@@ -333,8 +387,8 @@ acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc) | |||
333 | status = | 387 | status = |
334 | acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, &temp_semaphore); | 388 | acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0, &temp_semaphore); |
335 | if (ACPI_SUCCESS(status)) { | 389 | if (ACPI_SUCCESS(status)) { |
336 | (void)acpi_os_delete_semaphore(obj_desc->event.semaphore); | 390 | (void)acpi_os_delete_semaphore(obj_desc->event.os_semaphore); |
337 | obj_desc->event.semaphore = temp_semaphore; | 391 | obj_desc->event.os_semaphore = temp_semaphore; |
338 | } | 392 | } |
339 | 393 | ||
340 | return (status); | 394 | return (status); |