arch/sparc/kernel/smp_32.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/smp_32.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/smp_32.c- Extension
.c- Size
- 7536 bytes
- Lines
- 390
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/head.hlinux/kernel.hlinux/sched.hlinux/threads.hlinux/smp.hlinux/interrupt.hlinux/kernel_stat.hlinux/init.hlinux/spinlock.hlinux/mm.hlinux/fs.hlinux/seq_file.hlinux/cache.hlinux/delay.hlinux/profile.hlinux/cpu.hasm/ptrace.hlinux/atomic.hasm/irq.hasm/page.hasm/oplib.hasm/cacheflush.hasm/tlbflush.hasm/cpudata.hasm/timer.hasm/leon.hkernel.hirq.h
Detected Declarations
function smp_store_cpu_infofunction smp_cpus_donefunction for_each_online_cpufunction cpu_panicfunction arch_smp_send_reschedulefunction smp_send_stopfunction arch_send_call_function_ipi_maskfunction smp_resched_interruptfunction smp_call_function_single_interruptfunction smp_call_function_interruptfunction smp_prepare_cpusfunction smp_setup_cpu_possible_mapfunction smp_prepare_boot_cpufunction __cpu_upfunction arch_cpu_pre_startingfunction arch_cpu_pre_onlinefunction sparc_start_secondaryfunction smp_callinfunction smp_bogofunction for_each_online_cpufunction smp_info
Annotated Snippet
if (mid < NR_CPUS) {
set_cpu_possible(mid, true);
set_cpu_present(mid, true);
}
instance++;
}
}
void __init smp_prepare_boot_cpu(void)
{
int cpuid = hard_smp_processor_id();
if (cpuid >= NR_CPUS) {
prom_printf("Serious problem, boot cpu id >= NR_CPUS\n");
prom_halt();
}
if (cpuid != 0)
printk("boot cpu id != 0, this could work but is untested\n");
current_thread_info()->cpu = cpuid;
set_cpu_online(cpuid, true);
set_cpu_possible(cpuid, true);
}
int __cpu_up(unsigned int cpu, struct task_struct *tidle)
{
int ret=0;
switch(sparc_cpu_model) {
case sun4m:
ret = smp4m_boot_one_cpu(cpu, tidle);
break;
case sun4d:
ret = smp4d_boot_one_cpu(cpu, tidle);
break;
case sparc_leon:
ret = leon_boot_one_cpu(cpu, tidle);
break;
case sun4e:
printk("SUN4E\n");
BUG();
break;
case sun4u:
printk("SUN4U\n");
BUG();
break;
default:
printk("UNKNOWN!\n");
BUG();
break;
}
if (!ret) {
cpumask_set_cpu(cpu, &smp_commenced_mask);
while (!cpu_online(cpu))
mb();
}
return ret;
}
static void arch_cpu_pre_starting(void *arg)
{
local_ops->cache_all();
local_ops->tlb_all();
switch(sparc_cpu_model) {
case sun4m:
sun4m_cpu_pre_starting(arg);
break;
case sun4d:
sun4d_cpu_pre_starting(arg);
break;
case sparc_leon:
leon_cpu_pre_starting(arg);
break;
default:
BUG();
}
}
static void arch_cpu_pre_online(void *arg)
{
unsigned int cpuid = hard_smp_processor_id();
register_percpu_ce(cpuid);
calibrate_delay();
smp_store_cpu_info(cpuid);
local_ops->cache_all();
Annotation
- Immediate include surface: `asm/head.h`, `linux/kernel.h`, `linux/sched.h`, `linux/threads.h`, `linux/smp.h`, `linux/interrupt.h`, `linux/kernel_stat.h`, `linux/init.h`.
- Detected declarations: `function smp_store_cpu_info`, `function smp_cpus_done`, `function for_each_online_cpu`, `function cpu_panic`, `function arch_smp_send_reschedule`, `function smp_send_stop`, `function arch_send_call_function_ipi_mask`, `function smp_resched_interrupt`, `function smp_call_function_single_interrupt`, `function smp_call_function_interrupt`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: source 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.