From nobody Wed Nov 12 00:13:36 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=1566829310; cv=none; d=zoho.com; s=zohoarc; b=O46i2ZZv/Ei2YLbf6xqtIIHx1G9uzNU/IHjREsiYuEectDPAPUPdV/t76R/bdQIL2skPMwiFTIBBwedIjUTmvRuErR6aFgj6fpOeAugnaEeTavC8pcjrMA2+85n5syrPO9irRGg10KiORnkQuKCWJ6U/EWijFQfn23rkuhJbVdo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566829310; 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=Xo0O54+09yf5fGyREWDFWv1qIoWsHvjOkBhxPfgHEJQ=; b=KWaABmCX9vwwNXMjgxlgEF9jWg/uDO7VWPYsbOc0G7npjM5ggz1L9rjEB4RtsLfqw8wG1E87ejnp5GM6wcv+6t2d0s7Zig6CtQt3+2lpej+yE2SfZGF6jtgw+ITd0WlpMZLerNJOXsVj++3Az5RsiKNOa/phSTMwyIi5exEP9eg= 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 1566829310802489.5222677285997; Mon, 26 Aug 2019 07:21:50 -0700 (PDT) Received: from localhost ([::1]:53536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2FsT-0005z5-Bm for importer@patchew.org; Mon, 26 Aug 2019 10:21:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42521) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Fp6-0003xB-No for qemu-devel@nongnu.org; Mon, 26 Aug 2019 10:18:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2Fp5-00083U-Mh for qemu-devel@nongnu.org; Mon, 26 Aug 2019 10:18:20 -0400 Received: from nsstlmta10p.bpe.bigpond.com ([203.38.21.10]:57504) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i2Fp5-00080C-36; Mon, 26 Aug 2019 10:18:19 -0400 Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep10p-svc.bpe.nexus.telstra.com.au with ESMTP id <20190826141814.RFAT6772.nsstlfep10p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com>; Tue, 27 Aug 2019 00:18:14 +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 5D2D11751058886B; Tue, 27 Aug 2019 00:18:14 +1000 X-RG-Spam: Unknown X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduvddrudehgedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuuffpveftpgfvgffnuffvtfetpdfqfgfvnecuuegrihhlohhuthemucegtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhonhihucfpghhuhigvnhcuoehtohhnhidrnhhguhihvghnsegsthdrtghomheqnecukfhppeehkedrudejfedrleekrdeikeenucfrrghrrghmpehhvghlohepuggsiidrthgvlhhsthhrrgdrtghomhdrrghupdhinhgvthepheekrddujeefrdelkedrieekpdhmrghilhhfrhhomhepoehtohhnhidrnhhguhihvghnsegsthdrtghomheqpdhrtghpthhtohepoehjshhnohifsehrvgguhhgrthdrtghomheqpdhrtghpthhtohepoehkfiholhhfsehrvgguhhgrthdrtghomheqpdhrtghpthhtohepoehmrhgvihhtiiesrhgvughhrghtrdgtohhmqedprhgtphhtthhopeeoqhgvmhhuqdgslhhotghksehnohhnghhnuhdrohhrgheqpdhrtghpthhtohepoehqvghmuhdquggvvhgvlhesnhhonhhgnhhurdhorhhgqedprhgtphhtthhopeeothhonhihrdhnghhuhigvnhessghtrdgtohhmqeenucevlhhushhtvghrufhiiigvpedt 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:28 +1000 Message-Id: <2a1a5d52f1d6a44151e2e486653d47835151e649.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.10 Subject: [Qemu-devel] [PATCH 02/19] hw/block: 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: Kevin Wolf , Tony Nguyen , John Snow , qemu-block@nongnu.org, Max Reitz 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 ununsed, re-declare as DEVICE_HOST_ENDIAN. - if max/min size=3D1, re-declare as DEVICE_HOST_ENDIAN. - if just a bit bucket, re-delcare 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/block/fdc.c | 4 ++-- hw/block/onenand.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index ac5d31e8c1..2745586982 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -984,13 +984,13 @@ static void fdctrl_write_mem (void *opaque, hwaddr re= g, static const MemoryRegionOps fdctrl_mem_ops =3D { .read =3D fdctrl_read_mem, .write =3D fdctrl_write_mem, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_HOST_ENDIAN, }; =20 static const MemoryRegionOps fdctrl_mem_strict_ops =3D { .read =3D fdctrl_read_mem, .write =3D fdctrl_write_mem, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_HOST_ENDIAN, .valid =3D { .min_access_size =3D 1, .max_access_size =3D 1, diff --git a/hw/block/onenand.c b/hw/block/onenand.c index fcc5a69b90..95fc0443d3 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -771,7 +771,7 @@ static void onenand_write(void *opaque, hwaddr addr, static const MemoryRegionOps onenand_ops =3D { .read =3D onenand_read, .write =3D onenand_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 static void onenand_realize(DeviceState *dev, Error **errp) --=20 2.23.0