aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exmutex.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-04-18 22:49:35 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:08:52 -0400
commit44f6c01242da4e162f28d8e1216a8c7a91174605 (patch)
tree53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/executer/exmutex.c
parentebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff)
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer/exmutex.c')
-rw-r--r--drivers/acpi/executer/exmutex.c45
1 files changed, 29 insertions, 16 deletions
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 68c4bb1970a..c3cb714d2cb 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -49,6 +49,13 @@
49#define _COMPONENT ACPI_EXECUTER 49#define _COMPONENT ACPI_EXECUTER
50 ACPI_MODULE_NAME ("exmutex") 50 ACPI_MODULE_NAME ("exmutex")
51 51
52/* Local prototypes */
53
54static void
55acpi_ex_link_mutex (
56 union acpi_operand_object *obj_desc,
57 struct acpi_thread_state *thread);
58
52 59
53/******************************************************************************* 60/*******************************************************************************
54 * 61 *
@@ -56,7 +63,7 @@
56 * 63 *
57 * PARAMETERS: obj_desc - The mutex to be unlinked 64 * PARAMETERS: obj_desc - The mutex to be unlinked
58 * 65 *
59 * RETURN: Status 66 * RETURN: None
60 * 67 *
61 * DESCRIPTION: Remove a mutex from the "acquired_mutex" list 68 * DESCRIPTION: Remove a mutex from the "acquired_mutex" list
62 * 69 *
@@ -92,16 +99,16 @@ acpi_ex_unlink_mutex (
92 * 99 *
93 * FUNCTION: acpi_ex_link_mutex 100 * FUNCTION: acpi_ex_link_mutex
94 * 101 *
95 * PARAMETERS: obj_desc - The mutex to be linked 102 * PARAMETERS: obj_desc - The mutex to be linked
96 * list_head - head of the "acquired_mutex" list 103 * Thread - Current executing thread object
97 * 104 *
98 * RETURN: Status 105 * RETURN: None
99 * 106 *
100 * DESCRIPTION: Add a mutex to the "acquired_mutex" list for this walk 107 * DESCRIPTION: Add a mutex to the "acquired_mutex" list for this walk
101 * 108 *
102 ******************************************************************************/ 109 ******************************************************************************/
103 110
104void 111static void
105acpi_ex_link_mutex ( 112acpi_ex_link_mutex (
106 union acpi_operand_object *obj_desc, 113 union acpi_operand_object *obj_desc,
107 struct acpi_thread_state *thread) 114 struct acpi_thread_state *thread)
@@ -132,8 +139,9 @@ acpi_ex_link_mutex (
132 * 139 *
133 * FUNCTION: acpi_ex_acquire_mutex 140 * FUNCTION: acpi_ex_acquire_mutex
134 * 141 *
135 * PARAMETERS: time_desc - The 'time to delay' object descriptor 142 * PARAMETERS: time_desc - Timeout integer
136 * obj_desc - The object descriptor for this op 143 * obj_desc - Mutex object
144 * walk_state - Current method execution state
137 * 145 *
138 * RETURN: Status 146 * RETURN: Status
139 * 147 *
@@ -161,7 +169,7 @@ acpi_ex_acquire_mutex (
161 169
162 if (!walk_state->thread) { 170 if (!walk_state->thread) {
163 ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], null thread info\n", 171 ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], null thread info\n",
164 acpi_ut_get_node_name (obj_desc->mutex.node))); 172 acpi_ut_get_node_name (obj_desc->mutex.node)));
165 return_ACPI_STATUS (AE_AML_INTERNAL); 173 return_ACPI_STATUS (AE_AML_INTERNAL);
166 } 174 }
167 175
@@ -170,8 +178,9 @@ acpi_ex_acquire_mutex (
170 * mutex. This mechanism provides some deadlock prevention 178 * mutex. This mechanism provides some deadlock prevention
171 */ 179 */
172 if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { 180 if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
173 ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect sync_level\n", 181 ACPI_REPORT_ERROR ((
174 acpi_ut_get_node_name (obj_desc->mutex.node))); 182 "Cannot acquire Mutex [%4.4s], incorrect sync_level\n",
183 acpi_ut_get_node_name (obj_desc->mutex.node)));
175 return_ACPI_STATUS (AE_AML_MUTEX_ORDER); 184 return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
176 } 185 }
177 186
@@ -180,8 +189,10 @@ acpi_ex_acquire_mutex (
180 if (obj_desc->mutex.owner_thread) { 189 if (obj_desc->mutex.owner_thread) {
181 /* Special case for Global Lock, allow all threads */ 190 /* Special case for Global Lock, allow all threads */
182 191
183 if ((obj_desc->mutex.owner_thread->thread_id == walk_state->thread->thread_id) || 192 if ((obj_desc->mutex.owner_thread->thread_id ==
184 (obj_desc->mutex.semaphore == acpi_gbl_global_lock_semaphore)) { 193 walk_state->thread->thread_id) ||
194 (obj_desc->mutex.semaphore ==
195 acpi_gbl_global_lock_semaphore)) {
185 /* 196 /*
186 * The mutex is already owned by this thread, 197 * The mutex is already owned by this thread,
187 * just increment the acquisition depth 198 * just increment the acquisition depth
@@ -221,6 +232,7 @@ acpi_ex_acquire_mutex (
221 * FUNCTION: acpi_ex_release_mutex 232 * FUNCTION: acpi_ex_release_mutex
222 * 233 *
223 * PARAMETERS: obj_desc - The object descriptor for this op 234 * PARAMETERS: obj_desc - The object descriptor for this op
235 * walk_state - Current method execution state
224 * 236 *
225 * RETURN: Status 237 * RETURN: Status
226 * 238 *
@@ -278,8 +290,9 @@ acpi_ex_release_mutex (
278 * equal to the current sync level 290 * equal to the current sync level
279 */ 291 */
280 if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) { 292 if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
281 ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], incorrect sync_level\n", 293 ACPI_REPORT_ERROR ((
282 acpi_ut_get_node_name (obj_desc->mutex.node))); 294 "Cannot release Mutex [%4.4s], incorrect sync_level\n",
295 acpi_ut_get_node_name (obj_desc->mutex.node)));
283 return_ACPI_STATUS (AE_AML_MUTEX_ORDER); 296 return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
284 } 297 }
285 298
@@ -313,11 +326,11 @@ acpi_ex_release_mutex (
313 * 326 *
314 * FUNCTION: acpi_ex_release_all_mutexes 327 * FUNCTION: acpi_ex_release_all_mutexes
315 * 328 *
316 * PARAMETERS: mutex_list - Head of the mutex list 329 * PARAMETERS: Thread - Current executing thread object
317 * 330 *
318 * RETURN: Status 331 * RETURN: Status
319 * 332 *
320 * DESCRIPTION: Release all mutexes in the list 333 * DESCRIPTION: Release all mutexes held by this thread
321 * 334 *
322 ******************************************************************************/ 335 ******************************************************************************/
323 336