aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-06-24 15:51:59 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-09 03:14:09 -0400
commit663aa96df32af9c4141ef3179282f95c7537643a (patch)
treefd8856815bea7ef8b6525f498cbc6f7dc2ded28e /arch/x86/lib
parent0ada3164031162b4e1b7ff6b36ba8cc80ff7fe96 (diff)
x86: change testing logic in putuser_64.S.
Instead of operating over a register we need to put back into normal state afterwards (the memory position), just sub from rbx, which is trashed anyway. We can save a few instructions. Also, this is the i386 way. 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/putuser_64.S33
1 files changed, 12 insertions, 21 deletions
diff --git a/arch/x86/lib/putuser_64.S b/arch/x86/lib/putuser_64.S
index ce5fcd5d8c16..a96bd8a5298e 100644
--- a/arch/x86/lib/putuser_64.S
+++ b/arch/x86/lib/putuser_64.S
@@ -46,48 +46,39 @@ ENDPROC(__put_user_1)
46ENTRY(__put_user_2) 46ENTRY(__put_user_2)
47 CFI_STARTPROC 47 CFI_STARTPROC
48 GET_THREAD_INFO(%rbx) 48 GET_THREAD_INFO(%rbx)
49 addq $1,%rcx 49 mov TI_addr_limit(%rbx),%rbx
50 jc 20f 50 sub $1, %rbx
51 cmpq TI_addr_limit(%rbx),%rcx 51 cmpq %rbx ,%rcx
52 jae 20f 52 jae bad_put_user
53 decq %rcx
542: movw %ax,(%rcx) 532: movw %ax,(%rcx)
55 xorl %eax,%eax 54 xorl %eax,%eax
56 ret 55 ret
5720: decq %rcx
58 jmp bad_put_user
59 CFI_ENDPROC 56 CFI_ENDPROC
60ENDPROC(__put_user_2) 57ENDPROC(__put_user_2)
61 58
62ENTRY(__put_user_4) 59ENTRY(__put_user_4)
63 CFI_STARTPROC 60 CFI_STARTPROC
64 GET_THREAD_INFO(%rbx) 61 GET_THREAD_INFO(%rbx)
65 addq $3,%rcx 62 mov TI_addr_limit(%rbx),%rbx
66 jc 30f 63 sub $3, %rbx
67 cmpq TI_addr_limit(%rbx),%rcx 64 cmp %rbx, %rcx
68 jae 30f 65 jae bad_put_user
69 subq $3,%rcx
703: movl %eax,(%rcx) 663: movl %eax,(%rcx)
71 xorl %eax,%eax 67 xorl %eax,%eax
72 ret 68 ret
7330: subq $3,%rcx
74 jmp bad_put_user
75 CFI_ENDPROC 69 CFI_ENDPROC
76ENDPROC(__put_user_4) 70ENDPROC(__put_user_4)
77 71
78ENTRY(__put_user_8) 72ENTRY(__put_user_8)
79 CFI_STARTPROC 73 CFI_STARTPROC
80 GET_THREAD_INFO(%rbx) 74 GET_THREAD_INFO(%rbx)
81 addq $7,%rcx 75 mov TI_addr_limit(%rbx),%rbx
82 jc 40f 76 sub $7, %rbx
83 cmpq TI_addr_limit(%rbx),%rcx 77 cmp %rbx, %rcx
84 jae 40f 78 jae bad_put_user
85 subq $7,%rcx
864: movq %rax,(%rcx) 794: movq %rax,(%rcx)
87 xorl %eax,%eax 80 xorl %eax,%eax
88 ret 81 ret
8940: subq $7,%rcx
90 jmp bad_put_user
91 CFI_ENDPROC 82 CFI_ENDPROC
92ENDPROC(__put_user_8) 83ENDPROC(__put_user_8)
93 84