]> git.proxmox.com Git - qemu.git/commitdiff
cpu: Change cpu_exit() argument to CPUState
authorAndreas Färber <afaerber@suse.de>
Fri, 17 May 2013 16:26:54 +0000 (18:26 +0200)
committerAndreas Färber <afaerber@suse.de>
Fri, 28 Jun 2013 11:25:12 +0000 (13:25 +0200)
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>
13 files changed:
cpus.c
exec.c
gdbstub.c
hw/i386/pc.c
hw/mips/mips_fulong2e.c
hw/mips/mips_jazz.c
hw/mips/mips_malta.c
hw/ppc/prep.c
include/exec/cpu-all.h
include/qom/cpu.h
linux-user/main.c
linux-user/signal.c
qom/cpu.c

diff --git a/cpus.c b/cpus.c
index 353208cef22ccac08263740fc2f8fc7bb06c7987..cce5223a23f7da21eb654deb398345b860375e3e 100644 (file)
--- 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 0b172b45a65563b3b7c49586b26752ab497f890a..2d02b11e1c4d950d3f4432560c3b92cb255d1900 100644 (file)
--- 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;
index 663549cf3358bda55f5776096fb97f4540b07d26..0f15c7c3443c97590887ce95b3b87bfea88a54af 100644 (file)
--- 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
 }
 
index 5e8f143bc2b383e6c9f465756107bcfc5b2e9711..78f92e29a7789e62474f98b2df85644d63ba1f80 100644 (file)
@@ -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)));
     }
 }
 
index 1aac93a414bc99d557aa6635b3a488417f523f23..00c9071af1d85425cbcae905d03b1caff8f40f30 100644 (file)
@@ -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)));
     }
 }
 
index 94d95702a4ed899568c5014936128619baddfa44..2ad0c0b4147a019f06929e259f7112f7ce0c77b9 100644 (file)
@@ -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)));
     }
 }
 
index 5033d51224cd4a1a14db057da50a9443492857f1..8a4459d0b2bdef9f309a68cd610e13c1125a431f 100644 (file)
@@ -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)));
     }
 }
 
index 4fdc1649fd322e0a4e533a64a239eac2cc52782f..90828f263584f6c5d934c2b700440d3b4a3bf461 100644 (file)
@@ -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)));
     }
 }
 
index e9c37178639b001900967f52f1c25514bc0af9f2..e1cc62ef5ea13ab267639917b05b3d255c1b7e7f 100644 (file)
@@ -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
index 3e8cc479bd43d48de303fe5d1d46737e05eb34d4..3494356d67f81a80bef44e6625183f9f38de6469 100644 (file)
@@ -370,6 +370,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.
index 21725a4971a36acbbad6fc69e8ebc19667657610..f67a62b18823a06b8fc7c1a25f2e482010bff4c1 100644 (file)
@@ -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) {
index 5da8452b2a16de63f5059736efdbcde8730f4cba..c4e20dc8b9c75acffcc764960bb9ac57e11cab18 100644 (file)
@@ -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));
     }
 }
 
index dba4a11edc02cecfd1e2528a5039c82f4824c9e8..8a122b0ea97d8584b2358a2bfb5ecbdfa88b4f9d 100644 (file)
--- 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)
 {