arch/m68k/kernel/signal.c
Source file repositories/reference/linux-study-clean/arch/m68k/kernel/signal.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/kernel/signal.c- Extension
.c- Size
- 30125 bytes
- Lines
- 1123
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- 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.
- 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/sched.hlinux/mm.hlinux/kernel.hlinux/signal.hlinux/syscalls.hlinux/errno.hlinux/wait.hlinux/ptrace.hlinux/unistd.hlinux/stddef.hlinux/highuid.hlinux/personality.hlinux/tty.hlinux/binfmts.hlinux/extable.hlinux/resume_user_mode.hasm/setup.hlinux/uaccess.hasm/traps.hasm/ucontext.hasm/cacheflush.hsignal.h
Detected Declarations
struct sigframestruct rt_sigframefunction frame_extra_sizesfunction fixup_exceptionfunction push_cachefunction adjustformatfunction frame_extra_sizesfunction adjustformatfunction save_a5_statefunction push_cachefunction restore_fpu_statefunction rt_restore_fpu_statefunction save_fpu_statefunction rt_save_fpu_statefunction restore_fpu_statefunction rt_restore_fpu_statefunction save_fpu_statefunction siginfo_build_testsfunction mangle_kernel_stackfunction restore_sigcontextfunction rt_restore_ucontextfunction setup_sigcontextfunction rt_setup_ucontextfunction get_sigframefunction setup_framefunction setup_rt_framefunction handle_restartfunction handle_signalfunction do_signalfunction do_notify_resume
Annotated Snippet
else if (CPU_IS_060) {
unsigned long temp;
__asm__ __volatile__ (".chip 68060\n\t"
"plpar (%0)\n\t"
".chip 68k"
: "=a" (temp)
: "0" (vaddr));
__asm__ __volatile__ (".chip 68060\n\t"
"cpushl %%bc,(%0)\n\t"
".chip 68k"
: : "a" (temp));
} else if (!CPU_IS_COLDFIRE) {
/*
* 68030/68020 have no writeback cache;
* still need to clear icache.
* Note that vaddr is guaranteed to be long word aligned.
*/
unsigned long temp;
asm volatile ("movec %%cacr,%0" : "=r" (temp));
temp += 4;
asm volatile ("movec %0,%%caar\n\t"
"movec %1,%%cacr"
: : "r" (vaddr), "r" (temp));
asm volatile ("movec %0,%%caar\n\t"
"movec %1,%%cacr"
: : "r" (vaddr + 4), "r" (temp));
} else {
/* CPU_IS_COLDFIRE */
#if defined(CONFIG_CACHE_COPYBACK)
flush_cf_dcache(0, DCACHE_MAX_ADDR);
#endif
/* Invalidate instruction cache for the pushed bytes */
clear_cf_icache(vaddr, vaddr + 8);
}
}
static inline void adjustformat(struct pt_regs *regs)
{
}
static inline void save_a5_state(struct sigcontext *sc, struct pt_regs *regs)
{
}
#else /* CONFIG_MMU */
void ret_from_user_signal(void);
void ret_from_user_rt_signal(void);
static inline int frame_extra_sizes(int f)
{
/* No frame size adjustments required on non-MMU CPUs */
return 0;
}
static inline void adjustformat(struct pt_regs *regs)
{
/*
* set format byte to make stack appear modulo 4, which it will
* be when doing the rte
*/
regs->format = 0x4;
}
static inline void save_a5_state(struct sigcontext *sc, struct pt_regs *regs)
{
sc->sc_a5 = ((struct switch_stack *)regs - 1)->a5;
}
static inline void push_cache(unsigned long vaddr)
{
}
#endif /* CONFIG_MMU */
/*
* Do a signal return; undo the signal stack.
*
* Keep the return code on the stack quadword aligned!
* That makes the cache flush below easier.
*/
struct sigframe
{
char __user *pretcode;
int sig;
int code;
struct sigcontext __user *psc;
char retcode[8];
unsigned long extramask[_NSIG_WORDS-1];
Annotation
- Immediate include surface: `linux/sched.h`, `linux/mm.h`, `linux/kernel.h`, `linux/signal.h`, `linux/syscalls.h`, `linux/errno.h`, `linux/wait.h`, `linux/ptrace.h`.
- Detected declarations: `struct sigframe`, `struct rt_sigframe`, `function frame_extra_sizes`, `function fixup_exception`, `function push_cache`, `function adjustformat`, `function frame_extra_sizes`, `function adjustformat`, `function save_a5_state`, `function push_cache`.
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: source 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.