public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 06/12] avr32: use generic gd->start_addr_sp
Date: Fri,  6 Feb 2015 23:06:44 +0100	[thread overview]
Message-ID: <1423260410-9290-7-git-send-email-andreas.devel@googlemail.com> (raw)
In-Reply-To: <1423260410-9290-1-git-send-email-andreas.devel@googlemail.com>

Before avr32 had an extra storage for stack end to have a nice stack printout
on exception. Remove this extra storage and use generic gd->start_addr_sp
instead.

Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
---

Changes in v3:
- new in v3

Changes in v2: None
Changes in v1: None

 arch/avr32/cpu/exception.c           |    6 +++---
 arch/avr32/include/asm/global_data.h |    1 -
 arch/avr32/lib/board.c               |    2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/avr32/cpu/exception.c b/arch/avr32/cpu/exception.c
index 5d1bc68..d6991f6 100644
--- a/arch/avr32/cpu/exception.c
+++ b/arch/avr32/cpu/exception.c
@@ -96,11 +96,11 @@ void do_unknown_exception(unsigned int ecr, struct pt_regs *regs)
 	printf("CPU Mode: %s\n", cpu_modes[mode]);
 
 	/* Avoid exception loops */
-	if (regs->sp < (gd->arch.stack_end - CONFIG_STACKSIZE)
-			|| regs->sp >= gd->arch.stack_end)
+	if (regs->sp < (gd->start_addr_sp - CONFIG_STACKSIZE) ||
+	    regs->sp >= gd->start_addr_sp)
 		printf("\nStack pointer seems bogus, won't do stack dump\n");
 	else
-		dump_mem("\nStack: ", regs->sp, gd->arch.stack_end);
+		dump_mem("\nStack: ", regs->sp, gd->start_addr_sp);
 
 	panic("Unhandled exception\n");
 }
diff --git a/arch/avr32/include/asm/global_data.h b/arch/avr32/include/asm/global_data.h
index d82fb7c..60abd00 100644
--- a/arch/avr32/include/asm/global_data.h
+++ b/arch/avr32/include/asm/global_data.h
@@ -8,7 +8,6 @@
 
 /* Architecture-specific global data */
 struct arch_global_data {
-	unsigned long stack_end;	/* highest stack address */
 	unsigned long cpu_hz;		/* cpu core clock frequency */
 };
 
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 13b7fed..99aa96e 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -157,7 +157,7 @@ void board_init_f(ulong board_type)
 
 	/* And finally, a new, bigger stack. */
 	new_sp = (unsigned long *)addr;
-	gd->arch.stack_end = addr;
+	gd->start_addr_sp = addr;
 	*(--new_sp) = 0;
 	*(--new_sp) = 0;
 
-- 
1.7.10.4

  parent reply	other threads:[~2015-02-06 22:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 22:06 [U-Boot] [PATCH v3 0/12] avr32: add generic board Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 01/12] avr32: use dlmalloc for DMA buffers Andreas Bießmann
2015-02-16 20:22   ` [U-Boot] [U-Boot,v3,01/12] " Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 02/12] avr32: rename cpu_init() -> arch_cpu_init() Andreas Bießmann
2015-02-16 20:22   ` [U-Boot] [U-Boot,v3,02/12] " Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 03/12] avr32: factor out cpu_mmc_init() Andreas Bießmann
2015-02-16 20:22   ` [U-Boot] [U-Boot,v3,03/12] " Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 04/12] avr32: rename mmu.h definitions Andreas Bießmann
2015-02-16 20:22   ` [U-Boot] [U-Boot,v3,04/12] " Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 05/12] avr32: convert to dram_init() Andreas Bießmann
2015-02-16 20:22   ` [U-Boot] [U-Boot,v3,05/12] " Andreas Bießmann
2015-02-06 22:06 ` Andreas Bießmann [this message]
2015-02-16 20:22   ` [U-Boot] [U-Boot,v3,06/12] avr32: use generic gd->start_addr_sp Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 07/12] common/board_f: factor out reserve_stacks Andreas Bießmann
2015-02-07  0:28   ` Simon Glass
2015-02-16 20:23   ` [U-Boot] [U-Boot,v3,07/12] " Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 08/12] common/board_r: manual relocation for cmd table Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 09/12] common/board_r: allocate bootparams Andreas Bießmann
2015-02-07  0:28   ` Simon Glass
2015-02-16 20:23   ` [U-Boot] [U-Boot,v3,09/12] " Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 10/12] avr32: add generic board support Andreas Bießmann
2015-02-07  0:28   ` Simon Glass
2015-02-08 21:21     ` Andreas Bießmann
2015-02-09  4:30       ` Simon Glass
2015-02-16 20:23   ` [U-Boot] [U-Boot,v3,10/12] " Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 11/12] grasshopper: enable generic board Andreas Bießmann
2015-02-16 20:23   ` [U-Boot] [U-Boot,v3,11/12] " Andreas Bießmann
2015-02-06 22:06 ` [U-Boot] [PATCH v3 12/12] atstk1002: " Andreas Bießmann
2015-02-16 20:23   ` [U-Boot] [U-Boot,v3,12/12] " Andreas Bießmann
2015-02-10 19:34 ` [U-Boot] [PATCH v3 0/12] avr32: add " Waldemar Brodkorb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423260410-9290-7-git-send-email-andreas.devel@googlemail.com \
    --to=andreas.devel@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox