15c48b108SAl Viro /*
25c48b108SAl Viro * Copyright 2003 PathScale, Inc.
35c48b108SAl Viro *
45c48b108SAl Viro * Licensed under the GPL
55c48b108SAl Viro */
65c48b108SAl Viro
75c48b108SAl Viro #include <linux/kernel.h>
85c48b108SAl Viro #include <linux/module.h>
95c48b108SAl Viro #include <linux/sched.h>
10b17b0153SIngo Molnar #include <linux/sched/debug.h>
115c48b108SAl Viro #include <linux/utsname.h>
125c48b108SAl Viro #include <asm/current.h>
135c48b108SAl Viro #include <asm/ptrace.h>
14382d95fdSAl Viro #include <asm/sysrq.h>
155c48b108SAl Viro
show_regs(struct pt_regs * regs)169d1ee8ceSRichard Weinberger void show_regs(struct pt_regs *regs)
175c48b108SAl Viro {
185c48b108SAl Viro printk("\n");
195c48b108SAl Viro print_modules();
205c48b108SAl Viro printk(KERN_INFO "Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current),
215c48b108SAl Viro current->comm, print_tainted(), init_utsname()->release);
22*e062356eSJohannes Berg printk(KERN_INFO "RIP: %04lx:%pS\n", PT_REGS_CS(regs) & 0xffff,
23*e062356eSJohannes Berg (void *)PT_REGS_IP(regs));
24f67aa2ffSAl Viro printk(KERN_INFO "RSP: %016lx EFLAGS: %08lx\n", PT_REGS_SP(regs),
255c48b108SAl Viro PT_REGS_EFLAGS(regs));
265c48b108SAl Viro printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n",
27243412beSAl Viro PT_REGS_AX(regs), PT_REGS_BX(regs), PT_REGS_CX(regs));
285c48b108SAl Viro printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n",
29243412beSAl Viro PT_REGS_DX(regs), PT_REGS_SI(regs), PT_REGS_DI(regs));
305c48b108SAl Viro printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n",
31243412beSAl Viro PT_REGS_BP(regs), PT_REGS_R8(regs), PT_REGS_R9(regs));
325c48b108SAl Viro printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n",
335c48b108SAl Viro PT_REGS_R10(regs), PT_REGS_R11(regs), PT_REGS_R12(regs));
345c48b108SAl Viro printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
355c48b108SAl Viro PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
365c48b108SAl Viro }
37