12.07.2015 Views

The ARM-THUMB Procedure Call Standard

The ARM-THUMB Procedure Call Standard

The ARM-THUMB Procedure Call Standard

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>The</strong> <strong>ARM</strong>-<strong>THUMB</strong> <strong>Procedure</strong> <strong>Call</strong> <strong>Standard</strong>5.8 Chunked stacksA chunked stack is a non-contiguous, linked list of contiguous chunks with the following properties:ooYou can extend a chunked stack by allocating an additional chunk anywhere in memory. <strong>The</strong>re are noconstraints on the ordering of chunks in the address spaceWithin a chunk, activation records are allocated in descending address order. At all observable instants ofexecution, SP points to the lowest used address of the most recently allocated activation record.o At all observable instants of execution, SL identifies the same chunk as SP points into. SL points at least 256bytes above the lowest usable address in the chunk.oA chunked stack must be limit-checked. It can be extended only when a limit check fails.Corollaries<strong>The</strong> requirement that, at all observable instants of execution, SP and SL point into the same chunk means that onchanging stack chunks either:ooSP and SL must be loaded atomically.Or, an interrupt handler cannot run on the stack of the process it interrupts.In <strong>ARM</strong>-state, SP and SL can be loaded simultaneously using:LDM ..., {..., SL, SP}In general, this means that return from a routine executing on an extension chunk to one executing on an earlierallocatedchunk should be through an intermediate routine activation, specially fabricated when the stack wasextended.SWS ESPC 0002 A-05 Page 20 of 37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!