arch/loongarch/kernel/process.c
Source file repositories/reference/linux-study-clean/arch/loongarch/kernel/process.c
File Facts
- System
- Linux kernel
- Corpus path
arch/loongarch/kernel/process.c- Extension
.c- Size
- 10267 bytes
- Lines
- 409
- Domain
- Architecture Layer
- Bucket
- arch/loongarch
- 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/cpu.hlinux/init.hlinux/kernel.hlinux/entry-common.hlinux/errno.hlinux/sched.hlinux/sched/debug.hlinux/sched/task.hlinux/sched/task_stack.hlinux/hw_breakpoint.hlinux/mm.hlinux/stddef.hlinux/unistd.hlinux/export.hlinux/ptrace.hlinux/mman.hlinux/personality.hlinux/sys.hlinux/completion.hlinux/kallsyms.hlinux/random.hlinux/prctl.hlinux/nmi.hasm/asm.hasm/asm-prototypes.hasm/bootinfo.hasm/cpu.hasm/elf.hasm/exec.hasm/fpu.hasm/lbt.hasm/io.h
Detected Declarations
function start_threadfunction flush_threadfunction exit_threadfunction ret_from_forkfunction ret_from_kernel_threadfunction copy_threadfunction __get_wchanfunction in_irq_stackfunction in_task_stackfunction get_stack_infofunction stack_topfunction arch_align_stackfunction handle_backtracefunction raise_backtracefunction for_each_cpufunction arch_trigger_cpumask_backtraceexport __stack_chk_guardexport boot_option_idle_override
Annotated Snippet
if (cpumask_test_and_set_cpu(cpu, &backtrace_csd_busy)) {
pr_warn("Unable to send backtrace IPI to CPU%u - perhaps it hung?\n",
cpu);
continue;
}
csd = &per_cpu(backtrace_csd, cpu);
csd->func = handle_backtrace;
smp_call_function_single_async(cpu, csd);
}
}
void arch_trigger_cpumask_backtrace(const cpumask_t *mask, int exclude_cpu)
{
nmi_trigger_cpumask_backtrace(mask, exclude_cpu, raise_backtrace);
}
#ifdef CONFIG_32BIT
void loongarch_dump_regs32(u32 *uregs, const struct pt_regs *regs)
#else
void loongarch_dump_regs64(u64 *uregs, const struct pt_regs *regs)
#endif
{
unsigned int i;
for (i = LOONGARCH_EF_R1; i <= LOONGARCH_EF_R31; i++) {
uregs[i] = regs->regs[i - LOONGARCH_EF_R0];
}
uregs[LOONGARCH_EF_ORIG_A0] = regs->orig_a0;
uregs[LOONGARCH_EF_CSR_ERA] = regs->csr_era;
uregs[LOONGARCH_EF_CSR_BADV] = regs->csr_badvaddr;
uregs[LOONGARCH_EF_CSR_CRMD] = regs->csr_crmd;
uregs[LOONGARCH_EF_CSR_PRMD] = regs->csr_prmd;
uregs[LOONGARCH_EF_CSR_EUEN] = regs->csr_euen;
uregs[LOONGARCH_EF_CSR_ECFG] = regs->csr_ecfg;
uregs[LOONGARCH_EF_CSR_ESTAT] = regs->csr_estat;
}
Annotation
- Immediate include surface: `linux/cpu.h`, `linux/init.h`, `linux/kernel.h`, `linux/entry-common.h`, `linux/errno.h`, `linux/sched.h`, `linux/sched/debug.h`, `linux/sched/task.h`.
- Detected declarations: `function start_thread`, `function flush_thread`, `function exit_thread`, `function ret_from_fork`, `function ret_from_kernel_thread`, `function copy_thread`, `function __get_wchan`, `function in_irq_stack`, `function in_task_stack`, `function get_stack_info`.
- Atlas domain: Architecture Layer / arch/loongarch.
- 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.