cpu: Introduce cpu_resume(), for single CPU
authorIgor Mammedov <imammedo@redhat.com>
Tue, 23 Apr 2013 08:29:37 +0000 (10:29 +0200)
committerAndreas Färber <afaerber@suse.de>
Wed, 1 May 2013 11:04:17 +0000 (13:04 +0200)
Also add a stub for it, to make possible to use it in qom/cpu.c,
which is shared with user emulators.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus.c
include/qom/cpu.h
stubs/Makefile.objs
stubs/cpus.c [new file with mode: 0644]

diff --git a/cpus.c b/cpus.c
index 5a98a370df92bebb3f634d00af3c78a42fc3c7c2..1d8876157c96b662ea5c31c183c44467d497c714 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -993,6 +993,13 @@ void pause_all_vcpus(void)
     }
 }
 
+void cpu_resume(CPUState *cpu)
+{
+    cpu->stop = false;
+    cpu->stopped = false;
+    qemu_cpu_kick(cpu);
+}
+
 void resume_all_vcpus(void)
 {
     CPUArchState *penv = first_cpu;
@@ -1000,9 +1007,7 @@ void resume_all_vcpus(void)
     qemu_clock_enable(vm_clock, true);
     while (penv) {
         CPUState *pcpu = ENV_GET_CPU(penv);
-        pcpu->stop = false;
-        pcpu->stopped = false;
-        qemu_cpu_kick(pcpu);
+        cpu_resume(pcpu);
         penv = penv->next_cpu;
     }
 }
index 3664a1b6314bd931ff66ae1d2bc3833ec7c0bc95..ac93dcec6639ddda8a44cc2ab87e97bc57e18871 100644 (file)
@@ -256,5 +256,12 @@ void cpu_interrupt(CPUState *cpu, int mask);
  */
 void cpu_reset_interrupt(CPUState *cpu, int mask);
 
+/**
+ * cpu_resume:
+ * @cpu: The CPU to resume.
+ *
+ * Resumes CPU, i.e. puts CPU into runnable state.
+ */
+void cpu_resume(CPUState *cpu);
 
 #endif
index 9c55b34354cfd58ea3243578dca2af9576ef772c..03dff202e4c608c6ac105e9cc50bae0edcef61a4 100644 (file)
@@ -23,3 +23,4 @@ stub-obj-y += sysbus.o
 stub-obj-y += vm-stop.o
 stub-obj-y += vmstate.o
 stub-obj-$(CONFIG_WIN32) += fd-register.o
+stub-obj-y += cpus.o
diff --git a/stubs/cpus.c b/stubs/cpus.c
new file mode 100644 (file)
index 0000000..37000dd
--- /dev/null
@@ -0,0 +1,5 @@
+#include "qom/cpu.h"
+
+void cpu_resume(CPUState *cpu)
+{
+}