drivers/acpi/acpica/evgpe.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/evgpe.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/evgpe.c- Extension
.c- Size
- 24413 bytes
- Lines
- 850
- 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.hacnamesp.h
Detected Declarations
function acpi_ev_update_gpe_enable_maskfunction acpi_ev_enable_gpefunction acpi_ev_mask_gpefunction acpi_ev_add_gpe_referencefunction acpi_ev_remove_gpe_referencefunction acpi_ev_gpe_detectfunction acpi_ev_asynch_execute_gpe_methodfunction completefunction acpi_ev_finish_gpefunction acpi_ev_detect_gpefunction methodfunction GPE
Annotated Snippet
if (register_bit & gpe_register_info->mask_for_run) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
(void)acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
ACPI_SET_BIT(gpe_register_info->mask_for_run, (u8)register_bit);
} else {
if (!(register_bit & gpe_register_info->mask_for_run)) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
ACPI_CLEAR_BIT(gpe_register_info->mask_for_run,
(u8)register_bit);
if (gpe_event_info->runtime_count
&& !gpe_event_info->disable_for_dispatch) {
(void)acpi_hw_low_set_gpe(gpe_event_info,
ACPI_GPE_ENABLE);
}
}
return_ACPI_STATUS(AE_OK);
}
/*******************************************************************************
*
* FUNCTION: acpi_ev_add_gpe_reference
*
* PARAMETERS: gpe_event_info - Add a reference to this GPE
* clear_on_enable - Clear GPE status before enabling it
*
* RETURN: Status
*
* DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
* hardware-enabled.
*
******************************************************************************/
acpi_status
acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info,
u8 clear_on_enable)
{
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(ev_add_gpe_reference);
if (gpe_event_info->runtime_count == ACPI_UINT8_MAX) {
return_ACPI_STATUS(AE_LIMIT);
}
gpe_event_info->runtime_count++;
if (gpe_event_info->runtime_count == 1) {
/* Enable on first reference */
if (clear_on_enable) {
(void)acpi_hw_clear_gpe(gpe_event_info);
}
status = acpi_ev_update_gpe_enable_mask(gpe_event_info);
if (ACPI_SUCCESS(status)) {
status = acpi_ev_enable_gpe(gpe_event_info);
}
if (ACPI_FAILURE(status)) {
gpe_event_info->runtime_count--;
}
}
return_ACPI_STATUS(status);
}
/*******************************************************************************
*
* FUNCTION: acpi_ev_remove_gpe_reference
*
* PARAMETERS: gpe_event_info - Remove a reference to this GPE
*
* RETURN: Status
*
* DESCRIPTION: Remove a reference to a GPE. When the last reference is
* removed, the GPE is hardware-disabled.
*
******************************************************************************/
acpi_status
acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)
{
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(ev_remove_gpe_reference);
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acevents.h`, `acnamesp.h`.
- Detected declarations: `function acpi_ev_update_gpe_enable_mask`, `function acpi_ev_enable_gpe`, `function acpi_ev_mask_gpe`, `function acpi_ev_add_gpe_reference`, `function acpi_ev_remove_gpe_reference`, `function acpi_ev_gpe_detect`, `function acpi_ev_asynch_execute_gpe_method`, `function complete`, `function acpi_ev_finish_gpe`, `function acpi_ev_detect_gpe`.
- 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.