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
......@@ -5,7 +5,7 @@
*/
#include <arch.h>
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <cortex_a73.h>
#include <cpu_macros.S>
#include <plat_macros.S>
......
......@@ -6,7 +6,7 @@
#include <cortex_a75.h>
#include <cpuamu.h>
#include <pubsub_events.h>
#include <lib/el3_runtime/pubsub_events.h>
static void *cortex_a75_context_save(const void *arg)
{
......
......@@ -5,13 +5,13 @@
*/
#include <arch.h>
#include <arm_arch_svc.h>
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <context.h>
#include <cortex_a76.h>
#include <cpu_macros.S>
#include <plat_macros.S>
#include <services/arm_arch_svc.h>
#if !DYNAMIC_WORKAROUND_CVE_2018_3639
#error Cortex A76 requires DYNAMIC_WORKAROUND_CVE_2018_3639=1
......
......@@ -6,7 +6,7 @@
#include <cortex_ares.h>
#include <cpuamu.h>
#include <pubsub_events.h>
#include <lib/el3_runtime/pubsub_events.h>
static void *cortex_ares_context_save(const void *arg)
{
......
......@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <cortex_deimos.h>
#include <cpu_macros.S>
#include <plat_macros.S>
......
......@@ -5,10 +5,10 @@
*/
#include <arch.h>
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <cortex_helios.h>
#include <cpu_macros.S>
#include <debug.h>
#include <plat_macros.S>
func cortex_helios_cpu_pwr_dwn
......
......@@ -7,10 +7,10 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
#include <cpu_data.h>
#include <common/debug.h>
#include <cpu_macros.S>
#include <debug.h>
#include <errata_report.h>
#include <lib/cpus/errata_report.h>
#include <lib/el3_runtime/cpu_data.h>
/* Reset fn is needed in BL at reset vector */
#if defined(IMAGE_BL1) || defined(IMAGE_BL31) || (defined(IMAGE_BL2) && BL2_AT_EL3)
......
......@@ -5,8 +5,8 @@
*/
#include <cpuamu.h>
#include <platform.h>
#include <pubsub_events.h>
#include <lib/el3_runtime/pubsub_events.h>
#include <plat/common/platform.h>
#define CPUAMU_NR_COUNTERS 5U
......
......@@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <dsu_def.h>
#include <errata_report.h>
#include <lib/cpus/errata_report.h>
/* -----------------------------------------------------------------------
* DSU erratum 936184 check function
......
......@@ -5,9 +5,9 @@
*/
#include <arch.h>
#include <arm_arch_svc.h>
#include <asm_macros.S>
#include <context.h>
#include <services/arm_arch_svc.h>
.globl wa_cve_2017_5715_bpiall_vbar
......
......@@ -5,9 +5,9 @@
*/
#include <arch.h>
#include <arm_arch_svc.h>
#include <asm_macros.S>
#include <context.h>
#include <services/arm_arch_svc.h>
.globl wa_cve_2017_5715_mmu_vbar
......
......@@ -6,14 +6,15 @@
/* Runtime firmware routines to report errata status for the current CPU. */
#include <arch_helpers.h>
#include <assert.h>
#include <cpu_data.h>
#include <debug.h>
#include <errata_report.h>
#include <spinlock.h>
#include <stdbool.h>
#include <utils.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/cpus/errata_report.h>
#include <lib/el3_runtime/cpu_data.h>
#include <lib/spinlock.h>
#include <lib/utils.h>
#ifdef IMAGE_BL1
# define BL_STRING "BL1"
......
......@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <amu.h>
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <common/bl_common.h>
#include <context.h>
#include <context_mgmt.h>
#include <platform.h>
#include <platform_def.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/extensions/amu.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <smccc_helpers.h>
#include <stdbool.h>
#include <string.h>
#include <utils.h>
/*******************************************************************************
* Context management library initialisation routine. This library is used by
......
......@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
#include <cpu_data.h>
#include <lib/el3_runtime/cpu_data.h>
.globl _cpu_data
.globl _cpu_data_by_index
......
......@@ -4,24 +4,26 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <amu.h>
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <bl31/interrupt_mgmt.h>
#include <common/bl_common.h>
#include <context.h>
#include <context_mgmt.h>
#include <interrupt_mgmt.h>
#include <mpam.h>
#include <platform.h>
#include <platform_def.h>
#include <pubsub_events.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/el3_runtime/pubsub_events.h>
#include <lib/extensions/amu.h>
#include <lib/extensions/mpam.h>
#include <lib/extensions/spe.h>
#include <lib/extensions/sve.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <smccc_helpers.h>
#include <spe.h>
#include <stdbool.h>
#include <string.h>
#include <sve.h>
#include <utils.h>
/*******************************************************************************
......
......@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
#include <cpu_data.h>
#include <lib/el3_runtime/cpu_data.h>
.globl init_cpu_data_ptr
.globl _cpu_data_by_index
......
......@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <cassert.h>
#include <cpu_data.h>
#include <platform_def.h>
#include <lib/cassert.h>
#include <lib/el3_runtime/cpu_data.h>
/* The per_cpu_ptr_cache_t space allocation */
cpu_data_t percpu_data[PLATFORM_CORE_COUNT];
......@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <amu.h>
#include <amu_private.h>
#include <stdbool.h>
#include <arch.h>
#include <arch_helpers.h>
#include <platform.h>
#include <pubsub_events.h>
#include <stdbool.h>
#include <lib/el3_runtime/pubsub_events.h>
#include <lib/extensions/amu.h>
#include <lib/extensions/amu_private.h>
#include <plat/common/platform.h>
#define AMU_GROUP0_NR_COUNTERS 4
......
......@@ -4,15 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <amu.h>
#include <amu_private.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <platform.h>
#include <pubsub_events.h>
#include <stdbool.h>
#include <arch.h>
#include <arch_helpers.h>
#include <lib/el3_runtime/pubsub_events.h>
#include <lib/extensions/amu.h>
#include <lib/extensions/amu_private.h>
#include <plat/common/platform.h>
#define AMU_GROUP0_NR_COUNTERS 4
struct amu_ctx {
......
......@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdbool.h>
#include <arch.h>
#include <arch_helpers.h>
#include <mpam.h>
#include <stdbool.h>
#include <lib/extensions/mpam.h>
bool mpam_supported(void)
{
......
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