aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-m32r/system.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index f62f5c9abba6..b291b2f72954 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -21,12 +21,22 @@
21 * `next' and `prev' should be struct task_struct, but it isn't always defined 21 * `next' and `prev' should be struct task_struct, but it isn't always defined
22 */ 22 */
23 23
24#if defined(CONFIG_FRAME_POINTER) || \
25 !defined(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER)
26#define M32R_PUSH_FP " push fp\n"
27#define M32R_POP_FP " pop fp\n"
28#else
29#define M32R_PUSH_FP ""
30#define M32R_POP_FP ""
31#endif
32
24#define switch_to(prev, next, last) do { \ 33#define switch_to(prev, next, last) do { \
25 __asm__ __volatile__ ( \ 34 __asm__ __volatile__ ( \
26 " seth lr, #high(1f) \n" \ 35 " seth lr, #high(1f) \n" \
27 " or3 lr, lr, #low(1f) \n" \ 36 " or3 lr, lr, #low(1f) \n" \
28 " st lr, @%4 ; store old LR \n" \ 37 " st lr, @%4 ; store old LR \n" \
29 " ld lr, @%5 ; load new LR \n" \ 38 " ld lr, @%5 ; load new LR \n" \
39 M32R_PUSH_FP \
30 " st sp, @%2 ; store old SP \n" \ 40 " st sp, @%2 ; store old SP \n" \
31 " ld sp, @%3 ; load new SP \n" \ 41 " ld sp, @%3 ; load new SP \n" \
32 " push %1 ; store `prev' on new stack \n" \ 42 " push %1 ; store `prev' on new stack \n" \
@@ -34,6 +44,7 @@
34 " .fillinsn \n" \ 44 " .fillinsn \n" \
35 "1: \n" \ 45 "1: \n" \
36 " pop %0 ; restore `__last' from new stack \n" \ 46 " pop %0 ; restore `__last' from new stack \n" \
47 M32R_POP_FP \
37 : "=r" (last) \ 48 : "=r" (last) \
38 : "0" (prev), \ 49 : "0" (prev), \
39 "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \ 50 "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \