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> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include "sysrq.h" |
| 14 | |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [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, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | PT_REGS_RIP(regs)); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 23 | printk(KERN_INFO "RSP: %016lx EFLAGS: %08lx\n", PT_REGS_RSP(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", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | PT_REGS_RAX(regs), PT_REGS_RBX(regs), PT_REGS_RCX(regs)); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 27 | printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | PT_REGS_RDX(regs), PT_REGS_RSI(regs), PT_REGS_RDI(regs)); |
Jeff Dike | 95906b2 | 2008-02-04 22:31:20 -0800 | [diff] [blame] | 29 | printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | PT_REGS_RBP(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 | } |
| 36 | |
| 37 | void show_regs(struct pt_regs *regs) |
| 38 | { |
| 39 | __show_regs(regs); |
Paolo 'Blaisorblade' Giarrusso | b346103 | 2005-05-28 15:52:00 -0700 | [diff] [blame] | 40 | show_trace(current, (unsigned long *) ®s); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | } |