Commit 09d40e0e authored by Antonio Nino Diaz's avatar Antonio Nino Diaz
Browse files

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: e0ea0928 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3 ("drivers: add tzc380 support").

This problem was introduced in commit 4ecca339

 ("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: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
parent f5478ded
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <context_mgmt.h>
#include <debug.h>
#include <platform.h>
#include <pubsub_events.h>
#include <stddef.h> #include <stddef.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/el3_runtime/pubsub_events.h>
#include <plat/common/platform.h>
#include "psci_private.h" #include "psci_private.h"
/* /*
......
...@@ -7,14 +7,15 @@ ...@@ -7,14 +7,15 @@
#ifndef PSCI_PRIVATE_H #ifndef PSCI_PRIVATE_H
#define PSCI_PRIVATE_H #define PSCI_PRIVATE_H
#include <stdbool.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <bakery_lock.h> #include <common/bl_common.h>
#include <bl_common.h> #include <lib/bakery_lock.h>
#include <cpu_data.h> #include <lib/el3_runtime/cpu_data.h>
#include <psci.h> #include <lib/psci/psci.h>
#include <spinlock.h> #include <lib/spinlock.h>
#include <stdbool.h>
/* /*
* The PSCI capability which are provided by the generic code but does not * The PSCI capability which are provided by the generic code but does not
......
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <stddef.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <assert.h> #include <common/bl_common.h>
#include <bl_common.h>
#include <context.h> #include <context.h>
#include <context_mgmt.h> #include <lib/el3_runtime/context_mgmt.h>
#include <errata_report.h> #include <lib/cpus/errata_report.h>
#include <platform.h> #include <plat/common/platform.h>
#include <stddef.h>
#include "psci_private.h" #include "psci_private.h"
/******************************************************************************* /*******************************************************************************
......
...@@ -5,9 +5,12 @@ ...@@ -5,9 +5,12 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/debug.h>
#include <plat/common/platform.h>
#include "psci_private.h" #include "psci_private.h"
#ifndef PLAT_MAX_PWR_LVL_STATES #ifndef PLAT_MAX_PWR_LVL_STATES
......
...@@ -4,19 +4,21 @@ ...@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <stddef.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <assert.h> #include <common/bl_common.h>
#include <bl_common.h> #include <common/debug.h>
#include <context.h> #include <context.h>
#include <context_mgmt.h> #include <lib/el3_runtime/context_mgmt.h>
#include <cpu_data.h> #include <lib/el3_runtime/cpu_data.h>
#include <debug.h> #include <lib/el3_runtime/pubsub_events.h>
#include <platform.h> #include <lib/pmf/pmf.h>
#include <pmf.h> #include <lib/runtime_instr.h>
#include <pubsub_events.h> #include <plat/common/platform.h>
#include <runtime_instr.h>
#include <stddef.h>
#include "psci_private.h" #include "psci_private.h"
/******************************************************************************* /*******************************************************************************
......
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <console.h>
#include <debug.h>
#include <platform.h>
#include <stddef.h> #include <stddef.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/console.h>
#include <plat/common/platform.h>
#include "psci_private.h" #include "psci_private.h"
void __dead2 psci_system_off(void) void __dead2 psci_system_off(void)
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <platform_def.h> #include <platform_def.h>
#include <xlat_tables_defs.h>
MEMORY { MEMORY {
ROM (rx): ORIGIN = ROMLIB_RO_BASE, LENGTH = ROMLIB_RO_LIMIT - ROMLIB_RO_BASE ROM (rx): ORIGIN = ROMLIB_RO_BASE, LENGTH = ROMLIB_RO_LIMIT - ROMLIB_RO_BASE
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <semihosting.h>
#include <string.h> #include <string.h>
#include <lib/semihosting.h>
#ifndef SEMIHOSTING_SUPPORTED #ifndef SEMIHOSTING_SUPPORTED
#define SEMIHOSTING_SUPPORTED 1 #define SEMIHOSTING_SUPPORTED 1
#endif #endif
......
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <platform.h>
#include <stdint.h> #include <stdint.h>
#include <common/debug.h>
#include <plat/common/platform.h>
/* /*
* Canary value used by the compiler runtime checks to detect stack corruption. * Canary value used by the compiler runtime checks to detect stack corruption.
* *
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
*/ */
#include <assert.h> #include <assert.h>
#include <utils.h>
#include <lib/utils.h>
/* /*
* All the regions defined in mem_region_t must have the following properties * All the regions defined in mem_region_t must have the following properties
......
...@@ -4,13 +4,16 @@ ...@@ -4,13 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <platform_def.h> #include <platform_def.h>
#include <utils.h>
#include <xlat_tables_arch.h> #include <arch.h>
#include <xlat_tables.h> #include <arch_helpers.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables_arch.h>
#include <lib/xlat_tables/xlat_tables.h>
#include "../xlat_tables_private.h" #include "../xlat_tables_private.h"
#if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING) #if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING)
......
...@@ -4,16 +4,19 @@ ...@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <common_def.h>
#include <platform_def.h>
#include <stdint.h> #include <stdint.h>
#include <utils.h>
#include <xlat_tables.h> #include <platform_def.h>
#include <xlat_tables_arch.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <lib/xlat_tables/xlat_tables_arch.h>
#include <plat/common/common_def.h>
#include "../xlat_tables_private.h" #include "../xlat_tables_private.h"
#define XLAT_TABLE_LEVEL_BASE \ #define XLAT_TABLE_LEVEL_BASE \
......
...@@ -4,18 +4,21 @@ ...@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <cassert.h>
#include <common_def.h>
#include <debug.h>
#include <platform_def.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <utils.h>
#include <xlat_tables.h> #include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/cassert.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/common_def.h>
#include "xlat_tables_private.h" #include "xlat_tables_private.h"
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE #if LOG_LEVEL >= LOG_LEVEL_VERBOSE
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
#ifndef XLAT_TABLES_PRIVATE_H #ifndef XLAT_TABLES_PRIVATE_H
#define XLAT_TABLES_PRIVATE_H #define XLAT_TABLES_PRIVATE_H
#include <cassert.h>
#include <platform_def.h> #include <platform_def.h>
#include <xlat_tables_arch.h>
#include <lib/cassert.h>
#include <lib/xlat_tables/xlat_tables_arch.h>
#if HW_ASSISTED_COHERENCY #if HW_ASSISTED_COHERENCY
#error xlat tables v2 must be used with HW_ASSISTED_COHERENCY #error xlat tables v2 must be used with HW_ASSISTED_COHERENCY
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <asm_macros.S> #include <asm_macros.S>
#include <assert_macros.S> #include <assert_macros.S>
#include <xlat_tables_v2.h> #include <lib/xlat_tables/xlat_tables_v2.h>
.global enable_mmu_direct_svc_mon .global enable_mmu_direct_svc_mon
.global enable_mmu_direct_hyp .global enable_mmu_direct_hyp
......
...@@ -4,14 +4,17 @@ ...@@ -4,14 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <cassert.h>
#include <platform_def.h>
#include <stdbool.h> #include <stdbool.h>
#include <utils_def.h>
#include <xlat_tables_v2.h> #include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <lib/cassert.h>
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include "../xlat_tables_private.h" #include "../xlat_tables_private.h"
#if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING) #if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <asm_macros.S> #include <asm_macros.S>
#include <assert_macros.S> #include <assert_macros.S>
#include <xlat_tables_v2.h> #include <lib/xlat_tables/xlat_tables_v2.h>
.global enable_mmu_direct_el1 .global enable_mmu_direct_el1
.global enable_mmu_direct_el2 .global enable_mmu_direct_el2
......
...@@ -4,14 +4,16 @@ ...@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <cassert.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <utils_def.h>
#include <xlat_tables_v2.h> #include <arch.h>
#include <arch_helpers.h>
#include <lib/cassert.h>
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include "../xlat_tables_private.h" #include "../xlat_tables_private.h"
/* /*
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <platform_def.h> #include <platform_def.h>
#include <xlat_tables_defs.h>
#include <xlat_tables_v2.h> #include <common/debug.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h" #include "xlat_tables_private.h"
......
...@@ -4,17 +4,19 @@ ...@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <platform_def.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <utils_def.h>
#include <xlat_tables_defs.h> #include <platform_def.h>
#include <xlat_tables_v2.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h" #include "xlat_tables_private.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment