Permalink
Browse files

Add bigendian logic to lseek for bsd-user mips

  • Loading branch information...
1 parent 9af5fc1 commit 05ee8495804599b52a88eb36b13ea9c06b3207cd @seanbruno committed Mar 23, 2014
Showing with 7 additions and 1 deletion.
  1. +7 −1 bsd-user/bsd-file.h
View
@@ -996,9 +996,15 @@ static abi_long do_bsd_lseek(void *cpu_env, abi_long arg1, abi_long arg2,
}
if (res == -1) {
ret = get_errno(res);
+ set_second_rval(cpu_env, 0xFFFFFFFF);
} else {
- ret = res & 0xFFFFFFFF;
+#ifdef TARGET_WORDS_BIGENDIAN
+ ret = ((res >> 32) & 0xFFFFFFFF);
+ set_second_rval(cpu_env, res & 0xFFFFFFFF);
+#else
+ ret = res & 0xFFFFFFFF;
set_second_rval(cpu_env, (res >> 32) & 0xFFFFFFFF);
+#endif
}
#else
ret = get_errno(lseek(arg1, arg2, arg3));

0 comments on commit 05ee849

Please sign in to comment.