Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/uaccess.h
Show First 20 Lines • Show All 54 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__) | ||||
#define access_ok(...) linux_access_ok(__VA_ARGS__) | |||||
hselasky: Can you given an example where access_ok is already defined? | |||||
Not Done Inline ActionsSee user_access_begin above johalun: See user_access_begin above | |||||
#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 | |||||
#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(int rw, 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 | ||||
* pagefault_enable() call in the same scope. The former creates a new | * pagefault_enable() call in the same scope. The former creates a new | ||||
* block and defines a temporary variable, and the latter uses the | * block and defines a temporary variable, and the latter uses the | ||||
* temporary variable and closes the block. Failure to balance the | * temporary variable and closes the block. Failure to balance the | ||||
* calls will result in a compile-time error. | * calls will result in a compile-time error. | ||||
*/ | */ | ||||
Show All 15 Lines |
Can you given an example where access_ok is already defined?