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

Go to the source code of this file.

Data Structures

struct  exception_table_entry
 

Macros

#define get_ds()   (KERNEL_DS)
 
#define get_fs()   (current_thread_info()->addr_limit)
 
#define segment_eq(a, b)   ((a) == (b))
 
#define VERIFY_READ   0
 
#define VERIFY_WRITE   1
 
#define access_ok(type, addr, size)   _access_ok((unsigned long)(addr), (size))
 
#define put_user(x, p)
 
#define __put_user(x, p)   put_user(x,p)
 
#define __put_user_bad()
 
#define __ptr(x)   ((unsigned long *)(x))
 
#define __put_user_asm(x, p, bhw)
 
#define get_user(x, ptr)
 
#define __get_user(x, p)   get_user(x,p)
 
#define __get_user_bad()   (bad_user_access_length(), (-EFAULT))
 
#define __get_user_asm(x, ptr, bhw, option)
 
#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)
 
#define copy_from_user_ret(to, from, n, retval)
 
#define clear_user(to, n)   __clear_user(to, n)
 

Enumerations

enum  {
  BFIN_MEM_ACCESS_CORE = 0, BFIN_MEM_ACCESS_CORE_ONLY, BFIN_MEM_ACCESS_DMA, BFIN_MEM_ACCESS_IDMA,
  BFIN_MEM_ACCESS_ITEST
}
 

Functions

int bfin_mem_access_type (unsigned long addr, unsigned long size)
 

Macro Definition Documentation

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

Definition at line 183 of file uaccess.h.

#define __copy_from_user_inatomic   __copy_from_user

Definition at line 186 of file uaccess.h.

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

Definition at line 184 of file uaccess.h.

#define __copy_to_user_inatomic   __copy_to_user

Definition at line 185 of file uaccess.h.

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

Definition at line 171 of file uaccess.h.

#define __get_user_asm (   x,
  ptr,
  bhw,
  option 
)
Value:
({ \
__asm__ __volatile__ ( \
"%0 =" #bhw "[%1]" #option ";" \
: "=d" (x) \
: "a" (__ptr(ptr))); \
})

Definition at line 175 of file uaccess.h.

#define __get_user_bad (   void)    (bad_user_access_length(), (-EFAULT))

Definition at line 173 of file uaccess.h.

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

Definition at line 139 of file uaccess.h.

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

Definition at line 122 of file uaccess.h.

#define __put_user_asm (   x,
  p,
  bhw 
)
Value:
__asm__ (#bhw"[%1] = %0;\n\t" \
: /* no outputs */ \
:"d" (x),"a" (__ptr(p)) : "memory")

Definition at line 141 of file uaccess.h.

#define __put_user_bad (   void)
Value:
(printk(KERN_INFO "put_user_bad %s:%d %s\n",\
__FILE__, __LINE__, __func__),\
bad_user_access_length(), (-EFAULT))

Definition at line 129 of file uaccess.h.

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

Definition at line 35 of file uaccess.h.

#define clear_user (   to,
  n 
)    __clear_user(to, n)

Definition at line 267 of file uaccess.h.

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

Definition at line 191 of file uaccess.h.

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

Definition at line 188 of file uaccess.h.

#define get_ds (   void)    (KERNEL_DS)

Definition at line 22 of file uaccess.h.

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

Definition at line 23 of file uaccess.h.

#define get_user (   x,
  ptr 
)
Value:
({ \
int _err = 0; \
unsigned long _val = 0; \
const typeof(*(ptr)) __user *_p = (ptr); \
const size_t ptr_size = sizeof(*(_p)); \
if (likely(access_ok(VERIFY_READ, _p, ptr_size))) { \
BUILD_BUG_ON(ptr_size >= 8); \
switch (ptr_size) { \
case 1: \
__get_user_asm(_val, _p, B,(Z)); \
break; \
case 2: \
__get_user_asm(_val, _p, W,(Z)); \
break; \
case 4: \
__get_user_asm(_val, _p, , ); \
break; \
} \
} else \
_err = -EFAULT; \
x = (typeof(*(ptr)))_val; \
_err; \
})

Definition at line 146 of file uaccess.h.

#define put_user (   x,
  p 
)

Definition at line 88 of file uaccess.h.

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

Definition at line 30 of file uaccess.h.

#define VERIFY_READ   0

Definition at line 32 of file uaccess.h.

#define VERIFY_WRITE   1

Definition at line 33 of file uaccess.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
BFIN_MEM_ACCESS_CORE 
BFIN_MEM_ACCESS_CORE_ONLY 
BFIN_MEM_ACCESS_DMA 
BFIN_MEM_ACCESS_IDMA 
BFIN_MEM_ACCESS_ITEST 

Definition at line 276 of file uaccess.h.

Function Documentation

int bfin_mem_access_type ( unsigned long  addr,
unsigned long  size 
)

bfin_mem_access_type() - what kind of memory access is required : the address to check : number of bytes needed

Returns
: <0 is error, >=0 is BFIN_MEM_ACCESS_xxx enum (see above)

Definition at line 391 of file process.c.