diff options
author | Ilya Leoshkevich | 2022-09-06 02:08:36 +0200 |
---|---|---|
committer | Laurent Vivier | 2022-09-27 09:30:09 +0200 |
commit | 8655b4c7099dd198836610bdfb22f09d332b28d3 (patch) | |
tree | 1e8de691cd1a6cabfd75fdd1e0ae6e46c390f2f5 /linux-user | |
parent | linux-user: Provide MADV_* definitions (diff) | |
download | qemu-8655b4c7099dd198836610bdfb22f09d332b28d3.tar.gz qemu-8655b4c7099dd198836610bdfb22f09d332b28d3.tar.xz qemu-8655b4c7099dd198836610bdfb22f09d332b28d3.zip |
linux-user: Fix madvise(MADV_DONTNEED) on alpha
MADV_DONTNEED has a different value on alpha, compared to all the other
architectures. Fix by using TARGET_MADV_DONTNEED instead of
MADV_DONTNEED.
Fixes: 892a4f6a750a ("linux-user: Add partial support for MADV_DONTNEED")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220906000839.1672934-3-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/mmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 83fdae7034..942bec7e85 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -22,6 +22,7 @@ #include "qemu.h" #include "user-internals.h" #include "user-mmap.h" +#include "target_mman.h" static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER; static __thread int mmap_lock_count; @@ -897,7 +898,7 @@ abi_long target_madvise(abi_ulong start, abi_ulong len_in, int advice) * anonymous mappings. In this case passthrough is safe, so do it. */ mmap_lock(); - if (advice == MADV_DONTNEED && + if (advice == TARGET_MADV_DONTNEED && can_passthrough_madv_dontneed(start, end)) { ret = get_errno(madvise(g2h_untagged(start), len, MADV_DONTNEED)); if (ret == 0) { |