From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Thu, 15 Mar 2012 16:25:41 -0500 Subject: [U-Boot] [PATCH v4 14/27] Introduce generic pre-relocation board_f.c In-Reply-To: References: <1331777784-8528-1-git-send-email-sjg@chromium.org> <1331777784-8528-15-git-send-email-sjg@chromium.org> <4F623E4C.1080000@freescale.com> Message-ID: <4F625E55.1080305@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/15/2012 04:23 PM, Simon Glass wrote: >>> +static int reserve_stacks(void) >>> +{ >>> + /* setup stack pointer for exceptions */ >>> + gd->irq_sp = gd->dest_addr_sp; >>> +#ifdef CONFIG_USE_IRQ >>> + gd->dest_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ); >>> + debug("Reserving %zu Bytes for IRQ stack at: %08lx\n", >>> + CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ, gd->dest_addr_sp); >>> + >>> + /* 8-byte alignment for ARM ABI compliance */ >>> + gd->dest_addr_sp &= ~0x07; >>> +#endif >>> + /* leave 3 words for abort-stack, plus 1 for alignment */ >>> + gd->dest_addr_sp -= 16; >>> + >>> + return 0; >>> +} >> >> What does "leave 3 words for abort-stack, plus 1 for alignment" mean in >> a generic context? Certainly we shouldn't have references to things >> like FIQ or ARM ABI. > > This is limited to code which has CONFIG_USE_IRQ in it. Maybe this > function will have to be per-architecture? If CONFIG_USE_IRQ is ARM-specific, perhaps it needs a better name. >> Do all architectures U-Boot supports have a stack that grows downward? > > So far I have included ARM, x86 and PowerPC. If we add other archs to > generic board init, we will need to look at this. So it's not so much "generic" as supports more than one architecture. -Scott