arch/parisc/kernel/traps.c
Source file repositories/reference/linux-study-clean/arch/parisc/kernel/traps.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/kernel/traps.c- Extension
.c- Size
- 22270 bytes
- Lines
- 864
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched.hlinux/sched/debug.hlinux/kernel.hlinux/string.hlinux/errno.hlinux/ptrace.hlinux/timer.hlinux/delay.hlinux/mm.hlinux/module.hlinux/smp.hlinux/spinlock.hlinux/init.hlinux/interrupt.hlinux/console.hlinux/bug.hlinux/ratelimit.hlinux/uaccess.hlinux/kdebug.hlinux/kfence.hlinux/perf_event.hasm/assembly.hasm/io.hasm/irq.hasm/traps.hlinux/unaligned.hlinux/atomic.hasm/smp.hasm/pdc.hasm/pdc_chassis.hasm/unwind.hasm/tlbflush.h
Detected Declarations
function printbinaryfunction print_grfunction print_frfunction show_regsfunction do_show_stackfunction parisc_show_stackfunction show_stackfunction is_valid_bugaddrfunction die_if_kernelfunction handle_gdb_breakfunction handle_breakfunction default_trapfunction transfer_pim_to_trap_framefunction parisc_terminatefunction handle_interruptionfunction ptep_get_and_clearfunction pagefault_disablefunction initialize_ivtfunction early_trap_init
Annotated Snippet
if (__kernel_text_address(info->ip)) {
printk("%s [<" RFMT ">] %pS\n",
loglvl, info->ip, (void *) info->ip);
i++;
}
}
printk("%s\n", loglvl);
}
static void parisc_show_stack(struct task_struct *task,
struct pt_regs *regs, const char *loglvl)
{
struct unwind_frame_info info;
unwind_frame_init_task(&info, task, regs);
do_show_stack(&info, loglvl);
}
void show_stack(struct task_struct *t, unsigned long *sp, const char *loglvl)
{
parisc_show_stack(t, NULL, loglvl);
}
int is_valid_bugaddr(unsigned long iaoq)
{
return 1;
}
void die_if_kernel(char *str, struct pt_regs *regs, long err)
{
if (user_mode(regs)) {
if (err == 0)
return; /* STFU */
parisc_printk_ratelimited(1, regs,
KERN_CRIT "%s (pid %d): %s (code %ld) at " RFMT "\n",
current->comm, task_pid_nr(current), str, err, regs->iaoq[0]);
return;
}
bust_spinlocks(1);
oops_enter();
/* Amuse the user in a SPARC fashion */
if (err) printk(KERN_CRIT
" _______________________________ \n"
" < Your System ate a SPARC! Gah! >\n"
" ------------------------------- \n"
" \\ ^__^\n"
" (__)\\ )\\/\\\n"
" U ||----w |\n"
" || ||\n");
/* unlock the pdc lock if necessary */
pdc_emergency_unlock();
if (err)
printk(KERN_CRIT "%s (pid %d): %s (code %ld)\n",
current->comm, task_pid_nr(current), str, err);
/* Wot's wrong wif bein' racy? */
if (current->thread.flags & PARISC_KERNEL_DEATH) {
printk(KERN_CRIT "%s() recursion detected.\n", __func__);
local_irq_enable();
while (1);
}
current->thread.flags |= PARISC_KERNEL_DEATH;
show_regs(regs);
dump_stack();
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
if (in_interrupt())
panic("Fatal exception in interrupt");
if (panic_on_oops)
panic("Fatal exception");
oops_exit();
make_task_dead(SIGSEGV);
}
/* gdb uses break 4,8 */
#define GDB_BREAK_INSN 0x10004
static void handle_gdb_break(struct pt_regs *regs, int wot)
{
force_sig_fault(SIGTRAP, wot,
Annotation
- Immediate include surface: `linux/sched.h`, `linux/sched/debug.h`, `linux/kernel.h`, `linux/string.h`, `linux/errno.h`, `linux/ptrace.h`, `linux/timer.h`, `linux/delay.h`.
- Detected declarations: `function printbinary`, `function print_gr`, `function print_fr`, `function show_regs`, `function do_show_stack`, `function parisc_show_stack`, `function show_stack`, `function is_valid_bugaddr`, `function die_if_kernel`, `function handle_gdb_break`.
- Atlas domain: Architecture Layer / arch/parisc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.