diff options
-rw-r--r-- | arch/x86/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/lib/putuser.S (renamed from arch/x86/lib/putuser_32.S) | 11 | ||||
-rw-r--r-- | arch/x86/lib/putuser_64.S | 94 |
3 files changed, 10 insertions, 97 deletions
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index e92948203a5d..83226e0a7ce4 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile | |||
@@ -5,7 +5,7 @@ | |||
5 | obj-$(CONFIG_SMP) := msr-on-cpu.o | 5 | obj-$(CONFIG_SMP) := msr-on-cpu.o |
6 | 6 | ||
7 | lib-y := delay.o | 7 | lib-y := delay.o |
8 | lib-y += usercopy_$(BITS).o getuser.o putuser_$(BITS).o | 8 | lib-y += usercopy_$(BITS).o getuser.o putuser.o |
9 | lib-y += memcpy_$(BITS).o | 9 | lib-y += memcpy_$(BITS).o |
10 | 10 | ||
11 | ifeq ($(CONFIG_X86_32),y) | 11 | ifeq ($(CONFIG_X86_32),y) |
diff --git a/arch/x86/lib/putuser_32.S b/arch/x86/lib/putuser.S index e7eda34feb34..36b0d15ae6e9 100644 --- a/arch/x86/lib/putuser_32.S +++ b/arch/x86/lib/putuser.S | |||
@@ -2,6 +2,8 @@ | |||
2 | * __put_user functions. | 2 | * __put_user functions. |
3 | * | 3 | * |
4 | * (C) Copyright 2005 Linus Torvalds | 4 | * (C) Copyright 2005 Linus Torvalds |
5 | * (C) Copyright 2005 Andi Kleen | ||
6 | * (C) Copyright 2008 Glauber Costa | ||
5 | * | 7 | * |
6 | * These functions have a non-standard call interface | 8 | * These functions have a non-standard call interface |
7 | * to make them more efficient, especially as they | 9 | * to make them more efficient, especially as they |
@@ -11,6 +13,7 @@ | |||
11 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
12 | #include <asm/dwarf2.h> | 14 | #include <asm/dwarf2.h> |
13 | #include <asm/thread_info.h> | 15 | #include <asm/thread_info.h> |
16 | #include <asm/errno.h> | ||
14 | #include <asm/asm.h> | 17 | #include <asm/asm.h> |
15 | 18 | ||
16 | 19 | ||
@@ -69,15 +72,17 @@ ENTRY(__put_user_8) | |||
69 | sub $7,%_ASM_BX | 72 | sub $7,%_ASM_BX |
70 | cmp %_ASM_BX,%_ASM_CX | 73 | cmp %_ASM_BX,%_ASM_CX |
71 | jae bad_put_user | 74 | jae bad_put_user |
72 | 4: movl %_ASM_AX,(%_ASM_CX) | 75 | 4: mov %_ASM_AX,(%_ASM_CX) |
76 | #ifdef CONFIG_X86_32 | ||
73 | 5: movl %edx,4(%_ASM_CX) | 77 | 5: movl %edx,4(%_ASM_CX) |
78 | #endif | ||
74 | xor %eax,%eax | 79 | xor %eax,%eax |
75 | EXIT | 80 | EXIT |
76 | ENDPROC(__put_user_8) | 81 | ENDPROC(__put_user_8) |
77 | 82 | ||
78 | bad_put_user: | 83 | bad_put_user: |
79 | CFI_STARTPROC | 84 | CFI_STARTPROC |
80 | movl $-14,%eax | 85 | movl $-EFAULT,%eax |
81 | EXIT | 86 | EXIT |
82 | END(bad_put_user) | 87 | END(bad_put_user) |
83 | 88 | ||
@@ -86,5 +91,7 @@ END(bad_put_user) | |||
86 | _ASM_PTR 2b,bad_put_user | 91 | _ASM_PTR 2b,bad_put_user |
87 | _ASM_PTR 3b,bad_put_user | 92 | _ASM_PTR 3b,bad_put_user |
88 | _ASM_PTR 4b,bad_put_user | 93 | _ASM_PTR 4b,bad_put_user |
94 | #ifdef CONFIG_X86_32 | ||
89 | _ASM_PTR 5b,bad_put_user | 95 | _ASM_PTR 5b,bad_put_user |
96 | #endif | ||
90 | .previous | 97 | .previous |
diff --git a/arch/x86/lib/putuser_64.S b/arch/x86/lib/putuser_64.S deleted file mode 100644 index d496cc8e7308..000000000000 --- a/arch/x86/lib/putuser_64.S +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | * __put_user functions. | ||
3 | * | ||
4 | * (C) Copyright 1998 Linus Torvalds | ||
5 | * (C) Copyright 2005 Andi Kleen | ||
6 | * | ||
7 | * These functions have a non-standard call interface | ||
8 | * to make them more efficient, especially as they | ||
9 | * return an error value in addition to the "real" | ||
10 | * return value. | ||
11 | */ | ||
12 | |||
13 | /* | ||
14 | * __put_user_X | ||
15 | * | ||
16 | * Inputs: %rcx contains the address | ||
17 | * %rdx contains new value | ||
18 | * | ||
19 | * Outputs: %rax is error code (0 or -EFAULT) | ||
20 | * | ||
21 | * %rbx is destroyed. | ||
22 | * | ||
23 | * These functions should not modify any other registers, | ||
24 | * as they get called from within inline assembly. | ||
25 | */ | ||
26 | |||
27 | #include <linux/linkage.h> | ||
28 | #include <asm/dwarf2.h> | ||
29 | #include <asm/page.h> | ||
30 | #include <asm/errno.h> | ||
31 | #include <asm/asm-offsets.h> | ||
32 | #include <asm/thread_info.h> | ||
33 | #include <asm/asm.h> | ||
34 | |||
35 | #define ENTER CFI_STARTPROC ; \ | ||
36 | GET_THREAD_INFO(%_ASM_BX) | ||
37 | #define EXIT ret ; \ | ||
38 | CFI_ENDPROC | ||
39 | |||
40 | .text | ||
41 | ENTRY(__put_user_1) | ||
42 | ENTER | ||
43 | cmp TI_addr_limit(%_ASM_BX),%_ASM_CX | ||
44 | jae bad_put_user | ||
45 | 1: movb %al,(%_ASM_CX) | ||
46 | xor %eax,%eax | ||
47 | EXIT | ||
48 | ENDPROC(__put_user_1) | ||
49 | |||
50 | ENTRY(__put_user_2) | ||
51 | ENTER | ||
52 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX | ||
53 | sub $1, %_ASM_BX | ||
54 | cmp %_ASM_BX ,%_ASM_CX | ||
55 | jae bad_put_user | ||
56 | 2: movw %ax,(%_ASM_CX) | ||
57 | xor %eax,%eax | ||
58 | EXIT | ||
59 | ENDPROC(__put_user_2) | ||
60 | |||
61 | ENTRY(__put_user_4) | ||
62 | ENTER | ||
63 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX | ||
64 | sub $3, %_ASM_BX | ||
65 | cmp %_ASM_BX, %_ASM_CX | ||
66 | jae bad_put_user | ||
67 | 3: movl %eax,(%_ASM_CX) | ||
68 | xor %eax,%eax | ||
69 | EXIT | ||
70 | ENDPROC(__put_user_4) | ||
71 | |||
72 | ENTRY(__put_user_8) | ||
73 | ENTER | ||
74 | mov TI_addr_limit(%_ASM_BX),%_ASM_BX | ||
75 | sub $7, %_ASM_BX | ||
76 | cmp %_ASM_BX, %_ASM_CX | ||
77 | jae bad_put_user | ||
78 | 4: movq %_ASM_AX,(%_ASM_CX) | ||
79 | xor %eax,%eax | ||
80 | EXIT | ||
81 | ENDPROC(__put_user_8) | ||
82 | |||
83 | bad_put_user: | ||
84 | CFI_STARTPROC | ||
85 | mov $(-EFAULT),%eax | ||
86 | EXIT | ||
87 | END(bad_put_user) | ||
88 | |||
89 | .section __ex_table,"a" | ||
90 | _ASM_PTR 1b,bad_put_user | ||
91 | _ASM_PTR 2b,bad_put_user | ||
92 | _ASM_PTR 3b,bad_put_user | ||
93 | _ASM_PTR 4b,bad_put_user | ||
94 | .previous | ||