Commit 2054ac9baf27ecec52acde96881c9f0278ce04da

Authored by aurel32
1 parent 34c9dd8e

linux-user: Add readahead syscall

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5479 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 14 additions and 1 deletions
linux-user/syscall.c
... ... @@ -5761,7 +5761,20 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
5761 5761 break;
5762 5762 #ifdef TARGET_NR_readahead
5763 5763 case TARGET_NR_readahead:
5764   - goto unimplemented;
  5764 +#if TARGET_ABI_BITS == 32
  5765 +#ifdef TARGET_ARM
  5766 + if (((CPUARMState *)cpu_env)->eabi)
  5767 + {
  5768 + arg2 = arg3;
  5769 + arg3 = arg4;
  5770 + arg4 = arg5;
  5771 + }
  5772 +#endif
  5773 + ret = get_errno(readahead(arg1, ((off64_t)arg3 << 32) | arg2, arg4));
  5774 +#else
  5775 + ret = get_errno(readahead(arg1, arg2, arg3));
  5776 +#endif
  5777 + break;
5765 5778 #endif
5766 5779 #ifdef TARGET_NR_setxattr
5767 5780 case TARGET_NR_setxattr:
... ...