mirror of https://github.com/xemu-project/xemu.git
Add VMState support for ptimers
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
4e2a68c1e1
commit
55a6e51f2a
7
hw/hw.h
7
hw/hw.h
|
@ -324,6 +324,7 @@ extern const VMStateInfo vmstate_info_uint32;
|
||||||
extern const VMStateInfo vmstate_info_uint64;
|
extern const VMStateInfo vmstate_info_uint64;
|
||||||
|
|
||||||
extern const VMStateInfo vmstate_info_timer;
|
extern const VMStateInfo vmstate_info_timer;
|
||||||
|
extern const VMStateInfo vmstate_info_ptimer;
|
||||||
extern const VMStateInfo vmstate_info_buffer;
|
extern const VMStateInfo vmstate_info_buffer;
|
||||||
|
|
||||||
#define type_check_array(t1,t2,n) ((t1(*)[n])0 - (t2*)0)
|
#define type_check_array(t1,t2,n) ((t1(*)[n])0 - (t2*)0)
|
||||||
|
@ -470,6 +471,12 @@ extern const VMStateDescription vmstate_pci_device;
|
||||||
#define VMSTATE_TIMER(_f, _s) \
|
#define VMSTATE_TIMER(_f, _s) \
|
||||||
VMSTATE_TIMER_V(_f, _s, 0)
|
VMSTATE_TIMER_V(_f, _s, 0)
|
||||||
|
|
||||||
|
#define VMSTATE_PTIMER_V(_f, _s, _v) \
|
||||||
|
VMSTATE_POINTER(_f, _s, _v, vmstate_info_ptimer, ptimer_state *)
|
||||||
|
|
||||||
|
#define VMSTATE_PTIMER(_f, _s) \
|
||||||
|
VMSTATE_PTIMER_V(_f, _s, 0)
|
||||||
|
|
||||||
#define VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v) \
|
#define VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v) \
|
||||||
VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint32, uint32_t)
|
VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint32, uint32_t)
|
||||||
|
|
||||||
|
|
21
hw/ptimer.c
21
hw/ptimer.c
|
@ -212,6 +212,27 @@ void qemu_get_ptimer(QEMUFile *f, ptimer_state *s)
|
||||||
qemu_get_timer(f, s->timer);
|
qemu_get_timer(f, s->timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int get_ptimer(QEMUFile *f, void *pv, size_t size)
|
||||||
|
{
|
||||||
|
ptimer_state *v = pv;
|
||||||
|
|
||||||
|
qemu_get_ptimer(f, v);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void put_ptimer(QEMUFile *f, const void *pv, size_t size)
|
||||||
|
{
|
||||||
|
ptimer_state *v = (void *)pv;
|
||||||
|
|
||||||
|
qemu_put_ptimer(f, v);
|
||||||
|
}
|
||||||
|
|
||||||
|
const VMStateInfo vmstate_info_ptimer = {
|
||||||
|
.name = "ptimer",
|
||||||
|
.get = get_ptimer,
|
||||||
|
.put = put_ptimer,
|
||||||
|
};
|
||||||
|
|
||||||
ptimer_state *ptimer_init(QEMUBH *bh)
|
ptimer_state *ptimer_init(QEMUBH *bh)
|
||||||
{
|
{
|
||||||
ptimer_state *s;
|
ptimer_state *s;
|
||||||
|
|
Loading…
Reference in New Issue