drivers/acpi/acpica/dbutils.c

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

File Facts

System
Linux kernel
Corpus path
drivers/acpi/acpica/dbutils.c
Extension
.c
Size
10255 bytes
Lines
422
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 (obj_desc->buffer.length) {
			if (obj_desc->buffer.length > 16) {
				acpi_os_printf("\n");
			}

			acpi_ut_debug_dump_buffer(ACPI_CAST_PTR
						  (u8,
						   obj_desc->buffer.pointer),
						  obj_desc->buffer.length,
						  DB_BYTE_DISPLAY, _COMPONENT);
		} else {
			acpi_os_printf("\n");
		}
		break;

	case ACPI_TYPE_PACKAGE:

		acpi_os_printf("[Package] Contains %u Elements:\n",
			       obj_desc->package.count);

		for (i = 0; i < obj_desc->package.count; i++) {
			acpi_db_dump_external_object(&obj_desc->package.
						     elements[i], level + 1);
		}
		break;

	case ACPI_TYPE_LOCAL_REFERENCE:

		acpi_os_printf("[Object Reference] = ");
		acpi_db_display_internal_object(obj_desc->reference.handle,
						NULL);
		break;

	case ACPI_TYPE_PROCESSOR:

		acpi_os_printf("[Processor]\n");
		break;

	case ACPI_TYPE_POWER:

		acpi_os_printf("[Power Resource]\n");
		break;

	default:

		acpi_os_printf("[Unknown Type] %X\n", obj_desc->type);
		break;
	}
}

/*******************************************************************************
 *
 * FUNCTION:    acpi_db_prep_namestring
 *
 * PARAMETERS:  name            - String to prepare
 *
 * RETURN:      None
 *
 * DESCRIPTION: Translate all forward slashes and dots to backslashes.
 *
 ******************************************************************************/

void acpi_db_prep_namestring(char *name)
{

	if (!name) {
		return;
	}

	acpi_ut_strupr(name);

	/* Convert a leading forward slash to a backslash */

	if (*name == '/') {
		*name = '\\';
	}

	/* Ignore a leading backslash, this is the root prefix */

	if (ACPI_IS_ROOT_PREFIX(*name)) {
		name++;
	}

	/* Convert all slash path separators to dots */

	while (*name) {
		if ((*name == '/') || (*name == '\\')) {
			*name = '.';
		}

Annotation

Implementation Notes