x86: don't use word-size specifiers in putuser files.
[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 35 ENTER
efea505d 36 cmp TI_addr_limit(%ebx),%ecx
1da177e4
LT
37 jae bad_put_user
381: movb %al,(%ecx)
efea505d 39 xor %eax,%eax
1da177e4 40 EXIT
00e065ea 41ENDPROC(__put_user_1)
1da177e4 42
00e065ea 43ENTRY(__put_user_2)
1da177e4 44 ENTER
efea505d
GC
45 mov TI_addr_limit(%ebx),%ebx
46 sub $1,%ebx
47 cmp %ebx,%ecx
1da177e4
LT
48 jae bad_put_user
492: movw %ax,(%ecx)
efea505d 50 xor %eax,%eax
1da177e4 51 EXIT
00e065ea 52ENDPROC(__put_user_2)
1da177e4 53
00e065ea 54ENTRY(__put_user_4)
1da177e4 55 ENTER
efea505d
GC
56 mov TI_addr_limit(%ebx),%ebx
57 sub $3,%ebx
58 cmp %ebx,%ecx
1da177e4
LT
59 jae bad_put_user
603: movl %eax,(%ecx)
efea505d 61 xor %eax,%eax
1da177e4 62 EXIT
00e065ea 63ENDPROC(__put_user_4)
1da177e4 64
00e065ea 65ENTRY(__put_user_8)
1da177e4 66 ENTER
efea505d
GC
67 mov TI_addr_limit(%ebx),%ebx
68 sub $7,%ebx
69 cmp %ebx,%ecx
1da177e4
LT
70 jae bad_put_user
714: movl %eax,(%ecx)
725: movl %edx,4(%ecx)
efea505d 73 xor %eax,%eax
1da177e4 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.323708 seconds and 5 git commands to generate.