drivers/acpi/acpica/dbmethod.c

Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/dbmethod.c

File Facts

System
Linux kernel
Corpus path
drivers/acpi/acpica/dbmethod.c
Extension
.c
Size
15023 bytes
Lines
590
Domain
Driver Families
Bucket
drivers/acpi
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!node) {
			return;
		}

		if (node->type != ACPI_TYPE_INTEGER) {
			acpi_os_printf("Can only set Integer nodes\n");
			return;
		}
		obj_desc = node->object;
		obj_desc->integer.value = value;
		return;
	}

	/* Get the index and value */

	index = strtoul(index_arg, NULL, 16);

	walk_state = acpi_ds_get_current_walk_state(acpi_gbl_current_walk_list);
	if (!walk_state) {
		acpi_os_printf("There is no method currently executing\n");
		return;
	}

	/* Create and initialize the new object */

	obj_desc = acpi_ut_create_integer_object((u64)value);
	if (!obj_desc) {
		acpi_os_printf("Could not create an internal object\n");
		return;
	}

	/* Store the new object into the target */

	switch (type) {
	case 'A':

		/* Set a method argument */

		if (index > ACPI_METHOD_MAX_ARG) {
			acpi_os_printf("Arg%u - Invalid argument name\n",
				       index);
			goto cleanup;
		}

		status = acpi_ds_store_object_to_local(ACPI_REFCLASS_ARG,
						       index, obj_desc,
						       walk_state);
		if (ACPI_FAILURE(status)) {
			goto cleanup;
		}

		obj_desc = walk_state->arguments[index].object;

		acpi_os_printf("Arg%u: ", index);
		acpi_db_display_internal_object(obj_desc, walk_state);
		break;

	case 'L':

		/* Set a method local */

		if (index > ACPI_METHOD_MAX_LOCAL) {
			acpi_os_printf
			    ("Local%u - Invalid local variable name\n", index);
			goto cleanup;
		}

		status = acpi_ds_store_object_to_local(ACPI_REFCLASS_LOCAL,
						       index, obj_desc,
						       walk_state);
		if (ACPI_FAILURE(status)) {
			goto cleanup;
		}

		obj_desc = walk_state->local_variables[index].object;

		acpi_os_printf("Local%u: ", index);
		acpi_db_display_internal_object(obj_desc, walk_state);
		break;

	default:

		break;
	}

cleanup:
	acpi_ut_remove_reference(obj_desc);
}

#ifdef ACPI_DISASSEMBLER

Annotation

Implementation Notes