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 MAKE_MM_SEG(s)   ((mm_segment_t) { (s) })
 
#define KERNEL_DS   MAKE_MM_SEG(~0UL)
 
#define USER_DS   MAKE_MM_SEG(TASK_SIZE - 1)
 
#define get_ds()   (KERNEL_DS)
 
#define get_fs()   (current_thread_info()->addr_limit)
 
#define segment_eq(a, b)   ((a).seg == (b).seg)
 
#define VERIFY_READ   0
 
#define VERIFY_WRITE   1
 
#define access_ok(type, addr, size)   __access_ok((unsigned long)(addr),(size))
 
#define __put_user(x, ptr)
 
#define put_user(x, ptr)
 
#define __get_user(x, ptr)
 
#define get_user(x, ptr)
 
#define __copy_from_user_inatomic   __copy_from_user
 
#define __copy_to_user_inatomic   __copy_to_user
 
#define __strnlen_user(s, n)   (strnlen((s), (n)) + 1)
 

Functions

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

Macro Definition Documentation

#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 240 of file uaccess.h.

#define __get_user (   x,
  ptr 
)

Definition at line 179 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 143 of file uaccess.h.

#define __strnlen_user (   s,
  n 
)    (strnlen((s), (n)) + 1)

Definition at line 292 of file uaccess.h.

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

Definition at line 40 of file uaccess.h.

#define get_ds (   void)    (KERNEL_DS)

Definition at line 26 of file uaccess.h.

#define get_fs (   void)    (current_thread_info()->addr_limit)

Definition at line 27 of file uaccess.h.

#define get_user (   x,
  ptr 
)
Value:
({ \
might_sleep(); \
access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \
-EFAULT; \
})

Definition at line 219 of file uaccess.h.

#define KERNEL_DS   MAKE_MM_SEG(~0UL)

Definition at line 18 of file uaccess.h.

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

Definition at line 15 of file uaccess.h.

#define put_user (   x,
  ptr 
)
Value:
({ \
might_sleep(); \
access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \
__put_user(x, ptr) : \
-EFAULT; \
})

Definition at line 163 of file uaccess.h.

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

Definition at line 35 of file uaccess.h.

#define USER_DS   MAKE_MM_SEG(TASK_SIZE - 1)

Definition at line 22 of file uaccess.h.

#define VERIFY_READ   0

Definition at line 37 of file uaccess.h.

#define VERIFY_WRITE   1

Definition at line 38 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.