arch/powerpc/platforms/powermac/setup.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/powermac/setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/powermac/setup.c- Extension
.c- Size
- 13692 bytes
- Lines
- 600
- 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/init.hlinux/errno.hlinux/sched.hlinux/kernel.hlinux/mm.hlinux/stddef.hlinux/unistd.hlinux/ptrace.hlinux/export.hlinux/user.hlinux/string.hlinux/delay.hlinux/ioport.hlinux/major.hlinux/initrd.hlinux/console.hlinux/pci.hlinux/adb.hlinux/cuda.hlinux/pmu.hlinux/irq.hlinux/seq_file.hlinux/root_dev.hlinux/bitops.hlinux/suspend.hlinux/string_choices.hlinux/of.hlinux/of_platform.hasm/reg.hasm/sections.hasm/io.hasm/pci-bridge.h
Detected Declarations
function pmac_show_cpuinfofunction find_via_cudafunction find_via_pmufunction smu_initfunction ohare_initfunction l2cr_initfunction for_each_of_cpu_nodefunction pmac_setup_archfunction for_each_of_cpu_nodefunction pmac_late_initfunction note_bootable_partfunction cuda_restartfunction cuda_shutdownfunction pmac_restartfunction pmac_power_offfunction pmac_haltfunction pmac_initfunction pmac_declare_of_platform_devicesfunction time_initfunction pmac_probeexport sys_ctrler
Annotated Snippet
if (pp != NULL) {
seq_printf(m, "motherboard\t:");
while (plen > 0) {
int l = strlen(pp) + 1;
seq_printf(m, " %s", pp);
plen -= l;
pp += l;
}
seq_printf(m, "\n");
}
of_node_put(np);
} else
seq_printf(m, "PowerMac\n");
/* print parsed model */
seq_printf(m, "detected as\t: %d (%s)\n", mbmodel, mbname);
seq_printf(m, "pmac flags\t: %08x\n", mbflags);
/* find l2 cache info */
np = of_find_node_by_name(NULL, "l2-cache");
if (np == NULL)
np = of_find_node_by_type(NULL, "cache");
if (np != NULL) {
const unsigned int *ic =
of_get_property(np, "i-cache-size", NULL);
const unsigned int *dc =
of_get_property(np, "d-cache-size", NULL);
seq_printf(m, "L2 cache\t:");
has_l2cache = 1;
if (of_property_read_bool(np, "cache-unified") && dc) {
seq_printf(m, " %dK unified", *dc / 1024);
} else {
if (ic)
seq_printf(m, " %dK instruction", *ic / 1024);
if (dc)
seq_printf(m, "%s %dK data",
(ic? " +": ""), *dc / 1024);
}
pp = of_get_property(np, "ram-type", NULL);
if (pp)
seq_printf(m, " %s", pp);
seq_printf(m, "\n");
of_node_put(np);
}
/* Indicate newworld/oldworld */
seq_printf(m, "pmac-generation\t: %s\n",
pmac_newworld ? "NewWorld" : "OldWorld");
}
#ifndef CONFIG_ADB_CUDA
int __init find_via_cuda(void)
{
struct device_node *dn = of_find_node_by_name(NULL, "via-cuda");
if (!dn)
return 0;
of_node_put(dn);
printk("WARNING ! Your machine is CUDA-based but your kernel\n");
printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n");
return 0;
}
#endif
#ifndef CONFIG_ADB_PMU
int __init find_via_pmu(void)
{
struct device_node *dn = of_find_node_by_name(NULL, "via-pmu");
if (!dn)
return 0;
of_node_put(dn);
printk("WARNING ! Your machine is PMU-based but your kernel\n");
printk(" wasn't compiled with CONFIG_ADB_PMU option !\n");
return 0;
}
#endif
#ifndef CONFIG_PMAC_SMU
int __init smu_init(void)
{
/* should check and warn if SMU is present */
return 0;
}
#endif
#ifdef CONFIG_PPC32
static volatile u32 *sysctrl_regs;
static void __init ohare_init(void)
Annotation
- Immediate include surface: `linux/init.h`, `linux/errno.h`, `linux/sched.h`, `linux/kernel.h`, `linux/mm.h`, `linux/stddef.h`, `linux/unistd.h`, `linux/ptrace.h`.
- Detected declarations: `function pmac_show_cpuinfo`, `function find_via_cuda`, `function find_via_pmu`, `function smu_init`, `function ohare_init`, `function l2cr_init`, `function for_each_of_cpu_node`, `function pmac_setup_arch`, `function for_each_of_cpu_node`, `function pmac_late_init`.
- 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.