summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-11 14:26:47 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-11 14:26:47 +0000
commit579a97f7ff4c0f958a5d8adcba717a205bb58567 (patch)
tree845f187afdd4a15f4625d2156f0fd967beb50c5d /exec.c
parent44f8625d23f9807c0853556ffe1c44540bd453f9 (diff)
downloadqemu-579a97f7ff4c0f958a5d8adcba717a205bb58567.tar.gz
Linux user memory access API change (initial patch by Thayne Harbaugh)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3583 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index 7987803634..e817a4e5e2 100644
--- a/exec.c
+++ b/exec.c
@@ -2510,13 +2510,19 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
if (is_write) {
if (!(flags & PAGE_WRITE))
return;
- p = lock_user(addr, len, 0);
+ /* XXX: this code should not depend on lock_user */
+ if (!(p = lock_user(VERIFY_WRITE, addr, len, 0)))
+ /* FIXME - should this return an error rather than just fail? */
+ return;
memcpy(p, buf, len);
unlock_user(p, addr, len);
} else {
if (!(flags & PAGE_READ))
return;
- p = lock_user(addr, len, 1);
+ /* XXX: this code should not depend on lock_user */
+ if (!(p = lock_user(VERIFY_READ, addr, len, 1)))
+ /* FIXME - should this return an error rather than just fail? */
+ return;
memcpy(buf, p, len);
unlock_user(p, addr, 0);
}