drivers/acpi/acpica/exserial.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/exserial.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/exserial.c- Extension
.c- Size
- 10740 bytes
- Lines
- 369
- 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.
- 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
acpi/acpi.haccommon.hacdispat.hacinterp.hamlcode.h
Detected Declarations
function Copyrightfunction acpi_ex_write_gpiofunction GPIOfunction acpi_ex_read_serial_busfunction acpi_ex_write_serial_bus
Annotated Snippet
if (accessor_type == AML_FIELD_ATTRIB_RAW_PROCESS_BYTES) {
ACPI_ERROR((AE_INFO,
"Invalid direct read using bidirectional write-then-read protocol"));
return_ACPI_STATUS(AE_AML_PROTOCOL);
}
status =
acpi_ex_get_protocol_buffer_length(accessor_type,
&buffer_length);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO,
"Invalid protocol ID for GSBus: 0x%4.4X",
accessor_type));
return_ACPI_STATUS(status);
}
/* Add header length to get the full size of the buffer */
buffer_length += ACPI_SERIAL_HEADER_SIZE;
function = ACPI_READ | (accessor_type << 16);
break;
case ACPI_ADR_SPACE_PLATFORM_RT:
buffer_length = ACPI_PRM_INPUT_BUFFER_SIZE;
function = ACPI_READ;
break;
case ACPI_ADR_SPACE_FIXED_HARDWARE:
buffer_length = ACPI_FFH_INPUT_BUFFER_SIZE;
function = ACPI_READ;
break;
default:
return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
}
/* Create the local transfer buffer that is returned to the caller */
buffer_desc = acpi_ut_create_buffer_object(buffer_length);
if (!buffer_desc) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
/* Lock entire transaction if requested */
acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
/* Call the region handler for the write-then-read */
status = acpi_ex_access_region(obj_desc, 0,
ACPI_CAST_PTR(u64,
buffer_desc->buffer.
pointer), function);
acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
*return_buffer = buffer_desc;
return_ACPI_STATUS(status);
}
/*******************************************************************************
*
* FUNCTION: acpi_ex_write_serial_bus
*
* PARAMETERS: source_desc - Contains data to write
* obj_desc - The named field
* return_buffer - Where the return value is returned, if any
*
* RETURN: Status
*
* DESCRIPTION: Write to a named field that references a serial bus
* (SMBus, IPMI, GSBus).
*
******************************************************************************/
acpi_status
acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
union acpi_operand_object *obj_desc,
union acpi_operand_object **return_buffer)
{
acpi_status status;
u32 buffer_length;
u32 data_length;
void *buffer;
union acpi_operand_object *buffer_desc;
u32 function;
u16 accessor_type;
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acdispat.h`, `acinterp.h`, `amlcode.h`.
- Detected declarations: `function Copyright`, `function acpi_ex_write_gpio`, `function GPIO`, `function acpi_ex_read_serial_bus`, `function acpi_ex_write_serial_bus`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.