xref: /kernel/linux/linux-5.10/arch/x86/um/sysrq_64.c (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2003 PathScale, Inc.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Licensed under the GPL
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#include <linux/kernel.h>
88c2ecf20Sopenharmony_ci#include <linux/module.h>
98c2ecf20Sopenharmony_ci#include <linux/sched.h>
108c2ecf20Sopenharmony_ci#include <linux/sched/debug.h>
118c2ecf20Sopenharmony_ci#include <linux/utsname.h>
128c2ecf20Sopenharmony_ci#include <asm/current.h>
138c2ecf20Sopenharmony_ci#include <asm/ptrace.h>
148c2ecf20Sopenharmony_ci#include <asm/sysrq.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_civoid show_regs(struct pt_regs *regs)
178c2ecf20Sopenharmony_ci{
188c2ecf20Sopenharmony_ci	printk("\n");
198c2ecf20Sopenharmony_ci	print_modules();
208c2ecf20Sopenharmony_ci	printk(KERN_INFO "Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current),
218c2ecf20Sopenharmony_ci		current->comm, print_tainted(), init_utsname()->release);
228c2ecf20Sopenharmony_ci	printk(KERN_INFO "RIP: %04lx:[<%016lx>]\n", PT_REGS_CS(regs) & 0xffff,
238c2ecf20Sopenharmony_ci	       PT_REGS_IP(regs));
248c2ecf20Sopenharmony_ci	printk(KERN_INFO "RSP: %016lx  EFLAGS: %08lx\n", PT_REGS_SP(regs),
258c2ecf20Sopenharmony_ci	       PT_REGS_EFLAGS(regs));
268c2ecf20Sopenharmony_ci	printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n",
278c2ecf20Sopenharmony_ci	       PT_REGS_AX(regs), PT_REGS_BX(regs), PT_REGS_CX(regs));
288c2ecf20Sopenharmony_ci	printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n",
298c2ecf20Sopenharmony_ci	       PT_REGS_DX(regs), PT_REGS_SI(regs), PT_REGS_DI(regs));
308c2ecf20Sopenharmony_ci	printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n",
318c2ecf20Sopenharmony_ci	       PT_REGS_BP(regs), PT_REGS_R8(regs), PT_REGS_R9(regs));
328c2ecf20Sopenharmony_ci	printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n",
338c2ecf20Sopenharmony_ci	       PT_REGS_R10(regs), PT_REGS_R11(regs), PT_REGS_R12(regs));
348c2ecf20Sopenharmony_ci	printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
358c2ecf20Sopenharmony_ci	       PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
368c2ecf20Sopenharmony_ci}
37