Commit fdb6d070 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[S390] switch_to: dont restore/save access & fpu regs for kernel threads

If the previous task was a kernel thread there is no need to save the
contents of the fpu and access registers since they aren't used in
kernel mode.
For the same reason it is not necessary to restore these registers if
the next task is a kernel thread.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f861e405
...@@ -85,14 +85,18 @@ static inline void restore_access_regs(unsigned int *acrs) ...@@ -85,14 +85,18 @@ static inline void restore_access_regs(unsigned int *acrs)
asm volatile("lam 0,15,%0" : : "Q" (*acrs)); asm volatile("lam 0,15,%0" : : "Q" (*acrs));
} }
#define switch_to(prev,next,last) do { \ #define switch_to(prev,next,last) do { \
if (prev == next) \ if (prev == next) \
break; \ break; \
save_fp_regs(&prev->thread.fp_regs); \ if (prev->mm) { \
restore_fp_regs(&next->thread.fp_regs); \ save_fp_regs(&prev->thread.fp_regs); \
save_access_regs(&prev->thread.acrs[0]); \ save_access_regs(&prev->thread.acrs[0]); \
restore_access_regs(&next->thread.acrs[0]); \ } \
prev = __switch_to(prev,next); \ if (next->mm) { \
restore_fp_regs(&next->thread.fp_regs); \
restore_access_regs(&next->thread.acrs[0]); \
} \
prev = __switch_to(prev,next); \
} while (0) } while (0)
extern void account_vtime(struct task_struct *, struct task_struct *); extern void account_vtime(struct task_struct *, struct task_struct *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment