Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/uaccess.h
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
#define __put_user(_x, _p) ({ \ | #define __put_user(_x, _p) ({ \ | ||||
__typeof(*(_p)) __x = (_x); \ | __typeof(*(_p)) __x = (_x); \ | ||||
linux_copyout(&(__x), (_p), sizeof(*(_p))); \ | linux_copyout(&(__x), (_p), sizeof(*(_p))); \ | ||||
}) | }) | ||||
#define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) | #define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) | ||||
#define put_user(_x, _p) __put_user(_x, _p) | #define put_user(_x, _p) __put_user(_x, _p) | ||||
#define clear_user(...) linux_clear_user(__VA_ARGS__) | #define clear_user(...) linux_clear_user(__VA_ARGS__) | ||||
#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 | |||||
#define access_ok(a,b) linux_access_ok(a,b) | #define access_ok(a,b) linux_access_ok(a,b) | ||||
#else | |||||
#define access_ok(a,b,c) linux_access_ok(b,c) | |||||
#endif | |||||
extern int linux_copyin(const void *uaddr, void *kaddr, size_t len); | extern int linux_copyin(const void *uaddr, void *kaddr, size_t len); | ||||
extern int linux_copyout(const void *kaddr, void *uaddr, size_t len); | extern int linux_copyout(const void *kaddr, void *uaddr, size_t len); | ||||
extern size_t linux_clear_user(void *uaddr, size_t len); | extern size_t linux_clear_user(void *uaddr, size_t len); | ||||
extern int linux_access_ok(const void *uaddr, size_t len); | extern int linux_access_ok(const void *uaddr, size_t len); | ||||
/* | /* | ||||
* NOTE: Each pagefault_disable() call must have a corresponding | * NOTE: Each pagefault_disable() call must have a corresponding | ||||
Show All 20 Lines |