[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 10/12] bsd-user: Support CPU work queue
From: |
Sergey Fedorov |
Subject: |
[Qemu-devel] [PATCH v4 10/12] bsd-user: Support CPU work queue |
Date: |
Fri, 15 Jul 2016 21:57:24 +0300 |
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>
---
bsd-user/main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 4819b9ec6333..f738dd64d691 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -63,6 +63,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)
{
@@ -70,6 +83,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)
@@ -740,6 +754,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.9.1
- [Qemu-devel] [PATCH v4 00/12] cpu-exec: Safe work in quiescent state, Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 01/12] atomic: introduce atomic_dec_fetch., Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 11/12] cpu-exec-common: Introduce async_safe_run_on_cpu(), Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 10/12] bsd-user: Support CPU work queue,
Sergey Fedorov <=
- [Qemu-devel] [PATCH v4 05/12] cpus: Rename flush_queued_work(), Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 06/12] linux-user: Use QemuMutex and QemuCond, Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 02/12] cpus: pass CPUState to run_on_cpu helpers, Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 08/12] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick(), Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 03/12] cpus: Move common code out of {async_, }run_on_cpu(), Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 12/12] tcg: Make tb_flush() thread safe, Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 04/12] cpus: Wrap mutex used to protect CPU work, Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 07/12] linux-user: Rework exclusive operation mechanism, Sergey Fedorov, 2016/07/15
- [Qemu-devel] [PATCH v4 09/12] linux-user: Support CPU work queue, Sergey Fedorov, 2016/07/15