[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/42] bsd-user: assume pthreads and support of __thread
From: |
imp |
Subject: |
[PULL 15/42] bsd-user: assume pthreads and support of __thread |
Date: |
Tue, 7 Sep 2021 15:53:05 -0600 |
From: Warner Losh <imp@bsdimp.com>
All compilers for some time have supported this. Follow linux-user and
eliminate the #define THREAD and unconditionally insert __thread where
needed. Please insert: "(see 24cb36a61c6: "configure: Make NPTL
non-optional")"
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
bsd-user/main.c | 2 +-
bsd-user/qemu.h | 10 +---------
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 1388c7a13d..e06cc7b414 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -309,7 +309,7 @@ static void usage(void)
exit(1);
}
-THREAD CPUState *thread_cpu;
+__thread CPUState *thread_cpu;
bool qemu_cpu_is_self(CPUState *cpu)
{
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index d1ab58a8eb..cf248ad3df 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -40,12 +40,6 @@ extern enum BSDType bsd_type;
#include "target_syscall.h"
#include "exec/gdbstub.h"
-#if defined(CONFIG_USE_NPTL)
-#define THREAD __thread
-#else
-#define THREAD
-#endif
-
/*
* This struct is used to hold certain information about the image. Basically,
* it replicates in user space what would be certain task_struct fields in the
@@ -155,7 +149,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num,
abi_long arg1,
abi_long arg2, abi_long arg3, abi_long arg4,
abi_long arg5, abi_long arg6);
void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
-extern THREAD CPUState *thread_cpu;
+extern __thread CPUState *thread_cpu;
void cpu_loop(CPUArchState *env);
char *target_strerror(int err);
int get_osversion(void);
@@ -422,8 +416,6 @@ static inline void *lock_user_string(abi_ulong guest_addr)
#define unlock_user_struct(host_ptr, guest_addr, copy) \
unlock_user(host_ptr, guest_addr, (copy) ? sizeof(*host_ptr) : 0)
-#if defined(CONFIG_USE_NPTL)
#include <pthread.h>
-#endif
#endif /* QEMU_H */
--
2.32.0
- [PULL 06/42] bsd-user: Remove all non-x86 code from elfload.c, (continued)
- [PULL 06/42] bsd-user: Remove all non-x86 code from elfload.c, imp, 2021/09/07
- [PULL 03/42] bsd-user: Add Stacey's copyright to main.c, imp, 2021/09/07
- [PULL 08/42] bsd-user: pass the bsd_param into loader_exec, imp, 2021/09/07
- [PULL 13/42] bsd-user: TARGET_NGROUPS unused in this file, remove, imp, 2021/09/07
- [PULL 07/42] bsd-user: move arch specific defines out of elfload.c, imp, 2021/09/07
- [PULL 09/42] bsd-user: Fix calculation of size to allocate, imp, 2021/09/07
- [PULL 12/42] bsd-user: remove a.out support, imp, 2021/09/07
- [PULL 17/42] bsd-user: Include host-os.h from main, imp, 2021/09/07
- [PULL 22/42] bsd-user: Include more things in qemu.h, imp, 2021/09/07
- [PULL 10/42] bsd-user: implement path searching, imp, 2021/09/07
- [PULL 15/42] bsd-user: assume pthreads and support of __thread,
imp <=
- [PULL 14/42] bsd-user: elfload: simplify bswap a bit., imp, 2021/09/07
- [PULL 16/42] bsd-user: add host-os.h, imp, 2021/09/07
- [PULL 18/42] bsd-user: save the path to the qemu emulator, imp, 2021/09/07
- [PULL 19/42] bsd-user: start to move target CPU functions to target_arch*, imp, 2021/09/07
- [PULL 29/42] bsd-user: Add architecture specific signal tramp code, imp, 2021/09/07
- [PULL 23/42] bsd-user: define max args in terms of pages, imp, 2021/09/07
- [PULL 25/42] bsd-user: Add system independent stack, data and text limiting, imp, 2021/09/07
- [PULL 21/42] bsd-user: pull in target_arch_thread.h update target_arch_elf.h, imp, 2021/09/07
- [PULL 27/42] bsd-user: Implement --seed and initialize random state, imp, 2021/09/07
- [PULL 26/42] bsd-user: *BSD specific siginfo defintions, imp, 2021/09/07