drivers/acpi/acpica/rsaddr.c

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

File Facts

System
Linux kernel
Corpus path
drivers/acpi/acpica/rsaddr.c
Extension
.c
Size
10678 bytes
Lines
348
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

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/*******************************************************************************
 *
 * Module Name: rsaddr - Address resource descriptors (16/32/64)
 *
 ******************************************************************************/

#include <acpi/acpi.h>
#include "accommon.h"
#include "acresrc.h"

#define _COMPONENT          ACPI_RESOURCES
ACPI_MODULE_NAME("rsaddr")

/*******************************************************************************
 *
 * acpi_rs_convert_address16 - All WORD (16-bit) address resources
 *
 ******************************************************************************/
struct acpi_rsconvert_info acpi_rs_convert_address16[5] = {
	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_ADDRESS16,
	 ACPI_RS_SIZE(struct acpi_resource_address16),
	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_address16)},

	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_ADDRESS16,
	 sizeof(struct aml_resource_address16),
	 0},

	/* Resource Type, General Flags, and Type-Specific Flags */

	{ACPI_RSC_ADDRESS, 0, 0, 0},

	/*
	 * These fields are contiguous in both the source and destination:
	 * Address Granularity
	 * Address Range Minimum
	 * Address Range Maximum
	 * Address Translation Offset
	 * Address Length
	 */
	{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.address16.address.granularity),
	 AML_OFFSET(address16.granularity),
	 5},

	/* Optional resource_source (Index and String) */

	{ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.address16.resource_source),
	 0,
	 sizeof(struct aml_resource_address16)}
};

/*******************************************************************************
 *
 * acpi_rs_convert_address32 - All DWORD (32-bit) address resources
 *
 ******************************************************************************/

struct acpi_rsconvert_info acpi_rs_convert_address32[5] = {
	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_ADDRESS32,
	 ACPI_RS_SIZE(struct acpi_resource_address32),
	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_address32)},

	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_ADDRESS32,
	 sizeof(struct aml_resource_address32),
	 0},

	/* Resource Type, General Flags, and Type-Specific Flags */

	{ACPI_RSC_ADDRESS, 0, 0, 0},

	/*
	 * These fields are contiguous in both the source and destination:
	 * Address Granularity
	 * Address Range Minimum
	 * Address Range Maximum
	 * Address Translation Offset
	 * Address Length
	 */
	{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.address32.address.granularity),
	 AML_OFFSET(address32.granularity),
	 5},

	/* Optional resource_source (Index and String) */

	{ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.address32.resource_source),
	 0,
	 sizeof(struct aml_resource_address32)}
};

/*******************************************************************************

Annotation

Implementation Notes