Lines Matching full:object
4 * Module Name: utdelete - object deletion and reference count utilities
18 static void acpi_ut_delete_internal_obj(union acpi_operand_object *object);
21 acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action);
27 * PARAMETERS: object - Object to be deleted
31 * DESCRIPTION: Low level object deletion, after reference counts have been
36 static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) in acpi_ut_delete_internal_obj() argument
45 ACPI_FUNCTION_TRACE_PTR(ut_delete_internal_obj, object); in acpi_ut_delete_internal_obj()
47 if (!object) { in acpi_ut_delete_internal_obj()
52 * Must delete or free any pointers within the object that are not in acpi_ut_delete_internal_obj()
55 switch (object->common.type) { in acpi_ut_delete_internal_obj()
59 "**** String %p, ptr %p\n", object, in acpi_ut_delete_internal_obj()
60 object->string.pointer)); in acpi_ut_delete_internal_obj()
64 if (!(object->common.flags & AOPOBJ_STATIC_POINTER)) { in acpi_ut_delete_internal_obj()
68 obj_pointer = object->string.pointer; in acpi_ut_delete_internal_obj()
75 "**** Buffer %p, ptr %p\n", object, in acpi_ut_delete_internal_obj()
76 object->buffer.pointer)); in acpi_ut_delete_internal_obj()
80 if (!(object->common.flags & AOPOBJ_STATIC_POINTER)) { in acpi_ut_delete_internal_obj()
84 obj_pointer = object->buffer.pointer; in acpi_ut_delete_internal_obj()
92 object->package.count)); in acpi_ut_delete_internal_obj()
101 obj_pointer = object->package.elements; in acpi_ut_delete_internal_obj()
106 * Device object also may have a GPE block. in acpi_ut_delete_internal_obj()
110 if (object->device.gpe_block) { in acpi_ut_delete_internal_obj()
111 (void)acpi_ev_delete_gpe_block(object->device. in acpi_ut_delete_internal_obj()
120 /* Walk the address handler list for this object */ in acpi_ut_delete_internal_obj()
122 handler_desc = object->common_notify.handler; in acpi_ut_delete_internal_obj()
134 object, object->mutex.os_mutex)); in acpi_ut_delete_internal_obj()
136 if (object == acpi_gbl_global_lock_mutex) { in acpi_ut_delete_internal_obj()
145 acpi_os_delete_mutex(object->mutex.os_mutex); in acpi_ut_delete_internal_obj()
148 acpi_ex_unlink_mutex(object); in acpi_ut_delete_internal_obj()
149 acpi_os_delete_mutex(object->mutex.os_mutex); in acpi_ut_delete_internal_obj()
157 object, object->event.os_semaphore)); in acpi_ut_delete_internal_obj()
159 (void)acpi_os_delete_semaphore(object->event.os_semaphore); in acpi_ut_delete_internal_obj()
160 object->event.os_semaphore = NULL; in acpi_ut_delete_internal_obj()
166 "***** Method %p\n", object)); in acpi_ut_delete_internal_obj()
170 if (object->method.mutex) { in acpi_ut_delete_internal_obj()
171 acpi_os_delete_mutex(object->method.mutex->mutex. in acpi_ut_delete_internal_obj()
173 acpi_ut_delete_object_desc(object->method.mutex); in acpi_ut_delete_internal_obj()
174 object->method.mutex = NULL; in acpi_ut_delete_internal_obj()
177 if (object->method.node) { in acpi_ut_delete_internal_obj()
178 object->method.node = NULL; in acpi_ut_delete_internal_obj()
185 "***** Region %p\n", object)); in acpi_ut_delete_internal_obj()
191 if (!(object->region.node->flags & ANOBJ_TEMPORARY)) { in acpi_ut_delete_internal_obj()
192 acpi_ut_remove_address_range(object->region.space_id, in acpi_ut_delete_internal_obj()
193 object->region.node); in acpi_ut_delete_internal_obj()
196 second_desc = acpi_ns_get_secondary_object(object); in acpi_ut_delete_internal_obj()
200 * default handlers -- and therefore, we created the context object in acpi_ut_delete_internal_obj()
203 handler_desc = object->region.handler; in acpi_ut_delete_internal_obj()
211 /* Remove the region object from the handler list */ in acpi_ut_delete_internal_obj()
214 if (next_desc == object) { in acpi_ut_delete_internal_obj()
229 "Circular region list in address handler object %p", in acpi_ut_delete_internal_obj()
242 address_space.setup(object, in acpi_ut_delete_internal_obj()
256 /* Now we can free the Extra object */ in acpi_ut_delete_internal_obj()
265 "***** Buffer Field %p\n", object)); in acpi_ut_delete_internal_obj()
267 second_desc = acpi_ns_get_secondary_object(object); in acpi_ut_delete_internal_obj()
276 "***** Bank Field %p\n", object)); in acpi_ut_delete_internal_obj()
278 second_desc = acpi_ns_get_secondary_object(object); in acpi_ut_delete_internal_obj()
289 /* Free any allocated memory (pointer within the object) found above */ in acpi_ut_delete_internal_obj()
293 "Deleting Object Subptr %p\n", obj_pointer)); in acpi_ut_delete_internal_obj()
297 /* Now the object can be safely deleted */ in acpi_ut_delete_internal_obj()
300 "%s: Deleting Object %p [%s]\n", in acpi_ut_delete_internal_obj()
301 ACPI_GET_FUNCTION_NAME, object, in acpi_ut_delete_internal_obj()
302 acpi_ut_get_object_type_name(object))); in acpi_ut_delete_internal_obj()
304 acpi_ut_delete_object_desc(object); in acpi_ut_delete_internal_obj()
316 * DESCRIPTION: This function deletes an internal object list, including both
333 /* Free the combined parameter pointer list and object array */ in acpi_ut_delete_internal_object_list()
343 * PARAMETERS: object - Object whose ref count is to be updated
346 * RETURN: None. Sets new reference count within the object
348 * DESCRIPTION: Modify the reference count for an internal acpi object
353 acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action) in acpi_ut_update_ref_count() argument
362 if (!object) { in acpi_ut_update_ref_count()
371 original_count = object->common.reference_count; in acpi_ut_update_ref_count()
379 object->common.reference_count = new_count; in acpi_ut_update_ref_count()
387 object)); in acpi_ut_update_ref_count()
392 object, object->common.type, in acpi_ut_update_ref_count()
393 acpi_ut_get_object_type_name(object), in acpi_ut_update_ref_count()
404 object->common.reference_count = new_count; in acpi_ut_update_ref_count()
412 object)); in acpi_ut_update_ref_count()
417 ACPI_GET_FUNCTION_NAME, object, in acpi_ut_update_ref_count()
418 object->common.type, new_count)); in acpi_ut_update_ref_count()
420 /* Actually delete the object on a reference count of zero */ in acpi_ut_update_ref_count()
423 acpi_ut_delete_internal_obj(object); in acpi_ut_update_ref_count()
438 * (A deleted object will have a huge reference count) in acpi_ut_update_ref_count()
442 "Large Reference Count (0x%X) in object %p, Type=0x%.2X Operation=%s", in acpi_ut_update_ref_count()
443 new_count, object, object->common.type, message)); in acpi_ut_update_ref_count()
451 * PARAMETERS: object - Increment ref count for this object
457 * DESCRIPTION: Increment the object reference count
459 * Object references are incremented when:
460 * 1) An object is attached to a Node (namespace object)
461 * 2) An object is copied (all subobjects must be incremented)
463 * Object references are decremented when:
464 * 1) An object is detached from an Node
469 acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) in acpi_ut_update_object_reference() argument
480 while (object) { in acpi_ut_update_object_reference()
484 if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) { in acpi_ut_update_object_reference()
486 "Object %p is NS handle\n", object)); in acpi_ut_update_object_reference()
492 * also. Different object types have different subobjects. in acpi_ut_update_object_reference()
494 switch (object->common.type) { in acpi_ut_update_object_reference()
505 object->common_notify.notify_list[i]; in acpi_ut_update_object_reference()
521 for (i = 0; i < object->package.count; i++) { in acpi_ut_update_object_reference()
526 next_object = object->package.elements[i]; in acpi_ut_update_object_reference()
563 next_object = object->buffer_field.buffer_obj; in acpi_ut_update_object_reference()
568 next_object = object->bank_field.bank_obj; in acpi_ut_update_object_reference()
570 acpi_ut_create_update_state_and_push(object-> in acpi_ut_update_object_reference()
582 next_object = object->index_field.index_obj; in acpi_ut_update_object_reference()
584 acpi_ut_create_update_state_and_push(object-> in acpi_ut_update_object_reference()
598 * target object. in acpi_ut_update_object_reference()
600 if ((object->reference.class == ACPI_REFCLASS_INDEX) || in acpi_ut_update_object_reference()
601 (object->reference.class == ACPI_REFCLASS_NAME)) { in acpi_ut_update_object_reference()
602 next_object = object->reference.object; in acpi_ut_update_object_reference()
614 * Now we can update the count in the main object. This can only in acpi_ut_update_object_reference()
616 * main object to be deleted. in acpi_ut_update_object_reference()
618 acpi_ut_update_ref_count(object, action); in acpi_ut_update_object_reference()
619 object = NULL; in acpi_ut_update_object_reference()
621 /* Move on to the next object to be updated */ in acpi_ut_update_object_reference()
624 object = next_object; in acpi_ut_update_object_reference()
628 object = state->update.object; in acpi_ut_update_object_reference()
638 "Could not update object reference count")); in acpi_ut_update_object_reference()
654 * PARAMETERS: object - Object whose reference count is to be
659 * DESCRIPTION: Add one reference to an ACPI object
663 void acpi_ut_add_reference(union acpi_operand_object *object) in acpi_ut_add_reference() argument
668 /* Ensure that we have a valid object */ in acpi_ut_add_reference()
670 if (!acpi_ut_valid_internal_object(object)) { in acpi_ut_add_reference()
676 object, object->common.reference_count)); in acpi_ut_add_reference()
680 (void)acpi_ut_update_object_reference(object, REF_INCREMENT); in acpi_ut_add_reference()
688 * PARAMETERS: object - Object whose ref count will be decremented
692 * DESCRIPTION: Decrement the reference count of an ACPI internal object
696 void acpi_ut_remove_reference(union acpi_operand_object *object) in acpi_ut_remove_reference() argument
705 if (!object || in acpi_ut_remove_reference()
706 (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) { in acpi_ut_remove_reference()
710 /* Ensure that we have a valid object */ in acpi_ut_remove_reference()
712 if (!acpi_ut_valid_internal_object(object)) { in acpi_ut_remove_reference()
718 ACPI_GET_FUNCTION_NAME, object, in acpi_ut_remove_reference()
719 object->common.reference_count)); in acpi_ut_remove_reference()
722 * Decrement the reference count, and only actually delete the object in acpi_ut_remove_reference()
726 (void)acpi_ut_update_object_reference(object, REF_DECREMENT); in acpi_ut_remove_reference()