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

Go to the source code of this file.

Data Structures

struct  exception_table_entry
 

Macros

#define VERIFY_READ   0
 
#define VERIFY_WRITE   1
 
#define access_ok(type, addr, size)   __access_ok((unsigned long)addr,size)
 
#define RANGE_CHECK_OK(addr, size, lower, upper)   (((addr) >= (lower)) && (((addr) + (size)) < (upper)))
 
#define put_user(x, ptr)
 
#define __put_user(x, ptr)   put_user(x, ptr)
 
#define __ptr(x)   ((unsigned long *)(x))
 
#define get_user(x, ptr)
 
#define __get_user(x, ptr)   get_user(x, ptr)
 
#define copy_from_user(to, from, n)   (memcpy(to, from, n), 0)
 
#define copy_to_user(to, from, n)   (memcpy(to, from, n), 0)
 
#define __copy_from_user(to, from, n)   copy_from_user(to, from, n)
 
#define __copy_to_user(to, from, n)   copy_to_user(to, from, n)
 
#define __copy_to_user_inatomic   __copy_to_user
 
#define __copy_from_user_inatomic   __copy_from_user
 
#define copy_to_user_ret(to, from, n, retval)   ({ if (copy_to_user(to,from,n)) return retval; })
 
#define copy_from_user_ret(to, from, n, retval)   ({ if (copy_from_user(to,from,n)) return retval; })
 
#define strlen_user(str)   strnlen_user(str, 32767)
 
#define __clear_user   clear_user
 

Functions

unsigned long search_exception_table (unsigned long)
 
int __put_user_bad (void)
 
int __get_user_bad (void)
 

Macro Definition Documentation

#define __clear_user   clear_user

Definition at line 161 of file uaccess.h.

#define __copy_from_user (   to,
  from,
  n 
)    copy_from_user(to, from, n)

Definition at line 115 of file uaccess.h.

#define __copy_from_user_inatomic   __copy_from_user

Definition at line 118 of file uaccess.h.

#define __copy_to_user (   to,
  from,
  n 
)    copy_to_user(to, from, n)

Definition at line 116 of file uaccess.h.

#define __copy_to_user_inatomic   __copy_to_user

Definition at line 117 of file uaccess.h.

#define __get_user (   x,
  ptr 
)    get_user(x, ptr)

Definition at line 108 of file uaccess.h.

#define __ptr (   x)    ((unsigned long *)(x))

Definition at line 83 of file uaccess.h.

#define __put_user (   x,
  ptr 
)    put_user(x, ptr)

Definition at line 73 of file uaccess.h.

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

Definition at line 17 of file uaccess.h.

#define copy_from_user (   to,
  from,
  n 
)    (memcpy(to, from, n), 0)

Definition at line 112 of file uaccess.h.

#define copy_from_user_ret (   to,
  from,
  n,
  retval 
)    ({ if (copy_from_user(to,from,n)) return retval; })

Definition at line 122 of file uaccess.h.

#define copy_to_user (   to,
  from,
  n 
)    (memcpy(to, from, n), 0)

Definition at line 113 of file uaccess.h.

#define copy_to_user_ret (   to,
  from,
  n,
  retval 
)    ({ if (copy_to_user(to,from,n)) return retval; })

Definition at line 120 of file uaccess.h.

#define get_user (   x,
  ptr 
)
Value:
({ \
int __gu_err = 0; \
typeof(*(ptr)) __gu_val = *ptr; \
switch (sizeof(*(ptr))) { \
case 1: \
case 2: \
case 4: \
case 8: \
break; \
default: \
__gu_err = __get_user_bad(); \
break; \
} \
(x) = __gu_val; \
__gu_err; \
})

Definition at line 91 of file uaccess.h.

#define put_user (   x,
  ptr 
)
Value:
({ \
int __pu_err = 0; \
typeof(*(ptr)) __pu_val = (x); \
switch (sizeof (*(ptr))) { \
case 1: \
case 2: \
case 4: \
*(ptr) = (__pu_val); \
break; \
case 8: \
memcpy(ptr, &__pu_val, sizeof (*(ptr))); \
break; \
default: \
__pu_err = __put_user_bad(); \
break; \
} \
__pu_err; \
})

Definition at line 54 of file uaccess.h.

#define RANGE_CHECK_OK (   addr,
  size,
  lower,
  upper 
)    (((addr) >= (lower)) && (((addr) + (size)) < (upper)))
#define strlen_user (   str)    strnlen_user(str, 32767)

Definition at line 148 of file uaccess.h.

#define VERIFY_READ   0

Definition at line 13 of file uaccess.h.

#define VERIFY_WRITE   1

Definition at line 14 of file uaccess.h.

Function Documentation

int __get_user_bad ( void  )
int __put_user_bad ( void  )
unsigned long search_exception_table ( unsigned  long)

Definition at line 43 of file extable.c.