Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2003 PathScale, Inc.
0003  *
0004  * Licensed under the GPL
0005  */
0006 
0007 #include <linux/kernel.h>
0008 #include <linux/module.h>
0009 #include <linux/sched.h>
0010 #include <linux/sched/debug.h>
0011 #include <linux/utsname.h>
0012 #include <asm/current.h>
0013 #include <asm/ptrace.h>
0014 #include <asm/sysrq.h>
0015 
0016 void show_regs(struct pt_regs *regs)
0017 {
0018     printk("\n");
0019     print_modules();
0020     printk(KERN_INFO "Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current),
0021         current->comm, print_tainted(), init_utsname()->release);
0022     printk(KERN_INFO "RIP: %04lx:%pS\n", PT_REGS_CS(regs) & 0xffff,
0023            (void *)PT_REGS_IP(regs));
0024     printk(KERN_INFO "RSP: %016lx  EFLAGS: %08lx\n", PT_REGS_SP(regs),
0025            PT_REGS_EFLAGS(regs));
0026     printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n",
0027            PT_REGS_AX(regs), PT_REGS_BX(regs), PT_REGS_CX(regs));
0028     printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n",
0029            PT_REGS_DX(regs), PT_REGS_SI(regs), PT_REGS_DI(regs));
0030     printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n",
0031            PT_REGS_BP(regs), PT_REGS_R8(regs), PT_REGS_R9(regs));
0032     printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n",
0033            PT_REGS_R10(regs), PT_REGS_R11(regs), PT_REGS_R12(regs));
0034     printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
0035            PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
0036 }