[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/11] hw/gpio/avr_gpio: Add migration VMstate
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 04/11] hw/gpio/avr_gpio: Add migration VMstate |
Date: |
Sat, 13 Mar 2021 17:54:38 +0100 |
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/gpio/avr_gpio.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/gpio/avr_gpio.c b/hw/gpio/avr_gpio.c
index cdb574ef0d8..da34009daea 100644
--- a/hw/gpio/avr_gpio.c
+++ b/hw/gpio/avr_gpio.c
@@ -25,6 +25,7 @@
#include "hw/irq.h"
#include "hw/gpio/avr_gpio.h"
#include "hw/qdev-properties.h"
+#include "migration/vmstate.h"
static void avr_gpio_reset(DeviceState *dev)
{
@@ -100,6 +101,18 @@ static const MemoryRegionOps avr_gpio_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
+static const VMStateDescription avr_gpio_vmstate = {
+ .name = "avr-gpio",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT8(reg.pin, AVRGPIOState),
+ VMSTATE_UINT8(reg.ddr, AVRGPIOState),
+ VMSTATE_UINT8(reg.port, AVRGPIOState),
+ VMSTATE_END_OF_LIST(),
+ },
+};
+
static void avr_gpio_init(Object *obj)
{
AVRGPIOState *s = AVR_GPIO(obj);
@@ -120,6 +133,7 @@ static void avr_gpio_class_init(ObjectClass *klass, void
*data)
dc->reset = avr_gpio_reset;
dc->realize = avr_gpio_realize;
+ dc->vmsd = &avr_gpio_vmstate;
}
static const TypeInfo avr_gpio_info = {
--
2.26.2
- [PATCH 00/11] AVR patch queue for QEMU 6.0, Philippe Mathieu-Daudé, 2021/03/13
- [PATCH 01/11] hw/misc/led: Add yellow LED, Philippe Mathieu-Daudé, 2021/03/13
- [PATCH 02/11] hw/avr/arduino: List board schematic links, Philippe Mathieu-Daudé, 2021/03/13
- [PATCH 03/11] hw/avr: Add limited support for avr gpio registers, Philippe Mathieu-Daudé, 2021/03/13
- [PATCH 04/11] hw/gpio/avr_gpio: Add migration VMstate,
Philippe Mathieu-Daudé <=
- [PATCH 05/11] hw/gpio/avr_gpio: Add 'id' field in AVRGPIOState, Philippe Mathieu-Daudé, 2021/03/13
- [PATCH 06/11] hw/gpio/avr_gpio: Simplify avr_gpio_write_port using extract32(), Philippe Mathieu-Daudé, 2021/03/13
- [PATCH 07/11] hw/gpio/avr_gpio: Add tracing for reads and writes, Philippe Mathieu-Daudé, 2021/03/13
- [PATCH 08/11] hw/avr/arduino: Add D13 LED, Philippe Mathieu-Daudé, 2021/03/13