2 * Copyright (C) 2004-2006 Atmel Corporation
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #include <asm/sysreg.h>
13 .type __switch_to, @function
15 /* Switch thread context from "prev" to "next", returning "last"
17 * r11 : &prev->thread + 1
21 stm --r11, r0,r1,r2,r3,r4,r5,r6,r7,sp,lr
26 * schedule() may have been called from a mode with a different
27 * set of registers. Make sure we don't lose anything here.
31 frs /* flush the return stack */
32 sub pc, -2 /* flush the pipeline */
34 ldm r10++, r0,r1,r2,r3,r4,r5,r6,r7,sp,pc
35 .size __switch_to, . - __switch_to