From nobody Wed Nov 12 00:12:56 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=1566829832; cv=none; d=zoho.com; s=zohoarc; b=UyMBCyKcYj2fwvxRKul7BB+lCHgibGfJeqgJi3O8nB8FEdnOZK1Tx7LAxiPPT8rij/gcpeYP/UH4fG62QjjzqYM/8WUJKzh0gBrE6YPRhPyh2bFonycYqbEYASJEzlUNqNHuTsmm+CK4hj5JErI5Rk8U2+WDYGEW00WNRQa7T3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566829832; 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=zrJ6MPWD4+/88Sz9SgVKis3WxZfairHFP5VG8Ii/Xfc=; b=Gg0wVLl1PTiApvENvFvSFB+EpJLt+wXFePQmPeQralDWobXce0uo5W02CTH66f6Xnq1XOL2jcnVvn9LhOe1eF/PO9pMyVEy6TDDKq8+OQKmt3rIHPZWJ2XYFSzuQaKE+W5P9kFMtLSwIyQR2aK4KEydp2xd+aEv92OrsL1M13E0= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566829832560685.6581594398997; Mon, 26 Aug 2019 07:30:32 -0700 (PDT) Received: from localhost ([::1]:53656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2G0p-0005IC-F5 for importer@patchew.org; Mon, 26 Aug 2019 10:30:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42620) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2FpY-0004OD-1l for qemu-devel@nongnu.org; Mon, 26 Aug 2019 10:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2FpW-0008MA-3e for qemu-devel@nongnu.org; Mon, 26 Aug 2019 10:18:47 -0400 Received: from nsstlmta35p.bpe.bigpond.com ([203.38.21.35]:50794) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i2FpU-0008HU-R4; Mon, 26 Aug 2019 10:18:45 -0400 Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep35p-svc.bpe.nexus.telstra.com.au with ESMTP id <20190826141839.CMQF29150.nsstlfep35p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com>; Tue, 27 Aug 2019 00:18:39 +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 5D2D117510588E84; Tue, 27 Aug 2019 00:18:38 +1000 X-RG-Spam: Unknown X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduvddrudehgedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuuffpveftpgfvgffnuffvtfetpdfqfgfvnecuuegrihhlohhuthemucegtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhonhihucfpghhuhigvnhcuoehtohhnhidrnhhguhihvghnsegsthdrtghomheqnecukfhppeehkedrudejfedrleekrdeikeenucfrrghrrghmpehhvghlohepuggsiidrthgvlhhsthhrrgdrtghomhdrrghupdhinhgvthepheekrddujeefrdelkedrieekpdhmrghilhhfrhhomhepoehtohhnhidrnhhguhihvghnsegsthdrtghomheqpdhrtghpthhtohepoeetnhgurhgvfidruegruhhmrghnnhesmhhitghrohhsohhfthdrtghomheqpdhrtghpthhtohepoegvughgrghrrdhighhlvghsihgrshesghhmrghilhdrtghomheqpdhrtghpthhtohepoehfgegsuhhgsegrmhhsrghtrdhorhhgqedprhgtphhtthhopeeoghigthesmhhprhgtrdhpkhhurdgvughurdgtnheqpdhrtghpthhtohepoehmrghrkhdrtggrvhgvqdgrhihlrghnugesihhlrghnuggvrdgtohdruhhkqedprhgtphhtthhopeeomhhsthesrhgvughhrghtrdgtohhmqedprhgtphhtthhopeeophgsohhniihinhhisehrvgguhhgrthdrtghomheqpdhrtghpthhtohepoehpvghtvghrrdhm rgihuggvlhhlsehlihhnrghrohdrohhrgheqpdhrtghpthhtohepoehqvghmuhdqrghrmhesnhhonhhgnhhurdhorhhgqedprhgtphhtthhopeeoqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrgheqpdhrtghpthhtohepoehtohhnhidrnhhguhihvghnsegsthdrtghomheqnecuvehluhhsthgvrhfuihiivgeptd 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:32 +1000 Message-Id: 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.35 Subject: [Qemu-devel] [PATCH 06/19] hw/dma: 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 , "Michael S. Tsirkin" , Peter Maydell , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Paolo Bonzini , "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/dma/bcm2835_dma.c | 4 ++-- hw/dma/etraxfs_dma.c | 14 +++++++------- hw/dma/i8257.c | 4 ++-- hw/dma/pl080.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/puv3_dma.c | 2 +- hw/dma/sparc32_dma.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/dma/bcm2835_dma.c b/hw/dma/bcm2835_dma.c index 192bd377a0..550e67f686 100644 --- a/hw/dma/bcm2835_dma.c +++ b/hw/dma/bcm2835_dma.c @@ -290,7 +290,7 @@ static void bcm2835_dma15_write(void *opaque, hwaddr of= fset, uint64_t value, static const MemoryRegionOps bcm2835_dma0_ops =3D { .read =3D bcm2835_dma0_read, .write =3D bcm2835_dma0_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, .valid.min_access_size =3D 4, .valid.max_access_size =3D 4, }; @@ -298,7 +298,7 @@ static const MemoryRegionOps bcm2835_dma0_ops =3D { static const MemoryRegionOps bcm2835_dma15_ops =3D { .read =3D bcm2835_dma15_read, .write =3D bcm2835_dma15_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, .valid.min_access_size =3D 4, .valid.max_access_size =3D 4, }; diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c index 47e1c6df12..ee3b92437a 100644 --- a/hw/dma/etraxfs_dma.c +++ b/hw/dma/etraxfs_dma.c @@ -698,13 +698,13 @@ dma_write(void *opaque, hwaddr addr, } =20 static const MemoryRegionOps dma_ops =3D { - .read =3D dma_read, - .write =3D dma_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, - .valid =3D { - .min_access_size =3D 1, - .max_access_size =3D 4 - } + .read =3D dma_read, + .write =3D dma_write, + .endianness =3D DEVICE_LITTLE_ENDIAN, + .valid =3D { + .min_access_size =3D 1, + .max_access_size =3D 4 + } }; =20 static int etraxfs_dmac_run(void *opaque) diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index 792f617eb4..e68736fa44 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -476,7 +476,7 @@ static int i8257_phony_handler(void *opaque, int nchan,= int dma_pos, static const MemoryRegionOps channel_io_ops =3D { .read =3D i8257_read_chan, .write =3D i8257_write_chan, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_HOST_ENDIAN, .impl =3D { .min_access_size =3D 1, .max_access_size =3D 1, @@ -500,7 +500,7 @@ static const MemoryRegionPortio pageh_portio_list[] =3D= { static const MemoryRegionOps cont_io_ops =3D { .read =3D i8257_read_cont, .write =3D i8257_write_cont, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_HOST_ENDIAN, .impl =3D { .min_access_size =3D 1, .max_access_size =3D 1, diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c index 52ba23f4bf..cbdd1849cd 100644 --- a/hw/dma/pl080.c +++ b/hw/dma/pl080.c @@ -350,7 +350,7 @@ static void pl080_write(void *opaque, hwaddr offset, static const MemoryRegionOps pl080_ops =3D { .read =3D pl080_read, .write =3D pl080_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static void pl080_reset(DeviceState *dev) diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index f2bb2d9ac1..a9216680ef 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -1496,7 +1496,7 @@ static uint64_t pl330_iomem_read(void *opaque, hwaddr= offset, static const MemoryRegionOps pl330_ops =3D { .read =3D pl330_iomem_read, .write =3D pl330_iomem_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, .impl =3D { .min_access_size =3D 4, .max_access_size =3D 4, diff --git a/hw/dma/puv3_dma.c b/hw/dma/puv3_dma.c index 5488d388a9..1577056715 100644 --- a/hw/dma/puv3_dma.c +++ b/hw/dma/puv3_dma.c @@ -74,7 +74,7 @@ static const MemoryRegionOps puv3_dma_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_dma_realize(DeviceState *dev, Error **errp) diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index 0e5bbcdc7f..bf76f2e558 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -226,7 +226,7 @@ static void dma_mem_write(void *opaque, hwaddr addr, static const MemoryRegionOps dma_mem_ops =3D { .read =3D dma_mem_read, .write =3D dma_mem_write, - .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