]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - linux-user/uaccess.c
target/rx: TCG helpers
[thirdparty/qemu.git] / linux-user / uaccess.c
index 4d506935f8cad50c48c6c3ee85fee40d556ba47a..e215ecc2a60b29bd506f524e17c035fd96d4f523 100644 (file)
@@ -1,6 +1,6 @@
 /* User memory access */
-#include <stdio.h>
-#include <string.h>
+#include "qemu/osdep.h"
+#include "qemu/cutils.h"
 
 #include "qemu.h"
 
@@ -30,24 +30,13 @@ abi_long copy_to_user(abi_ulong gaddr, void *hptr, size_t len)
 
     if ((ghptr = lock_user(VERIFY_WRITE, gaddr, len, 0))) {
         memcpy(ghptr, hptr, len);
-       unlock_user(ghptr, gaddr, len);
+        unlock_user(ghptr, gaddr, len);
     } else
         ret = -TARGET_EFAULT;
 
     return ret;
 }
 
-/* XXX: use host strnlen if available ? */
-static int qemu_strnlen(const char *s, int max_len)
-{
-    int i;
-    for(i = 0; i < max_len; i++) {
-        if (s[i] == '\0')
-            break;
-    }
-    return i;
-}
-
 /* Return the length of a string in target memory or -TARGET_EFAULT if
    access error  */
 abi_long target_strlen(abi_ulong guest_addr1)