aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-24 10:13:16 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 03:14:01 -0400
commit9262875395cf22b5a90dd8a640e1070cedf55d0e (patch)
tree81b17b8f280817da70b4225409c65aaf1c824db9 /arch
parent9aa038815b5756e20a00b8e1efd5740434b37aea (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')
-rw-r--r--arch/x86/lib/getuser_64.S33
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
48ENTRY(__get_user_2) 48ENTRY(__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 552: movzwl -1(%rax),%edx
562: movzwl (%rax),%edx
57 xorl %eax,%eax 56 xorl %eax,%eax
58 ret 57 ret
5920: decq %rax
60 jmp bad_get_user
61 CFI_ENDPROC 58 CFI_ENDPROC
62ENDPROC(__get_user_2) 59ENDPROC(__get_user_2)
63 60
64ENTRY(__get_user_4) 61ENTRY(__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 683: movl -3(%rax),%edx
723: movl (%rax),%edx
73 xorl %eax,%eax 69 xorl %eax,%eax
74 ret 70 ret
7530: subq $3,%rax
76 jmp bad_get_user
77 CFI_ENDPROC 71 CFI_ENDPROC
78ENDPROC(__get_user_4) 72ENDPROC(__get_user_4)
79 73
80ENTRY(__get_user_8) 74ENTRY(__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 814: movq -7(%rax),%rdx
884: movq (%rax),%rdx
89 xorl %eax,%eax 82 xorl %eax,%eax
90 ret 83 ret
9140: subq $7,%rax
92 jmp bad_get_user
93 CFI_ENDPROC 84 CFI_ENDPROC
94ENDPROC(__get_user_8) 85ENDPROC(__get_user_8)
95 86