ia64/xen-unstable

view xenolinux-2.4.21-pre4-sparse/arch/xeno/lib/getuser.S @ 235:d7d0a23b2e07

bitkeeper revision 1.93 (3e5a4e6bkPheUp3x1uufN2MS3LAB7A)

Latest and Greatest version of XenoLinux based on the Linux-2.4.21-pre4
kernel.
author iap10@labyrinth.cl.cam.ac.uk
date Mon Feb 24 16:55:07 2003 +0000 (2003-02-24)
parents
children
line source
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 */
12 /*
13 * __get_user_X
14 *
15 * Inputs: %eax contains the address
16 *
17 * Outputs: %eax is error code (0 or -EFAULT)
18 * %edx contains zero-extended value
19 *
20 * These functions should not modify any other registers,
21 * as they get called from within inline assembly.
22 */
24 addr_limit = 12
26 .text
27 .align 4
28 .globl __get_user_1
29 __get_user_1:
30 movl %esp,%edx
31 andl $0xffffe000,%edx
32 cmpl addr_limit(%edx),%eax
33 jae bad_get_user
34 1: movzbl (%eax),%edx
35 xorl %eax,%eax
36 ret
38 .align 4
39 .globl __get_user_2
40 __get_user_2:
41 addl $1,%eax
42 movl %esp,%edx
43 jc bad_get_user
44 andl $0xffffe000,%edx
45 cmpl addr_limit(%edx),%eax
46 jae bad_get_user
47 2: movzwl -1(%eax),%edx
48 xorl %eax,%eax
49 ret
51 .align 4
52 .globl __get_user_4
53 __get_user_4:
54 addl $3,%eax
55 movl %esp,%edx
56 jc bad_get_user
57 andl $0xffffe000,%edx
58 cmpl addr_limit(%edx),%eax
59 jae bad_get_user
60 3: movl -3(%eax),%edx
61 xorl %eax,%eax
62 ret
64 bad_get_user:
65 xorl %edx,%edx
66 movl $-14,%eax
67 ret
69 .section __ex_table,"a"
70 .long 1b,bad_get_user
71 .long 2b,bad_get_user
72 .long 3b,bad_get_user
73 .previous