diff options
Diffstat (limited to 'include/asm-x86/system.h')
-rw-r--r-- | include/asm-x86/system.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h index 299ae9605cb1..33b0017156a7 100644 --- a/include/asm-x86/system.h +++ b/include/asm-x86/system.h | |||
@@ -29,7 +29,14 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
29 | */ | 29 | */ |
30 | #define switch_to(prev, next, last) \ | 30 | #define switch_to(prev, next, last) \ |
31 | do { \ | 31 | do { \ |
32 | unsigned long esi, edi; \ | 32 | /* \ |
33 | * Context-switching clobbers all registers, so we clobber \ | ||
34 | * them explicitly, via unused output variables. \ | ||
35 | * (EAX and EBP is not listed because EBP is saved/restored \ | ||
36 | * explicitly for wchan access and EAX is the return value of \ | ||
37 | * __switch_to()) \ | ||
38 | */ \ | ||
39 | unsigned long ebx, ecx, edx, esi, edi; \ | ||
33 | \ | 40 | \ |
34 | asm volatile( \ | 41 | asm volatile( \ |
35 | "pushfl \n\t" /* save flags */ \ | 42 | "pushfl \n\t" /* save flags */ \ |
@@ -49,6 +56,7 @@ do { \ | |||
49 | "=a" (last), \ | 56 | "=a" (last), \ |
50 | \ | 57 | \ |
51 | /* clobbered output registers: */ \ | 58 | /* clobbered output registers: */ \ |
59 | "=b" (ebx), "=c" (ecx), "=d" (edx), \ | ||
52 | "=S" (esi), "=D" (edi) \ | 60 | "=S" (esi), "=D" (edi) \ |
53 | \ | 61 | \ |
54 | /* input parameters: */ \ | 62 | /* input parameters: */ \ |