18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (C) 2001 - 2003 Jeff Dike (jdike@addtoit.com)
38c2ecf20Sopenharmony_ci * Licensed under the GPL
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#include <linux/kernel.h>
78c2ecf20Sopenharmony_ci#include <linux/smp.h>
88c2ecf20Sopenharmony_ci#include <linux/sched.h>
98c2ecf20Sopenharmony_ci#include <linux/sched/debug.h>
108c2ecf20Sopenharmony_ci#include <linux/kallsyms.h>
118c2ecf20Sopenharmony_ci#include <asm/ptrace.h>
128c2ecf20Sopenharmony_ci#include <asm/sysrq.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/* This is declared by <linux/sched.h> */
158c2ecf20Sopenharmony_civoid show_regs(struct pt_regs *regs)
168c2ecf20Sopenharmony_ci{
178c2ecf20Sopenharmony_ci        printk("\n");
188c2ecf20Sopenharmony_ci        printk("EIP: %04lx:[<%08lx>] CPU: %d %s",
198c2ecf20Sopenharmony_ci	       0xffff & PT_REGS_CS(regs), PT_REGS_IP(regs),
208c2ecf20Sopenharmony_ci	       smp_processor_id(), print_tainted());
218c2ecf20Sopenharmony_ci        if (PT_REGS_CS(regs) & 3)
228c2ecf20Sopenharmony_ci                printk(" ESP: %04lx:%08lx", 0xffff & PT_REGS_SS(regs),
238c2ecf20Sopenharmony_ci		       PT_REGS_SP(regs));
248c2ecf20Sopenharmony_ci        printk(" EFLAGS: %08lx\n    %s\n", PT_REGS_EFLAGS(regs),
258c2ecf20Sopenharmony_ci	       print_tainted());
268c2ecf20Sopenharmony_ci        printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
278c2ecf20Sopenharmony_ci               PT_REGS_AX(regs), PT_REGS_BX(regs),
288c2ecf20Sopenharmony_ci	       PT_REGS_CX(regs), PT_REGS_DX(regs));
298c2ecf20Sopenharmony_ci        printk("ESI: %08lx EDI: %08lx EBP: %08lx",
308c2ecf20Sopenharmony_ci	       PT_REGS_SI(regs), PT_REGS_DI(regs), PT_REGS_BP(regs));
318c2ecf20Sopenharmony_ci        printk(" DS: %04lx ES: %04lx\n",
328c2ecf20Sopenharmony_ci	       0xffff & PT_REGS_DS(regs),
338c2ecf20Sopenharmony_ci	       0xffff & PT_REGS_ES(regs));
348c2ecf20Sopenharmony_ci}
35