On 21 August 2014 14:15, Christopher Covington <c...@codeaurora.org> wrote: > On 08/21/2014 08:33 AM, Peter Maydell wrote: >> I think the ELF loading thing is a separate issue -- if we're loading >> an ELF file we should honour its entry point address instead of >> trying to load from the vector table. (The question of what we >> do about SP is an interesting one...) > > In my experience with A-profile, software is expected to either know enough > about the platform to set the SP to something sane itself or make the > SYS_HEAPINFO semihosting call, which despite the name returns both stack and > heap information.
My point was that M profile is significantly different from A profile here. In A profile on CPU reset only the PC is set to a known value, and therefore any bare metal code that gets run will always set up SP itself in some way. In M profile, on CPU reset both PC and SP are read from the vector table, and so it's reasonable to have bare metal code for M profile whose entry point assumes that SP has been initialized. -- PMM