arch/sparc/kernel/process.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/process.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/process.c- Extension
.c- Size
- 3231 bytes
- Lines
- 135
- 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
linux/compat.hlinux/errno.hlinux/kernel.hlinux/ptrace.hlinux/sched.hlinux/sched/task.hlinux/sched/task_stack.hlinux/signal.hlinux/syscalls.hkernel.h
Detected Declarations
function sparc_forkfunction sparc_vforkfunction sparc_clonefunction sparc_clone3
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* This file handles the architecture independent parts of process handling..
*/
#include <linux/compat.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/sched/task.h>
#include <linux/sched/task_stack.h>
#include <linux/signal.h>
#include <linux/syscalls.h>
#include "kernel.h"
asmlinkage long sparc_fork(struct pt_regs *regs)
{
unsigned long orig_i1;
long ret;
struct kernel_clone_args args = {
.exit_signal = SIGCHLD,
};
synchronize_user_stack();
orig_i1 = regs->u_regs[UREG_I1];
/* Reuse the parent's stack for the child. */
args.stack = regs->u_regs[UREG_FP];
ret = kernel_clone(&args);
/* If we get an error and potentially restart the system
* call, we're screwed because copy_thread() clobbered
* the parent's %o1. So detect that case and restore it
* here.
*/
if ((unsigned long)ret >= -ERESTART_RESTARTBLOCK)
regs->u_regs[UREG_I1] = orig_i1;
return ret;
}
asmlinkage long sparc_vfork(struct pt_regs *regs)
{
unsigned long orig_i1;
long ret;
struct kernel_clone_args args = {
.flags = CLONE_VFORK | CLONE_VM,
.exit_signal = SIGCHLD,
};
synchronize_user_stack();
orig_i1 = regs->u_regs[UREG_I1];
/* Reuse the parent's stack for the child. */
args.stack = regs->u_regs[UREG_FP];
ret = kernel_clone(&args);
/* If we get an error and potentially restart the system
* call, we're screwed because copy_thread() clobbered
* the parent's %o1. So detect that case and restore it
* here.
*/
if ((unsigned long)ret >= -ERESTART_RESTARTBLOCK)
regs->u_regs[UREG_I1] = orig_i1;
return ret;
}
asmlinkage long sparc_clone(struct pt_regs *regs)
{
unsigned long orig_i1;
unsigned int flags;
long ret;
struct kernel_clone_args args = {0};
synchronize_user_stack();
orig_i1 = regs->u_regs[UREG_I1];
flags = lower_32_bits(regs->u_regs[UREG_I0]);
args.flags = (flags & ~CSIGNAL);
args.exit_signal = (flags & CSIGNAL);
args.tls = regs->u_regs[UREG_I3];
#ifdef CONFIG_COMPAT
if (test_thread_flag(TIF_32BIT)) {
Annotation
- Immediate include surface: `linux/compat.h`, `linux/errno.h`, `linux/kernel.h`, `linux/ptrace.h`, `linux/sched.h`, `linux/sched/task.h`, `linux/sched/task_stack.h`, `linux/signal.h`.
- Detected declarations: `function sparc_fork`, `function sparc_vfork`, `function sparc_clone`, `function sparc_clone3`.
- 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.