[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/15] lock: introduce global lock for device tree
From: |
Liu Ping Fan |
Subject: |
[Qemu-devel] [PATCH 11/15] lock: introduce global lock for device tree |
Date: |
Wed, 8 Aug 2012 14:25:52 +0800 |
From: Liu Ping Fan <address@hidden>
Signed-off-by: Liu Ping Fan <address@hidden>
---
cpus.c | 12 ++++++++++++
main-loop.h | 3 +++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/cpus.c b/cpus.c
index b182b3d..a734b36 100644
--- a/cpus.c
+++ b/cpus.c
@@ -611,6 +611,7 @@ static void qemu_tcg_init_cpu_signals(void)
}
#endif /* _WIN32 */
+QemuMutex qemu_device_tree_mutex;
QemuMutex qemu_global_mutex;
static QemuCond qemu_io_proceeded_cond;
static bool iothread_requesting_mutex;
@@ -634,6 +635,7 @@ void qemu_init_cpu_loop(void)
qemu_cond_init(&qemu_work_cond);
qemu_cond_init(&qemu_io_proceeded_cond);
qemu_mutex_init(&qemu_global_mutex);
+ qemu_mutex_init(&qemu_device_tree_mutex);
qemu_thread_get_self(&io_thread);
}
@@ -911,6 +913,16 @@ void qemu_mutex_unlock_iothread(void)
qemu_mutex_unlock(&qemu_global_mutex);
}
+void qemu_lock_devtree(void)
+{
+ qemu_mutex_lock(&qemu_device_tree_mutex);
+}
+
+void qemu_unlock_devtree(void)
+{
+ qemu_mutex_unlock(&qemu_device_tree_mutex);
+}
+
static int all_vcpus_paused(void)
{
CPUArchState *penv = first_cpu;
diff --git a/main-loop.h b/main-loop.h
index dce1cd9..17e959a 100644
--- a/main-loop.h
+++ b/main-loop.h
@@ -353,6 +353,9 @@ void qemu_mutex_lock_iothread(void);
*/
void qemu_mutex_unlock_iothread(void);
+void qemu_lock_devtree(void);
+void qemu_unlock_devtree(void);
+
/* internal interfaces */
void qemu_fd_register(int fd);
--
1.7.4.4
- Re: [Qemu-devel] [PATCH 13/15] hotplug: introduce qdev_unplug_complete() to remove device from views, (continued)
[Qemu-devel] [PATCH 15/15] e1000: using new interface--unmap to unplug, Liu Ping Fan, 2012/08/08
[Qemu-devel] [PATCH 11/15] lock: introduce global lock for device tree,
Liu Ping Fan <=
Re: [Qemu-devel] [PATCH 11/15] lock: introduce global lock for device tree, Avi Kivity, 2012/08/08
[Qemu-devel] [PATCH 12/15] qdev: using devtree lock to protect device's accessing, Liu Ping Fan, 2012/08/08
[Qemu-devel] [PATCH 07/15] memory: inc/dec mr's ref when adding/removing from mem view, Liu Ping Fan, 2012/08/08
[Qemu-devel] [PATCH 14/15] qom: object_unref call reclaimer, Liu Ping Fan, 2012/08/08