arch/powerpc/platforms/pseries/setup.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/setup.c- Extension
.c- Size
- 31335 bytes
- Lines
- 1166
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- 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/cpu.hlinux/errno.hlinux/platform_device.hlinux/sched.hlinux/kernel.hlinux/mm.hlinux/stddef.hlinux/unistd.hlinux/user.hlinux/tty.hlinux/major.hlinux/interrupt.hlinux/reboot.hlinux/init.hlinux/ioport.hlinux/console.hlinux/pci.hlinux/utsname.hlinux/adb.hlinux/export.hlinux/delay.hlinux/irq.hlinux/seq_file.hlinux/root_dev.hlinux/of.hlinux/of_irq.hlinux/of_pci.hlinux/memblock.hlinux/swiotlb.hlinux/seq_buf.hlinux/sched/cputime.hasm/mmu.h
Detected Declarations
enum rtas_iov_fw_value_mapenum get_iov_fw_value_indexfunction parse_no_stealaccfunction pSeries_show_cpuinfofunction fwnmi_initfunction for_each_possible_cpufunction pseries_wdt_initfunction pseries_8259_cascadefunction pseries_setup_i8259_cascadefunction for_each_node_by_typefunction pseries_init_irqfunction pseries_lpar_enable_pmcsfunction pci_dn_reconfig_notifierfunction alloc_dispatch_logsfunction alloc_dispatch_logsfunction alloc_dispatch_log_kmem_cachefunction pseries_lpar_idlefunction pseries_reloc_on_exceptionfunction pseries_enable_reloc_on_excfunction pseries_disable_reloc_on_excfunction pseries_big_endian_exceptionsfunction pseries_little_endian_exceptionsfunction pSeries_discover_phbsfunction for_each_child_of_nodefunction init_cpu_char_feature_flagsfunction pseries_setup_security_mitigationsfunction pseries_get_iov_fw_valuefunction of_pci_set_vf_bar_sizefunction of_pci_parse_iov_addrsfunction pseries_disable_sriov_resourcesfunction pseries_pci_fixup_resourcesfunction pseries_pci_fixup_iov_resourcesfunction pseries_pci_iov_resource_alignmentfunction pSeries_setup_archfunction pseries_panicfunction pSeries_init_panelfunction pseries_set_dabrfunction pseries_set_xdabrfunction pseries_set_dawrfunction pSeries_coalesce_initfunction pSeries_cmo_feature_initfunction pseries_add_hw_descriptionfunction pseries_initfunction pseries_power_offfunction pSeries_probefunction pSeries_pci_probe_modefunction pseries_memory_block_sizeexport shared_processor
Annotated Snippet
if (of_device_is_compatible(np, "chrp,iic")) {
found = np;
break;
}
}
if (found == NULL) {
printk(KERN_DEBUG "pic: no ISA interrupt controller\n");
return;
}
cascade = irq_of_parse_and_map(found, 0);
if (!cascade) {
printk(KERN_ERR "pic: failed to map cascade interrupt");
return;
}
pr_debug("pic: cascade mapped to irq %d\n", cascade);
for (old = of_node_get(found); old != NULL ; old = np) {
np = of_get_parent(old);
of_node_put(old);
if (np == NULL)
break;
if (!of_node_name_eq(np, "pci"))
continue;
addrp = of_get_property(np, "8259-interrupt-acknowledge", NULL);
if (addrp == NULL)
continue;
naddr = of_n_addr_cells(np);
intack = addrp[naddr-1];
if (naddr > 1)
intack |= ((unsigned long)addrp[naddr-2]) << 32;
}
if (intack)
printk(KERN_DEBUG "pic: PCI 8259 intack at 0x%016lx\n", intack);
i8259_init(found, intack);
of_node_put(found);
irq_set_chained_handler(cascade, pseries_8259_cascade);
}
static void __init pseries_init_irq(void)
{
/* Try using a XIVE if available, otherwise use a XICS */
if (!xive_spapr_init()) {
xics_init();
pseries_setup_i8259_cascade();
}
}
static void pseries_lpar_enable_pmcs(void)
{
unsigned long set, reset;
set = 1UL << 63;
reset = 0;
plpar_hcall_norets(H_PERFMON, set, reset);
}
static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *data)
{
struct of_reconfig_data *rd = data;
struct device_node *parent, *np = rd->dn;
struct pci_dn *pdn;
int err = NOTIFY_OK;
switch (action) {
case OF_RECONFIG_ATTACH_NODE:
parent = of_get_parent(np);
pdn = parent ? PCI_DN(parent) : NULL;
if (pdn)
pci_add_device_node_info(pdn->phb, np);
of_node_put(parent);
break;
case OF_RECONFIG_DETACH_NODE:
pdn = PCI_DN(np);
if (pdn)
list_del(&pdn->list);
break;
default:
err = NOTIFY_DONE;
break;
}
return err;
}
static struct notifier_block pci_dn_reconfig_nb = {
.notifier_call = pci_dn_reconfig_notifier,
};
Annotation
- Immediate include surface: `linux/cpu.h`, `linux/errno.h`, `linux/platform_device.h`, `linux/sched.h`, `linux/kernel.h`, `linux/mm.h`, `linux/stddef.h`, `linux/unistd.h`.
- Detected declarations: `enum rtas_iov_fw_value_map`, `enum get_iov_fw_value_index`, `function parse_no_stealacc`, `function pSeries_show_cpuinfo`, `function fwnmi_init`, `function for_each_possible_cpu`, `function pseries_wdt_init`, `function pseries_8259_cascade`, `function pseries_setup_i8259_cascade`, `function for_each_node_by_type`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.