aboutsummaryrefslogtreecommitdiff
path: root/linux-user/qemu.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-14 10:51:00 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-14 10:51:00 +0000
commitdae3270c6e25062b9085da0756b68fafedc9bb2c (patch)
treebbe89088ce3699c28271cb181bdbe1b54573d4e7 /linux-user/qemu.h
parent9b0b82037a2ebfb3d38ed2ae23194eadd85b1440 (diff)
suppressed page_unprotect_range() - fixed access_ok()
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3641 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/qemu.h')
-rw-r--r--linux-user/qemu.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 581ee27fa8..5917cb51aa 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -207,8 +207,11 @@ int target_msync(abi_ulong start, abi_ulong len, int flags);
#define VERIFY_READ 0
#define VERIFY_WRITE 1 /* implies read access */
-#define access_ok(type,addr,size) \
- (page_check_range((target_ulong)addr,size,(type==VERIFY_READ)?PAGE_READ:PAGE_WRITE)==0)
+static inline int 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;
+}
/* NOTE __get_user and __put_user use host pointers and don't check access. */
/* These are usually used to access struct data members once the