drivers/acpi/acpica/hwgpe.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/hwgpe.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/hwgpe.c- Extension
.c- Size
- 18406 bytes
- Lines
- 684
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
acpi/acpi.haccommon.hacevents.h
Detected Declarations
struct acpi_gpe_block_status_contextfunction acpi_hw_gpe_readfunction acpi_hw_gpe_writefunction acpi_hw_get_gpe_register_bitfunction acpi_hw_low_set_gpefunction acpi_hw_clear_gpefunction acpi_hw_get_gpe_statusfunction acpi_hw_gpe_enable_writefunction acpi_hw_disable_gpe_blockfunction acpi_hw_clear_gpe_blockfunction acpi_hw_enable_runtime_gpe_blockfunction acpi_hw_enable_wakeup_gpe_blockfunction acpi_hw_get_gpe_block_statusfunction acpi_hw_disable_all_gpesfunction acpi_hw_enable_all_runtime_gpesfunction acpi_hw_enable_all_wakeup_gpesfunction acpi_hw_check_all_gpes
Annotated Snippet
struct acpi_gpe_block_status_context {
struct acpi_gpe_register_info *gpe_skip_register_info;
u8 gpe_skip_mask;
u8 retval;
};
/******************************************************************************
*
* FUNCTION: acpi_hw_get_gpe_block_status
*
* PARAMETERS: gpe_xrupt_info - GPE Interrupt info
* gpe_block - Gpe Block info
* context - GPE list walk context data
*
* RETURN: Success
*
* DESCRIPTION: Produce a combined GPE status bits mask for the given block.
*
******************************************************************************/
static acpi_status
acpi_hw_get_gpe_block_status(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block,
void *context)
{
struct acpi_gpe_block_status_context *c = context;
struct acpi_gpe_register_info *gpe_register_info;
u64 in_enable, in_status;
acpi_status status;
u8 ret_mask;
u32 i;
/* Examine each GPE Register within the block */
for (i = 0; i < gpe_block->register_count; i++) {
gpe_register_info = &gpe_block->register_info[i];
status = acpi_hw_gpe_read(&in_enable,
&gpe_register_info->enable_address);
if (ACPI_FAILURE(status)) {
continue;
}
status = acpi_hw_gpe_read(&in_status,
&gpe_register_info->status_address);
if (ACPI_FAILURE(status)) {
continue;
}
ret_mask = in_enable & in_status;
if (ret_mask && c->gpe_skip_register_info == gpe_register_info) {
ret_mask &= ~c->gpe_skip_mask;
}
c->retval |= ret_mask;
}
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: acpi_hw_disable_all_gpes
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Disable and clear all GPEs in all GPE blocks
*
******************************************************************************/
acpi_status acpi_hw_disable_all_gpes(void)
{
acpi_status status;
ACPI_FUNCTION_TRACE(hw_disable_all_gpes);
status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
return_ACPI_STATUS(status);
}
/******************************************************************************
*
* FUNCTION: acpi_hw_enable_all_runtime_gpes
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acevents.h`.
- Detected declarations: `struct acpi_gpe_block_status_context`, `function acpi_hw_gpe_read`, `function acpi_hw_gpe_write`, `function acpi_hw_get_gpe_register_bit`, `function acpi_hw_low_set_gpe`, `function acpi_hw_clear_gpe`, `function acpi_hw_get_gpe_status`, `function acpi_hw_gpe_enable_write`, `function acpi_hw_disable_gpe_block`, `function acpi_hw_clear_gpe_block`.
- 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.