From nobody Wed Nov 12 03:42:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567601541; cv=none; d=zoho.com; s=zohoarc; b=Ge5VipWmRLkerOj4AqmT2k9eGNhFyOiKkZeGMf34/vlPmt8oxCbxcdh1dl72AzF6YR3cX6zlgR0ZuTilMPSZv0Ft/4kZsXLAtfmoBdclKJGZ2IqjFryoJ3iqVKfUZIQg6XXe7H72yEUy0LgbGJep+2fl5e2v7UkdFqpKICUZtfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567601541; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=maHjw57nHq4D7Qc3T0BUruHDBkArYwKHTizQf10RF2s=; b=m8AMBGZaTdM4tUBDR9IdMDxzwx8dJRp+WJTOLLF4U9Ypzz7uJQrpNe0j6FUDlj3LMem8HNrwCbmdzir7MzkaSYW5PuXnnhS8WxZOEyR2Cq12IUil/21C25xRzJWSg+C8wSaJ7kI35rFuLA+/cLg77CfF1V9zLCipy+Tjrmvo7k4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567601541702693.2572365955787; Wed, 4 Sep 2019 05:52:21 -0700 (PDT) Received: from localhost ([::1]:57408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5Ulo-0001hR-3p for importer@patchew.org; Wed, 04 Sep 2019 08:52:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47831) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5Rqq-0004qT-SG for qemu-devel@nongnu.org; Wed, 04 Sep 2019 05:45:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5Rqp-0008V1-Fl for qemu-devel@nongnu.org; Wed, 04 Sep 2019 05:45:20 -0400 Received: from beetle.greensocs.com ([5.135.226.135]:40544) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i5Rql-0008Mz-KR; Wed, 04 Sep 2019 05:45:15 -0400 Received: from crumble.bar.greensocs.com (crumble.bar.greensocs.com [172.16.11.102]) by beetle.greensocs.com (Postfix) with ESMTPS id 4B2B096F54; Wed, 4 Sep 2019 09:38:51 +0000 (UTC) From: damien.hedde@greensocs.con To: qemu-devel@nongnu.org Date: Wed, 4 Sep 2019 11:38:36 +0200 Message-Id: <20190904093843.8765-3-damien.hedde@greensocs.con> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190904093843.8765-1-damien.hedde@greensocs.con> References: <20190904093843.8765-1-damien.hedde@greensocs.con> MIME-Version: 1.0 X-Spam: Yes Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 5.135.226.135 X-Mailman-Approved-At: Wed, 04 Sep 2019 08:47:47 -0400 Subject: [Qemu-devel] [PATCH v6 2/9] hw/core/clock-vmstate: define a vmstate entry for clock state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damien Hedde , peter.maydell@linaro.org, berrange@redhat.com, ehabkost@redhat.com, alistair@alistair23.me, mark.burton@greensocs.com, pbonzini@redhat.com, qemu-arm@nongnu.org, marcandre.lureau@redhat.com, edgar.iglesias@gmail.com, philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Damien Hedde Signed-off-by: Damien Hedde --- This was in the previous reviewed commit. But it can't be in the clock.c file in order to allow linux-user builds. --- hw/core/Makefile.objs | 1 + hw/core/clock-vmstate.c | 25 +++++++++++++++++++++++++ include/hw/clock.h | 9 +++++++++ 3 files changed, 35 insertions(+) create mode 100644 hw/core/clock-vmstate.c diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index c66a5b2c6b..8fcebf2e67 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -4,6 +4,7 @@ common-obj-y +=3D bus.o reset.o common-obj-y +=3D resettable.o common-obj-$(CONFIG_SOFTMMU) +=3D qdev-fw.o common-obj-$(CONFIG_SOFTMMU) +=3D fw-path-provider.o +common-obj-$(CONFIG_SOFTMMU) +=3D clock-vmstate.o # irq.o needed for qdev GPIO handling: common-obj-y +=3D irq.o common-obj-y +=3D hotplug.o diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c new file mode 100644 index 0000000000..c781369c15 --- /dev/null +++ b/hw/core/clock-vmstate.c @@ -0,0 +1,25 @@ +/* + * Clock migration structure + * + * Copyright GreenSocs 2019 + * + * Authors: + * Damien Hedde + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "migration/vmstate.h" +#include "hw/clock.h" + +const VMStateDescription vmstate_clockin =3D { + .name =3D "clock", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (VMStateField[]) { + VMSTATE_UINT64(frequency, ClockIn), + VMSTATE_END_OF_LIST() + } +}; diff --git a/include/hw/clock.h b/include/hw/clock.h index fd11202ba4..e7efb6ad17 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -34,6 +34,15 @@ struct ClockOut { QLIST_HEAD(, ClockIn) followers; /* list of registered clocks */ }; =20 +/* + * vmstate description entry to be added in device vmsd. + */ +extern const VMStateDescription vmstate_clockin; +#define VMSTATE_CLOCKIN(_field, _state) \ + VMSTATE_CLOCKIN_V(_field, _state, 0) +#define VMSTATE_CLOCKIN_V(_field, _state, _version) \ + VMSTATE_STRUCT_POINTER_V(_field, _state, _version, vmstate_clockin, Cl= ockIn) + /** * clock_out_setup_canonical_path: * @clk: clock --=20 2.22.0