x86: replace function headers by macros.
[deliverable/linux.git] / arch / x86 / lib / putuser_32.S
CommitLineData
1da177e4
LT
1/*
2 * __put_user functions.
3 *
4 * (C) Copyright 2005 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 * __put_user_X
18 *
19 * Inputs: %eax[:%edx] contains the data
20 * %ecx contains the address
21 *
22 * Outputs: %eax is error code (0 or -EFAULT)
23 *
24 * These functions should not modify any other registers,
25 * as they get called from within inline assembly.
26 */
27
00e065ea 28#define ENTER CFI_STARTPROC ; \
00e065ea 29 GET_THREAD_INFO(%ebx)
268cf048 30#define EXIT ret ; \
00e065ea 31 CFI_ENDPROC
1da177e4
LT
32
33.text
00e065ea 34ENTRY(__put_user_1)
1da177e4
LT
35 ENTER
36 cmpl TI_addr_limit(%ebx),%ecx
37 jae bad_put_user
381: movb %al,(%ecx)
39 xorl %eax,%eax
40 EXIT
00e065ea 41ENDPROC(__put_user_1)
1da177e4 42
00e065ea 43ENTRY(__put_user_2)
1da177e4
LT
44 ENTER
45 movl TI_addr_limit(%ebx),%ebx
46 subl $1,%ebx
47 cmpl %ebx,%ecx
48 jae bad_put_user
492: movw %ax,(%ecx)
50 xorl %eax,%eax
51 EXIT
00e065ea 52ENDPROC(__put_user_2)
1da177e4 53
00e065ea 54ENTRY(__put_user_4)
1da177e4
LT
55 ENTER
56 movl TI_addr_limit(%ebx),%ebx
57 subl $3,%ebx
58 cmpl %ebx,%ecx
59 jae bad_put_user
603: movl %eax,(%ecx)
61 xorl %eax,%eax
62 EXIT
00e065ea 63ENDPROC(__put_user_4)
1da177e4 64
00e065ea 65ENTRY(__put_user_8)
1da177e4
LT
66 ENTER
67 movl TI_addr_limit(%ebx),%ebx
68 subl $7,%ebx
69 cmpl %ebx,%ecx
70 jae bad_put_user
714: movl %eax,(%ecx)
725: movl %edx,4(%ecx)
73 xorl %eax,%eax
74 EXIT
00e065ea 75ENDPROC(__put_user_8)
1da177e4
LT
76
77bad_put_user:
268cf048 78 CFI_STARTPROC
1da177e4
LT
79 movl $-14,%eax
80 EXIT
00e065ea 81END(bad_put_user)
1da177e4
LT
82
83.section __ex_table,"a"
84 .long 1b,bad_put_user
85 .long 2b,bad_put_user
86 .long 3b,bad_put_user
87 .long 4b,bad_put_user
88 .long 5b,bad_put_user
89.previous
This page took 0.37034 seconds and 5 git commands to generate.