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 /* 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 r0, =_ram_end-1024\n" /* 1k for main stack */
24 "b generic_exception_handler\n"
28 /* cortex-m3 trm, 5.5.1, mcu stacks xPSR, PC, LR, R12, R3, R2, R1, R0 */
29 void __naked
generic_exception_handler()
34 "tst r2, r1\n" /* process task, see EXC_RETURN */
41 /* yeah, on cortex-m3 this is push {r4-r11, lr} :P */
43 "mov lr, r0\n" /* tmp for sp */
48 "push {r0-r3}\n" /* r8-r11 */
50 "mov r0, lr\n" /* restore sp to r0 */
54 "b generic_exception_handler_c\n\t"