aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-24 15:56:30 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 03:14:10 -0400
commit766ed4282114eab616741107745b0dd11075e496 (patch)
tree70327f17da3cf94adfd9a99230b4e1110f1464ca /arch/x86
parent663aa96df32af9c4141ef3179282f95c7537643a (diff)
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 @@
31#include <asm/asm-offsets.h> 31#include <asm/asm-offsets.h>
32#include <asm/thread_info.h> 32#include <asm/thread_info.h>
33 33
34#define ENTER CFI_STARTPROC ; \
35 GET_THREAD_INFO(%rbx)
36#define EXIT ret ; \
37 CFI_ENDPROC
38
34 .text 39 .text
35ENTRY(__put_user_1) 40ENTRY(__put_user_1)
36 CFI_STARTPROC 41 ENTER
37 GET_THREAD_INFO(%rbx)
38 cmpq TI_addr_limit(%rbx),%rcx 42 cmpq TI_addr_limit(%rbx),%rcx
39 jae bad_put_user 43 jae bad_put_user
401: movb %al,(%rcx) 441: movb %al,(%rcx)
41 xorl %eax,%eax 45 xorl %eax,%eax
42 ret 46 EXIT
43 CFI_ENDPROC
44ENDPROC(__put_user_1) 47ENDPROC(__put_user_1)
45 48
46ENTRY(__put_user_2) 49ENTRY(__put_user_2)
47 CFI_STARTPROC 50 ENTER
48 GET_THREAD_INFO(%rbx)
49 mov TI_addr_limit(%rbx),%rbx 51 mov TI_addr_limit(%rbx),%rbx
50 sub $1, %rbx 52 sub $1, %rbx
51 cmpq %rbx ,%rcx 53 cmpq %rbx ,%rcx
52 jae bad_put_user 54 jae bad_put_user
532: movw %ax,(%rcx) 552: movw %ax,(%rcx)
54 xorl %eax,%eax 56 xorl %eax,%eax
55 ret 57 EXIT
56 CFI_ENDPROC
57ENDPROC(__put_user_2) 58ENDPROC(__put_user_2)
58 59
59ENTRY(__put_user_4) 60ENTRY(__put_user_4)
60 CFI_STARTPROC 61 ENTER
61 GET_THREAD_INFO(%rbx)
62 mov TI_addr_limit(%rbx),%rbx 62 mov TI_addr_limit(%rbx),%rbx
63 sub $3, %rbx 63 sub $3, %rbx
64 cmp %rbx, %rcx 64 cmp %rbx, %rcx
65 jae bad_put_user 65 jae bad_put_user
663: movl %eax,(%rcx) 663: movl %eax,(%rcx)
67 xorl %eax,%eax 67 xorl %eax,%eax
68 ret 68 EXIT
69 CFI_ENDPROC
70ENDPROC(__put_user_4) 69ENDPROC(__put_user_4)
71 70
72ENTRY(__put_user_8) 71ENTRY(__put_user_8)
73 CFI_STARTPROC 72 ENTER
74 GET_THREAD_INFO(%rbx)
75 mov TI_addr_limit(%rbx),%rbx 73 mov TI_addr_limit(%rbx),%rbx
76 sub $7, %rbx 74 sub $7, %rbx
77 cmp %rbx, %rcx 75 cmp %rbx, %rcx
78 jae bad_put_user 76 jae bad_put_user
794: movq %rax,(%rcx) 774: movq %rax,(%rcx)
80 xorl %eax,%eax 78 xorl %eax,%eax
81 ret 79 EXIT
82 CFI_ENDPROC
83ENDPROC(__put_user_8) 80ENDPROC(__put_user_8)
84 81
85bad_put_user: 82bad_put_user:
86 CFI_STARTPROC 83 CFI_STARTPROC
87 movq $(-EFAULT),%rax 84 movq $(-EFAULT),%rax
88 ret 85 EXIT
89 CFI_ENDPROC
90END(bad_put_user) 86END(bad_put_user)
91 87
92.section __ex_table,"a" 88.section __ex_table,"a"