summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-24 16:56:30 -0300
committerIngo Molnar <mingo@elte.hu>2008-07-09 09:14:10 +0200
commit766ed4282114eab616741107745b0dd11075e496 (patch)
tree70327f17da3cf94adfd9a99230b4e1110f1464ca /arch/x86
parent663aa96df32af9c4141ef3179282f95c7537643a (diff)
downloadlinux-766ed4282114eab616741107745b0dd11075e496.tar.bz2
x86: replace function headers by macros.
In putuser_64.S, do it the i386 way, and replace the code in beginning and end of functions with macros, since it's always the same thing. Save lines. 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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/lib/putuser_64.S32
1 files changed, 14 insertions, 18 deletions
diff --git a/arch/x86/lib/putuser_64.S b/arch/x86/lib/putuser_64.S
index a96bd8a5298e..6d7513bf885e 100644
--- a/arch/x86/lib/putuser_64.S
+++ b/arch/x86/lib/putuser_64.S
@@ -31,62 +31,58 @@
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
+#define ENTER CFI_STARTPROC ; \
+ GET_THREAD_INFO(%rbx)
+#define EXIT ret ; \
+ CFI_ENDPROC
+
.text
ENTRY(__put_user_1)
- CFI_STARTPROC
- GET_THREAD_INFO(%rbx)
+ ENTER
cmpq TI_addr_limit(%rbx),%rcx
jae bad_put_user
1: movb %al,(%rcx)
xorl %eax,%eax
- ret
- CFI_ENDPROC
+ EXIT
ENDPROC(__put_user_1)
ENTRY(__put_user_2)
- CFI_STARTPROC
- GET_THREAD_INFO(%rbx)
+ ENTER
mov TI_addr_limit(%rbx),%rbx
sub $1, %rbx
cmpq %rbx ,%rcx
jae bad_put_user
2: movw %ax,(%rcx)
xorl %eax,%eax
- ret
- CFI_ENDPROC
+ EXIT
ENDPROC(__put_user_2)
ENTRY(__put_user_4)
- CFI_STARTPROC
- GET_THREAD_INFO(%rbx)
+ ENTER
mov TI_addr_limit(%rbx),%rbx
sub $3, %rbx
cmp %rbx, %rcx
jae bad_put_user
3: movl %eax,(%rcx)
xorl %eax,%eax
- ret
- CFI_ENDPROC
+ EXIT
ENDPROC(__put_user_4)
ENTRY(__put_user_8)
- CFI_STARTPROC
- GET_THREAD_INFO(%rbx)
+ ENTER
mov TI_addr_limit(%rbx),%rbx
sub $7, %rbx
cmp %rbx, %rcx
jae bad_put_user
4: movq %rax,(%rcx)
xorl %eax,%eax
- ret
- CFI_ENDPROC
+ EXIT
ENDPROC(__put_user_8)
bad_put_user:
CFI_STARTPROC
movq $(-EFAULT),%rax
- ret
- CFI_ENDPROC
+ EXIT
END(bad_put_user)
.section __ex_table,"a"