aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utdelete.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utdelete.c')
-rw-r--r--drivers/acpi/utilities/utdelete.c63
1 files changed, 43 insertions, 20 deletions
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 9a52ad52a23a..bc5403022681 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -51,12 +51,23 @@
51#define _COMPONENT ACPI_UTILITIES 51#define _COMPONENT ACPI_UTILITIES
52 ACPI_MODULE_NAME ("utdelete") 52 ACPI_MODULE_NAME ("utdelete")
53 53
54/* Local prototypes */
55
56static void
57acpi_ut_delete_internal_obj (
58 union acpi_operand_object *object);
59
60static void
61acpi_ut_update_ref_count (
62 union acpi_operand_object *object,
63 u32 action);
64
54 65
55/******************************************************************************* 66/*******************************************************************************
56 * 67 *
57 * FUNCTION: acpi_ut_delete_internal_obj 68 * FUNCTION: acpi_ut_delete_internal_obj
58 * 69 *
59 * PARAMETERS: *Object - Pointer to the list to be deleted 70 * PARAMETERS: Object - Object to be deleted
60 * 71 *
61 * RETURN: None 72 * RETURN: None
62 * 73 *
@@ -65,7 +76,7 @@
65 * 76 *
66 ******************************************************************************/ 77 ******************************************************************************/
67 78
68void 79static void
69acpi_ut_delete_internal_obj ( 80acpi_ut_delete_internal_obj (
70 union acpi_operand_object *object) 81 union acpi_operand_object *object)
71{ 82{
@@ -152,7 +163,8 @@ acpi_ut_delete_internal_obj (
152 163
153 case ACPI_TYPE_MUTEX: 164 case ACPI_TYPE_MUTEX:
154 165
155 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Mutex %p, Semaphore %p\n", 166 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
167 "***** Mutex %p, Semaphore %p\n",
156 object, object->mutex.semaphore)); 168 object, object->mutex.semaphore));
157 169
158 acpi_ex_unlink_mutex (object); 170 acpi_ex_unlink_mutex (object);
@@ -162,7 +174,8 @@ acpi_ut_delete_internal_obj (
162 174
163 case ACPI_TYPE_EVENT: 175 case ACPI_TYPE_EVENT:
164 176
165 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Event %p, Semaphore %p\n", 177 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
178 "***** Event %p, Semaphore %p\n",
166 object, object->event.semaphore)); 179 object, object->event.semaphore));
167 180
168 (void) acpi_os_delete_semaphore (object->event.semaphore); 181 (void) acpi_os_delete_semaphore (object->event.semaphore);
@@ -172,7 +185,8 @@ acpi_ut_delete_internal_obj (
172 185
173 case ACPI_TYPE_METHOD: 186 case ACPI_TYPE_METHOD:
174 187
175 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Method %p\n", object)); 188 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
189 "***** Method %p\n", object));
176 190
177 /* Delete the method semaphore if it exists */ 191 /* Delete the method semaphore if it exists */
178 192
@@ -185,7 +199,8 @@ acpi_ut_delete_internal_obj (
185 199
186 case ACPI_TYPE_REGION: 200 case ACPI_TYPE_REGION:
187 201
188 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Region %p\n", object)); 202 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
203 "***** Region %p\n", object));
189 204
190 second_desc = acpi_ns_get_secondary_object (object); 205 second_desc = acpi_ns_get_secondary_object (object);
191 if (second_desc) { 206 if (second_desc) {
@@ -212,7 +227,8 @@ acpi_ut_delete_internal_obj (
212 227
213 case ACPI_TYPE_BUFFER_FIELD: 228 case ACPI_TYPE_BUFFER_FIELD:
214 229
215 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Buffer Field %p\n", object)); 230 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
231 "***** Buffer Field %p\n", object));
216 232
217 second_desc = acpi_ns_get_secondary_object (object); 233 second_desc = acpi_ns_get_secondary_object (object);
218 if (second_desc) { 234 if (second_desc) {
@@ -247,7 +263,7 @@ acpi_ut_delete_internal_obj (
247 * 263 *
248 * FUNCTION: acpi_ut_delete_internal_object_list 264 * FUNCTION: acpi_ut_delete_internal_object_list
249 * 265 *
250 * PARAMETERS: *obj_list - Pointer to the list to be deleted 266 * PARAMETERS: obj_list - Pointer to the list to be deleted
251 * 267 *
252 * RETURN: None 268 * RETURN: None
253 * 269 *
@@ -283,7 +299,7 @@ acpi_ut_delete_internal_object_list (
283 * 299 *
284 * FUNCTION: acpi_ut_update_ref_count 300 * FUNCTION: acpi_ut_update_ref_count
285 * 301 *
286 * PARAMETERS: *Object - Object whose ref count is to be updated 302 * PARAMETERS: Object - Object whose ref count is to be updated
287 * Action - What to do 303 * Action - What to do
288 * 304 *
289 * RETURN: New ref count 305 * RETURN: New ref count
@@ -312,7 +328,8 @@ acpi_ut_update_ref_count (
312 new_count = count; 328 new_count = count;
313 329
314 /* 330 /*
315 * Perform the reference count action (increment, decrement, or force delete) 331 * Perform the reference count action
332 * (increment, decrement, or force delete)
316 */ 333 */
317 switch (action) { 334 switch (action) {
318 335
@@ -321,7 +338,8 @@ acpi_ut_update_ref_count (
321 new_count++; 338 new_count++;
322 object->common.reference_count = new_count; 339 object->common.reference_count = new_count;
323 340
324 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Incremented]\n", 341 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
342 "Obj %p Refs=%X, [Incremented]\n",
325 object, new_count)); 343 object, new_count));
326 break; 344 break;
327 345
@@ -329,7 +347,8 @@ acpi_ut_update_ref_count (
329 case REF_DECREMENT: 347 case REF_DECREMENT:
330 348
331 if (count < 1) { 349 if (count < 1) {
332 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, can't decrement! (Set to 0)\n", 350 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
351 "Obj %p Refs=%X, can't decrement! (Set to 0)\n",
333 object, new_count)); 352 object, new_count));
334 353
335 new_count = 0; 354 new_count = 0;
@@ -337,12 +356,14 @@ acpi_ut_update_ref_count (
337 else { 356 else {
338 new_count--; 357 new_count--;
339 358
340 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Decremented]\n", 359 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
360 "Obj %p Refs=%X, [Decremented]\n",
341 object, new_count)); 361 object, new_count));
342 } 362 }
343 363
344 if (ACPI_GET_OBJECT_TYPE (object) == ACPI_TYPE_METHOD) { 364 if (ACPI_GET_OBJECT_TYPE (object) == ACPI_TYPE_METHOD) {
345 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Method Obj %p Refs=%X, [Decremented]\n", 365 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
366 "Method Obj %p Refs=%X, [Decremented]\n",
346 object, new_count)); 367 object, new_count));
347 } 368 }
348 369
@@ -356,7 +377,8 @@ acpi_ut_update_ref_count (
356 377
357 case REF_FORCE_DELETE: 378 case REF_FORCE_DELETE:
358 379
359 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, Force delete! (Set to 0)\n", 380 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
381 "Obj %p Refs=%X, Force delete! (Set to 0)\n",
360 object, count)); 382 object, count));
361 383
362 new_count = 0; 384 new_count = 0;
@@ -390,7 +412,7 @@ acpi_ut_update_ref_count (
390 * 412 *
391 * FUNCTION: acpi_ut_update_object_reference 413 * FUNCTION: acpi_ut_update_object_reference
392 * 414 *
393 * PARAMETERS: *Object - Increment ref count for this object 415 * PARAMETERS: Object - Increment ref count for this object
394 * and all sub-objects 416 * and all sub-objects
395 * Action - Either REF_INCREMENT or REF_DECREMENT or 417 * Action - Either REF_INCREMENT or REF_DECREMENT or
396 * REF_FORCE_DELETE 418 * REF_FORCE_DELETE
@@ -431,7 +453,8 @@ acpi_ut_update_object_reference (
431 /* Make sure that this isn't a namespace handle */ 453 /* Make sure that this isn't a namespace handle */
432 454
433 if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) { 455 if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) {
434 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p is NS handle\n", object)); 456 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
457 "Object %p is NS handle\n", object));
435 return_ACPI_STATUS (AE_OK); 458 return_ACPI_STATUS (AE_OK);
436 } 459 }
437 460
@@ -614,8 +637,8 @@ error_exit:
614 * 637 *
615 * FUNCTION: acpi_ut_add_reference 638 * FUNCTION: acpi_ut_add_reference
616 * 639 *
617 * PARAMETERS: *Object - Object whose reference count is to be 640 * PARAMETERS: Object - Object whose reference count is to be
618 * incremented 641 * incremented
619 * 642 *
620 * RETURN: None 643 * RETURN: None
621 * 644 *
@@ -652,7 +675,7 @@ acpi_ut_add_reference (
652 * 675 *
653 * FUNCTION: acpi_ut_remove_reference 676 * FUNCTION: acpi_ut_remove_reference
654 * 677 *
655 * PARAMETERS: *Object - Object whose ref count will be decremented 678 * PARAMETERS: Object - Object whose ref count will be decremented
656 * 679 *
657 * RETURN: None 680 * RETURN: None
658 * 681 *