qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 4/7] cleanup: remove redundant pc_cpu_reset


From: Igor Mammedov
Subject: [Qemu-devel] [PATCH 4/7] cleanup: remove redundant pc_cpu_reset
Date: Thu, 16 Feb 2012 00:16:11 +0100

All cpus except of boot cpu should be halted after reset.
So remove redundant pc_cpu_reset and use cpu_reset instead.

Signed-off-by: Igor Mammedov <address@hidden>
---
 hw/pc.c              |   11 ++---------
 target-i386/helper.c |    1 +
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index d9c397a..3d35d78 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -928,14 +928,6 @@ typedef struct CPUPC {
     CPUState state;
 } CPUPC;
 
-static void pc_cpu_reset(void *opaque)
-{
-    CPUState *env = opaque;
-
-    cpu_reset(env);
-    env->halted = !cpu_is_bsp(env);
-}
-
 static int cpu_device_init(ICCBusDevice *dev)
 {
     CPUPC* cpu = DO_UPCAST(CPUPC, busdev, dev);
@@ -955,7 +947,8 @@ static int cpu_device_init(ICCBusDevice *dev)
 static void cpu_device_reset(DeviceState *dev) {
     CPUPC *cpu = DO_UPCAST(CPUPC, busdev.qdev, dev);
     CPUState *env = &cpu->state;
-    pc_cpu_reset(env);
+
+    cpu_reset(env);
 }
 
 static ICCBusDeviceInfo cpu_device_info = {
diff --git a/target-i386/helper.c b/target-i386/helper.c
index df2f5ba..cd61d36 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -105,6 +105,7 @@ void cpu_reset(CPUX86State *env)
     env->dr[7] = DR7_FIXED_1;
     cpu_breakpoint_remove_all(env, BP_CPU);
     cpu_watchpoint_remove_all(env, BP_CPU);
+    env->halted = !cpu_is_bsp(env);
 }
 
 void cpu_x86_close(CPUX86State *env)
-- 
1.7.7.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]