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,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
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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)
{
......
......@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
#include <stdlib.h>
#include <common/debug.h>
void abort(void)
{
ERROR("ABORT\n");
......
......@@ -6,11 +6,12 @@
#include <assert.h>
#include <cdefs.h>
#include <console.h>
#include <debug.h>
#include <platform.h>
#include <stdio.h>
#include <common/debug.h>
#include <drivers/console.h>
#include <plat/common/platform.h>
/*
* Only print the output if PLAT_LOG_LEVEL_ASSERT is higher or equal to
* LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1.
......
......@@ -3,12 +3,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <debug.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <common/debug.h>
#define get_num_va_args(_args, _lcount) \
(((_lcount) > 1) ? va_arg(_args, long long int) : \
(((_lcount) == 1) ? va_arg(_args, long int) : \
......
......@@ -5,7 +5,8 @@
*/
#include <stdio.h>
#include <console.h>
#include <drivers/console.h>
int putchar(int c)
{
......
......@@ -5,10 +5,11 @@
*/
#include <assert.h>
#include <debug.h>
#include <platform.h>
#include <stdarg.h>
#include <common/debug.h>
#include <plat/common/platform.h>
static void string_print(char **s, size_t n, size_t *chars_printed,
const char *str)
{
......
......@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <bakery_lock.h>
#include <cpu_data.h>
#include <platform.h>
#include <string.h>
#include <arch_helpers.h>
#include <lib/bakery_lock.h>
#include <lib/el3_runtime/cpu_data.h>
#include <plat/common/platform.h>
/*
* Functions in this file implement Bakery Algorithm for mutual exclusion with the
* bakery lock data structures in coherent memory.
......
......@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <bakery_lock.h>
#include <cpu_data.h>
#include <platform.h>
#include <string.h>
#include <utils_def.h>
#include <arch_helpers.h>
#include <lib/bakery_lock.h>
#include <lib/el3_runtime/cpu_data.h>
#include <lib/utils_def.h>
#include <plat/common/platform.h>
/*
* Functions in this file implement Bakery Algorithm for mutual exclusion with the
......
......@@ -4,12 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <desc_image_load.h>
#include <errno.h>
#include <optee_utils.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <common/desc_image_load.h>
#include <lib/optee_utils.h>
/*
* load_addr_hi and load_addr_lo: image load address.
......
......@@ -3,15 +3,17 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <errno.h>
#include <platform.h>
#include <pmf.h>
#include <string.h>
#include <utils_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/pmf/pmf.h>
#include <lib/utils_def.h>
#include <plat/common/platform.h>
/*******************************************************************************
* The 'pmf_svc_descs' array holds the PMF service descriptors exported by
......
......@@ -3,10 +3,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <debug.h>
#include <platform.h>
#include <pmf.h>
#include <common/debug.h>
#include <lib/pmf/pmf.h>
#include <plat/common/platform.h>
#include <smccc_helpers.h>
/*
......
......@@ -5,8 +5,8 @@
*/
#include <asm_macros.S>
#include <lib/psci/psci.h>
#include <platform_def.h>
#include <psci.h>
.globl psci_do_pwrdown_cache_maintenance
.globl psci_do_pwrup_cache_maintenance
......
......@@ -6,8 +6,8 @@
#include <asm_macros.S>
#include <assert_macros.S>
#include <lib/psci/psci.h>
#include <platform_def.h>
#include <psci.h>
.globl psci_do_pwrdown_cache_maintenance
.globl psci_do_pwrup_cache_maintenance
......
......@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <string.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <context.h>
#include <context_mgmt.h>
#include <debug.h>
#include <platform.h>
#include <string.h>
#include <utils.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include "psci_private.h"
/*
......
......@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <arch_helpers.h>
#include <arm_arch_svc.h>
#include <assert.h>
#include <debug.h>
#include <platform.h>
#include <pmf.h>
#include <runtime_instr.h>
#include <smccc.h>
#include <string.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/pmf/pmf.h>
#include <lib/runtime_instr.h>
#include <lib/smccc.h>
#include <plat/common/platform.h>
#include <services/arm_arch_svc.h>
#include "psci_private.h"
/*******************************************************************************
......
......@@ -6,7 +6,9 @@
#include <assert.h>
#include <limits.h>
#include <utils.h>
#include <lib/utils.h>
#include "psci_private.h"
u_register_t psci_mem_protect(unsigned int enable)
......
......@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <platform.h>
#include <pmf.h>
#include <runtime_instr.h>
#include <string.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/pmf/pmf.h>
#include <lib/runtime_instr.h>
#include <plat/common/platform.h>
#include "psci_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