diff options
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/system.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h index 1f2ebc4afd82..c35d0a383f00 100644 --- a/arch/s390/include/asm/system.h +++ b/arch/s390/include/asm/system.h | |||
@@ -85,14 +85,18 @@ static inline void restore_access_regs(unsigned int *acrs) | |||
85 | asm volatile("lam 0,15,%0" : : "Q" (*acrs)); | 85 | asm volatile("lam 0,15,%0" : : "Q" (*acrs)); |
86 | } | 86 | } |
87 | 87 | ||
88 | #define switch_to(prev,next,last) do { \ | 88 | #define switch_to(prev,next,last) do { \ |
89 | if (prev == next) \ | 89 | if (prev == next) \ |
90 | break; \ | 90 | break; \ |
91 | save_fp_regs(&prev->thread.fp_regs); \ | 91 | if (prev->mm) { \ |
92 | restore_fp_regs(&next->thread.fp_regs); \ | 92 | save_fp_regs(&prev->thread.fp_regs); \ |
93 | save_access_regs(&prev->thread.acrs[0]); \ | 93 | save_access_regs(&prev->thread.acrs[0]); \ |
94 | restore_access_regs(&next->thread.acrs[0]); \ | 94 | } \ |
95 | prev = __switch_to(prev,next); \ | 95 | if (next->mm) { \ |
96 | restore_fp_regs(&next->thread.fp_regs); \ | ||
97 | restore_access_regs(&next->thread.acrs[0]); \ | ||
98 | } \ | ||
99 | prev = __switch_to(prev,next); \ | ||
96 | } while (0) | 100 | } while (0) |
97 | 101 | ||
98 | extern void account_vtime(struct task_struct *, struct task_struct *); | 102 | extern void account_vtime(struct task_struct *, struct task_struct *); |