From nobody Thu Nov 6 03:24:57 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538744763709787.1130784100417; Fri, 5 Oct 2018 06:06:03 -0700 (PDT) Received: from localhost ([::1]:35102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8Pnu-0005Td-8G for importer@patchew.org; Fri, 05 Oct 2018 09:06:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8PkX-0003G2-Po for qemu-devel@nongnu.org; Fri, 05 Oct 2018 09:02:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8PkT-0000Ih-La for qemu-devel@nongnu.org; Fri, 05 Oct 2018 09:02:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39160) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g8PkP-0008L1-Lt for qemu-devel@nongnu.org; Fri, 05 Oct 2018 09:02:25 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C7A03002F80; Fri, 5 Oct 2018 13:02:02 +0000 (UTC) Received: from thuth.com (dhcp-200-199.str.redhat.com [10.33.200.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id D15AE600C0; Fri, 5 Oct 2018 13:02:00 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Alistair Francis Date: Fri, 5 Oct 2018 15:01:48 +0200 Message-Id: <1538744508-17108-3-git-send-email-thuth@redhat.com> In-Reply-To: <1538744508-17108-1-git-send-email-thuth@redhat.com> References: <1538744508-17108-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 05 Oct 2018 13:02:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 2/2] hw/core/generic-loader: Compile only once, not for each target 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: , Cc: Peter Maydell , "Michael S. Tsirkin" , Peter Crosthwaite , Paolo Bonzini , Laszlo Ersek , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The generic-loader is currently compiled target specific due to one single "#ifdef TARGET_WORDS_BIGENDIAN" in the file. We have already a function called target_words_bigendian() for this instead, so we can put the generic-loader into common-obj to save some compilation time. Signed-off-by: Thomas Huth Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/Makefile.objs | 2 +- hw/core/generic-loader.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index eb88ca9..b736ce2 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -20,6 +20,6 @@ common-obj-$(CONFIG_SOFTMMU) +=3D register.o common-obj-$(CONFIG_SOFTMMU) +=3D or-irq.o common-obj-$(CONFIG_SOFTMMU) +=3D split-irq.o common-obj-$(CONFIG_PLATFORM_BUS) +=3D platform-bus.o +common-obj-$(CONFIG_SOFTMMU) +=3D generic-loader.o =20 -obj-$(CONFIG_SOFTMMU) +=3D generic-loader.o obj-$(CONFIG_SOFTMMU) +=3D null-machine.o diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c index be29ae1..fbae05f 100644 --- a/hw/core/generic-loader.c +++ b/hw/core/generic-loader.c @@ -130,11 +130,7 @@ static void generic_loader_realize(DeviceState *dev, E= rror **errp) s->cpu =3D first_cpu; } =20 -#ifdef TARGET_WORDS_BIGENDIAN - big_endian =3D 1; -#else - big_endian =3D 0; -#endif + big_endian =3D target_words_bigendian(); =20 if (s->file) { AddressSpace *as =3D s->cpu ? s->cpu->as : NULL; --=20 1.8.3.1