diff options
-rw-r--r-- | arch/x86/lib/putuser_32.S | 43 | ||||
-rw-r--r-- | arch/x86/lib/putuser_64.S | 41 | ||||
-rw-r--r-- | include/asm-x86/asm.h | 2 |
3 files changed, 45 insertions, 41 deletions
diff --git a/arch/x86/lib/putuser_32.S b/arch/x86/lib/putuser_32.S index b67a37cab1b0..e7eda34feb34 100644 --- a/arch/x86/lib/putuser_32.S +++ b/arch/x86/lib/putuser_32.S | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/linkage.h> | 11 | #include <linux/linkage.h> |
12 | #include <asm/dwarf2.h> | 12 | #include <asm/dwarf2.h> |
13 | #include <asm/thread_info.h> | 13 | #include <asm/thread_info.h> |
14 | #include <asm/asm.h> | ||
14 | 15 | ||
15 | 16 | ||
16 | /* | 17 | /* |
@@ -26,50 +27,50 @@ | |||
26 | */ | 27 | */ |
27 | 28 | ||
28 | #define ENTER CFI_STARTPROC ; \ | 29 | #define ENTER CFI_STARTPROC ; \ |
29 | GET_THREAD_INFO(%ebx) | 30 | GET_THREAD_INFO(%_ASM_BX) |
30 | #define EXIT ret ; \ | 31 | #define EXIT ret ; \ |
31 | CFI_ENDPROC | 32 | CFI_ENDPROC |
32 | 33 | ||
33 | .text | 34 | .text |
34 | ENTRY(__put_user_1) | 35 | ENTRY(__put_user_1) |
35 | ENTER | 36 | ENTER |
36 | cmp TI_addr_limit(%ebx),%ecx | 37 | cmp TI_addr_limit(%_ASM_BX),%_ASM_CX |
37 | jae bad_put_user | 38 | jae bad_put_user |
38 | 1: movb %al,(%ecx) | 39 | 1: movb %al,(%_ASM_CX) |
39 | xor %eax,%eax | 40 | xor %eax,%eax |
40 | EXIT | 41 | EXIT |
41 | ENDPROC(__put_user_1) | 42 | ENDPROC(__put_user_1) |
42 | 43 | ||
43 | ENTRY(__put_user_2) | 44 | ENTRY(__put_user_2) |
44 | ENTER | 45 | ENTER |
45 | mov TI_addr_limit(%ebx),%ebx | 46 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX |
46 | sub $1,%ebx | 47 | sub $1,%_ASM_BX |
47 | cmp %ebx,%ecx | 48 | cmp %_ASM_BX,%_ASM_CX |
48 | jae bad_put_user | 49 | jae bad_put_user |
49 | 2: movw %ax,(%ecx) | 50 | 2: movw %ax,(%_ASM_CX) |
50 | xor %eax,%eax | 51 | xor %eax,%eax |
51 | EXIT | 52 | EXIT |
52 | ENDPROC(__put_user_2) | 53 | ENDPROC(__put_user_2) |
53 | 54 | ||
54 | ENTRY(__put_user_4) | 55 | ENTRY(__put_user_4) |
55 | ENTER | 56 | ENTER |
56 | mov TI_addr_limit(%ebx),%ebx | 57 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX |
57 | sub $3,%ebx | 58 | sub $3,%_ASM_BX |
58 | cmp %ebx,%ecx | 59 | cmp %_ASM_BX,%_ASM_CX |
59 | jae bad_put_user | 60 | jae bad_put_user |
60 | 3: movl %eax,(%ecx) | 61 | 3: movl %eax,(%_ASM_CX) |
61 | xor %eax,%eax | 62 | xor %eax,%eax |
62 | EXIT | 63 | EXIT |
63 | ENDPROC(__put_user_4) | 64 | ENDPROC(__put_user_4) |
64 | 65 | ||
65 | ENTRY(__put_user_8) | 66 | ENTRY(__put_user_8) |
66 | ENTER | 67 | ENTER |
67 | mov TI_addr_limit(%ebx),%ebx | 68 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX |
68 | sub $7,%ebx | 69 | sub $7,%_ASM_BX |
69 | cmp %ebx,%ecx | 70 | cmp %_ASM_BX,%_ASM_CX |
70 | jae bad_put_user | 71 | jae bad_put_user |
71 | 4: movl %eax,(%ecx) | 72 | 4: movl %_ASM_AX,(%_ASM_CX) |
72 | 5: movl %edx,4(%ecx) | 73 | 5: movl %edx,4(%_ASM_CX) |
73 | xor %eax,%eax | 74 | xor %eax,%eax |
74 | EXIT | 75 | EXIT |
75 | ENDPROC(__put_user_8) | 76 | ENDPROC(__put_user_8) |
@@ -81,9 +82,9 @@ bad_put_user: | |||
81 | END(bad_put_user) | 82 | END(bad_put_user) |
82 | 83 | ||
83 | .section __ex_table,"a" | 84 | .section __ex_table,"a" |
84 | .long 1b,bad_put_user | 85 | _ASM_PTR 1b,bad_put_user |
85 | .long 2b,bad_put_user | 86 | _ASM_PTR 2b,bad_put_user |
86 | .long 3b,bad_put_user | 87 | _ASM_PTR 3b,bad_put_user |
87 | .long 4b,bad_put_user | 88 | _ASM_PTR 4b,bad_put_user |
88 | .long 5b,bad_put_user | 89 | _ASM_PTR 5b,bad_put_user |
89 | .previous | 90 | .previous |
diff --git a/arch/x86/lib/putuser_64.S b/arch/x86/lib/putuser_64.S index c18fc0f5256c..d496cc8e7308 100644 --- a/arch/x86/lib/putuser_64.S +++ b/arch/x86/lib/putuser_64.S | |||
@@ -30,64 +30,65 @@ | |||
30 | #include <asm/errno.h> | 30 | #include <asm/errno.h> |
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 | #include <asm/asm.h> | ||
33 | 34 | ||
34 | #define ENTER CFI_STARTPROC ; \ | 35 | #define ENTER CFI_STARTPROC ; \ |
35 | GET_THREAD_INFO(%rbx) | 36 | GET_THREAD_INFO(%_ASM_BX) |
36 | #define EXIT ret ; \ | 37 | #define EXIT ret ; \ |
37 | CFI_ENDPROC | 38 | CFI_ENDPROC |
38 | 39 | ||
39 | .text | 40 | .text |
40 | ENTRY(__put_user_1) | 41 | ENTRY(__put_user_1) |
41 | ENTER | 42 | ENTER |
42 | cmp TI_addr_limit(%rbx),%rcx | 43 | cmp TI_addr_limit(%_ASM_BX),%_ASM_CX |
43 | jae bad_put_user | 44 | jae bad_put_user |
44 | 1: movb %al,(%rcx) | 45 | 1: movb %al,(%_ASM_CX) |
45 | xor %eax,%eax | 46 | xor %eax,%eax |
46 | EXIT | 47 | EXIT |
47 | ENDPROC(__put_user_1) | 48 | ENDPROC(__put_user_1) |
48 | 49 | ||
49 | ENTRY(__put_user_2) | 50 | ENTRY(__put_user_2) |
50 | ENTER | 51 | ENTER |
51 | mov TI_addr_limit(%rbx),%rbx | 52 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX |
52 | sub $1, %rbx | 53 | sub $1, %_ASM_BX |
53 | cmp %rbx ,%rcx | 54 | cmp %_ASM_BX ,%_ASM_CX |
54 | jae bad_put_user | 55 | jae bad_put_user |
55 | 2: movw %ax,(%rcx) | 56 | 2: movw %ax,(%_ASM_CX) |
56 | xor %eax,%eax | 57 | xor %eax,%eax |
57 | EXIT | 58 | EXIT |
58 | ENDPROC(__put_user_2) | 59 | ENDPROC(__put_user_2) |
59 | 60 | ||
60 | ENTRY(__put_user_4) | 61 | ENTRY(__put_user_4) |
61 | ENTER | 62 | ENTER |
62 | mov TI_addr_limit(%rbx),%rbx | 63 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX |
63 | sub $3, %rbx | 64 | sub $3, %_ASM_BX |
64 | cmp %rbx, %rcx | 65 | cmp %_ASM_BX, %_ASM_CX |
65 | jae bad_put_user | 66 | jae bad_put_user |
66 | 3: movl %eax,(%rcx) | 67 | 3: movl %eax,(%_ASM_CX) |
67 | xor %eax,%eax | 68 | xor %eax,%eax |
68 | EXIT | 69 | EXIT |
69 | ENDPROC(__put_user_4) | 70 | ENDPROC(__put_user_4) |
70 | 71 | ||
71 | ENTRY(__put_user_8) | 72 | ENTRY(__put_user_8) |
72 | ENTER | 73 | ENTER |
73 | mov TI_addr_limit(%rbx),%rbx | 74 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX |
74 | sub $7, %rbx | 75 | sub $7, %_ASM_BX |
75 | cmp %rbx, %rcx | 76 | cmp %_ASM_BX, %_ASM_CX |
76 | jae bad_put_user | 77 | jae bad_put_user |
77 | 4: movq %rax,(%rcx) | 78 | 4: movq %_ASM_AX,(%_ASM_CX) |
78 | xor %eax,%eax | 79 | xor %eax,%eax |
79 | EXIT | 80 | EXIT |
80 | ENDPROC(__put_user_8) | 81 | ENDPROC(__put_user_8) |
81 | 82 | ||
82 | bad_put_user: | 83 | bad_put_user: |
83 | CFI_STARTPROC | 84 | CFI_STARTPROC |
84 | mov $(-EFAULT),%rax | 85 | mov $(-EFAULT),%eax |
85 | EXIT | 86 | EXIT |
86 | END(bad_put_user) | 87 | END(bad_put_user) |
87 | 88 | ||
88 | .section __ex_table,"a" | 89 | .section __ex_table,"a" |
89 | .quad 1b,bad_put_user | 90 | _ASM_PTR 1b,bad_put_user |
90 | .quad 2b,bad_put_user | 91 | _ASM_PTR 2b,bad_put_user |
91 | .quad 3b,bad_put_user | 92 | _ASM_PTR 3b,bad_put_user |
92 | .quad 4b,bad_put_user | 93 | _ASM_PTR 4b,bad_put_user |
93 | .previous | 94 | .previous |
diff --git a/include/asm-x86/asm.h b/include/asm-x86/asm.h index 57750a95685d..97220321f39d 100644 --- a/include/asm-x86/asm.h +++ b/include/asm-x86/asm.h | |||
@@ -28,6 +28,8 @@ | |||
28 | #define _ASM_SUB __ASM_SIZE(sub) | 28 | #define _ASM_SUB __ASM_SIZE(sub) |
29 | #define _ASM_XADD __ASM_SIZE(xadd) | 29 | #define _ASM_XADD __ASM_SIZE(xadd) |
30 | #define _ASM_AX __ASM_REG(ax) | 30 | #define _ASM_AX __ASM_REG(ax) |
31 | #define _ASM_BX __ASM_REG(bx) | ||
32 | #define _ASM_CX __ASM_REG(cx) | ||
31 | #define _ASM_DX __ASM_REG(dx) | 33 | #define _ASM_DX __ASM_REG(dx) |
32 | 34 | ||
33 | /* Exception table entry */ | 35 | /* Exception table entry */ |