#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/thread_info.h>
Go to the source code of this file.
|
#define | VERIFY_READ 0 |
|
#define | VERIFY_WRITE 1 |
|
#define | get_ds() (KERNEL_DS) |
|
#define | get_fs() (current_thread_info()->addr_limit) |
|
#define | segment_eq(a, b) ((a).seg == (b).seg) |
|
#define | __ua_size(size) ((__builtin_constant_p(size) && (signed long) (size) > 0) ? 0 : (size)) |
|
#define | __access_ok(addr, size) |
|
#define | access_ok(type, addr, size) likely(__access_ok((unsigned long)(addr), (size))) |
|
#define | put_user(x, ptr) __put_user_check((x), (ptr), sizeof(*(ptr))) |
|
#define | get_user(x, ptr) __get_user_check((x), (ptr), sizeof(*(ptr))) |
|
#define | __put_user(x, ptr) __put_user_nocheck((x), (ptr), sizeof(*(ptr))) |
|
#define | __get_user(x, ptr) __get_user_nocheck((x), (ptr), sizeof(*(ptr))) |
|
#define | __m(x) (*(struct __large_struct __user *)(x)) |
|
#define | __get_user_common(val, size, ptr) |
|
#define | __get_user_nocheck(x, ptr, size) |
|
#define | __get_user_check(x, ptr, size) |
|
#define | __get_user_asm(val, insn, addr) |
|
#define | __put_user_nocheck(val, ptr, size) |
|
#define | __put_user_check(val, ptr, size) |
|
#define | __put_user_asm(insn, ptr) |
|
#define | __copy_from_user(to, from, len) __copy_tofrom_user((to), (from), (len)) |
|
#define | __copy_to_user(to, from, len) __copy_tofrom_user((to), (from), (len)) |
|
#define | __copy_in_user(to, from, len) __copy_from_user(to, from, len) |
|
Value:{ \
long __gu_tmp; \
\
__asm__ __volatile__( \
"2:\n" \
".section .fixup,\"ax\"\n" \
"3:li %0, %4\n" \
"j 2b\n" \
".previous\n" \
".section __ex_table,\"a\"\n" \
".word 1b, 3b\n" \
".previous\n" \
: "=r" (__gu_err), "=r" (__gu_tmp) \
\
(
val) = (__typeof__(*(
addr))) __gu_tmp; \
}
Definition at line 190 of file uaccess.h.
#define __get_user_check |
( |
|
x, |
|
|
|
ptr, |
|
|
|
size |
|
) |
| |
Value:({ \
const __typeof__(*(
ptr)) __user *__gu_ptr = (
ptr); \
\
\
__gu_err; \
})
Definition at line 179 of file uaccess.h.
Value:do { \
case 1: \
__get_user_asm(
val,
"lb",
ptr); \
break; \
case 2: \
__get_user_asm(
val,
"lh",
ptr); \
break; \
case 4: \
__get_user_asm(
val,
"lw",
ptr); \
break; \
case 8: \
__gu_err = 0; \
else \
break; \
default: \
__get_user_unknown(); \
break; \
} \
} while (0)
Definition at line 148 of file uaccess.h.
#define __get_user_nocheck |
( |
|
x, |
|
|
|
ptr, |
|
|
|
size |
|
) |
| |
Value:({ \
long __gu_err = 0; \
__gu_err; \
})
Definition at line 172 of file uaccess.h.
#define __put_user_asm |
( |
|
insn, |
|
|
|
ptr |
|
) |
| |
Value:
"2:\n" \
".section .fixup,\"ax\"\n" \
"3:li %0, %4\n" \
"j 2b\n" \
".previous\n" \
".section __ex_table,\"a\"\n" \
".word 1b, 3b\n" \
".previous\n" \
: "=r" (__pu_err) \
:
"0" (0),
"r" (__pu_val),
"o" (
__m(
ptr)), \
Definition at line 275 of file uaccess.h.
Value:({ \
__typeof__(*(
ptr)) __user *__pu_addr = (
ptr); \
__typeof__(*(ptr)) __pu_val = (
val); \
\
switch (size) { \
case 1: \
__put_user_asm("sb", __pu_addr); \
break; \
case 2: \
__put_user_asm("sh", __pu_addr); \
break; \
case 4: \
__put_user_asm("sw", __pu_addr); \
break; \
case 8: \
__pu_err = 0; \
else \
break; \
default: \
__put_user_unknown(); \
break; \
} \
} \
__pu_err; \
})
Definition at line 244 of file uaccess.h.
Value:({ \
__typeof__(*(
ptr)) __pu_val; \
long __pu_err = 0; \
\
case 1: \
__put_user_asm(
"sb",
ptr); \
break; \
case 2: \
__put_user_asm(
"sh",
ptr); \
break; \
case 4: \
__put_user_asm(
"sw",
ptr); \
break; \
case 8: \
__pu_err = 0; \
else \
break; \
default: \
__put_user_unknown(); \
break; \
} \
__pu_err; \
})
Definition at line 214 of file uaccess.h.
__clear_user: - Zero a block of memory in user space, with less checking. : Destination address, in user space.
: Number of bytes to zero.
Zero a block of memory in user space. Caller must check the specified block with access_ok() before calling this function.
Returns number of bytes that could not be cleared. On success, this will be zero.
Definition at line 158 of file uaccess_with_memcpy.c.