diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2017-03-17 08:02:46 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2017-03-17 08:02:46 +0000 |
commit | 0a2f4606bb7b632fe902d16cfd5a661979d47169 (patch) | |
tree | 234d3d44be8860a686d425cc55c0de460a980a65 /sys | |
parent | 62cd9e48ca0eafcdde9446483c9124d6c8ba1ad8 (diff) | |
download | src-0a2f4606bb7b632fe902d16cfd5a661979d47169.tar.gz src-0a2f4606bb7b632fe902d16cfd5a661979d47169.zip |
Add comment describing the use of pagefault_disable() and
pagefault_enable() in the LinuxKPI.
Suggested by: rpokala@
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes
Notes:
svn path=/head/; revision=315442
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/uaccess.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/uaccess.h b/sys/compat/linuxkpi/common/include/linux/uaccess.h index b7e23922720a..c046e1c063a1 100644 --- a/sys/compat/linuxkpi/common/include/linux/uaccess.h +++ b/sys/compat/linuxkpi/common/include/linux/uaccess.h @@ -67,6 +67,13 @@ extern int linux_copyout(const void *kaddr, 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); +/* + * NOTE: Each pagefault_disable() call must have a corresponding + * pagefault_enable() call in the same scope. The former creates a new + * block and defines a temporary variable, and the latter uses the + * temporary variable and closes the block. Failure to balance the + * calls will result in a compile-time error. + */ #define pagefault_disable(void) do { \ int __saved_pflags = \ vm_fault_disable_pagefaults() |