From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50D30C4338F for ; Fri, 30 Jul 2021 17:43:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F3D66054F for ; Fri, 30 Jul 2021 17:43:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1F3D66054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9ffNKTmpSdiYDPIAxGzVfo7pKcHmy/m/sBHGm2xTu3Q=; b=K+aWrXO91RenOB qOMp36Zr4sNmBo/izWPJDQT5ImbllqlZfzDoZjthOq9nHy7ntLc8nrPY+pZVvdjdwT5nnzTAlifal twT5wz+9niHsg2dY9AxhBlbDeyg7h+Ra7gY0axpHWpGmx5kdF7evgkg3pIjPDcBAwTfF4EME37Rhi DdzALLc/3On+ScJvgeqGwUAwHdVL2dCth/a8/z9oY125nQjVqpdT1GWuUMWbUq8hx4pp7DQdVTFI8 2MvMw/N/RoaVV4qloyD8AEMgnPesCNanOeBD53YFXRyMlagJOFzXA8vThPyvOSiApxmSZg6Hcv5iz M1AVnyD9o4CfsuL5gWQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9WVM-009jBb-Oz; Fri, 30 Jul 2021 17:41:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9WVD-009j9k-Ni for linux-arm-kernel@lists.infradead.org; Fri, 30 Jul 2021 17:40:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C662811B3; Fri, 30 Jul 2021 10:40:51 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0D1E13F66F; Fri, 30 Jul 2021 10:40:50 -0700 (PDT) Date: Fri, 30 Jul 2021 18:40:09 +0100 From: Andre Przywara To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, Jaxson.Han@arm.com, Wei.Chen@arm.com Subject: Re: [boot-wrapper PATCH 12/12] Move common source files to `common` directory Message-ID: <20210730184009.5ea3c4cd@slackpad.fritz.box> In-Reply-To: <20210729152050.23635-13-mark.rutland@arm.com> References: <20210729152050.23635-1-mark.rutland@arm.com> <20210729152050.23635-13-mark.rutland@arm.com> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210730_104055_935094_33B09341 X-CRM114-Status: GOOD ( 20.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 29 Jul 2021 16:20:50 +0100 Mark Rutland wrote: > The top-level directory is getting increasingly cluttered. For clarity > let's move the common source files into their own directory. At the same > time let's clean up the way we generate object lists so that it's > consistent for arch/common objects, and doesn't require special casing > each optional object. > > Note that we also need to create a common/ directory for out-of-tree > builds. > > There should be no functional change as a result of this patch. > > Signed-off-by: Mark Rutland Looks like a good cleanup. Reviewed-by: Andre Przywara Thanks, Andre > --- > Makefile.am | 29 +++++++++++++++++------------ > bakery_lock.c => common/bakery_lock.c | 0 > boot_common.c => common/boot.c | 2 +- > gic-v3.c => common/gic-v3.c | 0 > gic.c => common/gic.c | 0 > lib.c => common/lib.c | 0 > platform.c => common/platform.c | 0 > psci.c => common/psci.c | 0 > 8 files changed, 18 insertions(+), 13 deletions(-) > rename bakery_lock.c => common/bakery_lock.c (100%) > rename boot_common.c => common/boot.c (96%) > rename gic-v3.c => common/gic-v3.c (100%) > rename gic.c => common/gic.c (100%) > rename lib.c => common/lib.c (100%) > rename platform.c => common/platform.c (100%) > rename psci.c => common/psci.c (100%) > > diff --git a/Makefile.am b/Makefile.am > index 5d34cc8..68f23d3 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -33,7 +33,10 @@ PSCI_CPU_ON := 0xc4000003 > endif > PSCI_CPU_OFF := 0x84000002 > > -OFILES = > +COMMON_SRC := common/ > +COMMON_OBJ := boot.o bakery_lock.o platform.o lib.o > + > +ARCH_OBJ := boot.o stack.o utils.o > > if BOOTWRAPPER_32 > CPPFLAGS += -DBOOTWRAPPER_32 > @@ -45,8 +48,8 @@ ARCH_SRC := arch/aarch64/ > endif > > if PSCI > -BOOTMETHOD := psci.o > -OFILES += psci.o > +ARCH_OBJ += psci.o > +COMMON_OBJ += psci.o > PSCI_NODE := psci { \ > compatible = \"arm,psci\"; \ > method = \"smc\"; \ > @@ -55,7 +58,7 @@ PSCI_NODE := psci { \ > }; > CPU_NODES := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/addpsci.pl $(KERNEL_DTB)) > else > -BOOTMETHOD := spin.o > +ARCH_OBJ += spin.o > PSCI_NODE := > CPU_NODES := > endif > @@ -65,13 +68,13 @@ GIC_DIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNE > GIC_RDIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 1 'arm,gic-v3') > DEFINES += -DGIC_DIST_BASE=$(GIC_DIST_BASE) > DEFINES += -DGIC_RDIST_BASE=$(GIC_RDIST_BASE) > -GIC := gic-v3.o > +COMMON_OBJ += gic-v3.o > else > GIC_DIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 0 'arm,cortex-a15-gic') > GIC_CPU_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 1 'arm,cortex-a15-gic') > DEFINES += -DGIC_CPU_BASE=$(GIC_CPU_BASE) > DEFINES += -DGIC_DIST_BASE=$(GIC_DIST_BASE) > -GIC := gic.o > +COMMON_OBJ += gic.o > endif > > if KERNEL_32 > @@ -125,8 +128,7 @@ CFLAGS += -Wall -fomit-frame-pointer > CFLAGS += -ffunction-sections -fdata-sections > LDFLAGS += --gc-sections > > -OFILES += boot_common.o bakery_lock.o platform.o $(GIC) lib.o > -OFILES += $(addprefix $(ARCH_SRC),boot.o stack.o $(BOOTMETHOD) utils.o) > +OBJ := $(addprefix $(ARCH_SRC),$(ARCH_OBJ)) $(addprefix $(COMMON_SRC),$(COMMON_OBJ)) > > # Don't lookup all prerequisites in $(top_srcdir), only the source files. When > # building outside the source tree $(ARCH_SRC) needs to be created. > @@ -136,18 +138,21 @@ vpath %.S $(top_srcdir) > > all: $(IMAGE) > > -CLEANFILES = $(IMAGE) linux-system.axf xen-system.axf $(OFILES) model.lds fdt.dtb > +CLEANFILES = $(IMAGE) linux-system.axf xen-system.axf $(OBJ) model.lds fdt.dtb > > -$(IMAGE): $(OFILES) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM) $(XEN_IMAGE) > - $(LD) $(LDFLAGS) $(OFILES) -o $@ --script=model.lds > +$(IMAGE): $(OBJ) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM) $(XEN_IMAGE) > + $(LD) $(LDFLAGS) $(OBJ) -o $@ --script=model.lds > > $(ARCH_SRC): > $(MKDIR_P) $@ > > +$(COMMON_SRC): > + $(MKDIR_P) $@ > + > %.o: %.S Makefile | $(ARCH_SRC) > $(CC) $(CPPFLAGS) -D__ASSEMBLY__ $(CFLAGS) $(DEFINES) -c -o $@ $< > > -%.o: %.c Makefile > +%.o: %.c Makefile | $(COMMON_SRC) > $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $< > > model.lds: $(LD_SCRIPT) Makefile > diff --git a/bakery_lock.c b/common/bakery_lock.c > similarity index 100% > rename from bakery_lock.c > rename to common/bakery_lock.c > diff --git a/boot_common.c b/common/boot.c > similarity index 96% > rename from boot_common.c > rename to common/boot.c > index eada179..c74d34c 100644 > --- a/boot_common.c > +++ b/common/boot.c > @@ -1,5 +1,5 @@ > /* > - * boot_common.c - common spin function for all boot methods > + * boot.c - common spin function for all boot methods > * > * Copyright (C) 2015 ARM Limited. All rights reserved. > * > diff --git a/gic-v3.c b/common/gic-v3.c > similarity index 100% > rename from gic-v3.c > rename to common/gic-v3.c > diff --git a/gic.c b/common/gic.c > similarity index 100% > rename from gic.c > rename to common/gic.c > diff --git a/lib.c b/common/lib.c > similarity index 100% > rename from lib.c > rename to common/lib.c > diff --git a/platform.c b/common/platform.c > similarity index 100% > rename from platform.c > rename to common/platform.c > diff --git a/psci.c b/common/psci.c > similarity index 100% > rename from psci.c > rename to common/psci.c _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel