~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/xtensa/include/asm/asm-uaccess.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * include/asm-xtensa/uaccess.h
  3  *
  4  * User space memory access functions
  5  *
  6  * These routines provide basic accessing functions to the user memory
  7  * space for the kernel. This header file provides functions such as:
  8  *
  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.
 12  *
 13  * Copyright (C) 2001 - 2005 Tensilica Inc.
 14  */
 15 
 16 #ifndef _XTENSA_ASM_UACCESS_H
 17 #define _XTENSA_ASM_UACCESS_H
 18 
 19 #include <linux/errno.h>
 20 #include <asm/types.h>
 21 
 22 #include <asm/current.h>
 23 #include <asm/asm-offsets.h>
 24 #include <asm/processor.h>
 25 
 26 /*
 27  * user_ok determines whether the access to user-space memory is allowed.
 28  * See the equivalent C-macro version below for clarity.
 29  *
 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.
 33  *
 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).
 37  *
 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))
 48  */
 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
 55 
 56 /*
 57  * access_ok determines whether a memory access is allowed.  See the
 58  * equivalent C-macro version below for clarity.
 59  *
 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.
 63  *
 64  * Note that we assume success is the common case, and we optimize the
 65  * branch fall-through case on success.
 66  *
 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
 78  */
 79         .macro  access_ok  aa, as, at, sp, error
 80         user_ok    \aa, \as, \at, \error
 81 .Laccess_ok_\@:
 82         .endm
 83 
 84 #endif  /* _XTENSA_ASM_UACCESS_H */
 85 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php