提交 46d62fac 编写于 作者: J Jan Kiszka 提交者: Marcelo Tosatti

Introduce VCPU self-signaling service

Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPU
context. First user will be kvm.
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 6d9cb73c
......@@ -529,6 +529,17 @@ void qemu_cpu_kick(void *env)
return;
}
void qemu_cpu_kick_self(void)
{
#ifndef _WIN32
assert(cpu_single_env);
raise(SIG_IPI);
#else
abort();
#endif
}
void qemu_notify_event(void)
{
CPUState *env = cpu_single_env;
......@@ -831,6 +842,16 @@ void qemu_cpu_kick(void *_env)
}
}
void qemu_cpu_kick_self(void)
{
assert(cpu_single_env);
if (!cpu_single_env->thread_kicked) {
qemu_thread_signal(cpu_single_env->thread, SIG_IPI);
cpu_single_env->thread_kicked = true;
}
}
int qemu_cpu_self(void *_env)
{
CPUState *env = _env;
......
......@@ -288,6 +288,7 @@ void qemu_notify_event(void);
/* Unblock cpu */
void qemu_cpu_kick(void *env);
void qemu_cpu_kick_self(void);
int qemu_cpu_self(void *env);
/* work queue */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册