From: Tom Rini Date: Tue, 13 Aug 2019 12:52:46 -0400 Subject: [U-Boot] [PATCH] spl: implement stack usage check In-Reply-To: <20190716203036.24430-1-simon.k.r.goldschmidt@gmail.com> References: <20190716203036.24430-1-simon.k.r.goldschmidt@gmail.com> Message-ID: <20190813165246.GA2718@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jul 16, 2019 at 10:30:36PM +0200, Simon Goldschmidt wrote: > This implements a stack usage check in SPL. > > Many boards start up SPL to run code + data from one common, rather small > SRAM. To implement a sophisticated SPL binary size limit on such boards, > the stack size (as well as malloc size and global data size) must be > subtracted from this SRAM size. > > However, to do that properly, the stack size first needs to be known. > > This patch adds a new Kconfig option: > - SPL_SYS_REPORT_STACK_F_USAGE: memset(0xaa) the whole area of the stack > very early and check stack usage based on this constant later before the > stack is switched to DRAM > > Initializing the stack and checking it is implemented in weak functions, > in case a board does not use the stack as saved in gd->start_addr_sp. > > Signed-off-by: Simon Goldschmidt Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: