Lines Matching refs: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)
45 ACPI_FUNCTION_TRACE_PTR(ut_delete_internal_obj, object);
47 if (!object) {
52 * Must delete or free any pointers within the object that are not
55 switch (object->common.type) {
59 "**** String %p, ptr %p\n", object,
60 object->string.pointer));
64 if (!(object->common.flags & AOPOBJ_STATIC_POINTER)) {
68 obj_pointer = object->string.pointer;
75 "**** Buffer %p, ptr %p\n", object,
76 object->buffer.pointer));
80 if (!(object->common.flags & AOPOBJ_STATIC_POINTER)) {
84 obj_pointer = object->buffer.pointer;
92 object->package.count));
101 obj_pointer = object->package.elements;
106 * Device object also may have a GPE block.
110 if (object->device.gpe_block) {
111 (void)acpi_ev_delete_gpe_block(object->device.
120 /* Walk the address handler list for this object */
122 handler_desc = object->common_notify.handler;
134 object, object->mutex.os_mutex));
136 if (object == acpi_gbl_global_lock_mutex) {
145 acpi_os_delete_mutex(object->mutex.os_mutex);
148 acpi_ex_unlink_mutex(object);
149 acpi_os_delete_mutex(object->mutex.os_mutex);
157 object, object->event.os_semaphore));
159 (void)acpi_os_delete_semaphore(object->event.os_semaphore);
160 object->event.os_semaphore = NULL;
166 "***** Method %p\n", object));
170 if (object->method.mutex) {
171 acpi_os_delete_mutex(object->method.mutex->mutex.
173 acpi_ut_delete_object_desc(object->method.mutex);
174 object->method.mutex = NULL;
177 if (object->method.node) {
178 object->method.node = NULL;
185 "***** Region %p\n", object));
191 if (!(object->region.node->flags & ANOBJ_TEMPORARY)) {
192 acpi_ut_remove_address_range(object->region.space_id,
193 object->region.node);
196 second_desc = acpi_ns_get_secondary_object(object);
200 * default handlers -- and therefore, we created the context object
203 handler_desc = object->region.handler;
211 /* Remove the region object from the handler list */
214 if (next_desc == object) {
229 "Circular region list in address handler object %p",
242 address_space.setup(object,
256 /* Now we can free the Extra object */
260 if (object->field.internal_pcc_buffer) {
261 ACPI_FREE(object->field.internal_pcc_buffer);
269 "***** Buffer Field %p\n", object));
271 second_desc = acpi_ns_get_secondary_object(object);
280 "***** Bank Field %p\n", object));
282 second_desc = acpi_ns_get_secondary_object(object);
291 "***** Address handler %p\n", object));
293 acpi_os_delete_mutex(object->address_space.context_mutex);
301 /* Free any allocated memory (pointer within the object) found above */
309 /* Now the object can be safely deleted */
313 ACPI_GET_FUNCTION_NAME, object,
314 acpi_ut_get_object_type_name(object)));
316 acpi_ut_delete_object_desc(object);
328 * DESCRIPTION: This function deletes an internal object list, including both
345 /* Free the combined parameter pointer list and object array */
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)
374 if (!object) {
383 original_count = object->common.reference_count;
391 object->common.reference_count = new_count;
399 object));
404 object, object->common.type,
405 acpi_ut_get_object_type_name(object),
416 object->common.reference_count = new_count;
424 object));
430 ACPI_GET_FUNCTION_NAME, object,
431 object->common.type, new_count));
433 /* Actually delete the object on a reference count of zero */
436 acpi_ut_delete_internal_obj(object);
451 * (A deleted object will have a huge reference count)
455 "Large Reference Count (0x%X) in object %p, Type=0x%.2X Operation=%s",
456 new_count, object, object->common.type, message));
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
473 * 1) An object is attached to a Node (namespace object)
474 * 2) An object is copied (all subobjects must be incremented)
477 * 1) An object is detached from an Node
482 acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
493 while (object) {
497 if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) {
499 "Object %p is NS handle\n", object));
505 * also. Different object types have different subobjects.
507 switch (object->common.type) {
518 object->common_notify.notify_list[i];
534 for (i = 0; i < object->package.count; i++) {
539 next_object = object->package.elements[i];
577 next_object = object->buffer_field.buffer_obj;
582 next_object = object->bank_field.bank_obj;
584 acpi_ut_create_update_state_and_push(object->
596 next_object = object->index_field.index_obj;
598 acpi_ut_create_update_state_and_push(object->
612 * target object.
614 if ((object->reference.class == ACPI_REFCLASS_INDEX) ||
615 (object->reference.class == ACPI_REFCLASS_NAME)) {
616 next_object = object->reference.object;
628 * Now we can update the count in the main object. This can only
630 * main object to be deleted.
632 acpi_ut_update_ref_count(object, action);
633 object = NULL;
635 /* Move on to the next object to be updated */
638 object = next_object;
642 object = state->update.object;
652 "Could not update object reference count"));
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)
682 /* Ensure that we have a valid object */
684 if (!acpi_ut_valid_internal_object(object)) {
690 object, object->common.reference_count));
694 (void)acpi_ut_update_object_reference(object, REF_INCREMENT);
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)
719 if (!object ||
720 (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) {
724 /* Ensure that we have a valid object */
726 if (!acpi_ut_valid_internal_object(object)) {
732 ACPI_GET_FUNCTION_NAME, object,
733 object->common.reference_count));
736 * Decrement the reference count, and only actually delete the object
740 (void)acpi_ut_update_object_reference(object, REF_DECREMENT);