sysrq_64.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright 2003 PathScale, Inc.
  3. *
  4. * Licensed under the GPL
  5. */
  6. #include <linux/kernel.h>
  7. #include <linux/module.h>
  8. #include <linux/sched.h>
  9. #include <linux/sched/debug.h>
  10. #include <linux/utsname.h>
  11. #include <asm/current.h>
  12. #include <asm/ptrace.h>
  13. #include <asm/sysrq.h>
  14. void show_regs(struct pt_regs *regs)
  15. {
  16. printk("\n");
  17. print_modules();
  18. printk(KERN_INFO "Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current),
  19. current->comm, print_tainted(), init_utsname()->release);
  20. printk(KERN_INFO "RIP: %04lx:%pS\n", PT_REGS_CS(regs) & 0xffff,
  21. (void *)PT_REGS_IP(regs));
  22. printk(KERN_INFO "RSP: %016lx EFLAGS: %08lx\n", PT_REGS_SP(regs),
  23. PT_REGS_EFLAGS(regs));
  24. printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n",
  25. PT_REGS_AX(regs), PT_REGS_BX(regs), PT_REGS_CX(regs));
  26. printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n",
  27. PT_REGS_DX(regs), PT_REGS_SI(regs), PT_REGS_DI(regs));
  28. printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n",
  29. PT_REGS_BP(regs), PT_REGS_R8(regs), PT_REGS_R9(regs));
  30. printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n",
  31. PT_REGS_R10(regs), PT_REGS_R11(regs), PT_REGS_R12(regs));
  32. printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
  33. PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
  34. }