Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2003 PathScale, Inc. |
| 3 | * |
| 4 | * Licensed under the GPL |
| 5 | */ |
| 6 | |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 7 | #include <linux/kernel.h> |
| 8 | #include <linux/module.h> |
| 9 | #include <linux/sched.h> |
| 10 | #include <linux/utsname.h> |
| 11 | #include <asm/current.h> |
| 12 | #include <asm/ptrace.h> |
Al Viro | 382d95f | 2012-10-08 03:26:54 +0100 | [diff] [blame] | 13 | #include <asm/sysrq.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
Richard Weinberger | 9d1ee8c | 2013-09-23 17:38:01 +0200 | [diff] [blame] | 15 | void show_regs(struct pt_regs *regs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | { |
| 17 | printk("\n"); |
| 18 | print_modules(); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 19 | printk(KERN_INFO "Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current), |
Alexey Dobriyan | 19c5870 | 2007-10-18 23:40:41 -0700 | [diff] [blame] | 20 | current->comm, print_tainted(), init_utsname()->release); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 21 | printk(KERN_INFO "RIP: %04lx:[<%016lx>]\n", PT_REGS_CS(regs) & 0xffff, |
Al Viro | 243412b | 2012-05-20 00:05:58 -0400 | [diff] [blame] | 22 | PT_REGS_IP(regs)); |
Al Viro | f67aa2f | 2011-08-18 20:10:39 +0100 | [diff] [blame] | 23 | printk(KERN_INFO "RSP: %016lx EFLAGS: %08lx\n", PT_REGS_SP(regs), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | PT_REGS_EFLAGS(regs)); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 25 | printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n", |
Al Viro | 243412b | 2012-05-20 00:05:58 -0400 | [diff] [blame] | 26 | PT_REGS_AX(regs), PT_REGS_BX(regs), PT_REGS_CX(regs)); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 27 | printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n", |
Al Viro | 243412b | 2012-05-20 00:05:58 -0400 | [diff] [blame] | 28 | PT_REGS_DX(regs), PT_REGS_SI(regs), PT_REGS_DI(regs)); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 29 | printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n", |
Al Viro | 243412b | 2012-05-20 00:05:58 -0400 | [diff] [blame] | 30 | PT_REGS_BP(regs), PT_REGS_R8(regs), PT_REGS_R9(regs)); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 31 | printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | PT_REGS_R10(regs), PT_REGS_R11(regs), PT_REGS_R12(regs)); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 33 | printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs)); |
| 35 | } |