[U-Boot] [PATCH v4 14/27] Introduce generic pre-relocation board_f.c
Scott Wood
scottwood at freescale.com
Thu Mar 15 22:25:41 CET 2012
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
More information about the U-Boot
mailing list