diff options
author | Mark Rutland <mark.rutland@arm.com> | 2021-07-26 14:46:01 +0100 |
---|---|---|
committer | Mark Rutland <mark.rutland@arm.com> | 2021-08-02 15:36:52 +0100 |
commit | f8fc0c92e5bc22d2acc8ea82453cbddbb5e822e3 (patch) | |
tree | 3fd2a0fd492c0564140dbb97ad98fd01501e022f | |
parent | 378bbbec05c5c1d8b136ecd3a487e6f60d119c83 (diff) | |
download | boot-wrapper-aarch64-f8fc0c92e5bc22d2acc8ea82453cbddbb5e822e3.tar.gz |
Move common source files to `common` directory
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 <mark.rutland@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
-rw-r--r-- | Makefile.am | 29 | ||||
-rw-r--r-- | common/bakery_lock.c (renamed from bakery_lock.c) | 0 | ||||
-rw-r--r-- | common/boot.c (renamed from boot_common.c) | 2 | ||||
-rw-r--r-- | common/gic-v3.c (renamed from gic-v3.c) | 0 | ||||
-rw-r--r-- | common/gic.c (renamed from gic.c) | 0 | ||||
-rw-r--r-- | common/lib.c (renamed from lib.c) | 0 | ||||
-rw-r--r-- | common/platform.c (renamed from platform.c) | 0 | ||||
-rw-r--r-- | common/psci.c (renamed from psci.c) | 0 |
8 files changed, 18 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am index bb6079d..3591d23 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 index 877118c..877118c 100644 --- a/bakery_lock.c +++ b/common/bakery_lock.c diff --git a/boot_common.c b/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 index 62f9676..62f9676 100644 --- a/gic-v3.c +++ b/common/gic-v3.c diff --git a/platform.c b/common/platform.c index d11f568..d11f568 100644 --- a/platform.c +++ b/common/platform.c |