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 /include/lib/el3_runtime | |
parent | f5478dedf9e096d9539362b38ceb096b940ba3e2 (diff) | |
download | trusted-firmware-a-09d40e0e08283a249e7dce0e106c07c5141f9b7e.tar.gz |
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 'include/lib/el3_runtime')
-rw-r--r-- | include/lib/el3_runtime/aarch32/context.h | 5 | ||||
-rw-r--r-- | include/lib/el3_runtime/aarch64/context.h | 8 | ||||
-rw-r--r-- | include/lib/el3_runtime/context_mgmt.h | 3 | ||||
-rw-r--r-- | include/lib/el3_runtime/cpu_data.h | 7 | ||||
-rw-r--r-- | include/lib/el3_runtime/pubsub.h | 3 | ||||
-rw-r--r-- | include/lib/el3_runtime/pubsub_events.h | 2 |
6 files changed, 17 insertions, 11 deletions
diff --git a/include/lib/el3_runtime/aarch32/context.h b/include/lib/el3_runtime/aarch32/context.h index 1ea19ca7c5..86ff53a673 100644 --- a/include/lib/el3_runtime/aarch32/context.h +++ b/include/lib/el3_runtime/aarch32/context.h @@ -7,7 +7,7 @@ #ifndef CONTEXT_H #define CONTEXT_H -#include <utils_def.h> +#include <lib/utils_def.h> /******************************************************************************* * Constants that allow assembler code to access members of and the 'regs' @@ -26,9 +26,10 @@ #ifndef __ASSEMBLY__ -#include <cassert.h> #include <stdint.h> +#include <lib/cassert.h> + /* * Common constants to help define the 'cpu_context' structure and its * members below. diff --git a/include/lib/el3_runtime/aarch64/context.h b/include/lib/el3_runtime/aarch64/context.h index 8c5f4c68d7..70c50aae27 100644 --- a/include/lib/el3_runtime/aarch64/context.h +++ b/include/lib/el3_runtime/aarch64/context.h @@ -7,7 +7,7 @@ #ifndef CONTEXT_H #define CONTEXT_H -#include <utils_def.h> +#include <lib/utils_def.h> /******************************************************************************* * Constants that allow assembler code to access members of and the 'gp_regs' @@ -180,10 +180,12 @@ #ifndef __ASSEMBLY__ -#include <cassert.h> -#include <platform_def.h> /* for CACHE_WRITEBACK_GRANULE */ #include <stdint.h> +#include <platform_def.h> /* for CACHE_WRITEBACK_GRANULE */ + +#include <lib/cassert.h> + /* * Common constants to help define the 'cpu_context' structure and its * members below. diff --git a/include/lib/el3_runtime/context_mgmt.h b/include/lib/el3_runtime/context_mgmt.h index 149ac3ffd1..f23f9cd44d 100644 --- a/include/lib/el3_runtime/context_mgmt.h +++ b/include/lib/el3_runtime/context_mgmt.h @@ -7,11 +7,12 @@ #ifndef CONTEXT_MGMT_H #define CONTEXT_MGMT_H -#include <arch.h> #include <assert.h> #include <context.h> #include <stdint.h> +#include <arch.h> + /******************************************************************************* * Forward declarations ******************************************************************************/ diff --git a/include/lib/el3_runtime/cpu_data.h b/include/lib/el3_runtime/cpu_data.h index 561f8beedb..9e1d7f16c7 100644 --- a/include/lib/el3_runtime/cpu_data.h +++ b/include/lib/el3_runtime/cpu_data.h @@ -7,9 +7,10 @@ #ifndef CPU_DATA_H #define CPU_DATA_H -#include <ehf.h> #include <platform_def.h> /* CACHE_WRITEBACK_GRANULE required */ +#include <bl31/ehf.h> + #ifdef AARCH32 #if CRASH_REPORTING @@ -51,9 +52,9 @@ #ifndef __ASSEMBLY__ #include <arch_helpers.h> -#include <cassert.h> +#include <lib/cassert.h> +#include <lib/psci/psci.h> #include <platform_def.h> -#include <psci.h> #include <stdint.h> /* Offsets for the cpu_data structure */ diff --git a/include/lib/el3_runtime/pubsub.h b/include/lib/el3_runtime/pubsub.h index 930952ff82..eb91286564 100644 --- a/include/lib/el3_runtime/pubsub.h +++ b/include/lib/el3_runtime/pubsub.h @@ -30,11 +30,12 @@ /* For the compiler ... */ -#include <arch_helpers.h> #include <assert.h> #include <cdefs.h> #include <stddef.h> +#include <arch_helpers.h> + #define __pubsub_section(event) __section("__pubsub_" #event) /* diff --git a/include/lib/el3_runtime/pubsub_events.h b/include/lib/el3_runtime/pubsub_events.h index 64b3f630c9..8e4a87afd4 100644 --- a/include/lib/el3_runtime/pubsub_events.h +++ b/include/lib/el3_runtime/pubsub_events.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <pubsub.h> +#include <lib/el3_runtime/pubsub.h> /* * This file defines a list of pubsub events, declared using |