printf: Remove unused 'bprintf'
[drm/drm-misc.git] / arch / xtensa / include / asm / asm-uaccess.h
blob7cec869136e3062ae95747996a5bf7f0e8f83b7e
1 /*
2 * include/asm-xtensa/uaccess.h
4 * User space memory access functions
6 * These routines provide basic accessing functions to the user memory
7 * space for the kernel. This header file provides functions such as:
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
13 * Copyright (C) 2001 - 2005 Tensilica Inc.
16 #ifndef _XTENSA_ASM_UACCESS_H
17 #define _XTENSA_ASM_UACCESS_H
19 #include <linux/errno.h>
20 #include <asm/types.h>
22 #include <asm/current.h>
23 #include <asm/asm-offsets.h>
24 #include <asm/processor.h>
27 * user_ok determines whether the access to user-space memory is allowed.
28 * See the equivalent C-macro version below for clarity.
30 * On error, user_ok branches to a label indicated by parameter
31 * <error>. This implies that the macro falls through to the next
32 * instruction on success.
34 * Note that while this macro can be used independently, we designed
35 * in for optimal use in the access_ok macro below (i.e., we fall
36 * through on success).
38 * On Entry:
39 * <aa> register containing memory address
40 * <as> register containing memory size
41 * <at> temp register
42 * <error> label to branch to on error; implies fall-through
43 * macro on success
44 * On Exit:
45 * <aa> preserved
46 * <as> preserved
47 * <at> destroyed (actually, (TASK_SIZE + 1 - size))
49 .macro user_ok aa, as, at, error
50 movi \at, __XTENSA_UL_CONST(TASK_SIZE)
51 bgeu \as, \at, \error
52 sub \at, \at, \as
53 bgeu \aa, \at, \error
54 .endm
57 * access_ok determines whether a memory access is allowed. See the
58 * equivalent C-macro version below for clarity.
60 * On error, access_ok branches to a label indicated by parameter
61 * <error>. This implies that the macro falls through to the next
62 * instruction on success.
64 * Note that we assume success is the common case, and we optimize the
65 * branch fall-through case on success.
67 * On Entry:
68 * <aa> register containing memory address
69 * <as> register containing memory size
70 * <at> temp register
71 * <sp>
72 * <error> label to branch to on error; implies fall-through
73 * macro on success
74 * On Exit:
75 * <aa> preserved
76 * <as> preserved
77 * <at> destroyed
79 .macro access_ok aa, as, at, sp, error
80 user_ok \aa, \as, \at, \error
81 .Laccess_ok_\@:
82 .endm
84 #endif /* _XTENSA_ASM_UACCESS_H */