diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-12-14 00:18:21 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2019-01-04 10:43:17 +0000 |
commit | 09d40e0e08283a249e7dce0e106c07c5141f9b7e (patch) | |
tree | 46e7af7b5be2738948b359b2a07078e4cf1bbec1 /bl32 | |
parent | f5478dedf9e096d9539362b38ceb096b940ba3e2 (diff) |
Sanitise includes across codebase
Enforce full include path for includes. Deprecate old paths.
The following folders inside include/lib have been left unchanged:
- include/lib/cpus/${ARCH}
- include/lib/el3_runtime/${ARCH}
The reason for this change is that having a global namespace for
includes isn't a good idea. It defeats one of the advantages of having
folders and it introduces problems that are sometimes subtle (because
you may not know the header you are actually including if there are two
of them).
For example, this patch had to be created because two headers were
called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3a282 ("drivers: add tzc380 support").
This problem was introduced in commit 4ecca33988b9 ("Move include and
source files to logical locations"). At that time, there weren't too
many headers so it wasn't a real issue. However, time has shown that
this creates problems.
Platforms that want to preserve the way they include headers may add the
removed paths to PLAT_INCLUDES, but this is discouraged.
Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'bl32')
-rw-r--r-- | bl32/sp_min/aarch32/entrypoint.S | 6 | ||||
-rw-r--r-- | bl32/sp_min/sp_min.ld.S | 7 | ||||
-rw-r--r-- | bl32/sp_min/sp_min_main.c | 32 | ||||
-rw-r--r-- | bl32/tsp/aarch64/tsp_entrypoint.S | 5 | ||||
-rw-r--r-- | bl32/tsp/aarch64/tsp_exceptions.S | 5 | ||||
-rw-r--r-- | bl32/tsp/aarch64/tsp_request.S | 2 | ||||
-rw-r--r-- | bl32/tsp/tsp.ld.S | 2 | ||||
-rw-r--r-- | bl32/tsp/tsp_interrupt.c | 11 | ||||
-rw-r--r-- | bl32/tsp/tsp_main.c | 14 | ||||
-rw-r--r-- | bl32/tsp/tsp_private.h | 9 | ||||
-rw-r--r-- | bl32/tsp/tsp_timer.c | 7 |
11 files changed, 56 insertions, 44 deletions
diff --git a/bl32/sp_min/aarch32/entrypoint.S b/bl32/sp_min/aarch32/entrypoint.S index d6853cc4..2ffef6a2 100644 --- a/bl32/sp_min/aarch32/entrypoint.S +++ b/bl32/sp_min/aarch32/entrypoint.S @@ -6,13 +6,13 @@ #include <arch.h> #include <asm_macros.S> -#include <bl_common.h> +#include <common/bl_common.h> +#include <common/runtime_svc.h> #include <context.h> #include <el3_common_macros.S> -#include <runtime_svc.h> +#include <lib/xlat_tables/xlat_tables_defs.h> #include <smccc_helpers.h> #include <smccc_macros.S> -#include <xlat_tables_defs.h> .globl sp_min_vector_table .globl sp_min_entrypoint diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S index ce6c954e..ba9d3421 100644 --- a/bl32/sp_min/sp_min.ld.S +++ b/bl32/sp_min/sp_min.ld.S @@ -5,7 +5,8 @@ */ #include <platform_def.h> -#include <xlat_tables_defs.h> + +#include <lib/xlat_tables/xlat_tables_defs.h> OUTPUT_FORMAT(elf32-littlearm) OUTPUT_ARCH(arm) @@ -62,7 +63,7 @@ SECTIONS /* Place pubsub sections for events */ . = ALIGN(8); -#include <pubsub_events.h> +#include <lib/el3_runtime/pubsub_events.h> . = ALIGN(PAGE_SIZE); __RODATA_END__ = .; @@ -91,7 +92,7 @@ SECTIONS /* Place pubsub sections for events */ . = ALIGN(8); -#include <pubsub_events.h> +#include <lib/el3_runtime/pubsub_events.h> *(.vectors) __RO_END_UNALIGNED__ = .; diff --git a/bl32/sp_min/sp_min_main.c b/bl32/sp_min/sp_min_main.c index a12a83bc..3cb19901 100644 --- a/bl32/sp_min/sp_min_main.c +++ b/bl32/sp_min/sp_min_main.c @@ -4,26 +4,28 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <assert.h> +#include <stddef.h> +#include <stdint.h> +#include <string.h> + +#include <platform_def.h> + #include <arch.h> #include <arch_helpers.h> -#include <assert.h> -#include <bl_common.h> -#include <console.h> +#include <common/bl_common.h> +#include <common/debug.h> +#include <common/runtime_svc.h> #include <context.h> -#include <context_mgmt.h> -#include <debug.h> -#include <platform.h> -#include <platform_def.h> +#include <drivers/console.h> +#include <lib/el3_runtime/context_mgmt.h> +#include <lib/psci/psci.h> +#include <lib/utils.h> +#include <plat/common/platform.h> #include <platform_sp_min.h> -#include <psci.h> -#include <runtime_svc.h> +#include <services/std_svc.h> #include <smccc_helpers.h> -#include <stddef.h> -#include <stdint.h> -#include <std_svc.h> -#include <stdint.h> -#include <string.h> -#include <utils.h> + #include "sp_min_private.h" /* Pointers to per-core cpu contexts */ diff --git a/bl32/tsp/aarch64/tsp_entrypoint.S b/bl32/tsp/aarch64/tsp_entrypoint.S index 5d9da857..48f6981b 100644 --- a/bl32/tsp/aarch64/tsp_entrypoint.S +++ b/bl32/tsp/aarch64/tsp_entrypoint.S @@ -6,8 +6,9 @@ #include <arch.h> #include <asm_macros.S> -#include <tsp.h> -#include <xlat_tables_defs.h> +#include <bl32/tsp/tsp.h> +#include <lib/xlat_tables/xlat_tables_defs.h> + #include "../tsp_private.h" diff --git a/bl32/tsp/aarch64/tsp_exceptions.S b/bl32/tsp/aarch64/tsp_exceptions.S index 48e358a3..ad4b6488 100644 --- a/bl32/tsp/aarch64/tsp_exceptions.S +++ b/bl32/tsp/aarch64/tsp_exceptions.S @@ -6,9 +6,8 @@ #include <arch.h> #include <asm_macros.S> -#include <bl_common.h> -#include <tsp.h> - +#include <bl32/tsp/tsp.h> +#include <common/bl_common.h> /* ---------------------------------------------------- * The caller-saved registers x0-x18 and LR are saved diff --git a/bl32/tsp/aarch64/tsp_request.S b/bl32/tsp/aarch64/tsp_request.S index 2261f87f..5ad16da6 100644 --- a/bl32/tsp/aarch64/tsp_request.S +++ b/bl32/tsp/aarch64/tsp_request.S @@ -5,7 +5,7 @@ */ #include <asm_macros.S> -#include <tsp.h> +#include <bl32/tsp/tsp.h> .globl tsp_get_magic diff --git a/bl32/tsp/tsp.ld.S b/bl32/tsp/tsp.ld.S index 97b12ce1..e9a1df16 100644 --- a/bl32/tsp/tsp.ld.S +++ b/bl32/tsp/tsp.ld.S @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <lib/xlat_tables/xlat_tables_defs.h> #include <platform_def.h> -#include <xlat_tables_defs.h> OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) diff --git a/bl32/tsp/tsp_interrupt.c b/bl32/tsp/tsp_interrupt.c index f5013381..4e500b3c 100644 --- a/bl32/tsp/tsp_interrupt.c +++ b/bl32/tsp/tsp_interrupt.c @@ -4,12 +4,15 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch_helpers.h> #include <assert.h> -#include <debug.h> -#include <platform.h> + #include <platform_def.h> -#include <tsp.h> + +#include <arch_helpers.h> +#include <bl32/tsp/tsp.h> +#include <common/debug.h> +#include <plat/common/platform.h> + #include "tsp_private.h" /******************************************************************************* diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c index e41b51eb..24efa618 100644 --- a/bl32/tsp/tsp_main.c +++ b/bl32/tsp/tsp_main.c @@ -4,14 +4,16 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch_helpers.h> -#include <bl_common.h> -#include <debug.h> -#include <platform.h> #include <platform_def.h> + +#include <arch_helpers.h> +#include <bl32/tsp/tsp.h> +#include <common/bl_common.h> +#include <common/debug.h> +#include <lib/spinlock.h> +#include <plat/common/platform.h> #include <platform_tsp.h> -#include <spinlock.h> -#include <tsp.h> + #include "tsp_private.h" diff --git a/bl32/tsp/tsp_private.h b/bl32/tsp/tsp_private.h index b697fa49..e39f2916 100644 --- a/bl32/tsp/tsp_private.h +++ b/bl32/tsp/tsp_private.h @@ -22,12 +22,13 @@ #ifndef __ASSEMBLY__ -#include <cassert.h> -#include <platform_def.h> /* For CACHE_WRITEBACK_GRANULE */ -#include <spinlock.h> #include <stdint.h> -#include <tsp.h> +#include <platform_def.h> /* For CACHE_WRITEBACK_GRANULE */ + +#include <bl32/tsp/tsp.h> +#include <lib/cassert.h> +#include <lib/spinlock.h> typedef struct work_statistics { /* Number of s-el1 interrupts on this cpu */ diff --git a/bl32/tsp/tsp_timer.c b/bl32/tsp/tsp_timer.c index ebe7f0d3..35928634 100644 --- a/bl32/tsp/tsp_timer.c +++ b/bl32/tsp/tsp_timer.c @@ -3,9 +3,12 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch_helpers.h> + #include <assert.h> -#include <platform.h> + +#include <arch_helpers.h> +#include <plat/common/platform.h> + #include "tsp_private.h" /******************************************************************************* |