arch/powerpc/kernel/setup-common.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/setup-common.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/setup-common.c- Extension
.c- Size
- 25914 bytes
- Lines
- 1024
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/panic_notifier.hlinux/string.hlinux/sched.hlinux/init.hlinux/kernel.hlinux/reboot.hlinux/delay.hlinux/initrd.hlinux/platform_device.hlinux/printk.hlinux/seq_file.hlinux/ioport.hlinux/console.hlinux/root_dev.hlinux/cpu.hlinux/unistd.hlinux/seq_buf.hlinux/serial.hlinux/serial_8250.hlinux/percpu.hlinux/memblock.hlinux/of.hlinux/of_fdt.hlinux/of_irq.hlinux/hugetlb.hlinux/pgtable.hasm/io.hasm/paca.hasm/processor.hasm/vdso_datapage.hasm/smp.h
Detected Declarations
function machine_shutdownfunction machine_hangfunction machine_restartfunction machine_power_offfunction arch_get_random_seed_longsfunction machine_haltfunction show_cpuinfo_summaryfunction show_cpuinfofunction c_stopfunction check_for_initrdfunction cpu_init_thread_core_mapsfunction assign_threadsfunction smp_setup_cpu_mapsfunction for_each_node_by_typefunction add_pcspkrfunction probe_machinefunction check_legacy_ioportfunction ppc_panic_fadump_handlerfunction dump_kernel_offsetfunction ppc_panic_platform_handlerfunction setup_panicfunction BUGfunction ppc_printk_progressfunction print_system_infofunction smp_setup_pacasfunction for_each_possible_cpufunction setup_archmodule init add_pcspkrexport ppc_mdexport machine_idexport boot_cpuidexport of_i8042_kbd_irqexport of_i8042_aux_irqexport ppc_do_canonicalize_irqsexport machine_power_offexport pm_power_offexport arch_get_random_seed_longsexport threads_per_coreexport threads_per_subcoreexport threads_shiftexport threads_core_maskexport check_legacy_ioport
Annotated Snippet
* Called into from start_kernel this initializes memblock, which is used
* to manage page allocation until mem_init is called.
*/
void __init setup_arch(char **cmdline_p)
{
kasan_init();
*cmdline_p = boot_command_line;
/* Set a half-reasonable default so udelay does something sensible */
loops_per_jiffy = 500000000 / HZ;
/* Unflatten the device-tree passed by prom_init or kexec */
unflatten_device_tree();
/*
* Initialize cache line/block info from device-tree (on ppc64) or
* just cputable (on ppc32).
*/
initialize_cache_info();
/* Initialize RTAS if available. */
rtas_initialize();
/* Check if we have an initrd provided via the device-tree. */
check_for_initrd();
/* Probe the machine type, establish ppc_md. */
probe_machine();
/* Setup panic notifier if requested by the platform. */
setup_panic();
/*
* Configure ppc_md.power_save (ppc32 only, 64-bit machines do
* it from their respective probe() function.
*/
setup_power_save();
/* Discover standard serial ports. */
find_legacy_serial_ports();
/* Register early console with the printk subsystem. */
register_early_udbg_console();
/* Setup the various CPU maps based on the device-tree. */
smp_setup_cpu_maps();
/* Initialize xmon. */
xmon_setup();
/* Check the SMT related command line arguments (ppc64). */
check_smt_enabled();
/* Parse memory topology */
mem_topology_setup();
high_memory = (void *)__va(max_low_pfn * PAGE_SIZE);
/*
* Release secondary cpus out of their spinloops at 0x60 now that
* we can map physical -> logical CPU ids.
*
* Freescale Book3e parts spin in a loop provided by firmware,
* so smp_release_cpus() does nothing for them.
*/
#ifdef CONFIG_SMP
smp_setup_pacas();
/* On BookE, setup per-core TLB data structures. */
setup_tlb_core_data();
#endif
/* Print various info about the machine that has been gathered so far. */
print_system_info();
klp_init_thread_info(&init_task);
setup_initial_init_mm(_stext, _etext, _edata, _end);
/* sched_init() does the mmgrab(&init_mm) for the primary CPU */
VM_WARN_ON(cpumask_test_cpu(smp_processor_id(), mm_cpumask(&init_mm)));
cpumask_set_cpu(smp_processor_id(), mm_cpumask(&init_mm));
inc_mm_active_cpus(&init_mm);
mm_iommu_init(&init_mm);
irqstack_early_init();
exc_lvl_early_init();
emergency_stack_init();
mce_init();
smp_release_cpus();
Annotation
- Immediate include surface: `linux/export.h`, `linux/panic_notifier.h`, `linux/string.h`, `linux/sched.h`, `linux/init.h`, `linux/kernel.h`, `linux/reboot.h`, `linux/delay.h`.
- Detected declarations: `function machine_shutdown`, `function machine_hang`, `function machine_restart`, `function machine_power_off`, `function arch_get_random_seed_longs`, `function machine_halt`, `function show_cpuinfo_summary`, `function show_cpuinfo`, `function c_stop`, `function check_for_initrd`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.