Diff for /qemu/hw/arm_timer.c between versions 1.1.1.9 and 1.1.1.10

version 1.1.1.9, 2018/04/24 18:38:16 version 1.1.1.10, 2018/04/24 19:00:17
Line 4 Line 4
  * Copyright (c) 2005-2006 CodeSourcery.   * Copyright (c) 2005-2006 CodeSourcery.
  * Written by Paul Brook   * Written by Paul Brook
  *   *
  * This code is licenced under the GPL.   * This code is licensed under the GPL.
  */   */
   
 #include "sysbus.h"  #include "sysbus.h"
Line 140  static void arm_timer_tick(void *opaque) Line 140  static void arm_timer_tick(void *opaque)
     arm_timer_update(s);      arm_timer_update(s);
 }  }
   
 static void arm_timer_save(QEMUFile *f, void *opaque)  static const VMStateDescription vmstate_arm_timer = {
 {      .name = "arm_timer",
     arm_timer_state *s = (arm_timer_state *)opaque;      .version_id = 1,
     qemu_put_be32(f, s->control);      .minimum_version_id = 1,
     qemu_put_be32(f, s->limit);      .minimum_version_id_old = 1,
     qemu_put_be32(f, s->int_level);      .fields      = (VMStateField[]) {
     qemu_put_ptimer(f, s->timer);          VMSTATE_UINT32(control, arm_timer_state),
 }          VMSTATE_UINT32(limit, arm_timer_state),
           VMSTATE_INT32(int_level, arm_timer_state),
 static int arm_timer_load(QEMUFile *f, void *opaque, int version_id)          VMSTATE_PTIMER(timer, arm_timer_state),
 {          VMSTATE_END_OF_LIST()
     arm_timer_state *s = (arm_timer_state *)opaque;      }
   };
     if (version_id != 1)  
         return -EINVAL;  
   
     s->control = qemu_get_be32(f);  
     s->limit = qemu_get_be32(f);  
     s->int_level = qemu_get_be32(f);  
     qemu_get_ptimer(f, s->timer);  
     return 0;  
 }  
   
 static arm_timer_state *arm_timer_init(uint32_t freq)  static arm_timer_state *arm_timer_init(uint32_t freq)
 {  {
Line 174  static arm_timer_state *arm_timer_init(u Line 165  static arm_timer_state *arm_timer_init(u
   
     bh = qemu_bh_new(arm_timer_tick, s);      bh = qemu_bh_new(arm_timer_tick, s);
     s->timer = ptimer_init(bh);      s->timer = ptimer_init(bh);
     register_savevm(NULL, "arm_timer", -1, 1, arm_timer_save, arm_timer_load, s);      vmstate_register(NULL, -1, &vmstate_arm_timer, s);
     return s;      return s;
 }  }
   
Line 235  static CPUWriteMemoryFunc * const sp804_ Line 226  static CPUWriteMemoryFunc * const sp804_
    sp804_write     sp804_write
 };  };
   
 static void sp804_save(QEMUFile *f, void *opaque)  
 {  
     sp804_state *s = (sp804_state *)opaque;  
     qemu_put_be32(f, s->level[0]);  
     qemu_put_be32(f, s->level[1]);  
 }  
   
 static int sp804_load(QEMUFile *f, void *opaque, int version_id)  
 {  
     sp804_state *s = (sp804_state *)opaque;  
   
     if (version_id != 1)  static const VMStateDescription vmstate_sp804 = {
         return -EINVAL;      .name = "sp804",
       .version_id = 1,
     s->level[0] = qemu_get_be32(f);      .minimum_version_id = 1,
     s->level[1] = qemu_get_be32(f);      .minimum_version_id_old = 1,
     return 0;      .fields      = (VMStateField[]) {
 }          VMSTATE_INT32_ARRAY(level, sp804_state, 2),
           VMSTATE_END_OF_LIST()
       }
   };
   
 static int sp804_init(SysBusDevice *dev)  static int sp804_init(SysBusDevice *dev)
 {  {
Line 271  static int sp804_init(SysBusDevice *dev) Line 255  static int sp804_init(SysBusDevice *dev)
     iomemtype = cpu_register_io_memory(sp804_readfn,      iomemtype = cpu_register_io_memory(sp804_readfn,
                                        sp804_writefn, s, DEVICE_NATIVE_ENDIAN);                                         sp804_writefn, s, DEVICE_NATIVE_ENDIAN);
     sysbus_init_mmio(dev, 0x1000, iomemtype);      sysbus_init_mmio(dev, 0x1000, iomemtype);
     register_savevm(&dev->qdev, "sp804", -1, 1, sp804_save, sp804_load, s);      vmstate_register(&dev->qdev, -1, &vmstate_sp804, s);
     return 0;      return 0;
 }  }
   

Removed from v.1.1.1.9  
changed lines
  Added in v.1.1.1.10


unix.superglobalmegacorp.com