arch/csky/kernel/process.c
Source file repositories/reference/linux-study-clean/arch/csky/kernel/process.c
File Facts
- System
- Linux kernel
- Corpus path
arch/csky/kernel/process.c- Extension
.c- Size
- 2444 bytes
- Lines
- 105
- Domain
- Architecture Layer
- Bucket
- arch/csky
- 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/module.hlinux/sched.hlinux/sched/task_stack.hlinux/sched/debug.hlinux/delay.hlinux/kallsyms.hlinux/uaccess.hlinux/ptrace.hlinux/elfcore.hasm/elf.habi/reg_ops.hlinux/stackprotector.h
Detected Declarations
function flush_threadfunction elf_core_copy_task_fpregsfunction dump_task_regsfunction arch_cpu_idleexport __stack_chk_guard
Annotated Snippet
void flush_thread(void){}
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
{
u64 clone_flags = args->flags;
unsigned long usp = args->stack;
unsigned long tls = args->tls;
struct switch_stack *childstack;
struct pt_regs *childregs = task_pt_regs(p);
#ifdef CONFIG_CPU_HAS_FPU
save_to_user_fp(&p->thread.user_fp);
#endif
childstack = ((struct switch_stack *) childregs) - 1;
memset(childstack, 0, sizeof(struct switch_stack));
/* setup thread.sp for switch_to !!! */
p->thread.sp = (unsigned long)childstack;
if (unlikely(args->fn)) {
memset(childregs, 0, sizeof(struct pt_regs));
childstack->r15 = (unsigned long) ret_from_kernel_thread;
childstack->r10 = (unsigned long) args->fn_arg;
childstack->r9 = (unsigned long) args->fn;
childregs->sr = mfcr("psr");
} else {
*childregs = *(current_pt_regs());
if (usp)
childregs->usp = usp;
if (clone_flags & CLONE_SETTLS)
task_thread_info(p)->tp_value = childregs->tls
= tls;
childregs->a0 = 0;
childstack->r15 = (unsigned long) ret_from_fork;
}
return 0;
}
/* Fill in the fpu structure for a core dump. */
int elf_core_copy_task_fpregs(struct task_struct *t, elf_fpregset_t *fpu)
{
memcpy(fpu, ¤t->thread.user_fp, sizeof(*fpu));
return 1;
}
int dump_task_regs(struct task_struct *tsk, elf_gregset_t *pr_regs)
{
struct pt_regs *regs = task_pt_regs(tsk);
/* NOTE: usp is error value. */
ELF_CORE_COPY_REGS((*pr_regs), regs)
return 1;
}
#ifndef CONFIG_CPU_PM_NONE
void arch_cpu_idle(void)
{
#ifdef CONFIG_CPU_PM_WAIT
asm volatile("wait\n");
#endif
#ifdef CONFIG_CPU_PM_DOZE
asm volatile("doze\n");
#endif
#ifdef CONFIG_CPU_PM_STOP
asm volatile("stop\n");
#endif
}
#endif
Annotation
- Immediate include surface: `linux/module.h`, `linux/sched.h`, `linux/sched/task_stack.h`, `linux/sched/debug.h`, `linux/delay.h`, `linux/kallsyms.h`, `linux/uaccess.h`, `linux/ptrace.h`.
- Detected declarations: `function flush_thread`, `function elf_core_copy_task_fpregs`, `function dump_task_regs`, `function arch_cpu_idle`, `export __stack_chk_guard`.
- Atlas domain: Architecture Layer / arch/csky.
- 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.