zephyr/arch/arm/include
Benjamin Walsh 7f4c294e5c arm: use interrupt stack during early init
The ARM Cortex-M early boot was using a custom stack at the end of the
SRAM instead of the interrupt stack. This works as long as no static
data that needs a known initial value occupies that stack space. This
has probably not been an issue because the .noinit section is at the
very end of the image, but it was still wrong to use that region of
memory for that initial stack.

To be able to use the interrupt stack during early boot, the stack has
to be released before an interrupt can happen. Since ARM Cortex-M uses
PendSV as a very low priority exception for context switching, if a
device driver installs and enables an interrupt during the PRE_KERNEL
initialization points, an interrupt could take precedence over PendSV
while the initial dummy thread has not yet been context switched of and
thus released the interrupt stack. To address this, rather than using
_Swap() and thus triggering PendSV, the initialization logic switches to
the main stack and branches to _main() directly instead.

Fixes ZEP-1309

Change-Id: If0b62cc66470b45b601e63826b5b3306e6a25ae9
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-23 00:23:59 +00:00
..
cortex_m kernel/arch: consolidate tTCS and TNANO definitions 2016-11-12 07:04:52 -05:00
asm_inline.h Change BSD-3 licenses to Apache 2 2016-02-05 20:24:29 -05:00
kernel_arch_data.h kernel/arm: fix race condition when setting _Swap() return value 2016-11-17 14:46:12 +00:00
kernel_arch_func.h arm: use interrupt stack during early init 2016-11-23 00:23:59 +00:00
kernel_event_logger_arch.h c++: Add extern "C" { } block to header files 2016-02-05 20:25:22 -05:00
offsets_short_arch.h kernel/arm: fix race condition when setting _Swap() return value 2016-11-17 14:46:12 +00:00
start_task_arch.h kernel/arch: consolidate tTCS and TNANO definitions 2016-11-12 07:04:52 -05:00