15c48b108SAl Viro /*
25c48b108SAl Viro * Copyright (C) 2001 - 2003 Jeff Dike (jdike@addtoit.com)
35c48b108SAl Viro * Licensed under the GPL
45c48b108SAl Viro */
55c48b108SAl Viro
6382d95fdSAl Viro #include <linux/kernel.h>
7382d95fdSAl Viro #include <linux/smp.h>
8382d95fdSAl Viro #include <linux/sched.h>
9*b17b0153SIngo Molnar #include <linux/sched/debug.h>
10382d95fdSAl Viro #include <linux/kallsyms.h>
11382d95fdSAl Viro #include <asm/ptrace.h>
125c48b108SAl Viro
135c48b108SAl Viro /* This is declared by <linux/sched.h> */
show_regs(struct pt_regs * regs)145c48b108SAl Viro void show_regs(struct pt_regs *regs)
155c48b108SAl Viro {
165c48b108SAl Viro printk("\n");
175c48b108SAl Viro printk("EIP: %04lx:[<%08lx>] CPU: %d %s",
185c48b108SAl Viro 0xffff & PT_REGS_CS(regs), PT_REGS_IP(regs),
195c48b108SAl Viro smp_processor_id(), print_tainted());
205c48b108SAl Viro if (PT_REGS_CS(regs) & 3)
215c48b108SAl Viro printk(" ESP: %04lx:%08lx", 0xffff & PT_REGS_SS(regs),
225c48b108SAl Viro PT_REGS_SP(regs));
235c48b108SAl Viro printk(" EFLAGS: %08lx\n %s\n", PT_REGS_EFLAGS(regs),
245c48b108SAl Viro print_tainted());
255c48b108SAl Viro printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
26243412beSAl Viro PT_REGS_AX(regs), PT_REGS_BX(regs),
27243412beSAl Viro PT_REGS_CX(regs), PT_REGS_DX(regs));
285c48b108SAl Viro printk("ESI: %08lx EDI: %08lx EBP: %08lx",
29243412beSAl Viro PT_REGS_SI(regs), PT_REGS_DI(regs), PT_REGS_BP(regs));
305c48b108SAl Viro printk(" DS: %04lx ES: %04lx\n",
315c48b108SAl Viro 0xffff & PT_REGS_DS(regs),
325c48b108SAl Viro 0xffff & PT_REGS_ES(regs));
335c48b108SAl Viro }
34