From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNRGx-0007Gn-LF for qemu-devel@nongnu.org; Wed, 13 Jul 2016 17:00:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNRGv-0001Hr-SW for qemu-devel@nongnu.org; Wed, 13 Jul 2016 17:00:46 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:35752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNRGv-0001Hh-LR for qemu-devel@nongnu.org; Wed, 13 Jul 2016 17:00:45 -0400 Received: by mail-lf0-x22f.google.com with SMTP id f93so48254375lfi.2 for ; Wed, 13 Jul 2016 14:00:45 -0700 (PDT) From: Sergey Fedorov Date: Thu, 14 Jul 2016 00:00:20 +0300 Message-Id: <1468443622-17368-11-git-send-email-sergey.fedorov@linaro.org> In-Reply-To: <1468443622-17368-1-git-send-email-sergey.fedorov@linaro.org> References: <1468443622-17368-1-git-send-email-sergey.fedorov@linaro.org> Subject: [Qemu-devel] [PATCH v3 10/12] bsd-user: Support CPU work queue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org, serge.fdrv@gmail.com, MTTCG Devel , =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= , Alvise Rigo , "Emilio G. Cota" , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Paolo Bonzini , Richard Henderson , Peter Maydell , Sergey Fedorov , Stefan Hajnoczi From: Sergey Fedorov It is a minimalistic support because bsd-linux claims to be _not_ threadsafe. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- 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) { -- 1.9.1