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> 12382d95fdSAl Viro #include <asm/sysrq.h> 135c48b108SAl Viro 145c48b108SAl Viro /* This is declared by <linux/sched.h> */ 155c48b108SAl Viro void show_regs(struct pt_regs *regs) 165c48b108SAl Viro { 175c48b108SAl Viro printk("\n"); 185c48b108SAl Viro printk("EIP: %04lx:[<%08lx>] CPU: %d %s", 195c48b108SAl Viro 0xffff & PT_REGS_CS(regs), PT_REGS_IP(regs), 205c48b108SAl Viro smp_processor_id(), print_tainted()); 215c48b108SAl Viro if (PT_REGS_CS(regs) & 3) 225c48b108SAl Viro printk(" ESP: %04lx:%08lx", 0xffff & PT_REGS_SS(regs), 235c48b108SAl Viro PT_REGS_SP(regs)); 245c48b108SAl Viro printk(" EFLAGS: %08lx\n %s\n", PT_REGS_EFLAGS(regs), 255c48b108SAl Viro print_tainted()); 265c48b108SAl Viro printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", 27243412beSAl Viro PT_REGS_AX(regs), PT_REGS_BX(regs), 28243412beSAl Viro PT_REGS_CX(regs), PT_REGS_DX(regs)); 295c48b108SAl Viro printk("ESI: %08lx EDI: %08lx EBP: %08lx", 30243412beSAl Viro PT_REGS_SI(regs), PT_REGS_DI(regs), PT_REGS_BP(regs)); 315c48b108SAl Viro printk(" DS: %04lx ES: %04lx\n", 325c48b108SAl Viro 0xffff & PT_REGS_DS(regs), 335c48b108SAl Viro 0xffff & PT_REGS_ES(regs)); 345c48b108SAl Viro } 35