Commit dc1c0b749fac857b8abb864577cc3f6d7a5279a1

Authored by aurel32
1 parent e6e514c5

Add a monitor command to raise NMI

(Jan Kiszka)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4271 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 17 additions and 0 deletions
monitor.c
... ... @@ -1283,6 +1283,19 @@ static void do_wav_capture (const char *path,
1283 1283 }
1284 1284 #endif
1285 1285  
  1286 +#if defined(TARGET_I386)
  1287 +static void do_inject_nmi(int cpu_index)
  1288 +{
  1289 + CPUState *env;
  1290 +
  1291 + for (env = first_cpu; env != NULL; env = env->next_cpu)
  1292 + if (env->cpu_index == cpu_index) {
  1293 + cpu_interrupt(env, CPU_INTERRUPT_NMI);
  1294 + break;
  1295 + }
  1296 +}
  1297 +#endif
  1298 +
1286 1299 static term_cmd_t term_cmds[] = {
1287 1300 { "help|?", "s?", do_help,
1288 1301 "[cmd]", "show the help" },
... ... @@ -1356,6 +1369,10 @@ static term_cmd_t term_cmds[] = {
1356 1369 "addr size file", "save to disk virtual memory dump starting at 'addr' of size 'size'", },
1357 1370 { "pmemsave", "lis", do_physical_memory_save,
1358 1371 "addr size file", "save to disk physical memory dump starting at 'addr' of size 'size'", },
  1372 +#if defined(TARGET_I386)
  1373 + { "nmi", "i", do_inject_nmi,
  1374 + "cpu", "inject an NMI on the given CPU", },
  1375 +#endif
1359 1376 { NULL, NULL, },
1360 1377 };
1361 1378  
... ...