diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-06-24 10:13:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 03:14:01 -0400 |
commit | 9262875395cf22b5a90dd8a640e1070cedf55d0e (patch) | |
tree | 81b17b8f280817da70b4225409c65aaf1c824db9 /arch/x86/lib | |
parent | 9aa038815b5756e20a00b8e1efd5740434b37aea (diff) |
x86: adapt x86_64 getuser functions.
Instead of doing a sub after the addition, use the
offset directly at the memory operand of the mov instructions.
This is the way i386 do.
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/lib')
-rw-r--r-- | arch/x86/lib/getuser_64.S | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/arch/x86/lib/getuser_64.S b/arch/x86/lib/getuser_64.S index 2b003d313480..df37d3a9ba2a 100644 --- a/arch/x86/lib/getuser_64.S +++ b/arch/x86/lib/getuser_64.S | |||
@@ -47,49 +47,40 @@ ENDPROC(__get_user_1) | |||
47 | 47 | ||
48 | ENTRY(__get_user_2) | 48 | ENTRY(__get_user_2) |
49 | CFI_STARTPROC | 49 | CFI_STARTPROC |
50 | GET_THREAD_INFO(%rdx) | ||
51 | addq $1,%rax | 50 | addq $1,%rax |
52 | jc 20f | 51 | jc bad_get_user |
52 | GET_THREAD_INFO(%rdx) | ||
53 | cmpq threadinfo_addr_limit(%rdx),%rax | 53 | cmpq threadinfo_addr_limit(%rdx),%rax |
54 | jae 20f | 54 | jae bad_get_user |
55 | decq %rax | 55 | 2: movzwl -1(%rax),%edx |
56 | 2: movzwl (%rax),%edx | ||
57 | xorl %eax,%eax | 56 | xorl %eax,%eax |
58 | ret | 57 | ret |
59 | 20: decq %rax | ||
60 | jmp bad_get_user | ||
61 | CFI_ENDPROC | 58 | CFI_ENDPROC |
62 | ENDPROC(__get_user_2) | 59 | ENDPROC(__get_user_2) |
63 | 60 | ||
64 | ENTRY(__get_user_4) | 61 | ENTRY(__get_user_4) |
65 | CFI_STARTPROC | 62 | CFI_STARTPROC |
66 | GET_THREAD_INFO(%rdx) | ||
67 | addq $3,%rax | 63 | addq $3,%rax |
68 | jc 30f | 64 | jc bad_get_user |
65 | GET_THREAD_INFO(%rdx) | ||
69 | cmpq threadinfo_addr_limit(%rdx),%rax | 66 | cmpq threadinfo_addr_limit(%rdx),%rax |
70 | jae 30f | 67 | jae bad_get_user |
71 | subq $3,%rax | 68 | 3: movl -3(%rax),%edx |
72 | 3: movl (%rax),%edx | ||
73 | xorl %eax,%eax | 69 | xorl %eax,%eax |
74 | ret | 70 | ret |
75 | 30: subq $3,%rax | ||
76 | jmp bad_get_user | ||
77 | CFI_ENDPROC | 71 | CFI_ENDPROC |
78 | ENDPROC(__get_user_4) | 72 | ENDPROC(__get_user_4) |
79 | 73 | ||
80 | ENTRY(__get_user_8) | 74 | ENTRY(__get_user_8) |
81 | CFI_STARTPROC | 75 | CFI_STARTPROC |
82 | GET_THREAD_INFO(%rdx) | ||
83 | addq $7,%rax | 76 | addq $7,%rax |
84 | jc 40f | 77 | jc bad_get_user |
78 | GET_THREAD_INFO(%rdx) | ||
85 | cmpq threadinfo_addr_limit(%rdx),%rax | 79 | cmpq threadinfo_addr_limit(%rdx),%rax |
86 | jae 40f | 80 | jae bad_get_user |
87 | subq $7,%rax | 81 | 4: movq -7(%rax),%rdx |
88 | 4: movq (%rax),%rdx | ||
89 | xorl %eax,%eax | 82 | xorl %eax,%eax |
90 | ret | 83 | ret |
91 | 40: subq $7,%rax | ||
92 | jmp bad_get_user | ||
93 | CFI_ENDPROC | 84 | CFI_ENDPROC |
94 | ENDPROC(__get_user_8) | 85 | ENDPROC(__get_user_8) |
95 | 86 | ||