drivers/xen/acpi.c
Source file repositories/reference/linux-study-clean/drivers/xen/acpi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/xen/acpi.c- Extension
.c- Size
- 4410 bytes
- Lines
- 153
- Domain
- Driver Families
- Bucket
- drivers/xen
- 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
linux/pci.hxen/acpi.hxen/interface/platform.hasm/xen/hypercall.hasm/xen/hypervisor.h
Detected Declarations
struct acpi_prt_entryfunction filefunction xen_acpi_notify_hypervisor_sleepfunction xen_acpi_notify_hypervisor_extended_sleepfunction xen_acpi_get_gsi_infofunction xen_acpi_register_get_gsi_funcfunction xen_acpi_get_gsi_from_sbdfexport xen_acpi_get_gsi_infoexport xen_acpi_register_get_gsi_funcexport xen_acpi_get_gsi_from_sbdf
Annotated Snippet
struct acpi_prt_entry {
struct acpi_pci_id id;
u8 pin;
acpi_handle link;
u32 index;
};
int xen_acpi_get_gsi_info(struct pci_dev *dev,
int *gsi_out,
int *trigger_out,
int *polarity_out)
{
u32 gsi;
u8 pin;
struct acpi_prt_entry *entry;
int trigger = ACPI_LEVEL_SENSITIVE;
int ret, polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ?
ACPI_ACTIVE_HIGH : ACPI_ACTIVE_LOW;
if (!dev || !gsi_out || !trigger_out || !polarity_out)
return -EINVAL;
pin = dev->pin;
if (!pin)
return -EINVAL;
entry = acpi_pci_irq_lookup(dev, pin);
if (entry) {
ret = 0;
if (entry->link)
ret = acpi_pci_link_allocate_irq(entry->link,
entry->index,
&trigger, &polarity,
NULL, &gsi);
else
gsi = entry->index;
} else
ret = -ENODEV;
if (ret < 0)
return -EINVAL;
*gsi_out = gsi;
*trigger_out = trigger;
*polarity_out = polarity;
return 0;
}
EXPORT_SYMBOL_GPL(xen_acpi_get_gsi_info);
static get_gsi_from_sbdf_t get_gsi_from_sbdf;
static DEFINE_RWLOCK(get_gsi_from_sbdf_lock);
void xen_acpi_register_get_gsi_func(get_gsi_from_sbdf_t func)
{
write_lock(&get_gsi_from_sbdf_lock);
get_gsi_from_sbdf = func;
write_unlock(&get_gsi_from_sbdf_lock);
}
EXPORT_SYMBOL_GPL(xen_acpi_register_get_gsi_func);
int xen_acpi_get_gsi_from_sbdf(u32 sbdf)
{
int ret = -EOPNOTSUPP;
read_lock(&get_gsi_from_sbdf_lock);
if (get_gsi_from_sbdf)
ret = get_gsi_from_sbdf(sbdf);
read_unlock(&get_gsi_from_sbdf_lock);
return ret;
}
EXPORT_SYMBOL_GPL(xen_acpi_get_gsi_from_sbdf);
Annotation
- Immediate include surface: `linux/pci.h`, `xen/acpi.h`, `xen/interface/platform.h`, `asm/xen/hypercall.h`, `asm/xen/hypervisor.h`.
- Detected declarations: `struct acpi_prt_entry`, `function file`, `function xen_acpi_notify_hypervisor_sleep`, `function xen_acpi_notify_hypervisor_extended_sleep`, `function xen_acpi_get_gsi_info`, `function xen_acpi_register_get_gsi_func`, `function xen_acpi_get_gsi_from_sbdf`, `export xen_acpi_get_gsi_info`, `export xen_acpi_register_get_gsi_func`, `export xen_acpi_get_gsi_from_sbdf`.
- Atlas domain: Driver Families / drivers/xen.
- 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.