ftrace: use dynamic patching for updating mcount calls
[deliverable/linux.git] / arch / x86 / lib / getuser_32.S
CommitLineData
1da177e4
LT
1/*
2 * __get_user functions.
3 *
4 * (C) Copyright 1998 Linus Torvalds
5 *
6 * These functions have a non-standard call interface
7 * to make them more efficient, especially as they
8 * return an error value in addition to the "real"
9 * return value.
10 */
00e065ea
JB
11#include <linux/linkage.h>
12#include <asm/dwarf2.h>
1da177e4
LT
13#include <asm/thread_info.h>
14
15
16/*
17 * __get_user_X
18 *
19 * Inputs: %eax contains the address
20 *
21 * Outputs: %eax is error code (0 or -EFAULT)
22 * %edx contains zero-extended value
23 *
24 * These functions should not modify any other registers,
25 * as they get called from within inline assembly.
26 */
27
28.text
00e065ea
JB
29ENTRY(__get_user_1)
30 CFI_STARTPROC
1da177e4
LT
31 GET_THREAD_INFO(%edx)
32 cmpl TI_addr_limit(%edx),%eax
33 jae bad_get_user
341: movzbl (%eax),%edx
35 xorl %eax,%eax
36 ret
00e065ea
JB
37 CFI_ENDPROC
38ENDPROC(__get_user_1)
1da177e4 39
00e065ea
JB
40ENTRY(__get_user_2)
41 CFI_STARTPROC
1da177e4
LT
42 addl $1,%eax
43 jc bad_get_user
44 GET_THREAD_INFO(%edx)
45 cmpl TI_addr_limit(%edx),%eax
46 jae bad_get_user
472: movzwl -1(%eax),%edx
48 xorl %eax,%eax
49 ret
00e065ea
JB
50 CFI_ENDPROC
51ENDPROC(__get_user_2)
1da177e4 52
00e065ea
JB
53ENTRY(__get_user_4)
54 CFI_STARTPROC
1da177e4
LT
55 addl $3,%eax
56 jc bad_get_user
57 GET_THREAD_INFO(%edx)
58 cmpl TI_addr_limit(%edx),%eax
59 jae bad_get_user
603: movl -3(%eax),%edx
61 xorl %eax,%eax
62 ret
00e065ea
JB
63 CFI_ENDPROC
64ENDPROC(__get_user_4)
1da177e4
LT
65
66bad_get_user:
00e065ea 67 CFI_STARTPROC
1da177e4
LT
68 xorl %edx,%edx
69 movl $-14,%eax
70 ret
00e065ea
JB
71 CFI_ENDPROC
72END(bad_get_user)
1da177e4
LT
73
74.section __ex_table,"a"
75 .long 1b,bad_get_user
76 .long 2b,bad_get_user
77 .long 3b,bad_get_user
78.previous
This page took 0.315192 seconds and 5 git commands to generate.