blob: 765444031819c55ce6c51f92f09e665c57448ccd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
7#include "linux/kernel.h"
8#include "linux/utsname.h"
9#include "linux/module.h"
10#include "asm/current.h"
11#include "asm/ptrace.h"
12#include "sysrq.h"
13
14void __show_regs(struct pt_regs * regs)
15{
16 printk("\n");
17 print_modules();
Alexey Dobriyan19c58702007-10-18 23:40:41 -070018 printk("Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current),
19 current->comm, print_tainted(), init_utsname()->release);
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 printk("RIP: %04lx:[<%016lx>] ", PT_REGS_CS(regs) & 0xffff,
21 PT_REGS_RIP(regs));
22 printk("\nRSP: %016lx EFLAGS: %08lx\n", PT_REGS_RSP(regs),
23 PT_REGS_EFLAGS(regs));
24 printk("RAX: %016lx RBX: %016lx RCX: %016lx\n",
25 PT_REGS_RAX(regs), PT_REGS_RBX(regs), PT_REGS_RCX(regs));
26 printk("RDX: %016lx RSI: %016lx RDI: %016lx\n",
27 PT_REGS_RDX(regs), PT_REGS_RSI(regs), PT_REGS_RDI(regs));
28 printk("RBP: %016lx R08: %016lx R09: %016lx\n",
29 PT_REGS_RBP(regs), PT_REGS_R8(regs), PT_REGS_R9(regs));
30 printk("R10: %016lx R11: %016lx R12: %016lx\n",
31 PT_REGS_R10(regs), PT_REGS_R11(regs), PT_REGS_R12(regs));
32 printk("R13: %016lx R14: %016lx R15: %016lx\n",
33 PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
34}
35
36void show_regs(struct pt_regs *regs)
37{
38 __show_regs(regs);
Paolo 'Blaisorblade' Giarrussob3461032005-05-28 15:52:00 -070039 show_trace(current, (unsigned long *) &regs);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040}