From nobody Wed Nov 12 00:12:53 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; dmarc=fail(p=none dis=none) header.from=bt.com ARC-Seal: i=1; a=rsa-sha256; t=1566830268; cv=none; d=zoho.com; s=zohoarc; b=SCVZt7h3lWhNykrs8zf9hxApIuHr1WqddYZsvduUJat1rT7mZVdJeBCTKmL16F85u2dN+FVQ4z0OGsgimsv7lF/MWCoFfzwKlhN1ZZ6v4GxdIdDwA0avuJG/VI85G1VAbCjiiQC2KXbUvz4TLe4k9RG6KSUhe637pB5L9k4N17w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566830268; 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=dYDFpDtzRFfAO9EOOiVDcYUEyfTzZGEBm8+iEpK3MfY=; b=nxtNGmeNdLA5nMfsPLw57j3aotXHAp8Dr59sUcAh7siJUGGC3WACK3LSRqhnqct4gFTPG1vHv1Xle+Mfvrgu/iAWZxxqH+ZMeNlAjZ0flSZJeir2AH42QduUcPw7blIrramNIZVEB7HrfzKL1OF0npSmIyXI0iRvfYw2d/KWgMQ= 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566830268097836.2975038612223; Mon, 26 Aug 2019 07:37:48 -0700 (PDT) Received: from localhost ([::1]:53740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2G7k-0002Sh-Rd for importer@patchew.org; Mon, 26 Aug 2019 10:37:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42768) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Fpo-0004X0-BP for qemu-devel@nongnu.org; Mon, 26 Aug 2019 10:19:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2Fpm-0000Ju-QU for qemu-devel@nongnu.org; Mon, 26 Aug 2019 10:19:04 -0400 Received: from nsstlmta18p.bpe.bigpond.com ([203.38.21.18]:34232) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i2Fpl-00008j-T3; Mon, 26 Aug 2019 10:19:02 -0400 Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep18p-svc.bpe.nexus.telstra.com.au with ESMTP id <20190826141857.DCXX10803.nsstlfep18p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com>; Tue, 27 Aug 2019 00:18:57 +1000 Received: from dbz.telstra.com.au (58.173.98.68) by smtp.telstra.com (5.8.335) (authenticated as tony.nguyen.git@bigpond.com) id 5D3581440DDB0FB8; Tue, 27 Aug 2019 00:18:56 +1000 X-RG-Spam: Unknown X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduvddrudehgedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuuffpveftpgfvgffnuffvtfetpdfqfgfvnecuuegrihhlohhuthemucegtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhonhihucfpghhuhigvnhcuoehtohhnhidrnhhguhihvghnsegsthdrtghomheqnecukfhppeehkedrudejfedrleekrdeikeenucfrrghrrghmpehhvghlohepuggsiidrthgvlhhsthhrrgdrtghomhdrrghupdhinhgvthepheekrddujeefrdelkedrieekpdhmrghilhhfrhhomhepoehtohhnhidrnhhguhihvghnsegsthdrtghomheqpdhrtghpthhtohepoegvughgrghrrdhighhlvghsihgrshesghhmrghilhdrtghomheqpdhrtghpthhtohepoehggihtsehmphhrtgdrphhkuhdrvgguuhdrtghnqedprhgtphhtthhopeeomhgrrhhkrdgtrghvvgdqrgihlhgrnhgusehilhgrnhguvgdrtghordhukheqpdhrtghpthhtohepoehpvghtvghrrdgthhhusggssehnihgtthgrrdgtohhmrdgruheqpdhrtghpthhtohepoehpvghtvghrrdhmrgihuggvlhhlsehlihhnrghrohdrohhrgheqpdhrtghpthhtohepoehqvghmuhdqrghrmhesnhhonhhgnhhurdhorhhgqedprhgtphhtthhopeeoqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrgheqpdhrtghp thhtohepoehtohhnhidrnhhguhihvghnsegsthdrtghomheqnecuvehluhhsthgvrhfuihiivgeptd X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RG-VS-CLASS: clean X-Authentication-Info: Submitted using ID tony.nguyen.git@bigpond.com From: Tony Nguyen To: qemu-devel@nongnu.org Date: Tue, 27 Aug 2019 00:21:36 +1000 Message-Id: <554a2f98479cd6dbf0d0a1c019fe728b0902d0de.1566829168.git.tony.nguyen@bt.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 203.38.21.18 Subject: [Qemu-devel] [PATCH 10/19] hw/intc: Declare device little or big endian 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: Tony Nguyen , Peter Maydell , Mark Cave-Ayland , qemu-arm@nongnu.org, Peter Chubb , "Edgar E. Iglesias" , Guan Xuetao Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" For each device declared with DEVICE_NATIVE_ENDIAN, find the set of targets from the set of target/hw/*/device.o. If the set of targets are all little or all big endian, re-declare as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively. Then, on inspection: - if not used, re-declare as DEVICE_HOST_ENDIAN. - if max/min size=3D1, re-declare as DEVICE_HOST_ENDIAN. - if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN - if PCI, re-declare as DEVICE_LITTLE_ENDIAN. - if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN. - if for SPARC only, re-declare as DEVICE_BIG_ENDIAN. Signed-off-by: Tony Nguyen --- hw/intc/arm_gic.c | 12 ++++++------ hw/intc/arm_gicv3.c | 4 ++-- hw/intc/arm_gicv3_its_common.c | 2 +- hw/intc/etraxfs_pic.c | 2 +- hw/intc/imx_avic.c | 2 +- hw/intc/imx_gpcv2.c | 2 +- hw/intc/pl190.c | 2 +- hw/intc/puv3_intc.c | 2 +- hw/intc/slavio_intctl.c | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 1d7da7baa2..009933952c 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -2000,38 +2000,38 @@ static const MemoryRegionOps gic_ops[2] =3D { { .read_with_attrs =3D gic_dist_read, .write_with_attrs =3D gic_dist_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }, { .read_with_attrs =3D gic_thiscpu_read, .write_with_attrs =3D gic_thiscpu_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, } }; =20 static const MemoryRegionOps gic_cpu_ops =3D { .read_with_attrs =3D gic_do_cpu_read, .write_with_attrs =3D gic_do_cpu_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static const MemoryRegionOps gic_virt_ops[2] =3D { { .read_with_attrs =3D gic_thiscpu_hyp_read, .write_with_attrs =3D gic_thiscpu_hyp_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }, { .read_with_attrs =3D gic_thisvcpu_read, .write_with_attrs =3D gic_thisvcpu_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, } }; =20 static const MemoryRegionOps gic_viface_ops =3D { .read_with_attrs =3D gic_do_hyp_read, .write_with_attrs =3D gic_do_hyp_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static void arm_gic_realize(DeviceState *dev, Error **errp) diff --git a/hw/intc/arm_gicv3.c b/hw/intc/arm_gicv3.c index 66eaa97198..9b4d5bad69 100644 --- a/hw/intc/arm_gicv3.c +++ b/hw/intc/arm_gicv3.c @@ -352,12 +352,12 @@ static const MemoryRegionOps gic_ops[] =3D { { .read_with_attrs =3D gicv3_dist_read, .write_with_attrs =3D gicv3_dist_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }, { .read_with_attrs =3D gicv3_redist_read, .write_with_attrs =3D gicv3_redist_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, } }; =20 diff --git a/hw/intc/arm_gicv3_its_common.c b/hw/intc/arm_gicv3_its_common.c index 66c4c6a188..97ff537bf1 100644 --- a/hw/intc/arm_gicv3_its_common.c +++ b/hw/intc/arm_gicv3_its_common.c @@ -96,7 +96,7 @@ static MemTxResult gicv3_its_trans_write(void *opaque, hw= addr offset, static const MemoryRegionOps gicv3_its_trans_ops =3D { .read_with_attrs =3D gicv3_its_trans_read, .write_with_attrs =3D gicv3_its_trans_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 void gicv3_its_init_mmio(GICv3ITSState *s, const MemoryRegionOps *ops) diff --git a/hw/intc/etraxfs_pic.c b/hw/intc/etraxfs_pic.c index 77f652acec..5895b671b1 100644 --- a/hw/intc/etraxfs_pic.c +++ b/hw/intc/etraxfs_pic.c @@ -112,7 +112,7 @@ static void pic_write(void *opaque, hwaddr addr, static const MemoryRegionOps pic_ops =3D { .read =3D pic_read, .write =3D pic_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, .valid =3D { .min_access_size =3D 4, .max_access_size =3D 4 diff --git a/hw/intc/imx_avic.c b/hw/intc/imx_avic.c index 63fc602a1a..15ed512e86 100644 --- a/hw/intc/imx_avic.c +++ b/hw/intc/imx_avic.c @@ -310,7 +310,7 @@ static void imx_avic_write(void *opaque, hwaddr offset, static const MemoryRegionOps imx_avic_ops =3D { .read =3D imx_avic_read, .write =3D imx_avic_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static void imx_avic_reset(DeviceState *dev) diff --git a/hw/intc/imx_gpcv2.c b/hw/intc/imx_gpcv2.c index 17007a4078..3df4a443b8 100644 --- a/hw/intc/imx_gpcv2.c +++ b/hw/intc/imx_gpcv2.c @@ -65,7 +65,7 @@ static void imx_gpcv2_write(void *opaque, hwaddr offset, static const struct MemoryRegionOps imx_gpcv2_ops =3D { .read =3D imx_gpcv2_read, .write =3D imx_gpcv2_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, .impl =3D { /* * Our device would not work correctly if the guest was doing diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c index e3bd3dd121..1b474d25b9 100644 --- a/hw/intc/pl190.c +++ b/hw/intc/pl190.c @@ -222,7 +222,7 @@ static void pl190_write(void *opaque, hwaddr offset, static const MemoryRegionOps pl190_ops =3D { .read =3D pl190_read, .write =3D pl190_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static void pl190_reset(DeviceState *d) diff --git a/hw/intc/puv3_intc.c b/hw/intc/puv3_intc.c index e018955ce8..1c8ddbd70d 100644 --- a/hw/intc/puv3_intc.c +++ b/hw/intc/puv3_intc.c @@ -101,7 +101,7 @@ static const MemoryRegionOps puv3_intc_ops =3D { .min_access_size =3D 4, .max_access_size =3D 4, }, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static void puv3_intc_realize(DeviceState *dev, Error **errp) diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c index c4cf9096eb..d12e10374c 100644 --- a/hw/intc/slavio_intctl.c +++ b/hw/intc/slavio_intctl.c @@ -136,7 +136,7 @@ static void slavio_intctl_mem_writel(void *opaque, hwad= dr addr, static const MemoryRegionOps slavio_intctl_mem_ops =3D { .read =3D slavio_intctl_mem_readl, .write =3D slavio_intctl_mem_writel, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, .valid =3D { .min_access_size =3D 4, .max_access_size =3D 4, @@ -206,7 +206,7 @@ static void slavio_intctlm_mem_writel(void *opaque, hwa= ddr addr, static const MemoryRegionOps slavio_intctlm_mem_ops =3D { .read =3D slavio_intctlm_mem_readl, .write =3D slavio_intctlm_mem_writel, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, .valid =3D { .min_access_size =3D 4, .max_access_size =3D 4, --=20 2.23.0