All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
	"Riku Voipio" <riku.voipio@iki.fi>,
	"Alexander Graf" <agraf@suse.de>,
	"Andreas Färber" <andreas.faerber@web.de>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"open list:PReP" <qemu-ppc@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [Qemu-devel] [PULL 10/24] cpu: Change cpu_exit() argument to CPUState
Date: Fri, 28 Jun 2013 17:55:32 +0200	[thread overview]
Message-ID: <1372434946-18489-11-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1372434946-18489-1-git-send-email-afaerber@suse.de>

It no longer depends on CPUArchState, so move it to qom/cpu.c.

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 cpus.c                  | 4 ++--
 exec.c                  | 8 --------
 gdbstub.c               | 2 +-
 hw/i386/pc.c            | 2 +-
 hw/mips/mips_fulong2e.c | 2 +-
 hw/mips/mips_jazz.c     | 2 +-
 hw/mips/mips_malta.c    | 2 +-
 hw/ppc/prep.c           | 2 +-
 include/exec/cpu-all.h  | 2 --
 include/qom/cpu.h       | 8 ++++++++
 linux-user/main.c       | 2 +-
 linux-user/signal.c     | 2 +-
 qom/cpu.c               | 6 ++++++
 13 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/cpus.c b/cpus.c
index 353208c..cce5223 100644
--- a/cpus.c
+++ b/cpus.c
@@ -473,7 +473,7 @@ static void cpu_handle_guest_debug(CPUArchState *env)
 static void cpu_signal(int sig)
 {
     if (cpu_single_env) {
-        cpu_exit(cpu_single_env);
+        cpu_exit(ENV_GET_CPU(cpu_single_env));
     }
     exit_request = 1;
 }
@@ -1088,7 +1088,7 @@ void cpu_stop_current(void)
         CPUState *cpu_single_cpu = ENV_GET_CPU(cpu_single_env);
         cpu_single_cpu->stop = false;
         cpu_single_cpu->stopped = true;
-        cpu_exit(cpu_single_env);
+        cpu_exit(cpu_single_cpu);
         qemu_cond_signal(&qemu_pause_cond);
     }
 }
diff --git a/exec.c b/exec.c
index 0b172b4..2d02b11 100644
--- a/exec.c
+++ b/exec.c
@@ -598,14 +598,6 @@ void cpu_single_step(CPUArchState *env, int enabled)
 #endif
 }
 
-void cpu_exit(CPUArchState *env)
-{
-    CPUState *cpu = ENV_GET_CPU(env);
-
-    cpu->exit_request = 1;
-    cpu->tcg_exit_req = 1;
-}
-
 void cpu_abort(CPUArchState *env, const char *fmt, ...)
 {
     va_list ap;
diff --git a/gdbstub.c b/gdbstub.c
index 663549c..0f15c7c 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2655,7 +2655,7 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
        is still in the running state, which can cause packets to be dropped
        and state transition 'T' packets to be sent while the syscall is still
        being processed.  */
-    cpu_exit(s->c_cpu);
+    cpu_exit(ENV_GET_CPU(s->c_cpu));
 #endif
 }
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 5e8f143..78f92e2 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1109,7 +1109,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
     CPUX86State *env = cpu_single_env;
 
     if (env && level) {
-        cpu_exit(env);
+        cpu_exit(CPU(x86_env_get_cpu(env)));
     }
 }
 
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 1aac93a..00c9071 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -253,7 +253,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
     CPUMIPSState *env = cpu_single_env;
 
     if (env && level) {
-        cpu_exit(env);
+        cpu_exit(CPU(mips_env_get_cpu(env)));
     }
 }
 
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 94d9570..2ad0c0b 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -102,7 +102,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
     CPUMIPSState *env = cpu_single_env;
 
     if (env && level) {
-        cpu_exit(env);
+        cpu_exit(CPU(mips_env_get_cpu(env)));
     }
 }
 
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 5033d51..8a4459d 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -773,7 +773,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
     CPUMIPSState *env = cpu_single_env;
 
     if (env && level) {
-        cpu_exit(env);
+        cpu_exit(CPU(mips_env_get_cpu(env)));
     }
 }
 
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 4fdc164..90828f2 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -420,7 +420,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)
     CPUPPCState *env = cpu_single_env;
 
     if (env && level) {
-        cpu_exit(env);
+        cpu_exit(CPU(ppc_env_get_cpu(env)));
     }
 }
 
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index e9c3717..e1cc62e 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -421,8 +421,6 @@ DECLARE_TLS(CPUArchState *,cpu_single_env);
      | CPU_INTERRUPT_TGT_EXT_3   \
      | CPU_INTERRUPT_TGT_EXT_4)
 
-void cpu_exit(CPUArchState *s);
-
 /* Breakpoint/watchpoint flags */
 #define BP_MEM_READ           0x01
 #define BP_MEM_WRITE          0x02
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 3e8cc47..3494356 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -371,6 +371,14 @@ void cpu_interrupt(CPUState *cpu, int mask);
 void cpu_reset_interrupt(CPUState *cpu, int mask);
 
 /**
+ * cpu_exit:
+ * @cpu: The CPU to exit.
+ *
+ * Requests the CPU @cpu to exit execution.
+ */
+void cpu_exit(CPUState *cpu);
+
+/**
  * cpu_resume:
  * @cpu: The CPU to resume.
  *
diff --git a/linux-user/main.c b/linux-user/main.c
index 21725a4..f67a62b 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -160,7 +160,7 @@ static inline void start_exclusive(void)
         other_cpu = ENV_GET_CPU(other);
         if (other_cpu->running) {
             pending_cpus++;
-            cpu_exit(other);
+            cpu_exit(other_cpu);
         }
     }
     if (pending_cpus > 1) {
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 5da8452..c4e20dc 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -524,7 +524,7 @@ static void host_signal_handler(int host_signum, siginfo_t *info,
     host_to_target_siginfo_noswap(&tinfo, info);
     if (queue_signal(thread_env, sig, &tinfo) == 1) {
         /* interrupt the virtual CPU as soon as possible */
-        cpu_exit(thread_env);
+        cpu_exit(ENV_GET_CPU(thread_env));
     }
 }
 
diff --git a/qom/cpu.c b/qom/cpu.c
index dba4a11..8a122b0 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -91,6 +91,12 @@ void cpu_reset_interrupt(CPUState *cpu, int mask)
     cpu->interrupt_request &= ~mask;
 }
 
+void cpu_exit(CPUState *cpu)
+{
+    cpu->exit_request = 1;
+    cpu->tcg_exit_req = 1;
+}
+
 int cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
                              void *opaque)
 {
-- 
1.8.1.4

  parent reply	other threads:[~2013-06-28 15:56 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 15:55 [Qemu-devel] [PULL 00/24] QOM CPUState patch queue 2013-06-28 Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 01/24] cpu: Fix cpu_class_set_vmsd() documentation Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 02/24] cpu: Introduce device_class_set_vmsd() helper Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 03/24] cpu: Introduce VMSTATE_CPU() macro for CPUState Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 04/24] target-alpha: Register VMStateDescription for AlphaCPU Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 05/24] target-openrisc: Register VMStateDescription for OpenRISCCPU Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 06/24] cpu: Guard cpu_{save, load}() definitions Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 07/24] gdbstub: Simplify find_cpu() Andreas Färber
2013-06-28 15:55 ` [PULL 08/24] kvm: Change kvm_cpu_synchronize_state() argument to CPUState Andreas Färber
2013-06-28 15:55   ` [Qemu-devel] " Andreas Färber
2013-06-28 15:55 ` [PULL 09/24] kvm: Change cpu_synchronize_state() " Andreas Färber
2013-06-28 15:55   ` [Qemu-devel] " Andreas Färber
2013-06-28 15:55 ` Andreas Färber [this message]
2013-06-28 15:55 ` [Qemu-devel] [PULL 11/24] cpus: Change cpu_thread_is_idle() " Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 12/24] cpus: Change qemu_kvm_wait_io_event() " Andreas Färber
2013-06-28 15:55 ` [PULL 13/24] kvm: Change kvm_set_signal_mask() " Andreas Färber
2013-06-28 15:55   ` [Qemu-devel] " Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 14/24] cpus: Change qemu_kvm_init_cpu_signals() " Andreas Färber
2013-06-28 15:55 ` [PULL 15/24] cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks Andreas Färber
2013-06-28 15:55   ` [Qemu-devel] [PULL 15/24] cpu: Turn cpu_dump_{state, statistics}() " Andreas Färber
2013-06-28 15:55 ` [PULL 16/24] kvm: Change kvm_handle_internal_error() argument to CPUState Andreas Färber
2013-06-28 15:55   ` [Qemu-devel] " Andreas Färber
2013-06-28 15:55 ` [PULL 17/24] kvm: Change kvm_cpu_exec() " Andreas Färber
2013-06-28 15:55   ` [Qemu-devel] " Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 18/24] gdbstub: Set gdb_set_stop_cpu() " Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 19/24] cpus: Change cpu_handle_guest_debug() " Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 20/24] cpus: Change qemu_kvm_start_vcpu() " Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 21/24] cpus: Change qemu_dummy_start_vcpu() " Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 22/24] cpu: Change qemu_init_vcpu() " Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 23/24] hwaddr: Make hwaddr type usable beyond softmmu Andreas Färber
2013-06-28 15:55 ` [Qemu-devel] [PULL 24/24] cpu: Turn cpu_unassigned_access() into a CPUState hook Andreas Färber

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=1372434946-18489-11-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=andreas.faerber@web.de \
    --cc=aurelien@aurel32.net \
    --cc=hpoussin@reactos.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.