arch/powerpc/sysdev/xics/icp-opal.c
Source file repositories/reference/linux-study-clean/arch/powerpc/sysdev/xics/icp-opal.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/sysdev/xics/icp-opal.c- Extension
.c- Size
- 4441 bytes
- Lines
- 203
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/types.hlinux/kernel.hlinux/irq.hlinux/smp.hlinux/interrupt.hlinux/irqdomain.hlinux/cpu.hlinux/of.hasm/smp.hasm/irq.hasm/errno.hasm/xics.hasm/io.hasm/opal.hasm/kvm_ppc.h
Detected Declarations
function icp_opal_teardown_cpufunction icp_opal_flush_ipifunction icp_opal_get_xirrfunction icp_opal_get_irqfunction icp_opal_set_cpu_priorityfunction icp_opal_eoifunction icp_opal_cause_ipifunction icp_opal_ipi_actionfunction icp_opal_flush_interruptfunction icp_opal_init
Annotated Snippet
if (vec == XICS_IPI) {
/* Clear pending IPI */
int cpu = smp_processor_id();
kvmppc_clear_host_ipi(cpu);
opal_int_set_mfrr(get_hard_smp_processor_id(cpu), 0xff);
} else {
pr_err("XICS: hw interrupt 0x%x to offline cpu, "
"disabling\n", vec);
xics_mask_unknown_vec(vec);
}
/* EOI the interrupt */
} while (opal_int_eoi(xirr) > 0);
}
#endif /* CONFIG_SMP */
static const struct icp_ops icp_opal_ops = {
.get_irq = icp_opal_get_irq,
.eoi = icp_opal_eoi,
.set_priority = icp_opal_set_cpu_priority,
.teardown_cpu = icp_opal_teardown_cpu,
.flush_ipi = icp_opal_flush_ipi,
#ifdef CONFIG_SMP
.ipi_action = icp_opal_ipi_action,
.cause_ipi = icp_opal_cause_ipi,
#endif
};
int __init icp_opal_init(void)
{
struct device_node *np;
np = of_find_compatible_node(NULL, NULL, "ibm,opal-intc");
if (!np)
return -ENODEV;
icp_ops = &icp_opal_ops;
printk("XICS: Using OPAL ICP fallbacks\n");
of_node_put(np);
return 0;
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/irq.h`, `linux/smp.h`, `linux/interrupt.h`, `linux/irqdomain.h`, `linux/cpu.h`, `linux/of.h`.
- Detected declarations: `function icp_opal_teardown_cpu`, `function icp_opal_flush_ipi`, `function icp_opal_get_xirr`, `function icp_opal_get_irq`, `function icp_opal_set_cpu_priority`, `function icp_opal_eoi`, `function icp_opal_cause_ipi`, `function icp_opal_ipi_action`, `function icp_opal_flush_interrupt`, `function icp_opal_init`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source 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.