diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-06-24 15:56:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 03:14:10 -0400 |
commit | 766ed4282114eab616741107745b0dd11075e496 (patch) | |
tree | 70327f17da3cf94adfd9a99230b4e1110f1464ca /arch/x86 | |
parent | 663aa96df32af9c4141ef3179282f95c7537643a (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.S | 32 |
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 |
35 | ENTRY(__put_user_1) | 40 | ENTRY(__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 |
40 | 1: movb %al,(%rcx) | 44 | 1: movb %al,(%rcx) |
41 | xorl %eax,%eax | 45 | xorl %eax,%eax |
42 | ret | 46 | EXIT |
43 | CFI_ENDPROC | ||
44 | ENDPROC(__put_user_1) | 47 | ENDPROC(__put_user_1) |
45 | 48 | ||
46 | ENTRY(__put_user_2) | 49 | ENTRY(__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 |
53 | 2: movw %ax,(%rcx) | 55 | 2: movw %ax,(%rcx) |
54 | xorl %eax,%eax | 56 | xorl %eax,%eax |
55 | ret | 57 | EXIT |
56 | CFI_ENDPROC | ||
57 | ENDPROC(__put_user_2) | 58 | ENDPROC(__put_user_2) |
58 | 59 | ||
59 | ENTRY(__put_user_4) | 60 | ENTRY(__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 |
66 | 3: movl %eax,(%rcx) | 66 | 3: movl %eax,(%rcx) |
67 | xorl %eax,%eax | 67 | xorl %eax,%eax |
68 | ret | 68 | EXIT |
69 | CFI_ENDPROC | ||
70 | ENDPROC(__put_user_4) | 69 | ENDPROC(__put_user_4) |
71 | 70 | ||
72 | ENTRY(__put_user_8) | 71 | ENTRY(__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 |
79 | 4: movq %rax,(%rcx) | 77 | 4: movq %rax,(%rcx) |
80 | xorl %eax,%eax | 78 | xorl %eax,%eax |
81 | ret | 79 | EXIT |
82 | CFI_ENDPROC | ||
83 | ENDPROC(__put_user_8) | 80 | ENDPROC(__put_user_8) |
84 | 81 | ||
85 | bad_put_user: | 82 | bad_put_user: |
86 | CFI_STARTPROC | 83 | CFI_STARTPROC |
87 | movq $(-EFAULT),%rax | 84 | movq $(-EFAULT),%rax |
88 | ret | 85 | EXIT |
89 | CFI_ENDPROC | ||
90 | END(bad_put_user) | 86 | END(bad_put_user) |
91 | 87 | ||
92 | .section __ex_table,"a" | 88 | .section __ex_table,"a" |