drivers/acpi/acpica/rsio.c

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

File Facts

System
Linux kernel
Corpus path
drivers/acpi/acpica/rsio.c
Extension
.c
Size
7383 bytes
Lines
255
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: rsio - IO and DMA resource descriptors
 *
 ******************************************************************************/

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

#define _COMPONENT          ACPI_RESOURCES
ACPI_MODULE_NAME("rsio")

/*******************************************************************************
 *
 * acpi_rs_convert_io
 *
 ******************************************************************************/
struct acpi_rsconvert_info acpi_rs_convert_io[5] = {
	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IO,
	 ACPI_RS_SIZE(struct acpi_resource_io),
	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_io)},

	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IO,
	 sizeof(struct aml_resource_io),
	 0},

	/* Decode flag */

	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.io.io_decode),
	 AML_OFFSET(io.flags),
	 0},
	/*
	 * These fields are contiguous in both the source and destination:
	 * Address Alignment
	 * Length
	 * Minimum Base Address
	 * Maximum Base Address
	 */
	{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.io.alignment),
	 AML_OFFSET(io.alignment),
	 2},

	{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.io.minimum),
	 AML_OFFSET(io.minimum),
	 2}
};

/*******************************************************************************
 *
 * acpi_rs_convert_fixed_io
 *
 ******************************************************************************/

struct acpi_rsconvert_info acpi_rs_convert_fixed_io[4] = {
	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_IO,
	 ACPI_RS_SIZE(struct acpi_resource_fixed_io),
	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_fixed_io)},

	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_IO,
	 sizeof(struct aml_resource_fixed_io),
	 0},
	/*
	 * These fields are contiguous in both the source and destination:
	 * Base Address
	 * Length
	 */
	{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.fixed_io.address_length),
	 AML_OFFSET(fixed_io.address_length),
	 1},

	{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.fixed_io.address),
	 AML_OFFSET(fixed_io.address),
	 1}
};

/*******************************************************************************
 *
 * acpi_rs_convert_generic_reg
 *
 ******************************************************************************/

struct acpi_rsconvert_info acpi_rs_convert_generic_reg[4] = {
	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GENERIC_REGISTER,
	 ACPI_RS_SIZE(struct acpi_resource_generic_register),
	 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_generic_reg)},

	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GENERIC_REGISTER,
	 sizeof(struct aml_resource_generic_register),

Annotation

Implementation Notes