From nobody Fri Dec 19 14:31:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1588247817; cv=none; d=zohomail.com; s=zohoarc; b=RXdmE97ZiGfwwfPGIWJBTObxqTurxVM2j5FosQ9KPM4t4qZmX8fYBQaBcFIjAQUSj0x7Hq5tiFM99CvsLenUPDyn2smtpnUwRergOhzIVXbJxn9Ts91E5IsYBYtA8pw0IP76zVs1pmPRRgJ5BTEn+Byl9m0Y9pWcSkCCBEpKtSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588247817; h=Content-Type:Content-Transfer-Encoding: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; bh=Jt6G/iju8uSaFNeIzNPrG1p2vPHbPGysm95I3wdnMB0=; b=R42Ap+PZNe55udLQvnHait1i2iRVYTdEog6svE91fbOH5dsnhtB/C58LsqY8BaSu5b17iDKH217OE609jeTGDGzMvbR/ISG9TV7gcjEsE3u+WVeeMdOwZ073f6sjLi3myQoAsK291CSv3dj6N7QU9IrHYga+hgzYQwcOU/pvh/c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588247817025235.2051769272; Thu, 30 Apr 2020 04:56:57 -0700 (PDT) Received: from localhost ([::1]:54878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU7oD-0004Ns-MH for importer@patchew.org; Thu, 30 Apr 2020 07:56:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33738) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU7jT-0002nQ-5n for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:51:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU7jR-0000Lx-Dh for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:51:58 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:37851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU7jQ-0000LP-VD for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:51:57 -0400 Received: by mail-wm1-x341.google.com with SMTP id z6so1552625wml.2 for ; Thu, 30 Apr 2020 04:51:56 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j22sm491518wre.84.2020.04.30.04.51.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 04:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Jt6G/iju8uSaFNeIzNPrG1p2vPHbPGysm95I3wdnMB0=; b=ZYXIx+doJ//wjNe0LhPLGhlbk9ZCEQPF4Aid9SHgu3OORkpLidu8TmOvs1yU2d3O63 nOy9mNnSb83YRMm/EaevTJswCQx5+P1lgIvGxc1DdseSkwkmu7KYIc2ryKPLD3LyH99f 1utovLxWWVy86R/NLo3aSaofiWtWgOGqLXFPri+zWkdFOhj14R/hnkJdP0psS4paW8FD QbxfJ847Zkw1K2WQmSlkJzEa9weF3SwHvrUYC/Y6s1A83cqMxgcQIgTrbepqRY1a51P0 qzxSGXZ5O3tyGwUK4xk5A6Lm7WBNRh4uirQpdEaSPL1+05D5DYm8eRS7dgaGR+ljhXo4 8zYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jt6G/iju8uSaFNeIzNPrG1p2vPHbPGysm95I3wdnMB0=; b=p13XSPzT1l3b4CMBAHEtWYS/3IfxV31VEq/nKGQ5mlLjzyuJvtwlC748CWGXa2n0dM Ghf2mrM2SeDbmw2gbVUiwOcp7sCfPAQ4naWe8nT19BMgXlDFagUmg7bNtdIFN3Lh6erL tYaQkROHIV/R9aJ0oa4STbxmHWMoh946vXUhSuYmt0BCRF476+WLeKMBCa3VKHZ9skZZ nLikPQ7yvJYIhLqDIN2a1kIHaBc+AZacyhwbR6on9I/rIFRg3ohHrcw9Hmg2yI455+vk LXsYn0Vv1Ws0gy6vo9SvvpqN+vMCIbDKqy9xjM7t5B4HwZfdv/BsJBCWfpnYcT/o07PR DEoQ== X-Gm-Message-State: AGi0PuYbGQcBAx925pgVxijOS1L5kIkMqi/gfGPD2J0sVYWgsY7gZNWK AfF5DhjyWsR5xuFSxujFJwk3r8Oesjj15w== X-Google-Smtp-Source: APiQypKHQ21JansXTdVDtmpHXDcbWPhS3pEkkbz9b2mmwHhexzl31EOSEsxSQ1ybOpfq2qQdHpqN9A== X-Received: by 2002:a1c:ba56:: with SMTP id k83mr2538868wmf.1.1588247515236; Thu, 30 Apr 2020 04:51:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/31] hw/core/clock-vmstate: define a vmstate entry for clock state Date: Thu, 30 Apr 2020 12:51:21 +0100 Message-Id: <20200430115142.13430-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430115142.13430-1-peter.maydell@linaro.org> References: <20200430115142.13430-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::341 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Damien Hedde Signed-off-by: Damien Hedde Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Message-id: 20200406135251.157596-3-damien.hedde@greensocs.com Signed-off-by: Peter Maydell --- hw/core/Makefile.objs | 1 + include/hw/clock.h | 9 +++++++++ hw/core/clock-vmstate.c | 25 +++++++++++++++++++++++++ 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 1d9b0aa2057..115df550874 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -21,6 +21,7 @@ common-obj-$(CONFIG_SOFTMMU) +=3D null-machine.o common-obj-$(CONFIG_SOFTMMU) +=3D loader.o common-obj-$(CONFIG_SOFTMMU) +=3D machine-hmp-cmds.o common-obj-$(CONFIG_SOFTMMU) +=3D numa.o +common-obj-$(CONFIG_SOFTMMU) +=3D clock-vmstate.o obj-$(CONFIG_SOFTMMU) +=3D machine-qmp-cmds.o =20 common-obj-$(CONFIG_EMPTY_SLOT) +=3D empty_slot.o diff --git a/include/hw/clock.h b/include/hw/clock.h index 82a7f3c6982..f3e44e9460c 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -74,6 +74,15 @@ struct Clock { QLIST_ENTRY(Clock) sibling; }; =20 +/* + * vmstate description entry to be added in device vmsd. + */ +extern const VMStateDescription vmstate_clock; +#define VMSTATE_CLOCK(field, state) \ + VMSTATE_CLOCK_V(field, state, 0) +#define VMSTATE_CLOCK_V(field, state, version) \ + VMSTATE_STRUCT_POINTER_V(field, state, version, vmstate_clock, Clock) + /** * clock_setup_canonical_path: * @clk: clock diff --git a/hw/core/clock-vmstate.c b/hw/core/clock-vmstate.c new file mode 100644 index 00000000000..260b13fc2c8 --- /dev/null +++ b/hw/core/clock-vmstate.c @@ -0,0 +1,25 @@ +/* + * Clock migration structure + * + * Copyright GreenSocs 2019-2020 + * + * 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_clock =3D { + .name =3D "clock", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (VMStateField[]) { + VMSTATE_UINT64(period, Clock), + VMSTATE_END_OF_LIST() + } +}; --=20 2.20.1