arch/sparc/kernel/smp_64.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/smp_64.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/smp_64.c- Extension
.c- Size
- 36991 bytes
- Lines
- 1564
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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/kernel.hlinux/sched/mm.hlinux/sched/hotplug.hlinux/mm.hlinux/pagemap.hlinux/threads.hlinux/smp.hlinux/interrupt.hlinux/kernel_stat.hlinux/delay.hlinux/init.hlinux/spinlock.hlinux/fs.hlinux/seq_file.hlinux/cache.hlinux/jiffies.hlinux/profile.hlinux/memblock.hlinux/vmalloc.hlinux/ftrace.hlinux/cpu.hlinux/slab.hlinux/kgdb.hasm/head.hasm/ptrace.hlinux/atomic.hasm/tlbflush.hasm/mmu_context.hasm/cpudata.hasm/hvtramp.hasm/io.h
Detected Declarations
struct tlb_pending_infofunction smp_infofunction smp_bogofunction smp_callinfunction cpu_panicfunction get_deltafunction smp_synchronize_tick_clientfunction smp_synchronize_one_tickfunction ldom_startcpu_cpuidfunction smp_boot_one_cpufunction spitfire_xcall_helperfunction spitfire_xcall_deliverfunction featurefunction hypervisor_xcall_deliverfunction xcall_deliverfunction smp_cross_call_maskedfunction smp_cross_callfunction smp_start_sync_tick_clientfunction arch_send_call_function_ipi_maskfunction arch_send_call_function_single_ipifunction smp_call_function_clientfunction smp_call_function_single_clientfunction tsb_syncfunction smp_tsb_syncfunction __local_flush_dcache_foliofunction smp_flush_dcache_folio_implfunction flush_dcache_folio_allfunction kgdb_roundup_cpusfunction smp_fetch_global_regsfunction smp_fetch_global_pmufunction hasfunction tlb_pending_funcfunction smp_flush_tlb_pendingfunction smp_flush_tlb_pagefunction smp_flush_tlb_kernel_rangefunction smp_capturefunction smp_releasefunction smp_penguin_jailcellfunction smp_prepare_cpusfunction smp_fill_in_sib_core_mapsfunction for_each_present_cpufunction for_each_present_cpufunction for_each_present_cpufunction for_each_present_cpufunction for_each_present_cpufunction for_each_present_cpufunction __cpu_upfunction cpu_play_dead
Annotated Snippet
struct tlb_pending_info {
unsigned long ctx;
unsigned long nr;
unsigned long *vaddrs;
};
static void tlb_pending_func(void *info)
{
struct tlb_pending_info *t = info;
__flush_tlb_pending(t->ctx, t->nr, t->vaddrs);
}
void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long *vaddrs)
{
u32 ctx = CTX_HWBITS(mm->context);
struct tlb_pending_info info;
get_cpu();
info.ctx = ctx;
info.nr = nr;
info.vaddrs = vaddrs;
smp_call_function_many(mm_cpumask(mm), tlb_pending_func,
&info, 1);
__flush_tlb_pending(ctx, nr, vaddrs);
put_cpu();
}
void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
{
unsigned long context = CTX_HWBITS(mm->context);
get_cpu();
smp_cross_call_masked(&xcall_flush_tlb_page,
context, vaddr, 0,
mm_cpumask(mm));
__flush_tlb_page(context, vaddr);
put_cpu();
}
void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end)
{
start &= PAGE_MASK;
end = PAGE_ALIGN(end);
if (start != end) {
smp_cross_call(&xcall_flush_tlb_kernel_range,
0, start, end);
__flush_tlb_kernel_range(start, end);
}
}
/* CPU capture. */
/* #define CAPTURE_DEBUG */
extern unsigned long xcall_capture;
static atomic_t smp_capture_depth = ATOMIC_INIT(0);
static atomic_t smp_capture_registry = ATOMIC_INIT(0);
static unsigned long penguins_are_doing_time;
void smp_capture(void)
{
int result = atomic_add_return(1, &smp_capture_depth);
if (result == 1) {
int ncpus = num_online_cpus();
#ifdef CAPTURE_DEBUG
printk("CPU[%d]: Sending penguins to jail...",
smp_processor_id());
#endif
penguins_are_doing_time = 1;
atomic_inc(&smp_capture_registry);
smp_cross_call(&xcall_capture, 0, 0, 0);
while (atomic_read(&smp_capture_registry) != ncpus)
rmb();
#ifdef CAPTURE_DEBUG
printk("done\n");
#endif
}
}
void smp_release(void)
Annotation
- Immediate include surface: `linux/export.h`, `linux/kernel.h`, `linux/sched/mm.h`, `linux/sched/hotplug.h`, `linux/mm.h`, `linux/pagemap.h`, `linux/threads.h`, `linux/smp.h`.
- Detected declarations: `struct tlb_pending_info`, `function smp_info`, `function smp_bogo`, `function smp_callin`, `function cpu_panic`, `function get_delta`, `function smp_synchronize_tick_client`, `function smp_synchronize_one_tick`, `function ldom_startcpu_cpuid`, `function smp_boot_one_cpu`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.