[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 10/13] bsd-user: Support CPU work queue
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v5 10/13] bsd-user: Support CPU work queue |
Date: |
Tue, 2 Aug 2016 18:27:41 +0100 |
From: Sergey Fedorov <address@hidden>
It is a minimalistic support because bsd-linux claims to be _not_
threadsafe.
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
---
bsd-user/main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 315ba1d..24d33c9 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -66,6 +66,19 @@ int cpu_get_pic_interrupt(CPUX86State *env)
}
#endif
+void qemu_init_cpu_loop(void)
+{
+ /* We need to do this becuase process_queued_cpu_work() calls
+ * qemu_cond_broadcast() on it
+ */
+ qemu_cond_init(&qemu_work_cond);
+}
+
+QemuMutex *qemu_get_cpu_work_mutex(void)
+{
+ return NULL; /* it will never be used */
+}
+
/* These are no-ops because we are not threadsafe. */
static inline void cpu_exec_start(CPUArchState *env)
{
@@ -73,6 +86,7 @@ static inline void cpu_exec_start(CPUArchState *env)
static inline void cpu_exec_end(CPUArchState *env)
{
+ process_queued_cpu_work(cpu);
}
static inline void start_exclusive(void)
@@ -746,6 +760,7 @@ int main(int argc, char **argv)
if (argc <= 1)
usage();
+ qemu_init_cpu_loop();
module_call_init(MODULE_INIT_QOM);
if ((envlist = envlist_create()) == NULL) {
--
2.7.4
- [Qemu-devel] [PATCH v5 00/13] cpu-exec: Safe work in quiescent state, Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 01/13] atomic: introduce atomic_dec_fetch., Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 05/13] cpus: Rename flush_queued_work(), Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 08/13] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick(), Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 02/13] cpus: pass CPUState to run_on_cpu helpers, Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 04/13] cpus: Wrap mutex used to protect CPU work, Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 03/13] cpus: Move common code out of {async_, }run_on_cpu(), Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 07/13] linux-user: Rework exclusive operation mechanism, Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 06/13] linux-user: Use QemuMutex and QemuCond, Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 12/13] tcg: Make tb_flush() thread safe, Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 10/13] bsd-user: Support CPU work queue,
Alex Bennée <=
- [Qemu-devel] [PATCH v5 13/13] cpu-exec: replace cpu->queued_work with GArray, Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 09/13] linux-user: Support CPU work queue, Alex Bennée, 2016/08/02
- [Qemu-devel] [PATCH v5 11/13] cpu-exec-common: Introduce async_safe_run_on_cpu(), Alex Bennée, 2016/08/02