arch/sparc/kernel/sun4m_smp.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/sun4m_smp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/sun4m_smp.c- Extension
.c- Size
- 6242 bytes
- Lines
- 276
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clockchips.hlinux/interrupt.hlinux/profile.hlinux/delay.hlinux/sched/mm.hlinux/cpu.hasm/cacheflush.hasm/switch_to.hasm/tlbflush.hasm/timer.hasm/oplib.hirq.hkernel.h
Detected Declarations
function Copyrightfunction sun4m_cpu_pre_startingfunction smp4m_boot_cpusfunction smp4m_boot_one_cpufunction smp4m_smp_donefunction sun4m_send_ipifunction sun4m_ipi_reschedfunction sun4m_ipi_singlefunction sun4m_ipi_mask_onefunction sun4m_cross_callfunction smp4m_cross_call_irqfunction smp4m_percpu_timer_interruptfunction sun4m_init_smp
Annotated Snippet
if (cpumask_test_cpu(i, &mask)) {
ccall_info.processors_in[i] = 0;
ccall_info.processors_out[i] = 0;
sun4m_send_ipi(i, IRQ_CROSS_CALL);
} else {
ccall_info.processors_in[i] = 1;
ccall_info.processors_out[i] = 1;
}
}
}
{
register int i;
i = 0;
do {
if (!cpumask_test_cpu(i, &mask))
continue;
while (!ccall_info.processors_in[i])
barrier();
} while (++i < ncpus);
i = 0;
do {
if (!cpumask_test_cpu(i, &mask))
continue;
while (!ccall_info.processors_out[i])
barrier();
} while (++i < ncpus);
}
spin_unlock_irqrestore(&cross_call_lock, flags);
}
/* Running cross calls. */
void smp4m_cross_call_irq(void)
{
void (*func)(unsigned long, unsigned long, unsigned long, unsigned long,
unsigned long) = ccall_info.func;
int i = smp_processor_id();
ccall_info.processors_in[i] = 1;
func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3, ccall_info.arg4,
ccall_info.arg5);
ccall_info.processors_out[i] = 1;
}
void smp4m_percpu_timer_interrupt(struct pt_regs *regs)
{
struct pt_regs *old_regs;
struct clock_event_device *ce;
int cpu = smp_processor_id();
old_regs = set_irq_regs(regs);
ce = &per_cpu(sparc32_clockevent, cpu);
if (clockevent_state_periodic(ce))
sun4m_clear_profile_irq(cpu);
else
sparc_config.load_profile_irq(cpu, 0); /* Is this needless? */
irq_enter();
ce->event_handler(ce);
irq_exit();
set_irq_regs(old_regs);
}
static const struct sparc32_ipi_ops sun4m_ipi_ops = {
.cross_call = sun4m_cross_call,
.resched = sun4m_ipi_resched,
.single = sun4m_ipi_single,
.mask_one = sun4m_ipi_mask_one,
};
void __init sun4m_init_smp(void)
{
sparc32_ipi_ops = &sun4m_ipi_ops;
}
Annotation
- Immediate include surface: `linux/clockchips.h`, `linux/interrupt.h`, `linux/profile.h`, `linux/delay.h`, `linux/sched/mm.h`, `linux/cpu.h`, `asm/cacheflush.h`, `asm/switch_to.h`.
- Detected declarations: `function Copyright`, `function sun4m_cpu_pre_starting`, `function smp4m_boot_cpus`, `function smp4m_boot_one_cpu`, `function smp4m_smp_done`, `function sun4m_send_ipi`, `function sun4m_ipi_resched`, `function sun4m_ipi_single`, `function sun4m_ipi_mask_one`, `function sun4m_cross_call`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: source 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.