aboutsummaryrefslogtreecommitdiff
path: root/linux-user/qemu.h
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/qemu.h')
-rw-r--r--linux-user/qemu.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index bcc0b34f36..d0f650edaa 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -206,22 +206,22 @@ int target_msync(abi_ulong start, abi_ulong len, int flags);
#define access_ok(type,addr,size) \
(page_check_range((target_ulong)addr,size,(type==VERIFY_READ)?PAGE_READ:PAGE_WRITE)==0)
-/* NOTE get_user and put_user use host addresses. */
-#define __put_user(x,ptr)\
+/* NOTE __get_user and __put_user use host pointers and don't check access. */
+#define __put_user(x, hptr)\
({\
- int size = sizeof(*ptr);\
+ int size = sizeof(*hptr);\
switch(size) {\
case 1:\
- *(uint8_t *)(ptr) = (typeof(*ptr))(x);\
+ *(uint8_t *)(hptr) = (typeof(*hptr))(x);\
break;\
case 2:\
- *(uint16_t *)(ptr) = tswap16((typeof(*ptr))(x));\
+ *(uint16_t *)(hptr) = tswap16((typeof(*hptr))(x));\
break;\
case 4:\
- *(uint32_t *)(ptr) = tswap32((typeof(*ptr))(x));\
+ *(uint32_t *)(hptr) = tswap32((typeof(*hptr))(x));\
break;\
case 8:\
- *(uint64_t *)(ptr) = tswap64((typeof(*ptr))(x));\
+ *(uint64_t *)(hptr) = tswap64((typeof(*hptr))(x));\
break;\
default:\
abort();\
@@ -229,21 +229,21 @@ int target_msync(abi_ulong start, abi_ulong len, int flags);
0;\
})
-#define __get_user(x, ptr) \
+#define __get_user(x, hptr) \
({\
- int size = sizeof(*ptr);\
+ int size = sizeof(*hptr);\
switch(size) {\
case 1:\
- x = (typeof(*ptr))*(uint8_t *)(ptr);\
+ x = (typeof(*hptr))*(uint8_t *)(hptr);\
break;\
case 2:\
- x = (typeof(*ptr))tswap16(*(uint16_t *)(ptr));\
+ x = (typeof(*hptr))tswap16(*(uint16_t *)(hptr));\
break;\
case 4:\
- x = (typeof(*ptr))tswap32(*(uint32_t *)(ptr));\
+ x = (typeof(*hptr))tswap32(*(uint32_t *)(hptr));\
break;\
case 8:\
- x = (typeof(*ptr))tswap64(*(uint64_t *)(ptr));\
+ x = (typeof(*hptr))tswap64(*(uint64_t *)(hptr));\
break;\
default:\
abort();\