drivers/acpi/acpica/evxface.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpica/evxface.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpica/evxface.c- Extension
.c- Size
- 30630 bytes
- Lines
- 1080
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
acpi/acpi.haccommon.hacnamesp.hacevents.hacinterp.h
Detected Declarations
function notifyfunction acpi_remove_notify_handlerfunction acpi_install_exception_handlerfunction acpi_install_sci_handlerfunction acpi_remove_sci_handlerfunction acpi_install_global_event_handlerfunction acpi_install_fixed_event_handlerfunction acpi_remove_fixed_event_handlerfunction acpi_ev_install_gpe_handlerfunction acpi_install_gpe_handlerfunction acpi_install_gpe_raw_handlerfunction acpi_remove_gpe_handlerfunction acpi_acquire_global_lockfunction acpi_release_global_lock
Annotated Snippet
if (handler_type & (i + 1)) {
if (acpi_gbl_global_notify[i].handler) {
status = AE_ALREADY_EXISTS;
goto unlock_and_exit;
}
acpi_gbl_global_notify[i].handler = handler;
acpi_gbl_global_notify[i].context = context;
}
}
goto unlock_and_exit; /* Global notify handler installed, all done */
}
/*
* All Other Objects:
* Caller will only receive notifications specific to the target
* object. Note that only certain object types are allowed to
* receive notifications.
*/
/* Are Notifies allowed on this object? */
if (!acpi_ev_is_notify_object(node)) {
status = AE_TYPE;
goto unlock_and_exit;
}
/* Check for an existing internal object, might not exist */
obj_desc = acpi_ns_get_attached_object(node);
if (!obj_desc) {
/* Create a new object */
obj_desc = acpi_ut_create_internal_object(node->type);
if (!obj_desc) {
status = AE_NO_MEMORY;
goto unlock_and_exit;
}
/* Attach new object to the Node, remove local reference */
status = acpi_ns_attach_object(device, obj_desc, node->type);
acpi_ut_remove_reference(obj_desc);
if (ACPI_FAILURE(status)) {
goto unlock_and_exit;
}
}
/* Ensure that the handler is not already installed in the lists */
for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) {
if (handler_type & (i + 1)) {
handler_obj = obj_desc->common_notify.notify_list[i];
while (handler_obj) {
if (handler_obj->notify.handler == handler) {
status = AE_ALREADY_EXISTS;
goto unlock_and_exit;
}
handler_obj = handler_obj->notify.next[i];
}
}
}
/* Create and populate a new notify handler object */
handler_obj = acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_NOTIFY);
if (!handler_obj) {
status = AE_NO_MEMORY;
goto unlock_and_exit;
}
handler_obj->notify.node = node;
handler_obj->notify.handler_type = handler_type;
handler_obj->notify.handler = handler;
handler_obj->notify.context = context;
/* Install the handler at the list head(s) */
for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) {
if (handler_type & (i + 1)) {
handler_obj->notify.next[i] =
obj_desc->common_notify.notify_list[i];
obj_desc->common_notify.notify_list[i] = handler_obj;
}
}
Annotation
- Immediate include surface: `acpi/acpi.h`, `accommon.h`, `acnamesp.h`, `acevents.h`, `acinterp.h`.
- Detected declarations: `function notify`, `function acpi_remove_notify_handler`, `function acpi_install_exception_handler`, `function acpi_install_sci_handler`, `function acpi_remove_sci_handler`, `function acpi_install_global_event_handler`, `function acpi_install_fixed_event_handler`, `function acpi_remove_fixed_event_handler`, `function acpi_ev_install_gpe_handler`, `function acpi_install_gpe_handler`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: integration 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.