From nobody Sun May 19 13:34:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) client-ip=209.85.221.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1636196186; cv=none; d=zohomail.com; s=zohoarc; b=kjnFPpVQcqH0/eYBrPbIbjwoLqKKJGexnyPFSbYXQHHtjHbq5speLgiP9jGS7s6rX5RZoLcNYlIpcyx3DBRi9/c5FYqXsXcxAVgffnPTVSL1I5uwQUK+nEWqJz9o+wPkQhWDJojn4zt/VjyD151EoUgBTZIoG0Ir01PT64u0r/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636196186; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Sender:Subject:To; bh=r7ChOI/rOL8VqbBn1urCKzj6+wcEmE0CC31/KsKTfic=; b=SHWv5eWbwbLpNoh8led9P5CZQAdWgQE98mb+nSlqzdTLisB9YZPaKsax7GA4thAZLyaspNsXJLJjfn1L06sc/0cvA/uffcCDyNDfbaCHc4Ek+3P+MDoRTSlTbLwcyLO4PjdVepGCjPMac5kboWvtQAv5UL8jLwSgRKdCQwzlIl8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.zohomail.com with SMTPS id 163619618671157.62750805789176; Sat, 6 Nov 2021 03:56:26 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id w29so6187981wra.12 for ; Sat, 06 Nov 2021 03:56:26 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id g18sm10387824wrv.42.2021.11.06.03.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 03:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=r7ChOI/rOL8VqbBn1urCKzj6+wcEmE0CC31/KsKTfic=; b=KrJKd/nfhzje79M+VknKNugIqOESWo30prGj30ickuHeuy4psfCpUKsRfqzP99ka8Z AJVcLVLAUja6gvTJLN/WjujTlnY0q8OVMK+QkdkM+e4D7DYTiUt+BQqpxij6OSn0B114 OYZRaQ/DNQyW0krBH7cGoA90ZkQQPWjldwXvgzB9EYaby9vGXOIpWwY2YEhO3gxwn8PQ h/3g8prVCzCE9yPVM/4TmzjvMB8v86vcSYbNAaNYHGzHieXK6icP5n2EcZ16q//08maq n6OdyrFOHHNt6Ex1eabWptrrY4xHHucOeShFWYM3hjUlED6bWDFerjxX7lzRwVU04Tw0 a6cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=r7ChOI/rOL8VqbBn1urCKzj6+wcEmE0CC31/KsKTfic=; b=v4FgN1XoQxQlyOtNxiZ+Zd0961VpuDNAjl7KIAxlgnxPyIt5C1HNS+8Orqiqy/rZt7 wqIqmRZxmk0TOjGEvT4/0gya9+awgz8TPD0VUtBY8pA05H8rudZdojzsvmDVPztblYa0 T5sWewGp6l81eMmIkRr0CFEvOukuvAZl6DztPr0lN3tSEEbhNwyPn5A9aG78HpKebtkq XDgTGlxbAhHrYyJ4mGjG+DHpAXD7LPksgqhVYc+VgPBRI7cSQHQsNY8/Uf8teRL4nl9N DZ8oCJiYfOgKo57VQ5xKTjWqOCX0slTXhwIq0DMscbY/fpeR06MAy5bLn45KIvklvJjw yelw== X-Gm-Message-State: AOAM533JxKRdyEjjzlHPD94oNndW9DE0ZMRwpfxTM4V2a7cX1Yv6IWQm BYnCPGGHwCEeh44jMVDdVnY= X-Google-Smtp-Source: ABdhPJxnbmoHniqKhPN8y8/y+ICCTR4X/b8Z2CauEWYugbdiiHA9JhqvOf6vhS7lO32Tu9gGtS+Djg== X-Received: by 2002:a5d:44d1:: with SMTP id z17mr71414562wrr.143.1636196184977; Sat, 06 Nov 2021 03:56:24 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , "Edgar E. Iglesias" , qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] hw/timer/etraxfs_timer: Add vmstate for ETRAX timers Date: Sat, 6 Nov 2021 11:56:23 +0100 Message-Id: <20211106105623.510868-1-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1636196188221100001 Add the vmstate for the ETRAX timers. This is in theory a migration compatibility break for the 'AXIS devboard 88' CRIS machine. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/timer/etraxfs_timer.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c index 4ba662190de..139e5b86a44 100644 --- a/hw/timer/etraxfs_timer.c +++ b/hw/timer/etraxfs_timer.c @@ -26,6 +26,7 @@ #include "hw/sysbus.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" +#include "migration/vmstate.h" #include "qemu/module.h" #include "qemu/timer.h" #include "hw/irq.h" @@ -64,7 +65,7 @@ struct ETRAXTimerState { ptimer_state *ptimer_t1; ptimer_state *ptimer_wd; =20 - int wd_hits; + uint32_t wd_hits; =20 /* Control registers. */ uint32_t rw_tmr0_div; @@ -83,6 +84,36 @@ struct ETRAXTimerState { uint32_t r_masked_intr; }; =20 +static const VMStateDescription vmstate_etraxfs =3D { + .name =3D "etraxfs", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (VMStateField[]) { + VMSTATE_PTIMER(ptimer_t0, ETRAXTimerState), + VMSTATE_PTIMER(ptimer_t1, ETRAXTimerState), + VMSTATE_PTIMER(ptimer_wd, ETRAXTimerState), + + VMSTATE_UINT32(wd_hits, ETRAXTimerState), + + VMSTATE_UINT32(rw_tmr0_div, ETRAXTimerState), + VMSTATE_UINT32(r_tmr0_data, ETRAXTimerState), + VMSTATE_UINT32(rw_tmr0_ctrl, ETRAXTimerState), + + VMSTATE_UINT32(rw_tmr1_div, ETRAXTimerState), + VMSTATE_UINT32(r_tmr1_data, ETRAXTimerState), + VMSTATE_UINT32(rw_tmr1_ctrl, ETRAXTimerState), + + VMSTATE_UINT32(rw_wd_ctrl, ETRAXTimerState), + + VMSTATE_UINT32(rw_intr_mask, ETRAXTimerState), + VMSTATE_UINT32(rw_ack_intr, ETRAXTimerState), + VMSTATE_UINT32(r_intr, ETRAXTimerState), + VMSTATE_UINT32(r_masked_intr, ETRAXTimerState), + + VMSTATE_END_OF_LIST() + } +}; + static uint64_t timer_read(void *opaque, hwaddr addr, unsigned int size) { @@ -357,6 +388,7 @@ static void etraxfs_timer_class_init(ObjectClass *klass= , void *data) ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 dc->realize =3D etraxfs_timer_realize; + dc->vmsd =3D &vmstate_etraxfs; rc->phases.enter =3D etraxfs_timer_reset_enter; rc->phases.hold =3D etraxfs_timer_reset_hold; } --=20 2.31.1