Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
uaccess.h File Reference
#include <linux/sched.h>
#include <linux/errno.h>
#include <asm/ctl_reg.h>

Go to the source code of this file.

Data Structures

struct  exception_table_entry
 
struct  uaccess_ops
 

Macros

#define VERIFY_READ   0
 
#define VERIFY_WRITE   1
 
#define MAKE_MM_SEG(a)   ((mm_segment_t) { (a) })
 
#define KERNEL_DS   MAKE_MM_SEG(0)
 
#define USER_DS   MAKE_MM_SEG(1)
 
#define get_ds()   (KERNEL_DS)
 
#define get_fs()   (current->thread.mm_segment)
 
#define set_fs(x)
 
#define segment_eq(a, b)   ((a).ar4 == (b).ar4)
 
#define __access_ok(addr, size)
 
#define access_ok(type, addr, size)   __access_ok(addr, size)
 
#define ARCH_HAS_SORT_EXTABLE
 
#define ARCH_HAS_SEARCH_EXTABLE
 
#define __put_user(x, ptr)
 
#define put_user(x, ptr)
 
#define __get_user(x, ptr)
 
#define get_user(x, ptr)
 
#define __put_user_unaligned   __put_user
 
#define __get_user_unaligned   __get_user
 
#define __copy_to_user_inatomic   __copy_to_user
 
#define __copy_from_user_inatomic   __copy_from_user
 
#define strlen_user(str)   strnlen_user(str, ~0UL)
 

Functions

int __handle_fault (unsigned long, unsigned long, int)
 
int __put_user_bad (void) __attribute__((noreturn))
 
int __get_user_bad (void) __attribute__((noreturn))
 
void copy_from_user_overflow (void)
 
int copy_to_user_real (void __user *dest, void *src, size_t count)
 
int copy_from_user_real (void *dest, void __user *src, size_t count)
 

Variables

struct uaccess_ops uaccess
 
struct uaccess_ops uaccess_std
 
struct uaccess_ops uaccess_mvcos
 
struct uaccess_ops uaccess_mvcos_switch
 
struct uaccess_ops uaccess_pt
 

Macro Definition Documentation

#define __access_ok (   addr,
  size 
)
Value:
({ \
__chk_user_ptr(addr); \
__range_ok((unsigned long)(addr), (size)); \
})

Definition at line 56 of file uaccess.h.

#define __copy_from_user_inatomic   __copy_from_user

Definition at line 236 of file uaccess.h.

#define __copy_to_user_inatomic   __copy_to_user

Definition at line 235 of file uaccess.h.

#define __get_user (   x,
  ptr 
)

Definition at line 161 of file uaccess.h.

#define __get_user_unaligned   __get_user

Definition at line 210 of file uaccess.h.

#define __put_user (   x,
  ptr 
)
Value:
({ \
__typeof__(*(ptr)) __x = (x); \
int __pu_err = -EFAULT; \
switch (sizeof (*(ptr))) { \
case 1: \
case 2: \
case 4: \
case 8: \
__pu_err = __put_user_fn(sizeof (*(ptr)), \
ptr, &__x); \
break; \
default: \
__put_user_bad(); \
break; \
} \
__pu_err; \
})

Definition at line 132 of file uaccess.h.

#define __put_user_unaligned   __put_user

Definition at line 209 of file uaccess.h.

#define access_ok (   type,
  addr,
  size 
)    __access_ok(addr, size)

Definition at line 62 of file uaccess.h.

#define ARCH_HAS_SEARCH_EXTABLE

Definition at line 93 of file uaccess.h.

#define ARCH_HAS_SORT_EXTABLE

Definition at line 92 of file uaccess.h.

#define get_ds (   void)    (KERNEL_DS)

Definition at line 37 of file uaccess.h.

#define get_fs (   void)    (current->thread.mm_segment)

Definition at line 38 of file uaccess.h.

#define get_user (   x,
  ptr 
)
Value:
({ \
might_fault(); \
})

Definition at line 201 of file uaccess.h.

#define KERNEL_DS   MAKE_MM_SEG(0)

Definition at line 34 of file uaccess.h.

#define MAKE_MM_SEG (   a)    ((mm_segment_t) { (a) })

Definition at line 31 of file uaccess.h.

#define put_user (   x,
  ptr 
)
Value:
({ \
might_fault(); \
__put_user(x, ptr); \
})

Definition at line 152 of file uaccess.h.

#define segment_eq (   a,
  b 
)    ((a).ar4 == (b).ar4)

Definition at line 49 of file uaccess.h.

#define set_fs (   x)
Value:
({ \
unsigned long __pto; \
current->thread.mm_segment = (x); \
__pto = current->thread.mm_segment.ar4 ? \
S390_lowcore.user_asce : S390_lowcore.kernel_asce; \
__ctl_load(__pto, 7, 7); \
})

Definition at line 40 of file uaccess.h.

#define strlen_user (   str)    strnlen_user(str, ~0UL)

strlen_user: - Get the size of a string in user space. : The string to measure.

Context: User context only. This function may sleep.

Get the size of a NUL-terminated string in user space.

Returns the size of the string INCLUDING the terminating NUL. On exception, returns 0.

If there is a limit on the length of a valid string, you may wish to consider using strnlen_user() instead.

Definition at line 374 of file uaccess.h.

#define USER_DS   MAKE_MM_SEG(1)

Definition at line 35 of file uaccess.h.

#define VERIFY_READ   0

Definition at line 19 of file uaccess.h.

#define VERIFY_WRITE   1

Definition at line 20 of file uaccess.h.

Function Documentation

int __get_user_bad ( void  )
int __handle_fault ( unsigned  long,
unsigned  long,
int   
)

Definition at line 450 of file fault.c.

int __put_user_bad ( void  )
void copy_from_user_overflow ( void  )

Definition at line 4 of file usercopy.c.

int copy_from_user_real ( void dest,
void __user src,
size_t  count 
)

Definition at line 156 of file maccess.c.

int copy_to_user_real ( void __user dest,
void src,
size_t  count 
)

Definition at line 130 of file maccess.c.

Variable Documentation

Definition at line 76 of file setup.c.

struct uaccess_ops uaccess_mvcos

Definition at line 201 of file uaccess_mvcos.c.

struct uaccess_ops uaccess_mvcos_switch

Definition at line 214 of file uaccess_mvcos.c.

struct uaccess_ops uaccess_pt

Definition at line 377 of file uaccess_pt.c.

struct uaccess_ops uaccess_std

Definition at line 306 of file uaccess_std.c.