diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2013-03-05 00:34:41 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2013-03-05 00:45:15 +0000 |
commit | 9ecb992674cec86091b4fce3bd66faee8b56b165 (patch) | |
tree | ec709b83da67726c3c624d9a1edeb768a340eaeb /hw/arm_gic_common.c | |
parent | 81635574f6e7f4d18ea059ecbeeec93c3ffc284c (diff) | |
download | qemu-9ecb992674cec86091b4fce3bd66faee8b56b165.zip qemu-9ecb992674cec86091b4fce3bd66faee8b56b165.tar.gz qemu-9ecb992674cec86091b4fce3bd66faee8b56b165.tar.bz2 |
hw/arm_gic: Add presave/postload hooks
Add presave/postload hooks to the ARM GIC common base class.
These will be used by the KVM in-kernel GIC subclass to sync
state between kernel and userspace when migrating.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/arm_gic_common.c')
-rw-r--r-- | hw/arm_gic_common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/arm_gic_common.c b/hw/arm_gic_common.c index 40e8dd7..2947622 100644 --- a/hw/arm_gic_common.c +++ b/hw/arm_gic_common.c @@ -23,9 +23,14 @@ static void gic_save(QEMUFile *f, void *opaque) { GICState *s = (GICState *)opaque; + ARMGICCommonClass *c = ARM_GIC_COMMON_GET_CLASS(s); int i; int j; + if (c->pre_save) { + c->pre_save(s); + } + qemu_put_be32(f, s->enabled); for (i = 0; i < s->num_cpu; i++) { qemu_put_be32(f, s->cpu_enabled[i]); @@ -57,6 +62,7 @@ static void gic_save(QEMUFile *f, void *opaque) static int gic_load(QEMUFile *f, void *opaque, int version_id) { GICState *s = (GICState *)opaque; + ARMGICCommonClass *c = ARM_GIC_COMMON_GET_CLASS(s); int i; int j; @@ -91,6 +97,10 @@ static int gic_load(QEMUFile *f, void *opaque, int version_id) s->irq_state[i].trigger = qemu_get_byte(f); } + if (c->post_load) { + c->post_load(s); + } + return 0; } |