3 * @brief ARM (32bit)用のコンテキストスイッチを行う。
10 /*------------------------------------------------------------------------
11 * ctxsw - ARM context switch; the call is ctxsw(&old_sp, &new_sp)
12 *------------------------------------------------------------------------
16 push {r0-r11, lr} /* Push regs 0 - 11 and lr */
17 push {lr} /* Push return address */
18 mrs r2, cpsr /* Obtain status from coprocess.*/
19 push {r2} /* and push onto stack */
20 str sp, [r0] /* Save old process's SP */
21 ldr sp, [r1] /* Pick up new process's SP */
22 pop {r0} /* Use status as argument and */
23 bl restore /* call restore to restore it */
24 pop {lr} /* Pick up the return address */
25 pop {r0-r12} /* Restore other registers */
26 mov pc, r12 /* Return to the new process */