]> Git Repo - qemu.git/commitdiff
bsd-user: align use of mmap_lock to that of linux-user
authorAlex Bennée <[email protected]>
Mon, 20 Mar 2017 14:36:47 +0000 (14:36 +0000)
committerAlex Bennée <[email protected]>
Tue, 28 Mar 2017 09:50:40 +0000 (10:50 +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 <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
bsd-user/mmap.c
bsd-user/qemu.h

index 1ad018a127898abc4fccd9d3d085e438000cdd11..7f2018ede04002bceafb0906af06e25589ddeeb7 100644 (file)
@@ -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)
index 2b2b9184e069d398a632468621dbfcfdaa8f60eb..b550cee0cb63377dc79065085482793dfbf5e3a8 100644 (file)
@@ -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;
This page took 0.028181 seconds and 4 git commands to generate.