Revision 23e39294 hw/armv7m_nvic.c

b/hw/armv7m_nvic.c
368 368
    }
369 369
}
370 370

  
371
static void nvic_save(QEMUFile *f, void *opaque)
372
{
373
    nvic_state *s = (nvic_state *)opaque;
374

  
375
    qemu_put_be32(f, s->systick.control);
376
    qemu_put_be32(f, s->systick.reload);
377
    qemu_put_be64(f, s->systick.tick);
378
    qemu_put_timer(f, s->systick.timer);
379
}
380

  
381
static int nvic_load(QEMUFile *f, void *opaque, int version_id)
382
{
383
    nvic_state *s = (nvic_state *)opaque;
384

  
385
    if (version_id != 1)
386
        return -EINVAL;
387

  
388
    s->systick.control = qemu_get_be32(f);
389
    s->systick.reload = qemu_get_be32(f);
390
    s->systick.tick = qemu_get_be64(f);
391
    qemu_get_timer(f, s->systick.timer);
392

  
393
    return 0;
394
}
395

  
371 396
qemu_irq *armv7m_nvic_init(CPUState *env)
372 397
{
373 398
    nvic_state *s;
......
381 406
    if (env->v7m.nvic)
382 407
        cpu_abort(env, "CPU can only have one NVIC\n");
383 408
    env->v7m.nvic = s;
409
    register_savevm("armv7m_nvic", -1, 1, nvic_save, nvic_load, s);
384 410
    return s->gic->in;
385 411
}

Also available in: Unified diff