From nobody Mon Feb 9 22:20:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) client-ip=209.85.221.68; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f68.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1600624714; cv=none; d=zohomail.com; s=zohoarc; b=Ol/I7/95iS46iws6Zd2x35ozHQO0aEaSM4RDXMzcBn11JHKmvoAPBvTeLrHj0AaiLQla3GeIpFgidzgBXSS55VbopVq88M+WiHNRl8iCJOmjyT7LcJFKOJJqipfphwIF8CFONehFjZu2kiE89MgFOg2mPjuhVPpO8VDCcHITjJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600624714; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3AjXG5w656FN23Be/Hsok/QAzJiXXjNLyOG7YnfgnNo=; b=kalsD9newI2c+yyg9ZOCHi0gBgzMFflYI+qjAVp1fx0uCN5n0QGO/BwPV5YTFyOYr2EgI1UTMz8y3pQCUu3MBEY3uZG2jaIMTiRhkiKaaTGo5NuarNLY1quGr3QKcH0aFYSJ7+oZoL2bOgiQlszd2mJUNrPFS3zjH+xeMDou8QU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.zohomail.com with SMTPS id 160062471473198.389795725368; Sun, 20 Sep 2020 10:58:34 -0700 (PDT) Received: by mail-wr1-f68.google.com with SMTP id s12so10420607wrw.11 for ; Sun, 20 Sep 2020 10:58:34 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u66sm15675781wme.12.2020.09.20.10.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Sep 2020 10:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3AjXG5w656FN23Be/Hsok/QAzJiXXjNLyOG7YnfgnNo=; b=ljsR5+zEPNjJbO27y7Q7qhZ1LQUsrhg4fL7Z606vSZcSpwnH+4mnfuev6facTO8M3+ J0LwcDklENnTTm/vJe4s5kwsh1bJyQWS+LWBfFLyggsstbrZ4d++rlFl+hh6lqKszud1 2n3uwkFXyzbdEVgUG/E2FrkZUp+6xyBuYrKQ6UHbYlcoqW0nIkssZHgulwkzMOiDSCax v4hWWFyHhEmM8ZQ6stYFKc/14DmoltbNZQZZCQIyPEI8ghHgCg1dxsQkK4BcpgmLSAQx 9SwEXl3bXYIgSC6W3UXF1tUSYy4sQF7TOBF8T4knZo+pWDg0KG3f4wfdF2C2kVo3c2os RUCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3AjXG5w656FN23Be/Hsok/QAzJiXXjNLyOG7YnfgnNo=; b=MyV2AvtigP7GIDIhAzICDqGzB/yZOQPde8nHSZiF7KpVoO6PkjyA202FIVH7a1AiIq jO+lDgx6Ga7jovTQYFBIDZV974xrImFNaEs5rVbWsniwXld8wy4D+MW66PJoHUeKB2aF JK/qZuXxKidy7KKBX3KCj7BnAkUdX+UYcojdY8/TDwlUue7f3DXMCbdKlXxeoHGsU+aQ EJw16Yz84Z3X2F+WFDS3zqHYGJLWJmqNtThw98tRT2dVetQVN6CFBZDloa9UtZI4/pmR MpXtfgN6cbRVGJcGsPqgYNYfPxK/lKI0pOJf27zAVKRVduHnsFpvKYGh4bV1W7rv/yVP 6tUA== X-Gm-Message-State: AOAM533rjCwijWKpDjzRA8yLz8/nn4tOaBQjaPa0L84DrcpzRGMKF3en zeKGPTifQY2oy7kXa0g6I9YpGEqQ2JM= X-Google-Smtp-Source: ABdhPJxKhDQPvWju88ruAaJaIPIVeSToQmeSh3ct0XSYEFOEu2z6vT6mI9tByBE0otRLL0ebMuY1ig== X-Received: by 2002:adf:eb8f:: with SMTP id t15mr24945019wrn.417.1600624712806; Sun, 20 Sep 2020 10:58:32 -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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Niek Linnenbank , Peter Maydell , Paul Zimmerman , Andrew Baumann , Luc Michel Subject: [PATCH 4/7] hw/timer/bcm2835: Introduce BCM2835_SYSTIMER_COUNT definition Date: Sun, 20 Sep 2020 19:58:22 +0200 Message-Id: <20200920175825.417680-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920175825.417680-1-f4bug@amsat.org> References: <20200920175825.417680-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Use the BCM2835_SYSTIMER_COUNT definition instead of the magic '4' value. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/timer/bcm2835_systmr.h | 4 +++- hw/timer/bcm2835_systmr.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_s= ystmr.h index 64166bd7120..11272837a6b 100644 --- a/include/hw/timer/bcm2835_systmr.h +++ b/include/hw/timer/bcm2835_systmr.h @@ -18,6 +18,8 @@ typedef struct BCM2835SystemTimerState BCM2835SystemTimer= State; DECLARE_INSTANCE_CHECKER(BCM2835SystemTimerState, BCM2835_SYSTIMER, TYPE_BCM2835_SYSTIMER) =20 +#define BCM2835_SYSTIMER_COUNT 4 + struct BCM2835SystemTimerState { /*< private >*/ SysBusDevice parent_obj; @@ -28,7 +30,7 @@ struct BCM2835SystemTimerState { =20 struct { uint32_t status; - uint32_t compare[4]; + uint32_t compare[BCM2835_SYSTIMER_COUNT]; } reg; }; =20 diff --git a/hw/timer/bcm2835_systmr.c b/hw/timer/bcm2835_systmr.c index 3387a6214a2..ff8c5536610 100644 --- a/hw/timer/bcm2835_systmr.c +++ b/hw/timer/bcm2835_systmr.c @@ -134,7 +134,8 @@ static const VMStateDescription bcm2835_systmr_vmstate = =3D { .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { VMSTATE_UINT32(reg.status, BCM2835SystemTimerState), - VMSTATE_UINT32_ARRAY(reg.compare, BCM2835SystemTimerState, 4), + VMSTATE_UINT32_ARRAY(reg.compare, BCM2835SystemTimerState, + BCM2835_SYSTIMER_COUNT), VMSTATE_END_OF_LIST() } }; --=20 2.26.2