drivers/parisc/gsc.c
Source file repositories/reference/linux-study-clean/drivers/parisc/gsc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/parisc/gsc.c- Extension
.c- Size
- 6107 bytes
- Lines
- 263
- Domain
- Driver Families
- Bucket
- drivers/parisc
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/errno.hlinux/init.hlinux/interrupt.hlinux/ioport.hlinux/module.hlinux/types.hasm/hardware.hasm/io.hgsc.h
Detected Declarations
struct gsc_fixup_structfunction gsc_alloc_irqfunction gsc_claim_irqfunction gsc_asic_intrfunction gsc_find_local_irqfunction gsc_asic_mask_irqfunction gsc_asic_unmask_irqfunction gsc_set_affinity_irqfunction gsc_assign_irqfunction gsc_asic_assign_irqfunction gsc_fixup_irqs_callbackfunction gsc_fixup_irqsfunction gsc_common_setupexport gsc_alloc_irqexport gsc_claim_irq
Annotated Snippet
struct gsc_fixup_struct {
void (*choose_irq)(struct parisc_device *, void *);
void *ctrl;
};
static int gsc_fixup_irqs_callback(struct device *dev, void *data)
{
struct parisc_device *padev = to_parisc_device(dev);
struct gsc_fixup_struct *gf = data;
/* work-around for 715/64 and others which have parent
at path [5] and children at path [5/0/x] */
if (padev->id.hw_type == HPHW_FAULTY)
gsc_fixup_irqs(padev, gf->ctrl, gf->choose_irq);
gf->choose_irq(padev, gf->ctrl);
return 0;
}
void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl,
void (*choose_irq)(struct parisc_device *, void *))
{
struct gsc_fixup_struct data = {
.choose_irq = choose_irq,
.ctrl = ctrl,
};
device_for_each_child(&parent->dev, &data, gsc_fixup_irqs_callback);
}
int gsc_common_setup(struct parisc_device *parent, struct gsc_asic *gsc_asic)
{
struct resource *res;
int i;
gsc_asic->gsc = parent;
/* Initialise local irq -> global irq mapping */
for (i = 0; i < 32; i++) {
gsc_asic->global_irq[i] = NO_IRQ;
}
/* allocate resource region */
res = request_mem_region(gsc_asic->hpa, 0x100000, gsc_asic->name);
if (res) {
res->flags = IORESOURCE_MEM; /* do not mark it busy ! */
}
#if 0
printk(KERN_WARNING "%s IRQ %d EIM 0x%x", gsc_asic->name,
parent->irq, gsc_asic->eim);
if (gsc_readl(gsc_asic->hpa + OFFSET_IMR))
printk(" IMR is non-zero! (0x%x)",
gsc_readl(gsc_asic->hpa + OFFSET_IMR));
printk("\n");
#endif
return 0;
}
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/errno.h`, `linux/init.h`, `linux/interrupt.h`, `linux/ioport.h`, `linux/module.h`, `linux/types.h`, `asm/hardware.h`.
- Detected declarations: `struct gsc_fixup_struct`, `function gsc_alloc_irq`, `function gsc_claim_irq`, `function gsc_asic_intr`, `function gsc_find_local_irq`, `function gsc_asic_mask_irq`, `function gsc_asic_unmask_irq`, `function gsc_set_affinity_irq`, `function gsc_assign_irq`, `function gsc_asic_assign_irq`.
- Atlas domain: Driver Families / drivers/parisc.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.