Revision 9656f324 exec.c

b/exec.c
443 443
#endif
444 444
}
445 445

  
446
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
447

  
448
#define CPU_COMMON_SAVE_VERSION 1
449

  
450
static void cpu_common_save(QEMUFile *f, void *opaque)
451
{
452
    CPUState *env = opaque;
453

  
454
    qemu_put_be32s(f, &env->halted);
455
    qemu_put_be32s(f, &env->interrupt_request);
456
}
457

  
458
static int cpu_common_load(QEMUFile *f, void *opaque, int version_id)
459
{
460
    CPUState *env = opaque;
461

  
462
    if (version_id != CPU_COMMON_SAVE_VERSION)
463
        return -EINVAL;
464

  
465
    qemu_get_be32s(f, &env->halted);
466
    qemu_put_be32s(f, &env->interrupt_request);
467
    tlb_flush(env, 1);
468

  
469
    return 0;
470
}
471
#endif
472

  
446 473
void cpu_exec_init(CPUState *env)
447 474
{
448 475
    CPUState **penv;
......
459 486
    env->nb_watchpoints = 0;
460 487
    *penv = env;
461 488
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
489
    register_savevm("cpu_common", cpu_index, CPU_COMMON_SAVE_VERSION,
490
                    cpu_common_save, cpu_common_load, env);
462 491
    register_savevm("cpu", cpu_index, CPU_SAVE_VERSION,
463 492
                    cpu_save, cpu_load, env);
464 493
#endif

Also available in: Unified diff