arch/um/kernel/signal.c
Source file repositories/reference/linux-study-clean/arch/um/kernel/signal.c
File Facts
- System
- Linux kernel
- Corpus path
arch/um/kernel/signal.c- Extension
.c- Size
- 2876 bytes
- Lines
- 130
- Domain
- Architecture Layer
- Bucket
- arch/um
- 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/ptrace.hlinux/sched.hlinux/ftrace.hasm/siginfo.hasm/signal.hasm/unistd.hframe_kern.hkern_util.hos.h
Detected Declarations
function block_signals_tracefunction unblock_signals_tracefunction um_trace_signals_onfunction um_trace_signals_offfunction handle_signalfunction do_signalexport block_signalsexport unblock_signals
Annotated Snippet
switch (PT_REGS_SYSCALL_RET(regs)) {
case -ERESTART_RESTARTBLOCK:
case -ERESTARTNOHAND:
PT_REGS_SYSCALL_RET(regs) = -EINTR;
break;
case -ERESTARTSYS:
if (!(ksig->ka.sa.sa_flags & SA_RESTART)) {
PT_REGS_SYSCALL_RET(regs) = -EINTR;
break;
}
fallthrough;
case -ERESTARTNOINTR:
PT_REGS_RESTART_SYSCALL(regs);
PT_REGS_ORIG_SYSCALL(regs) = PT_REGS_SYSCALL_NR(regs);
break;
}
}
sp = PT_REGS_SP(regs);
if ((ksig->ka.sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0))
sp = current->sas_ss_sp + current->sas_ss_size;
#ifdef CONFIG_ARCH_HAS_SC_SIGNALS
if (!(ksig->ka.sa.sa_flags & SA_SIGINFO))
err = setup_signal_stack_sc(sp, ksig, regs, oldset);
else
#endif
err = setup_signal_stack_si(sp, ksig, regs, oldset);
signal_setup_done(err, ksig, singlestep);
}
void do_signal(struct pt_regs *regs)
{
struct ksignal ksig;
int handled_sig = 0;
while (get_signal(&ksig)) {
handled_sig = 1;
/* Whee! Actually deliver the signal. */
handle_signal(&ksig, regs);
}
/* Did we come from a system call? */
if (!handled_sig && (PT_REGS_SYSCALL_NR(regs) >= 0)) {
/* Restart the system call - no handlers present */
switch (PT_REGS_SYSCALL_RET(regs)) {
case -ERESTARTNOHAND:
case -ERESTARTSYS:
case -ERESTARTNOINTR:
PT_REGS_ORIG_SYSCALL(regs) = PT_REGS_SYSCALL_NR(regs);
PT_REGS_RESTART_SYSCALL(regs);
break;
case -ERESTART_RESTARTBLOCK:
PT_REGS_ORIG_SYSCALL(regs) = __NR_restart_syscall;
PT_REGS_RESTART_SYSCALL(regs);
break;
}
}
/*
* if there's no signal to deliver, we just put the saved sigmask
* back
*/
if (!handled_sig)
restore_saved_sigmask();
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/ptrace.h`, `linux/sched.h`, `linux/ftrace.h`, `asm/siginfo.h`, `asm/signal.h`, `asm/unistd.h`, `frame_kern.h`.
- Detected declarations: `function block_signals_trace`, `function unblock_signals_trace`, `function um_trace_signals_on`, `function um_trace_signals_off`, `function handle_signal`, `function do_signal`, `export block_signals`, `export unblock_signals`.
- Atlas domain: Architecture Layer / arch/um.
- 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.