@@ -3922,6 +3922,7 @@ static inline abi_long target_truncate64(void *cpu_env, const char *arg1,
abi_long arg3,
abi_long arg4)
{
+#if TARGET_ABI_BITS == 32
#ifdef TARGET_ARM
if (((CPUARMState *)cpu_env)->eabi)
{
@@ -3929,6 +3930,11 @@ static inline abi_long target_truncate64(void *cpu_env, const char *arg1,
arg3 = arg4;
}
#endif
+#if defined TARGET_PPC || defined TARGET_MIPS
+ arg2 = arg3;
+ arg3 = arg4;
+#endif
+#endif
return get_errno(truncate64(arg1, target_offset64(arg2, arg3)));
}
#endif
@@ -3939,6 +3945,7 @@ static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1,
abi_long arg3,
abi_long arg4)
{
+#if TARGET_ABI_BITS == 32
#ifdef TARGET_ARM
if (((CPUARMState *)cpu_env)->eabi)
{
@@ -3946,10 +3953,63 @@ static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1,
arg3 = arg4;
}
#endif
+#if defined TARGET_PPC || defined TARGET_MIPS
+ arg2 = arg3;
+ arg3 = arg4;
+#endif
+#endif
return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3)));
}
#endif
+#ifdef TARGET_NR_pread64
+static inline abi_long target_pread64(void *cpu_env, abi_long arg1,
+ void *arg2,
+ abi_long arg3,
+ abi_long arg4,
+ abi_long arg5,
+ abi_long arg6)
+{
+#if TARGET_ABI_BITS == 32
+#ifdef TARGET_ARM
+ if (((CPUARMState *)cpu_env)->eabi)
+ {
+ arg4 = arg5;
+ arg5 = arg6;
+ }
+#endif
+#if defined TARGET_PPC || defined TARGET_MIPS
+ arg4 = arg5;
+ arg5 = arg6;
+#endif
+#endif
+ return get_errno(pread64(arg1, arg2, arg3, target_offset64(arg4, arg5)));
+}
+
+static inline abi_long target_pwrite64(void *cpu_env, abi_long arg1,
+ const void *arg2,
+ abi_long arg3,
+ abi_long arg4,
+ abi_long arg5,
+ abi_long arg6)
+{
+#if TARGET_ABI_BITS == 32
+#ifdef TARGET_ARM
+ if (((CPUARMState *)cpu_env)->eabi)
+ {
+ arg4 = arg5;
+ arg5 = arg6;
+ }
+#endif
+#if defined TARGET_PPC || defined TARGET_MIPS
+ arg4 = arg5;
+ arg5 = arg6;
+#endif
+#endif
+ return get_errno(pwrite64(arg1, arg2, arg3, target_offset64(arg4, arg5)));
+}
+#endif
+
static inline abi_long target_to_host_timespec(struct timespec *host_ts,
abi_ulong target_addr)
{
@@ -6166,13 +6226,13 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_pread64:
if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0)))
goto efault;
- ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5)));
+ ret = target_pread64(cpu_env, arg1, p, arg3, arg4, arg5, arg6);
unlock_user(p, arg2, ret);
break;
case TARGET_NR_pwrite64:
if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
goto efault;
- ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
+ ret = target_pwrite64(cpu_env, arg1, p, arg3, arg4, arg5, arg6);
unlock_user(p, arg2, 0);
break;
#endif