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 = ACPI_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()
260 if (object->field.internal_pcc_buffer) { in acpi_ut_delete_internal_obj()
261 ACPI_FREE(object->field.internal_pcc_buffer); in acpi_ut_delete_internal_obj()
269 "***** Buffer Field %p\n", object)); in acpi_ut_delete_internal_obj()
271 second_desc = acpi_ns_get_secondary_object(object); in acpi_ut_delete_internal_obj()
280 "***** Bank Field %p\n", object)); in acpi_ut_delete_internal_obj()
282 second_desc = acpi_ns_get_secondary_object(object); in acpi_ut_delete_internal_obj()
291 "***** Address handler %p\n", object)); in acpi_ut_delete_internal_obj()
293 acpi_os_delete_mutex(object->address_space.context_mutex); in acpi_ut_delete_internal_obj()
301 /* Free any allocated memory (pointer within the object) found above */ in acpi_ut_delete_internal_obj()
305 "Deleting Object Subptr %p\n", obj_pointer)); in acpi_ut_delete_internal_obj()
309 /* Now the object can be safely deleted */ in acpi_ut_delete_internal_obj()
312 "%s: Deleting Object %p [%s]\n", in acpi_ut_delete_internal_obj()
313 ACPI_GET_FUNCTION_NAME, object, in acpi_ut_delete_internal_obj()
314 acpi_ut_get_object_type_name(object))); in acpi_ut_delete_internal_obj()
316 acpi_ut_delete_object_desc(object); in acpi_ut_delete_internal_obj()
328 * DESCRIPTION: This function deletes an internal object list, including both
345 /* Free the combined parameter pointer list and object array */ in acpi_ut_delete_internal_object_list()
355 * PARAMETERS: object - Object whose ref count is to be updated
358 * RETURN: None. Sets new reference count within the object
360 * DESCRIPTION: Modify the reference count for an internal acpi object
365 acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action) in acpi_ut_update_ref_count() argument
374 if (!object) { in acpi_ut_update_ref_count()
383 original_count = object->common.reference_count; in acpi_ut_update_ref_count()
391 object->common.reference_count = new_count; in acpi_ut_update_ref_count()
399 object)); in acpi_ut_update_ref_count()
404 object, object->common.type, in acpi_ut_update_ref_count()
405 acpi_ut_get_object_type_name(object), in acpi_ut_update_ref_count()
416 object->common.reference_count = new_count; in acpi_ut_update_ref_count()
424 object)); in acpi_ut_update_ref_count()
430 ACPI_GET_FUNCTION_NAME, object, in acpi_ut_update_ref_count()
431 object->common.type, new_count)); in acpi_ut_update_ref_count()
433 /* Actually delete the object on a reference count of zero */ in acpi_ut_update_ref_count()
436 acpi_ut_delete_internal_obj(object); in acpi_ut_update_ref_count()
451 * (A deleted object will have a huge reference count) in acpi_ut_update_ref_count()
455 "Large Reference Count (0x%X) in object %p, Type=0x%.2X Operation=%s", in acpi_ut_update_ref_count()
456 new_count, object, object->common.type, message)); in acpi_ut_update_ref_count()
464 * PARAMETERS: object - Increment or decrement the ref count for
465 * this object and all sub-objects
470 * DESCRIPTION: Increment or decrement the object reference count
472 * Object references are incremented when:
473 * 1) An object is attached to a Node (namespace object)
474 * 2) An object is copied (all subobjects must be incremented)
476 * Object references are decremented when:
477 * 1) An object is detached from an Node
482 acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) in acpi_ut_update_object_reference() argument
493 while (object) { in acpi_ut_update_object_reference()
497 if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) { in acpi_ut_update_object_reference()
499 "Object %p is NS handle\n", object)); in acpi_ut_update_object_reference()
505 * also. Different object types have different subobjects. in acpi_ut_update_object_reference()
507 switch (object->common.type) { in acpi_ut_update_object_reference()
518 object->common_notify.notify_list[i]; in acpi_ut_update_object_reference()
534 for (i = 0; i < object->package.count; i++) { in acpi_ut_update_object_reference()
539 next_object = object->package.elements[i]; in acpi_ut_update_object_reference()
577 next_object = object->buffer_field.buffer_obj; in acpi_ut_update_object_reference()
582 next_object = object->bank_field.bank_obj; in acpi_ut_update_object_reference()
584 acpi_ut_create_update_state_and_push(object-> in acpi_ut_update_object_reference()
596 next_object = object->index_field.index_obj; in acpi_ut_update_object_reference()
598 acpi_ut_create_update_state_and_push(object-> in acpi_ut_update_object_reference()
612 * target object. in acpi_ut_update_object_reference()
614 if ((object->reference.class == ACPI_REFCLASS_INDEX) || in acpi_ut_update_object_reference()
615 (object->reference.class == ACPI_REFCLASS_NAME)) { in acpi_ut_update_object_reference()
616 next_object = object->reference.object; in acpi_ut_update_object_reference()
628 * Now we can update the count in the main object. This can only in acpi_ut_update_object_reference()
630 * main object to be deleted. in acpi_ut_update_object_reference()
632 acpi_ut_update_ref_count(object, action); in acpi_ut_update_object_reference()
633 object = NULL; in acpi_ut_update_object_reference()
635 /* Move on to the next object to be updated */ in acpi_ut_update_object_reference()
638 object = next_object; in acpi_ut_update_object_reference()
642 object = state->update.object; in acpi_ut_update_object_reference()
652 "Could not update object reference count")); in acpi_ut_update_object_reference()
668 * PARAMETERS: object - Object whose reference count is to be
673 * DESCRIPTION: Add one reference to an ACPI object
677 void acpi_ut_add_reference(union acpi_operand_object *object) in acpi_ut_add_reference() argument
682 /* Ensure that we have a valid object */ in acpi_ut_add_reference()
684 if (!acpi_ut_valid_internal_object(object)) { in acpi_ut_add_reference()
690 object, object->common.reference_count)); in acpi_ut_add_reference()
694 (void)acpi_ut_update_object_reference(object, REF_INCREMENT); in acpi_ut_add_reference()
702 * PARAMETERS: object - Object whose ref count will be decremented
706 * DESCRIPTION: Decrement the reference count of an ACPI internal object
710 void acpi_ut_remove_reference(union acpi_operand_object *object) in acpi_ut_remove_reference() argument
719 if (!object || in acpi_ut_remove_reference()
720 (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) { in acpi_ut_remove_reference()
724 /* Ensure that we have a valid object */ in acpi_ut_remove_reference()
726 if (!acpi_ut_valid_internal_object(object)) { in acpi_ut_remove_reference()
732 ACPI_GET_FUNCTION_NAME, object, in acpi_ut_remove_reference()
733 object->common.reference_count)); in acpi_ut_remove_reference()
736 * Decrement the reference count, and only actually delete the object in acpi_ut_remove_reference()
740 (void)acpi_ut_update_object_reference(object, REF_DECREMENT); in acpi_ut_remove_reference()