From patchwork Mon Jan 3 19:46:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 77313 X-Patchwork-Delegate: graeme.russ@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B6F23B70EA for ; Tue, 4 Jan 2011 06:48:30 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B7DFC282AC; Mon, 3 Jan 2011 20:47:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dwLRrOoImYeM; Mon, 3 Jan 2011 20:47:54 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0227F282AF; Mon, 3 Jan 2011 20:47:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7D7832827E for ; Mon, 3 Jan 2011 20:47:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iwin+i903fLk for ; Mon, 3 Jan 2011 20:47:39 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by theia.denx.de (Postfix) with ESMTP id F1EBF28286 for ; Mon, 3 Jan 2011 20:47:33 +0100 (CET) Received: by mail-fx0-f44.google.com with SMTP id 9so12889169fxm.3 for ; Mon, 03 Jan 2011 11:47:33 -0800 (PST) Received: by 10.223.103.198 with SMTP id l6mr2668653fao.99.1294084053414; Mon, 03 Jan 2011 11:47:33 -0800 (PST) Received: from helios.localdomain6 (d122-104-38-246.sbr6.nsw.optusnet.com.au [122.104.38.246]) by mx.google.com with ESMTPS id a6sm3124092fak.1.2011.01.03.11.47.29 (version=SSLv3 cipher=RC4-MD5); Mon, 03 Jan 2011 11:47:32 -0800 (PST) From: Graeme Russ To: u-boot@lists.denx.de Date: Tue, 4 Jan 2011 06:46:26 +1100 Message-Id: <1294084016-2674-7-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.1.422.g049e9 In-Reply-To: <1294084016-2674-1-git-send-email-graeme.russ@gmail.com> References: <1294084016-2674-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [RFC][PATCH 06/36] x86 - Add stack dump to register dump X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de --- arch/i386/cpu/interrupts.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) --- 1.7.1.422.g049e9 diff --git a/arch/i386/cpu/interrupts.c b/arch/i386/cpu/interrupts.c index e4d0868..3a83afc 100644 --- a/arch/i386/cpu/interrupts.c +++ b/arch/i386/cpu/interrupts.c @@ -29,6 +29,7 @@ #include #include +#include #define DECLARE_INTERRUPT(x) \ ".globl irq_"#x"\n" \ @@ -108,6 +109,7 @@ void dump_regs(struct irq_regs *regs) { unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; unsigned long d0, d1, d2, d3, d6, d7; + unsigned long sp; printf("EIP: %04x:[<%08lx>] EFLAGS: %08lx\n", (u16)regs->xcs, regs->eip, regs->eflags); @@ -139,6 +141,20 @@ void dump_regs(struct irq_regs *regs) d7 = get_debugreg(7); printf("DR6: %08lx DR7: %08lx\n", d6, d7); + + printf("Stack:\n"); + sp = regs->esp; + + sp += 64; + + while (sp > (regs->esp - 16)) { + if (sp == regs->esp) + printf ("--->"); + else + printf (" "); + printf("0x%8.8lx : 0x%8.8lx\n", sp, (ulong)readl(sp)); + sp -= 4; + } } struct idt_entry {