* [Qemu-devel] [PATCH V4 02/18] sysemu: support qemu_cpu_reset()
@ 2009-12-22 17:40 TAKEDA, toshiya
2010-01-04 20:28 ` Anthony Liguori
0 siblings, 1 reply; 3+ messages in thread
From: TAKEDA, toshiya @ 2009-12-22 17:40 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: TAKEDA, toshiya <t-takeda@m1.interq.or.jp>
---
sysemu.h | 3 +++
vl.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/sysemu.h b/sysemu.h
index 9d80bb2..51c7ac8 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -45,13 +45,16 @@ void cpu_enable_ticks(void);
void cpu_disable_ticks(void);
void qemu_system_reset_request(void);
+void qemu_cpu_reset_request(void);
void qemu_system_shutdown_request(void);
void qemu_system_powerdown_request(void);
int qemu_shutdown_requested(void);
int qemu_reset_requested(void);
+int qemu_cpu_reset_requested(void);
int qemu_powerdown_requested(void);
extern qemu_irq qemu_system_powerdown;
void qemu_system_reset(void);
+void qemu_cpu_reset(void);
void do_savevm(Monitor *mon, const QDict *qdict);
int load_vmstate(Monitor *mon, const char *name);
diff --git a/vl.c b/vl.c
index e606903..565dae4 100644
--- a/vl.c
+++ b/vl.c
@@ -3261,6 +3261,7 @@ typedef struct QEMUResetEntry {
static QTAILQ_HEAD(reset_handlers, QEMUResetEntry) reset_handlers =
QTAILQ_HEAD_INITIALIZER(reset_handlers);
static int reset_requested;
+static int cpu_reset_requested;
static int shutdown_requested;
static int powerdown_requested;
static int debug_requested;
@@ -3280,6 +3281,13 @@ int qemu_reset_requested(void)
return r;
}
+int qemu_cpu_reset_requested(void)
+{
+ int r = cpu_reset_requested;
+ cpu_reset_requested = 0;
+ return r;
+}
+
int qemu_powerdown_requested(void)
{
int r = powerdown_requested;
@@ -3343,6 +3351,16 @@ void qemu_system_reset(void)
}
}
+void qemu_cpu_reset(void)
+{
+ CPUState *env;
+
+ /* reset all cpus */
+ for(env = first_cpu; env != NULL; env = env->next_cpu) {
+ cpu_reset(env);
+ }
+}
+
void qemu_system_reset_request(void)
{
if (no_reboot) {
@@ -3353,6 +3371,12 @@ void qemu_system_reset_request(void)
qemu_notify_event();
}
+void qemu_cpu_reset_request(void)
+{
+ cpu_reset_requested = 1;
+ qemu_notify_event();
+}
+
void qemu_system_shutdown_request(void)
{
shutdown_requested = 1;
@@ -4129,6 +4153,8 @@ static int vm_can_run(void)
return 0;
if (reset_requested)
return 0;
+ if (cpu_reset_requested)
+ return 0;
if (shutdown_requested)
return 0;
if (debug_requested)
@@ -4182,6 +4208,12 @@ static void main_loop(void)
qemu_system_reset();
resume_all_vcpus();
}
+ if (qemu_cpu_reset_requested()) {
+ monitor_protocol_event(QEVENT_RESET, NULL);
+ pause_all_vcpus();
+ qemu_cpu_reset();
+ resume_all_vcpus();
+ }
if (qemu_powerdown_requested()) {
monitor_protocol_event(QEVENT_POWERDOWN, NULL);
qemu_irq_raise(qemu_system_powerdown);
--
1.6.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH V4 02/18] sysemu: support qemu_cpu_reset()
2009-12-22 17:40 [Qemu-devel] [PATCH V4 02/18] sysemu: support qemu_cpu_reset() TAKEDA, toshiya
@ 2010-01-04 20:28 ` Anthony Liguori
2010-01-06 15:46 ` TAKEDA, toshiya
0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2010-01-04 20:28 UTC (permalink / raw)
To: TAKEDA, toshiya; +Cc: qemu-devel
Hi,
Why is this needed verses qemu_system_reset()?
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH V4 02/18] sysemu: support qemu_cpu_reset()
2010-01-04 20:28 ` Anthony Liguori
@ 2010-01-06 15:46 ` TAKEDA, toshiya
0 siblings, 0 replies; 3+ messages in thread
From: TAKEDA, toshiya @ 2010-01-06 15:46 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
Hi,
Anthony Liguori wrote:
>Hi,
>
>Why is this needed verses qemu_system_reset()?
PC-98 has the ioport to reset only cpu (don't reset other periferals)
and I need qemu_cpu_reset() to emulate thios port.
This port was used to return to real mode from protect mode by resetting cpu.
It was added for 80286, but was used on PC-98 with 80386 and later.
(For example for checking of over 1mb memory in hardware initialization bios.)
Thanks,
TAKEDA, toshiya
>
>Regards,
>
>Anthony Liguori
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-06 15:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-22 17:40 [Qemu-devel] [PATCH V4 02/18] sysemu: support qemu_cpu_reset() TAKEDA, toshiya
2010-01-04 20:28 ` Anthony Liguori
2010-01-06 15:46 ` TAKEDA, toshiya
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).