]> git.proxmox.com Git - mirror_qemu.git/blobdiff - bsd-user/qemu.h
bsd-user: Tidy VERIFY_READ/VERIFY_WRITE
[mirror_qemu.git] / bsd-user / qemu.h
index f8bb1e5459d6074626eae9d9115933289282a6cb..4076adabd088cbaecaa2ff3996801d2e029df10a 100644 (file)
@@ -218,13 +218,12 @@ extern unsigned long x86_stack_size;
 
 /* user access */
 
-#define VERIFY_READ 0
-#define VERIFY_WRITE 1 /* implies read access */
+#define VERIFY_READ  PAGE_READ
+#define VERIFY_WRITE (PAGE_READ | PAGE_WRITE)
 
-static inline int access_ok(int type, abi_ulong addr, abi_ulong size)
+static inline bool access_ok(int type, abi_ulong addr, abi_ulong size)
 {
-    return page_check_range((target_ulong)addr, size,
-                            (type == VERIFY_READ) ? PAGE_READ : (PAGE_READ | PAGE_WRITE)) == 0;
+    return page_check_range((target_ulong)addr, size, type) == 0;
 }
 
 /* NOTE __get_user and __put_user use host pointers and don't check access. */