|
@@ -22,6 +22,7 @@
|
|
#include "qemu/path.h"
|
|
#include "qemu/path.h"
|
|
#include "qemu/memfd.h"
|
|
#include "qemu/memfd.h"
|
|
#include "qemu/queue.h"
|
|
#include "qemu/queue.h"
|
|
|
|
+#include "target_mman.h"
|
|
#include <elf.h>
|
|
#include <elf.h>
|
|
#include <endian.h>
|
|
#include <endian.h>
|
|
#include <grp.h>
|
|
#include <grp.h>
|
|
@@ -7612,6 +7613,14 @@ static inline int target_to_host_mlockall_arg(int arg)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+static inline int target_to_host_msync_arg(abi_long arg)
|
|
|
|
+{
|
|
|
|
+ return ((arg & TARGET_MS_ASYNC) ? MS_ASYNC : 0) |
|
|
|
|
+ ((arg & TARGET_MS_INVALIDATE) ? MS_INVALIDATE : 0) |
|
|
|
|
+ ((arg & TARGET_MS_SYNC) ? MS_SYNC : 0) |
|
|
|
|
+ (arg & ~(TARGET_MS_ASYNC | TARGET_MS_INVALIDATE | TARGET_MS_SYNC));
|
|
|
|
+}
|
|
|
|
+
|
|
#if (defined(TARGET_NR_stat64) || defined(TARGET_NR_lstat64) || \
|
|
#if (defined(TARGET_NR_stat64) || defined(TARGET_NR_lstat64) || \
|
|
defined(TARGET_NR_fstat64) || defined(TARGET_NR_fstatat64) || \
|
|
defined(TARGET_NR_fstat64) || defined(TARGET_NR_fstatat64) || \
|
|
defined(TARGET_NR_newfstatat))
|
|
defined(TARGET_NR_newfstatat))
|
|
@@ -10128,7 +10137,8 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
|
|
/* ??? msync/mlock/munlock are broken for softmmu. */
|
|
/* ??? msync/mlock/munlock are broken for softmmu. */
|
|
#ifdef TARGET_NR_msync
|
|
#ifdef TARGET_NR_msync
|
|
case TARGET_NR_msync:
|
|
case TARGET_NR_msync:
|
|
- return get_errno(msync(g2h(cpu, arg1), arg2, arg3));
|
|
|
|
|
|
+ return get_errno(msync(g2h(cpu, arg1), arg2,
|
|
|
|
+ target_to_host_msync_arg(arg3)));
|
|
#endif
|
|
#endif
|
|
#ifdef TARGET_NR_mlock
|
|
#ifdef TARGET_NR_mlock
|
|
case TARGET_NR_mlock:
|
|
case TARGET_NR_mlock:
|