diff options
author | Bob Moore <robert.moore@intel.com> | 2008-04-10 11:06:37 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-22 14:29:22 -0400 |
commit | 91e38d10b2b49b8a200111baa7714c4a7e658a4c (patch) | |
tree | c48b2889e074d83f3dc3f66c3889709ff3dc3e7a /drivers/acpi/executer | |
parent | dbaaa9567543191faa933e78f979f5ff7385918c (diff) |
ACPICA: Update comments for acquire/release mutex interfaces
pdate comments for acquire/release mutex interfaces
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r-- | drivers/acpi/executer/exmutex.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c index 0bebe751aac5..32f24a8fba57 100644 --- a/drivers/acpi/executer/exmutex.c +++ b/drivers/acpi/executer/exmutex.c | |||
@@ -134,7 +134,16 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc, | |||
134 | * | 134 | * |
135 | * RETURN: Status | 135 | * RETURN: Status |
136 | * | 136 | * |
137 | * DESCRIPTION: Acquire an AML mutex, low-level interface | 137 | * DESCRIPTION: Acquire an AML mutex, low-level interface. Provides a common |
138 | * path that supports multiple acquires by the same thread. | ||
139 | * | ||
140 | * MUTEX: Interpreter must be locked | ||
141 | * | ||
142 | * NOTE: This interface is called from three places: | ||
143 | * 1) From acpi_ex_acquire_mutex, via an AML Acquire() operator | ||
144 | * 2) From acpi_ex_acquire_global_lock when an AML Field access requires the | ||
145 | * global lock | ||
146 | * 3) From the external interface, acpi_acquire_global_lock | ||
138 | * | 147 | * |
139 | ******************************************************************************/ | 148 | ******************************************************************************/ |
140 | 149 | ||
@@ -174,7 +183,7 @@ acpi_ex_acquire_mutex_object(u16 timeout, | |||
174 | return_ACPI_STATUS(status); | 183 | return_ACPI_STATUS(status); |
175 | } | 184 | } |
176 | 185 | ||
177 | /* Have the mutex: update mutex and save the sync_level */ | 186 | /* Acquired the mutex: update mutex object */ |
178 | 187 | ||
179 | obj_desc->mutex.thread_id = thread_id; | 188 | obj_desc->mutex.thread_id = thread_id; |
180 | obj_desc->mutex.acquisition_depth = 1; | 189 | obj_desc->mutex.acquisition_depth = 1; |
@@ -211,7 +220,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, | |||
211 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 220 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
212 | } | 221 | } |
213 | 222 | ||
214 | /* Sanity check: we must have a valid thread ID */ | 223 | /* Must have a valid thread ID */ |
215 | 224 | ||
216 | if (!walk_state->thread) { | 225 | if (!walk_state->thread) { |
217 | ACPI_ERROR((AE_INFO, | 226 | ACPI_ERROR((AE_INFO, |
@@ -221,7 +230,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, | |||
221 | } | 230 | } |
222 | 231 | ||
223 | /* | 232 | /* |
224 | * Current Sync level must be less than or equal to the sync level of the | 233 | * Current sync level must be less than or equal to the sync level of the |
225 | * mutex. This mechanism provides some deadlock prevention | 234 | * mutex. This mechanism provides some deadlock prevention |
226 | */ | 235 | */ |
227 | if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { | 236 | if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { |
@@ -236,6 +245,9 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, | |||
236 | obj_desc, | 245 | obj_desc, |
237 | walk_state->thread->thread_id); | 246 | walk_state->thread->thread_id); |
238 | if (ACPI_SUCCESS(status) && obj_desc->mutex.acquisition_depth == 1) { | 247 | if (ACPI_SUCCESS(status) && obj_desc->mutex.acquisition_depth == 1) { |
248 | |||
249 | /* Save Thread object, original/current sync levels */ | ||
250 | |||
239 | obj_desc->mutex.owner_thread = walk_state->thread; | 251 | obj_desc->mutex.owner_thread = walk_state->thread; |
240 | obj_desc->mutex.original_sync_level = | 252 | obj_desc->mutex.original_sync_level = |
241 | walk_state->thread->current_sync_level; | 253 | walk_state->thread->current_sync_level; |
@@ -259,6 +271,16 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, | |||
259 | * RETURN: Status | 271 | * RETURN: Status |
260 | * | 272 | * |
261 | * DESCRIPTION: Release a previously acquired Mutex, low level interface. | 273 | * DESCRIPTION: Release a previously acquired Mutex, low level interface. |
274 | * Provides a common path that supports multiple releases (after | ||
275 | * previous multiple acquires) by the same thread. | ||
276 | * | ||
277 | * MUTEX: Interpreter must be locked | ||
278 | * | ||
279 | * NOTE: This interface is called from three places: | ||
280 | * 1) From acpi_ex_release_mutex, via an AML Acquire() operator | ||
281 | * 2) From acpi_ex_release_global_lock when an AML Field access requires the | ||
282 | * global lock | ||
283 | * 3) From the external interface, acpi_release_global_lock | ||
262 | * | 284 | * |
263 | ******************************************************************************/ | 285 | ******************************************************************************/ |
264 | 286 | ||
@@ -294,6 +316,8 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc) | |||
294 | acpi_os_release_mutex(obj_desc->mutex.os_mutex); | 316 | acpi_os_release_mutex(obj_desc->mutex.os_mutex); |
295 | } | 317 | } |
296 | 318 | ||
319 | /* Clear mutex info */ | ||
320 | |||
297 | obj_desc->mutex.thread_id = 0; | 321 | obj_desc->mutex.thread_id = 0; |
298 | return_ACPI_STATUS(status); | 322 | return_ACPI_STATUS(status); |
299 | } | 323 | } |
@@ -348,7 +372,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
348 | return_ACPI_STATUS(AE_AML_NOT_OWNER); | 372 | return_ACPI_STATUS(AE_AML_NOT_OWNER); |
349 | } | 373 | } |
350 | 374 | ||
351 | /* Sanity check: we must have a valid thread ID */ | 375 | /* Must have a valid thread ID */ |
352 | 376 | ||
353 | if (!walk_state->thread) { | 377 | if (!walk_state->thread) { |
354 | ACPI_ERROR((AE_INFO, | 378 | ACPI_ERROR((AE_INFO, |
@@ -370,7 +394,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
370 | 394 | ||
371 | status = acpi_ex_release_mutex_object(obj_desc); | 395 | status = acpi_ex_release_mutex_object(obj_desc); |
372 | 396 | ||
373 | /* Restore sync_level */ | 397 | /* Restore the original sync_level */ |
374 | 398 | ||
375 | walk_state->thread->current_sync_level = | 399 | walk_state->thread->current_sync_level = |
376 | obj_desc->mutex.original_sync_level; | 400 | obj_desc->mutex.original_sync_level; |