[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 2/6] bsd-user: align use of mmap_lock to that of linu
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL 2/6] bsd-user: align use of mmap_lock to that of linux-user |
Date: |
Tue, 28 Mar 2017 12:09:32 +0100 |
The introduction of stricter mmap_lock checking in translate-all broke
the BSD user build. The working mmap_lock functions were hidden behind
CONFIG_USE_NPTL which is never defined. This patch brings them inline
with linux-user.
Despite the disapearence of the comment "We aren't threadsafe to start
with..." this doesn't make bsd-user so. It will still need the rest of
the fixes that have been done in linux-user ported over.
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
---
bsd-user/mmap.c | 13 +------------
bsd-user/qemu.h | 2 --
2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 1ad018a127..7f2018ede0 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -24,8 +24,7 @@
//#define DEBUG_MMAP
-#if defined(CONFIG_USE_NPTL)
-pthread_mutex_t mmap_mutex;
+static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER;
static int __thread mmap_lock_count;
void mmap_lock(void)
@@ -62,16 +61,6 @@ void mmap_fork_end(int child)
else
pthread_mutex_unlock(&mmap_mutex);
}
-#else
-/* We aren't threadsafe to start with, so no need to worry about locking. */
-void mmap_lock(void)
-{
-}
-
-void mmap_unlock(void)
-{
-}
-#endif
/* NOTE: all the constants are the HOST ones, but addresses are target. */
int target_mprotect(abi_ulong start, abi_ulong len, int prot)
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 2b2b9184e0..b550cee0cb 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -209,10 +209,8 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong
old_size,
abi_ulong new_addr);
int target_msync(abi_ulong start, abi_ulong len, int flags);
extern unsigned long last_brk;
-#if defined(CONFIG_USE_NPTL)
void mmap_fork_start(void);
void mmap_fork_end(int child);
-#endif
/* main.c */
extern unsigned long x86_stack_size;
--
2.11.0
- [Qemu-devel] [PULL 0/6] MTTCG fixes for rc2, Alex Bennée, 2017/03/28
- [Qemu-devel] [PULL 2/6] bsd-user: align use of mmap_lock to that of linux-user,
Alex Bennée <=
- [Qemu-devel] [PULL 5/6] tcg: Add a new line after incompatibility warning, Alex Bennée, 2017/03/28
- [Qemu-devel] [PULL 4/6] ui/console: use exclusive mechanism directly, Alex Bennée, 2017/03/28
- [Qemu-devel] [PULL 3/6] ui/console: ensure do_safe_dpy_refresh holds BQL, Alex Bennée, 2017/03/28
- [Qemu-devel] [PULL 1/6] user-exec: handle synchronous signals from QEMU gracefully, Alex Bennée, 2017/03/28
- [Qemu-devel] [PULL 6/6] replay/replay.c: bump REPLAY_VERSION, Alex Bennée, 2017/03/28
- Re: [Qemu-devel] [PULL 0/6] MTTCG fixes for rc2, Peter Maydell, 2017/03/28