summaryrefslogtreecommitdiffstats
path: root/softmmu/cpus.c
diff options
context:
space:
mode:
authorXuzhou Cheng2022-10-28 06:57:26 +0200
committerThomas Huth2022-10-28 11:17:12 +0200
commitc9923550b446e54413024117c0ed978a08e3ab1a (patch)
tree5a16826541c7c0e2466c6f8a85e472ec778d1009 /softmmu/cpus.c
parenttests: Add sndio to the FreeBSD CI containers / VM (diff)
downloadqemu-c9923550b446e54413024117c0ed978a08e3ab1a.tar.gz
qemu-c9923550b446e54413024117c0ed978a08e3ab1a.tar.xz
qemu-c9923550b446e54413024117c0ed978a08e3ab1a.zip
accel/qtest: Support qtest accelerator for Windows
Currently signal SIGIPI [=SIGUSR1] is used to kick the dummy CPU when qtest accelerator is used. However SIGUSR1 is unsupported on Windows. To support Windows, we add a QemuSemaphore CPUState::sem to kick the dummy CPU instead for Windows. Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com> Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20221028045736.679903-2-bin.meng@windriver.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'softmmu/cpus.c')
-rw-r--r--softmmu/cpus.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index 61b27ff59d..9dd1a4dc17 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -437,18 +437,19 @@ void qemu_wait_io_event(CPUState *cpu)
void cpus_kick_thread(CPUState *cpu)
{
-#ifndef _WIN32
- int err;
-
if (cpu->thread_kicked) {
return;
}
cpu->thread_kicked = true;
- err = pthread_kill(cpu->thread->thread, SIG_IPI);
+
+#ifndef _WIN32
+ int err = pthread_kill(cpu->thread->thread, SIG_IPI);
if (err && err != ESRCH) {
fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
exit(1);
}
+#else
+ qemu_sem_post(&cpu->sem);
#endif
}