drivers/acpi/acpica/utpredef.c

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

File Facts

System
Linux kernel
Corpus path
drivers/acpi/acpica/utpredef.c
Extension
.c
Size
9620 bytes
Lines
365
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 (ACPI_COMPARE_NAMESEG(name, this_name->info.name)) {
			return (this_name);
		}

		this_name = acpi_ut_get_next_predefined_method(this_name);
	}

	return (NULL);		/* Not found */
}

/*******************************************************************************
 *
 * FUNCTION:    acpi_ut_get_expected_return_types
 *
 * PARAMETERS:  buffer              - Where the formatted string is returned
 *              expected_Btypes     - Bitfield of expected data types
 *
 * RETURN:      Formatted string in Buffer.
 *
 * DESCRIPTION: Format the expected object types into a printable string.
 *
 ******************************************************************************/

void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes)
{
	u32 this_rtype;
	u32 i;
	u32 j;

	if (!expected_btypes) {
		strcpy(buffer, "NONE");
		return;
	}

	j = 1;
	buffer[0] = 0;
	this_rtype = ACPI_RTYPE_INTEGER;

	for (i = 0; i < ACPI_NUM_RTYPES; i++) {

		/* If one of the expected types, concatenate the name of this type */

		if (expected_btypes & this_rtype) {
			strcat(buffer, &ut_rtype_names[i][j]);
			j = 0;	/* Use name separator from now on */
		}

		this_rtype <<= 1;	/* Next Rtype */
	}
}

/*******************************************************************************
 *
 * The remaining functions are used by iASL and acpi_help only
 *
 ******************************************************************************/

#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)

/* Local prototypes */

static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types);

/* Types that can be returned externally by a predefined name */

static const char *ut_external_type_names[] =	/* Indexed by ACPI_TYPE_* */
{
	", Type_ANY",
	", Integer",
	", String",
	", Buffer",
	", Package"
};

/* Bit widths for resource descriptor predefined names */

static const char *ut_resource_type_names[] = {
	"/1",
	"/2",
	"/3",
	"/8",
	"/16",
	"/32",
	"/64",
	"/variable",
};

/*******************************************************************************
 *
 * FUNCTION:    acpi_ut_match_resource_name

Annotation

Implementation Notes