diff options
Diffstat (limited to 'arch/x86_64/lib/getuser.S')
-rw-r--r-- | arch/x86_64/lib/getuser.S | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/arch/x86_64/lib/getuser.S b/arch/x86_64/lib/getuser.S index 3844d5e885a4..5448876261f8 100644 --- a/arch/x86_64/lib/getuser.S +++ b/arch/x86_64/lib/getuser.S | |||
@@ -27,25 +27,26 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/linkage.h> | 29 | #include <linux/linkage.h> |
30 | #include <asm/dwarf2.h> | ||
30 | #include <asm/page.h> | 31 | #include <asm/page.h> |
31 | #include <asm/errno.h> | 32 | #include <asm/errno.h> |
32 | #include <asm/asm-offsets.h> | 33 | #include <asm/asm-offsets.h> |
33 | #include <asm/thread_info.h> | 34 | #include <asm/thread_info.h> |
34 | 35 | ||
35 | .text | 36 | .text |
36 | .p2align 4 | 37 | ENTRY(__get_user_1) |
37 | .globl __get_user_1 | 38 | CFI_STARTPROC |
38 | __get_user_1: | ||
39 | GET_THREAD_INFO(%r8) | 39 | GET_THREAD_INFO(%r8) |
40 | cmpq threadinfo_addr_limit(%r8),%rcx | 40 | cmpq threadinfo_addr_limit(%r8),%rcx |
41 | jae bad_get_user | 41 | jae bad_get_user |
42 | 1: movzb (%rcx),%edx | 42 | 1: movzb (%rcx),%edx |
43 | xorl %eax,%eax | 43 | xorl %eax,%eax |
44 | ret | 44 | ret |
45 | CFI_ENDPROC | ||
46 | ENDPROC(__get_user_1) | ||
45 | 47 | ||
46 | .p2align 4 | 48 | ENTRY(__get_user_2) |
47 | .globl __get_user_2 | 49 | CFI_STARTPROC |
48 | __get_user_2: | ||
49 | GET_THREAD_INFO(%r8) | 50 | GET_THREAD_INFO(%r8) |
50 | addq $1,%rcx | 51 | addq $1,%rcx |
51 | jc 20f | 52 | jc 20f |
@@ -57,10 +58,11 @@ __get_user_2: | |||
57 | ret | 58 | ret |
58 | 20: decq %rcx | 59 | 20: decq %rcx |
59 | jmp bad_get_user | 60 | jmp bad_get_user |
61 | CFI_ENDPROC | ||
62 | ENDPROC(__get_user_2) | ||
60 | 63 | ||
61 | .p2align 4 | 64 | ENTRY(__get_user_4) |
62 | .globl __get_user_4 | 65 | CFI_STARTPROC |
63 | __get_user_4: | ||
64 | GET_THREAD_INFO(%r8) | 66 | GET_THREAD_INFO(%r8) |
65 | addq $3,%rcx | 67 | addq $3,%rcx |
66 | jc 30f | 68 | jc 30f |
@@ -72,10 +74,11 @@ __get_user_4: | |||
72 | ret | 74 | ret |
73 | 30: subq $3,%rcx | 75 | 30: subq $3,%rcx |
74 | jmp bad_get_user | 76 | jmp bad_get_user |
77 | CFI_ENDPROC | ||
78 | ENDPROC(__get_user_4) | ||
75 | 79 | ||
76 | .p2align 4 | 80 | ENTRY(__get_user_8) |
77 | .globl __get_user_8 | 81 | CFI_STARTPROC |
78 | __get_user_8: | ||
79 | GET_THREAD_INFO(%r8) | 82 | GET_THREAD_INFO(%r8) |
80 | addq $7,%rcx | 83 | addq $7,%rcx |
81 | jc 40f | 84 | jc 40f |
@@ -87,11 +90,16 @@ __get_user_8: | |||
87 | ret | 90 | ret |
88 | 40: subq $7,%rcx | 91 | 40: subq $7,%rcx |
89 | jmp bad_get_user | 92 | jmp bad_get_user |
93 | CFI_ENDPROC | ||
94 | ENDPROC(__get_user_8) | ||
90 | 95 | ||
91 | bad_get_user: | 96 | bad_get_user: |
97 | CFI_STARTPROC | ||
92 | xorl %edx,%edx | 98 | xorl %edx,%edx |
93 | movq $(-EFAULT),%rax | 99 | movq $(-EFAULT),%rax |
94 | ret | 100 | ret |
101 | CFI_ENDPROC | ||
102 | END(bad_get_user) | ||
95 | 103 | ||
96 | .section __ex_table,"a" | 104 | .section __ex_table,"a" |
97 | .quad 1b,bad_get_user | 105 | .quad 1b,bad_get_user |