diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-06-24 11:40:55 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 03:14:06 -0400 |
commit | 268cf048c890d10bd3a86bd87922ed8a722d502f (patch) | |
tree | f5ea14b5f422686a537561a37569c40722327d8a | |
parent | 6c2d458680d49d939ffd4b4cdc84d9e004d65910 (diff) |
x86: don't save ebx in putuser_32.S.
Clobber it in the inline asm macros, and let the compiler do this for us.
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/lib/putuser_32.S | 13 | ||||
-rw-r--r-- | include/asm-x86/uaccess_32.h | 10 |
2 files changed, 7 insertions, 16 deletions
diff --git a/arch/x86/lib/putuser_32.S b/arch/x86/lib/putuser_32.S index f58fba109d18..5b2a926f0e28 100644 --- a/arch/x86/lib/putuser_32.S +++ b/arch/x86/lib/putuser_32.S | |||
@@ -26,14 +26,8 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #define ENTER CFI_STARTPROC ; \ | 28 | #define ENTER CFI_STARTPROC ; \ |
29 | pushl %ebx ; \ | ||
30 | CFI_ADJUST_CFA_OFFSET 4 ; \ | ||
31 | CFI_REL_OFFSET ebx, 0 ; \ | ||
32 | GET_THREAD_INFO(%ebx) | 29 | GET_THREAD_INFO(%ebx) |
33 | #define EXIT popl %ebx ; \ | 30 | #define EXIT ret ; \ |
34 | CFI_ADJUST_CFA_OFFSET -4 ; \ | ||
35 | CFI_RESTORE ebx ; \ | ||
36 | ret ; \ | ||
37 | CFI_ENDPROC | 31 | CFI_ENDPROC |
38 | 32 | ||
39 | .text | 33 | .text |
@@ -81,10 +75,7 @@ ENTRY(__put_user_8) | |||
81 | ENDPROC(__put_user_8) | 75 | ENDPROC(__put_user_8) |
82 | 76 | ||
83 | bad_put_user: | 77 | bad_put_user: |
84 | CFI_STARTPROC simple | 78 | CFI_STARTPROC |
85 | CFI_DEF_CFA esp, 2*4 | ||
86 | CFI_OFFSET eip, -1*4 | ||
87 | CFI_OFFSET ebx, -2*4 | ||
88 | movl $-14,%eax | 79 | movl $-14,%eax |
89 | EXIT | 80 | EXIT |
90 | END(bad_put_user) | 81 | END(bad_put_user) |
diff --git a/include/asm-x86/uaccess_32.h b/include/asm-x86/uaccess_32.h index 8e7595c1f34e..0ecfe47ad60d 100644 --- a/include/asm-x86/uaccess_32.h +++ b/include/asm-x86/uaccess_32.h | |||
@@ -188,23 +188,23 @@ extern void __put_user_8(void); | |||
188 | 188 | ||
189 | #define __put_user_1(x, ptr) \ | 189 | #define __put_user_1(x, ptr) \ |
190 | asm volatile("call __put_user_1" : "=a" (__ret_pu) \ | 190 | asm volatile("call __put_user_1" : "=a" (__ret_pu) \ |
191 | : "0" ((typeof(*(ptr)))(x)), "c" (ptr)) | 191 | : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") |
192 | 192 | ||
193 | #define __put_user_2(x, ptr) \ | 193 | #define __put_user_2(x, ptr) \ |
194 | asm volatile("call __put_user_2" : "=a" (__ret_pu) \ | 194 | asm volatile("call __put_user_2" : "=a" (__ret_pu) \ |
195 | : "0" ((typeof(*(ptr)))(x)), "c" (ptr)) | 195 | : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") |
196 | 196 | ||
197 | #define __put_user_4(x, ptr) \ | 197 | #define __put_user_4(x, ptr) \ |
198 | asm volatile("call __put_user_4" : "=a" (__ret_pu) \ | 198 | asm volatile("call __put_user_4" : "=a" (__ret_pu) \ |
199 | : "0" ((typeof(*(ptr)))(x)), "c" (ptr)) | 199 | : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") |
200 | 200 | ||
201 | #define __put_user_8(x, ptr) \ | 201 | #define __put_user_8(x, ptr) \ |
202 | asm volatile("call __put_user_8" : "=a" (__ret_pu) \ | 202 | asm volatile("call __put_user_8" : "=a" (__ret_pu) \ |
203 | : "A" ((typeof(*(ptr)))(x)), "c" (ptr)) | 203 | : "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") |
204 | 204 | ||
205 | #define __put_user_X(x, ptr) \ | 205 | #define __put_user_X(x, ptr) \ |
206 | asm volatile("call __put_user_X" : "=a" (__ret_pu) \ | 206 | asm volatile("call __put_user_X" : "=a" (__ret_pu) \ |
207 | : "c" (ptr)) | 207 | : "c" (ptr): "ebx") |
208 | 208 | ||
209 | /** | 209 | /** |
210 | * put_user: - Write a simple value into user space. | 210 | * put_user: - Write a simple value into user space. |