arch/hexagon/kernel/signal.c
Source file repositories/reference/linux-study-clean/arch/hexagon/kernel/signal.c
File Facts
- System
- Linux kernel
- Corpus path
arch/hexagon/kernel/signal.c- Extension
.c- Size
- 6708 bytes
- Lines
- 257
- Domain
- Architecture Layer
- Bucket
- arch/hexagon
- Inferred role
- Architecture Layer: syscall or user/kernel boundary
- Status
- core 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 participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/linkage.hlinux/syscalls.hlinux/sched/task_stack.hasm/registers.hasm/thread_info.hasm/unistd.hlinux/uaccess.hasm/ucontext.hasm/cacheflush.hasm/signal.hasm/vdso.h
Detected Declarations
syscall rt_sigreturnstruct rt_sigframefunction setup_sigcontextfunction restore_sigcontextfunction setup_rt_framefunction handle_signalfunction do_signal
Annotated Snippet
SYSCALL_DEFINE0(rt_sigreturn)
{
struct pt_regs *regs = current_pt_regs();
struct rt_sigframe __user *frame;
sigset_t blocked;
/* Always make any pending restarted system calls return -EINTR */
current->restart_block.fn = do_no_restart_syscall;
frame = (struct rt_sigframe __user *)pt_psp(regs);
if (!access_ok(frame, sizeof(*frame)))
goto badframe;
if (__copy_from_user(&blocked, &frame->uc.uc_sigmask, sizeof(blocked)))
goto badframe;
set_current_blocked(&blocked);
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe;
/* Restore the user's stack as well */
pt_psp(regs) = regs->r29;
regs->syscall_nr = -1;
if (restore_altstack(&frame->uc.uc_stack))
goto badframe;
return regs->r00;
badframe:
force_sig(SIGSEGV);
return 0;
}
Annotation
- Immediate include surface: `linux/linkage.h`, `linux/syscalls.h`, `linux/sched/task_stack.h`, `asm/registers.h`, `asm/thread_info.h`, `asm/unistd.h`, `linux/uaccess.h`, `asm/ucontext.h`.
- Detected declarations: `syscall rt_sigreturn`, `struct rt_sigframe`, `function setup_sigcontext`, `function restore_sigcontext`, `function setup_rt_frame`, `function handle_signal`, `function do_signal`.
- Atlas domain: Architecture Layer / arch/hexagon.
- Implementation status: core implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.