#include <linux/string.h>
#include <linux/thread_info.h>
#include <asm/ptrace.h>
#include <asm/errno.h>
#include <asm/memory.h>
#include <asm/compiler.h>
Go to the source code of this file.
|
#define | VERIFY_READ 0 |
|
#define | VERIFY_WRITE 1 |
|
#define | KERNEL_DS (-1UL) |
|
#define | get_ds() (KERNEL_DS) |
|
#define | USER_DS TASK_SIZE_64 |
|
#define | get_fs() (current_thread_info()->addr_limit) |
|
#define | segment_eq(a, b) ((a) == (b)) |
|
#define | __addr_ok(addr) |
|
#define | __range_ok(addr, size) |
|
#define | access_ok(type, addr, size) __range_ok(addr, size) |
|
#define | __get_user_asm(instr, reg, x, addr, err) |
|
#define | __get_user_err(x, ptr, err) |
|
#define | __get_user(x, ptr) |
|
#define | __get_user_error(x, ptr, err) |
|
#define | __get_user_unaligned __get_user |
|
#define | get_user(x, ptr) |
|
#define | __put_user_asm(instr, reg, x, addr, err) |
|
#define | __put_user_err(x, ptr, err) |
|
#define | __put_user(x, ptr) |
|
#define | __put_user_error(x, ptr, err) |
|
#define | __put_user_unaligned __put_user |
|
#define | put_user(x, ptr) |
|
#define | __copy_to_user_inatomic __copy_to_user |
|
#define | __copy_from_user_inatomic __copy_from_user |
|
#define | strlen_user(s) strnlen_user(s, ~0UL >> 1) |
|
|
int | fixup_exception (struct pt_regs *regs) |
|
unsigned long __must_check | __copy_from_user (void *to, const void __user *from, unsigned long n) |
|
unsigned long __must_check | __copy_to_user (void __user *to, const void *from, unsigned long n) |
|
unsigned long __must_check | __copy_in_user (void __user *to, const void __user *from, unsigned long n) |
|
unsigned long __must_check | __clear_user (void __user *addr, unsigned long n) |
|
unsigned long __must_check | __strncpy_from_user (char *to, const char __user *from, unsigned long count) |
|
unsigned long __must_check | __strnlen_user (const char __user *s, long n) |
|
#define __addr_ok |
( |
|
addr | ) |
|
Value:({ \
asm("cmp %1, %0; cset %0, lo" \
: "=&r" (flag) \
})
Definition at line 71 of file uaccess.h.
Value:({ \
int __gu_err = 0; \
__get_user_err((
x), (
ptr), __gu_err); \
__gu_err; \
})
Definition at line 152 of file uaccess.h.
Value:asm volatile( \
"2:\n" \
" .section .fixup, \"ax\"\n" \
" .align 2\n" \
"3: mov %w0, %3\n" \
" mov %1, #0\n" \
" b 2b\n" \
" .previous\n" \
" .section __ex_table,\"a\"\n" \
" .align 3\n" \
" .quad 1b, 3b\n" \
" .previous" \
:
"+r" (
err),
"=&r" (
x) \
Definition at line 112 of file uaccess.h.
#define __get_user_err |
( |
|
x, |
|
|
|
ptr, |
|
|
|
err |
|
) |
| |
Value:do { \
unsigned long __gu_val; \
switch (
sizeof(*(
ptr))) { \
case 1: \
__get_user_asm(
"ldrb",
"%w", __gu_val, (
ptr), (
err)); \
break; \
case 2: \
__get_user_asm(
"ldrh",
"%w", __gu_val, (
ptr), (
err)); \
break; \
case 4: \
__get_user_asm(
"ldr",
"%w", __gu_val, (
ptr), (
err)); \
break; \
case 8: \
__get_user_asm(
"ldr",
"%", __gu_val, (
ptr), (
err)); \
break; \
default: \
BUILD_BUG(); \
} \
(
x) = (__typeof__(*(
ptr)))__gu_val; \
} while (0)
Definition at line 129 of file uaccess.h.
#define __get_user_error |
( |
|
x, |
|
|
|
ptr, |
|
|
|
err |
|
) |
| |
#define __put_user |
( |
|
x, |
|
|
|
ptr |
|
) |
| |
Value:({ \
int __pu_err = 0; \
__put_user_err((
x), (
ptr), __pu_err); \
__pu_err; \
})
Definition at line 213 of file uaccess.h.
Value:asm volatile( \
"2:\n" \
" .section .fixup,\"ax\"\n" \
" .align 2\n" \
"3: mov %w0, %3\n" \
" b 2b\n" \
" .previous\n" \
" .section __ex_table,\"a\"\n" \
" .align 3\n" \
" .quad 1b, 3b\n" \
" .previous" \
Definition at line 175 of file uaccess.h.
#define __put_user_err |
( |
|
x, |
|
|
|
ptr, |
|
|
|
err |
|
) |
| |
Value:do { \
__typeof__(*(
ptr)) __pu_val = (
x); \
case 1: \
__put_user_asm(
"strb",
"%w", __pu_val, (ptr), (
err)); \
break; \
case 2: \
__put_user_asm(
"strh",
"%w", __pu_val, (ptr), (
err)); \
break; \
case 4: \
__put_user_asm(
"str",
"%w", __pu_val, (ptr), (
err)); \
break; \
case 8: \
__put_user_asm(
"str",
"%", __pu_val, (ptr), (
err)); \
break; \
default: \
BUILD_BUG(); \
} \
} while (0)
Definition at line 191 of file uaccess.h.
#define __put_user_error |
( |
|
x, |
|
|
|
ptr, |
|
|
|
err |
|
) |
| |
Value:({ \
unsigned
long flag, roksum; \
asm("adds %1, %1, %3; ccmp %1, %4, #2, cc; cset %0, cc" \
: "=&r" (flag), "=&r" (roksum) \
})
Definition at line 90 of file uaccess.h.
#define get_user |
( |
|
x, |
|
|
|
ptr |
|
) |
| |
#define put_user |
( |
|
x, |
|
|
|
ptr |
|
) |
| |
Value:({ \
might_sleep(); \
__put_user((
x), (
ptr)) : \
})
Definition at line 228 of file uaccess.h.
#define segment_eq |
( |
|
a, |
|
|
|
b |
|
) |
| ((a) == (b)) |
__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.