1 /* Author: Domen Puncer <domen@cba.si>. License: WTFPL, see file LICENSE */
6 void __naked
reset_handler()
8 /* cortex-m3 trm 2.2.1 main stack and process stack */
10 //"ldr sp, =_ram_end\n\t" /* isn't actually needed, cpu reads addr 0 */
11 /* select PSP as current stack pointer */
17 /* hrm... this stack is ignored laters anyways, as the scheduler starts,
18 * so it could just be the same as for exceptions, yes? */
19 "ldr sp, =_ram_end-1024\n\t" /* 1k for main stack */
23 "b generic_exception_handler\n\t"
27 /* cortex-m3 trm, 5.5.1, mcu stacks xPSR, PC, LR, R12, R3, R2, R1, R0 */
28 void __naked
generic_exception_handler()
31 "tst lr, #0x4\n\t" /* process task, see EXC_RETURN */
35 "push {r4-r11, lr}\n\t" /* = stmfd/stmdb sp!, ... */
38 "b generic_exception_handler_c\n\t"