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 /lib/extensions | |
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 'lib/extensions')
-rw-r--r-- | lib/extensions/amu/aarch32/amu.c | 11 | ||||
-rw-r--r-- | lib/extensions/amu/aarch64/amu.c | 13 | ||||
-rw-r--r-- | lib/extensions/mpam/mpam.c | 5 | ||||
-rw-r--r-- | lib/extensions/ras/ras_common.c | 15 | ||||
-rw-r--r-- | lib/extensions/ras/std_err_record.c | 5 | ||||
-rw-r--r-- | lib/extensions/spe/spe.c | 7 | ||||
-rw-r--r-- | lib/extensions/sve/sve.c | 7 |
7 files changed, 35 insertions, 28 deletions
diff --git a/lib/extensions/amu/aarch32/amu.c b/lib/extensions/amu/aarch32/amu.c index 585d908f..82d2e186 100644 --- a/lib/extensions/amu/aarch32/amu.c +++ b/lib/extensions/amu/aarch32/amu.c @@ -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 diff --git a/lib/extensions/amu/aarch64/amu.c b/lib/extensions/amu/aarch64/amu.c index 1564e840..85f7007a 100644 --- a/lib/extensions/amu/aarch64/amu.c +++ b/lib/extensions/amu/aarch64/amu.c @@ -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 { diff --git a/lib/extensions/mpam/mpam.c b/lib/extensions/mpam/mpam.c index d57bb470..01667079 100644 --- a/lib/extensions/mpam/mpam.c +++ b/lib/extensions/mpam/mpam.c @@ -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) { diff --git a/lib/extensions/ras/ras_common.c b/lib/extensions/ras/ras_common.c index f39e5f5f..be8becee 100644 --- a/lib/extensions/ras/ras_common.c +++ b/lib/extensions/ras/ras_common.c @@ -4,15 +4,16 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch_helpers.h> -#include <debug.h> -#include <ea_handle.h> -#include <ehf.h> -#include <platform.h> -#include <ras.h> -#include <ras_arch.h> #include <stdbool.h> +#include <arch_helpers.h> +#include <bl31/ea_handle.h> +#include <bl31/ehf.h> +#include <common/debug.h> +#include <lib/extensions/ras.h> +#include <lib/extensions/ras_arch.h> +#include <plat/common/platform.h> + #ifndef PLAT_RAS_PRI # error Platform must define RAS priority value #endif diff --git a/lib/extensions/ras/std_err_record.c b/lib/extensions/ras/std_err_record.c index 9fdfd6b6..c03fbbe4 100644 --- a/lib/extensions/ras/std_err_record.c +++ b/lib/extensions/ras/std_err_record.c @@ -3,8 +3,9 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -#include <ras_arch.h> -#include <utils_def.h> + +#include <lib/extensions/ras_arch.h> +#include <lib/utils_def.h> /* * Probe for error in memory-mapped registers containing error records diff --git a/lib/extensions/spe/spe.c b/lib/extensions/spe/spe.c index e5df015b..78876c66 100644 --- a/lib/extensions/spe/spe.c +++ b/lib/extensions/spe/spe.c @@ -4,11 +4,12 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <stdbool.h> + #include <arch.h> #include <arch_helpers.h> -#include <pubsub.h> -#include <spe.h> -#include <stdbool.h> +#include <lib/el3_runtime/pubsub.h> +#include <lib/extensions/spe.h> static inline void psb_csync(void) { diff --git a/lib/extensions/sve/sve.c b/lib/extensions/sve/sve.c index e031bf61..fa4ac775 100644 --- a/lib/extensions/sve/sve.c +++ b/lib/extensions/sve/sve.c @@ -4,11 +4,12 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <stdbool.h> + #include <arch.h> #include <arch_helpers.h> -#include <pubsub.h> -#include <stdbool.h> -#include <sve.h> +#include <lib/el3_runtime/pubsub.h> +#include <lib/extensions/sve.h> bool sve_supported(void) { |