* [Qemu-devel] [PATCH] cpus.c: Make all_cpu_threads_idle() static
@ 2012-07-19 15:52 Peter Maydell
2012-07-21 9:47 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2012-07-19 15:52 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, patches
Commit 946fb27c1 moved all the uses of all_cpu_threads_idle()
into cpus.c. This means we can mark the function 'static'
(again), if we shuffle it a bit earlier in the source file.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
cpus.c | 52 ++++++++++++++++++++++++++--------------------------
qemu-common.h | 1 -
2 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/cpus.c b/cpus.c
index b182b3d..756e624 100644
--- a/cpus.c
+++ b/cpus.c
@@ -61,6 +61,32 @@
static CPUArchState *next_cpu;
+static bool cpu_thread_is_idle(CPUArchState *env)
+{
+ if (env->stop || env->queued_work_first) {
+ return false;
+ }
+ if (env->stopped || !runstate_is_running()) {
+ return true;
+ }
+ if (!env->halted || qemu_cpu_has_work(env) || kvm_irqchip_in_kernel()) {
+ return false;
+ }
+ return true;
+}
+
+static bool all_cpu_threads_idle(void)
+{
+ CPUArchState *env;
+
+ for (env = first_cpu; env != NULL; env = env->next_cpu) {
+ if (!cpu_thread_is_idle(env)) {
+ return false;
+ }
+ }
+ return true;
+}
+
/***********************************************************/
/* guest cycle counter */
@@ -433,32 +459,6 @@ static int cpu_can_run(CPUArchState *env)
return 1;
}
-static bool cpu_thread_is_idle(CPUArchState *env)
-{
- if (env->stop || env->queued_work_first) {
- return false;
- }
- if (env->stopped || !runstate_is_running()) {
- return true;
- }
- if (!env->halted || qemu_cpu_has_work(env) || kvm_irqchip_in_kernel()) {
- return false;
- }
- return true;
-}
-
-bool all_cpu_threads_idle(void)
-{
- CPUArchState *env;
-
- for (env = first_cpu; env != NULL; env = env->next_cpu) {
- if (!cpu_thread_is_idle(env)) {
- return false;
- }
- }
- return true;
-}
-
static void cpu_handle_guest_debug(CPUArchState *env)
{
gdb_set_stop_cpu(env);
diff --git a/qemu-common.h b/qemu-common.h
index 09676f5..7c8dac8 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -293,7 +293,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id);
void qemu_cpu_kick(void *env);
void qemu_cpu_kick_self(void);
int qemu_cpu_is_self(void *env);
-bool all_cpu_threads_idle(void);
/* work queue */
struct qemu_work_item {
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] cpus.c: Make all_cpu_threads_idle() static
2012-07-19 15:52 [Qemu-devel] [PATCH] cpus.c: Make all_cpu_threads_idle() static Peter Maydell
@ 2012-07-21 9:47 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2012-07-21 9:47 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-trivial, Paolo Bonzini, qemu-devel, patches
On Thu, Jul 19, 2012 at 04:52:27PM +0100, Peter Maydell wrote:
> Commit 946fb27c1 moved all the uses of all_cpu_threads_idle()
> into cpus.c. This means we can mark the function 'static'
> (again), if we shuffle it a bit earlier in the source file.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> cpus.c | 52 ++++++++++++++++++++++++++--------------------------
> qemu-common.h | 1 -
> 2 files changed, 26 insertions(+), 27 deletions(-)
Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-21 9:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-19 15:52 [Qemu-devel] [PATCH] cpus.c: Make all_cpu_threads_idle() static Peter Maydell
2012-07-21 9:47 ` Stefan Hajnoczi
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).