From patchwork Fri Dec 14 06:49:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 206346 X-Patchwork-Delegate: trini@ti.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 E537D2C008C for ; Fri, 14 Dec 2012 18:02:40 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 84A024A24D; Fri, 14 Dec 2012 08:02:10 +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 qd9KE-cqUhol; Fri, 14 Dec 2012 08:02:10 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 85D204A24E; Fri, 14 Dec 2012 07:55:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F4364A132 for ; Fri, 14 Dec 2012 07:53:35 +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 iXgRtOtIN6zd for ; Fri, 14 Dec 2012 07:53:33 +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-gg0-f202.google.com (mail-gg0-f202.google.com [209.85.161.202]) by theia.denx.de (Postfix) with ESMTPS id 02FD54A15C for ; Fri, 14 Dec 2012 07:50:25 +0100 (CET) Received: by mail-gg0-f202.google.com with SMTP id k1so309975ggn.3 for ; Thu, 13 Dec 2012 22:50:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=uPgJcKWQXj5b+LNsAOpSFt1WIrJMO82r4o8060BfCbw=; b=pcNFZndYQpJEv0CXTxOZ+pSBaeUCp54ELTuf3wTq0W32PlCRityUxpRe+6Id2qSs0u u1iQa9oghacXiBOIPmPAZWxtTwGIqY/PRZCoMyjFQWAHVSt3k8WkxQAsMDmEF9iKrPcx dDDfWvUTPKtbF+Z/CHMOfV3B4S/VHNn7HvnITxciMYxy8ZY2cQJSG98IamZYfRvulgWS QAjUnhVBMuKdzWJVf6qDJUxlGKg8Qs04Pykvuvv9TzPBtHeeqcBVgqwH4jWpyII6NfV+ hqZZb667gB6UcJhvH5wvy25ujFmhRvYGDvbf2Q0ZyHe5tF6xEuyRhyHIphQZGQOzJGhD odhA== Received: by 10.236.142.136 with SMTP id i8mr2260858yhj.45.1355467822728; Thu, 13 Dec 2012 22:50:22 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id i27si349902yhb.0.2012.12.13.22.50.22 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 13 Dec 2012 22:50:22 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 90568100047; Thu, 13 Dec 2012 22:50:22 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 69F591608F3; Thu, 13 Dec 2012 22:50:22 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 13 Dec 2012 22:49:09 -0800 Message-Id: <1355467767-29575-41-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1355467767-29575-1-git-send-email-sjg@chromium.org> References: <1355467767-29575-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQn79UdyDnljYSXXayF+Y+4QnX3BrFqTrDaXRegorZh+P6vGaIs8ZZQ0uPMUCaeRQbppSkiYzbhRHJ1G+Xv0AxAR3XhtMOVY/g7VWu3mOkeqVQ7u6HuhafIqk2IARW9giDv813WdlggnLLnkR97MEwY+4R6DABpn1gT384tVekusxsrXBeodXYjU+/HUFYBtvO2LQ1Vd Cc: Tom Rini Subject: [U-Boot] [PATCH v2 40/58] avr32: Move stack_end to arch_global_data X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Move this field into arch_global_data and tidy up. Signed-off-by: Simon Glass --- Changes in v2: None arch/avr32/cpu/exception.c | 6 +++--- arch/avr32/include/asm/global_data.h | 2 +- arch/avr32/lib/board.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/avr32/cpu/exception.c b/arch/avr32/cpu/exception.c index b21ef1f..828fc00 100644 --- a/arch/avr32/cpu/exception.c +++ b/arch/avr32/cpu/exception.c @@ -112,11 +112,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->stack_end - CONFIG_STACKSIZE) - || regs->sp >= gd->stack_end) + if (regs->sp < (gd->arch.stack_end - CONFIG_STACKSIZE) + || regs->sp >= gd->arch.stack_end) printf("\nStack pointer seems bogus, won't do stack dump\n"); else - dump_mem("\nStack: ", regs->sp, gd->stack_end); + dump_mem("\nStack: ", regs->sp, gd->arch.stack_end); panic("Unhandled exception\n"); } diff --git a/arch/avr32/include/asm/global_data.h b/arch/avr32/include/asm/global_data.h index 236a9da..3be8628 100644 --- a/arch/avr32/include/asm/global_data.h +++ b/arch/avr32/include/asm/global_data.h @@ -24,6 +24,7 @@ /* Architecture-specific global data */ struct arch_global_data { + unsigned long stack_end; /* highest stack address */ }; /* @@ -38,7 +39,6 @@ typedef struct global_data { bd_t *bd; unsigned long flags; unsigned int baudrate; - unsigned long stack_end; /* highest stack address */ unsigned long have_console; /* serial_init() was called */ #ifdef CONFIG_PRE_CONSOLE_BUFFER unsigned long precon_buf_idx; /* Pre-Console buffer index */ diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index e3287c4..d3c8cb7 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -231,7 +231,7 @@ void board_init_f(ulong board_type) /* And finally, a new, bigger stack. */ new_sp = (unsigned long *)addr; - gd->stack_end = addr; + gd->arch.stack_end = addr; *(--new_sp) = 0; *(--new_sp) = 0;