sysrq.c 1.2 KB

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