[SerialICE] r87 - trunk/qemu-0.11.0
svn at coresystems.de
svn at coresystems.de
Sat Dec 5 16:02:29 CET 2009
Author: stepan
Date: 2009-12-05 16:02:29 +0100 (Sat, 05 Dec 2009)
New Revision: 87
Modified:
trunk/qemu-0.11.0/serialice.c
Log:
Add SerialICE_system_reset to trigger a VM side reset.
This is needed to keep Qemu from running code after an outb to 0xcf9 has been
encountered.
Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Modified: trunk/qemu-0.11.0/serialice.c
===================================================================
--- trunk/qemu-0.11.0/serialice.c 2009-12-03 16:15:19 UTC (rev 86)
+++ trunk/qemu-0.11.0/serialice.c 2009-12-05 15:02:29 UTC (rev 87)
@@ -110,11 +110,17 @@
return 0;
}
+static int serialice_system_reset(lua_State * luastate)
+{
+ printf("Rebooting the emulated host CPU\n");
+ qemu_system_reset_request();
+ return 0;
+}
+
// **************************************************************************
// LUA register access
-// copied from target-i386/exec.h
-//CPUX86State *env;
+// some macros from target-i386/exec.h, which we can't include directly
#define env first_cpu
#define EAX (env->regs[R_EAX])
#define ECX (env->regs[R_ECX])
@@ -220,6 +226,7 @@
/* Register C function callbacks */
lua_register(L, "SerialICE_register_physical", serialice_register_physical);
+ lua_register(L, "SerialICE_system_reset", serialice_system_reset);
/* Set global variable SerialICE_mainboard */
lua_pushstring(L, serialice_mainboard);
@@ -1224,6 +1231,7 @@
for (i = 0; i < smp_cpus; i++) {
env = cpu_init(cpu_model);
+ qemu_register_reset((QEMUResetHandler*)cpu_reset, env);
}
/* Must not happen before CPUs are initialized */
More information about the SerialICE
mailing list