[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 20/23] bsd-user: Add stop_all_tasks
From: |
Warner Losh |
Subject: |
[PULL v2 20/23] bsd-user: Add stop_all_tasks |
Date: |
Mon, 18 Oct 2021 13:01:12 -0600 |
Similar to the same function in linux-user: this stops all the current tasks.
Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
---
bsd-user/main.c | 9 +++++++++
bsd-user/qemu.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index ee84554854..cb5ea40236 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -195,6 +195,15 @@ static void usage(void)
__thread CPUState *thread_cpu;
+void stop_all_tasks(void)
+{
+ /*
+ * We trust when using NPTL (pthreads) start_exclusive() handles thread
+ * stopping correctly.
+ */
+ start_exclusive();
+}
+
bool qemu_cpu_is_self(CPUState *cpu)
{
return thread_cpu == cpu;
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index c1170f14d9..cdb85140f4 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -103,6 +103,7 @@ typedef struct TaskState {
} __attribute__((aligned(16))) TaskState;
void init_task_state(TaskState *ts);
+void stop_all_tasks(void);
extern const char *qemu_uname_release;
/*
--
2.32.0
- [PULL v2 07/23] bsd-user/mmap.c: Don't mmap fd == -1 independently from MAP_ANON flag, (continued)
- [PULL v2 07/23] bsd-user/mmap.c: Don't mmap fd == -1 independently from MAP_ANON flag, Warner Losh, 2021/10/18
- [PULL v2 14/23] bsd-user: export get_errno and is_error from syscall.c, Warner Losh, 2021/10/18
- [PULL v2 17/23] bsd-user/target_os_elf.h: Remove fallback ELF_HWCAP and reorder, Warner Losh, 2021/10/18
- [PULL v2 18/23] bsd-user/target_os_elf: If ELF_HWCAP2 is defined, publish it, Warner Losh, 2021/10/18
- [PULL v2 19/23] bsd-user: Remove used from TaskState, Warner Losh, 2021/10/18
- [PULL v2 15/23] bsd-user/errno_defs.h: Add internal error numbers, Warner Losh, 2021/10/18
- [PULL v2 22/23] bsd-user: Rename sigqueue to qemu_sigqueue, Warner Losh, 2021/10/18
- [PULL v2 23/23] bsd-user/signal: Create a dummy signal queueing function, Warner Losh, 2021/10/18
- [PULL v2 16/23] bsd-user: move TARGET_MC_GET_CLEAR_RET to target_os_signal.h, Warner Losh, 2021/10/18
- [PULL v2 21/23] bsd-user/sysarch: Move to using do_freebsd_arch_sysarch interface, Warner Losh, 2021/10/18
- [PULL v2 20/23] bsd-user: Add stop_all_tasks,
Warner Losh <=
- Re: [PULL v2 00/23] Pull bsd user 20211018 patches, Richard Henderson, 2021/10/18