blob: 38b4e4abd0f836b28ee6596bf2aa2410078a6df4 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
Jeff Dike95906b22008-02-04 22:31:20 -08007#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 Viro382d95f2012-10-08 03:26:54 +010013#include <asm/sysrq.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Richard Weinberger9d1ee8c2013-09-23 17:38:01 +020015void show_regs(struct pt_regs *regs)
Linus Torvalds1da177e2005-04-16 15:20:36 -070016{
17 printk("\n");
18 print_modules();
Jeff Dike95906b22008-02-04 22:31:20 -080019 printk(KERN_INFO "Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current),
Alexey Dobriyan19c58702007-10-18 23:40:41 -070020 current->comm, print_tainted(), init_utsname()->release);
Jeff Dike95906b22008-02-04 22:31:20 -080021 printk(KERN_INFO "RIP: %04lx:[<%016lx>]\n", PT_REGS_CS(regs) & 0xffff,
Al Viro243412b2012-05-20 00:05:58 -040022 PT_REGS_IP(regs));
Al Virof67aa2f2011-08-18 20:10:39 +010023 printk(KERN_INFO "RSP: %016lx EFLAGS: %08lx\n", PT_REGS_SP(regs),
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 PT_REGS_EFLAGS(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080025 printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n",
Al Viro243412b2012-05-20 00:05:58 -040026 PT_REGS_AX(regs), PT_REGS_BX(regs), PT_REGS_CX(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080027 printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n",
Al Viro243412b2012-05-20 00:05:58 -040028 PT_REGS_DX(regs), PT_REGS_SI(regs), PT_REGS_DI(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080029 printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n",
Al Viro243412b2012-05-20 00:05:58 -040030 PT_REGS_BP(regs), PT_REGS_R8(regs), PT_REGS_R9(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080031 printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 PT_REGS_R10(regs), PT_REGS_R11(regs), PT_REGS_R12(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080033 printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
35}