From nobody Thu Dec 18 17:54:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506012536179354.55226112779053; Thu, 21 Sep 2017 09:48:56 -0700 (PDT) Received: from localhost ([::1]:54661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dv4eY-0000s4-GG for importer@patchew.org; Thu, 21 Sep 2017 12:48:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dv4XQ-00038k-BZ for qemu-devel@nongnu.org; Thu, 21 Sep 2017 12:41:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dv4XO-0003Ax-LZ for qemu-devel@nongnu.org; Thu, 21 Sep 2017 12:41:20 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37500) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dv4XO-0002yR-Dj for qemu-devel@nongnu.org; Thu, 21 Sep 2017 12:41:18 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1dv4XM-0005Ap-VI for qemu-devel@nongnu.org; Thu, 21 Sep 2017 17:41:16 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 21 Sep 2017 17:41:29 +0100 Message-Id: <1506012099-13605-22-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506012099-13605-1-git-send-email-peter.maydell@linaro.org> References: <1506012099-13605-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 21/31] hw/arm/palm.c: Don't use old_mmio for static_ops X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Update the static_ops functions to use new-style mmio rather than the legacy old_mmio functions. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 1505580378-9044-2-git-send-email-peter.maydell@linaro.org --- hw/arm/palm.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/hw/arm/palm.c b/hw/arm/palm.c index b8753e2..a1f55d7 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -31,26 +31,16 @@ #include "exec/address-spaces.h" #include "cpu.h" =20 -static uint32_t static_readb(void *opaque, hwaddr offset) +static uint64_t static_read(void *opaque, hwaddr offset, unsigned size) { - uint32_t *val =3D (uint32_t *) opaque; - return *val >> ((offset & 3) << 3); -} + uint32_t *val =3D (uint32_t *)opaque; + uint32_t sizemask =3D 7 >> size; =20 -static uint32_t static_readh(void *opaque, hwaddr offset) -{ - uint32_t *val =3D (uint32_t *) opaque; - return *val >> ((offset & 1) << 3); -} - -static uint32_t static_readw(void *opaque, hwaddr offset) -{ - uint32_t *val =3D (uint32_t *) opaque; - return *val >> ((offset & 0) << 3); + return *val >> ((offset & sizemask) << 3); } =20 -static void static_write(void *opaque, hwaddr offset, - uint32_t value) +static void static_write(void *opaque, hwaddr offset, uint64_t value, + unsigned size) { #ifdef SPY printf("%s: value %08lx written at " PA_FMT "\n", @@ -59,10 +49,10 @@ static void static_write(void *opaque, hwaddr offset, } =20 static const MemoryRegionOps static_ops =3D { - .old_mmio =3D { - .read =3D { static_readb, static_readh, static_readw, }, - .write =3D { static_write, static_write, static_write, }, - }, + .read =3D static_read, + .write =3D static_write, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 4, .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 --=20 2.7.4