From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>, anthony@codemonkey.ws
Subject: [Qemu-devel] [PATCH for-1.2 4/4] cpu: Move thread_kicked to CPUState
Date: Thu, 2 Aug 2012 02:48:37 +0200 [thread overview]
Message-ID: <1343868517-11852-5-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1343868517-11852-1-git-send-email-afaerber@suse.de>
Change field type to bool.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
cpu-defs.h | 1 -
cpus.c | 14 +++++++++-----
include/qemu/cpu.h | 1 +
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/cpu-defs.h b/cpu-defs.h
index be89684..4018b88 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -209,7 +209,6 @@ typedef struct CPUWatchpoint {
uint32_t stop; /* Stop request */ \
uint32_t stopped; /* Artificially stopped */ \
struct QemuCond *halt_cond; \
- int thread_kicked; \
struct qemu_work_item *queued_work_first, *queued_work_last; \
const char *cpu_model_str; \
struct KVMState *kvm_state; \
diff --git a/cpus.c b/cpus.c
index 565abb4..b61f60e 100644
--- a/cpus.c
+++ b/cpus.c
@@ -686,13 +686,15 @@ static void flush_queued_work(CPUArchState *env)
static void qemu_wait_io_event_common(CPUArchState *env)
{
+ CPUState *cpu = ENV_GET_CPU(env);
+
if (env->stop) {
env->stop = 0;
env->stopped = 1;
qemu_cond_signal(&qemu_pause_cond);
}
flush_queued_work(env);
- env->thread_kicked = false;
+ cpu->thread_kicked = false;
}
static void qemu_tcg_wait_io_event(void)
@@ -866,11 +868,12 @@ static void qemu_cpu_kick_thread(CPUArchState *env)
void qemu_cpu_kick(void *_env)
{
CPUArchState *env = _env;
+ CPUState *cpu = ENV_GET_CPU(env);
qemu_cond_broadcast(env->halt_cond);
- if (!tcg_enabled() && !env->thread_kicked) {
+ if (!tcg_enabled() && !cpu->thread_kicked) {
qemu_cpu_kick_thread(env);
- env->thread_kicked = true;
+ cpu->thread_kicked = true;
}
}
@@ -878,10 +881,11 @@ void qemu_cpu_kick_self(void)
{
#ifndef _WIN32
assert(cpu_single_env);
+ CPUState *cpu_single_cpu = ENV_GET_CPU(cpu_single_env);
- if (!cpu_single_env->thread_kicked) {
+ if (!cpu_single_cpu->thread_kicked) {
qemu_cpu_kick_thread(cpu_single_env);
- cpu_single_env->thread_kicked = true;
+ cpu_single_cpu->thread_kicked = true;
}
#else
abort();
diff --git a/include/qemu/cpu.h b/include/qemu/cpu.h
index d20644b..ad706a6 100644
--- a/include/qemu/cpu.h
+++ b/include/qemu/cpu.h
@@ -66,6 +66,7 @@ struct CPUState {
#ifdef _WIN32
HANDLE hThread;
#endif
+ bool thread_kicked;
/* TODO Move common fields from CPUArchState here. */
};
--
1.7.7
next prev parent reply other threads:[~2012-08-02 0:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-02 0:48 [Qemu-devel] [PULL for-1.2] QOM CPUState, part 4: initial field movements Andreas Färber
2012-08-02 0:48 ` [Qemu-devel] [PATCH for-1.2 1/4] qemu-thread: Let qemu_thread_is_self() return bool Andreas Färber
2012-08-02 6:27 ` Stefan Weil
2012-08-02 16:14 ` Andreas Färber
2012-08-02 0:48 ` [Qemu-devel] [PATCH for-1.2 2/4] cpu: Move CPU_COMMON_THREAD into CPUState Andreas Färber
2012-08-02 0:48 ` [Qemu-devel] [PATCH for-1.2 3/4] cpu: Move thread field " Andreas Färber
2012-08-02 0:48 ` Andreas Färber [this message]
2012-08-03 20:44 ` [Qemu-devel] [PULL for-1.2] QOM CPUState, part 4: initial field movements Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343868517-11852-5-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).