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/psci | |
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/psci')
-rw-r--r-- | lib/psci/aarch32/psci_helpers.S | 2 | ||||
-rw-r--r-- | lib/psci/aarch64/psci_helpers.S | 2 | ||||
-rw-r--r-- | lib/psci/psci_common.c | 16 | ||||
-rw-r--r-- | lib/psci/psci_main.c | 18 | ||||
-rw-r--r-- | lib/psci/psci_mem_protect.c | 4 | ||||
-rw-r--r-- | lib/psci/psci_off.c | 14 | ||||
-rw-r--r-- | lib/psci/psci_on.c | 16 | ||||
-rw-r--r-- | lib/psci/psci_private.h | 13 | ||||
-rw-r--r-- | lib/psci/psci_setup.c | 14 | ||||
-rw-r--r-- | lib/psci/psci_stat.c | 7 | ||||
-rw-r--r-- | lib/psci/psci_suspend.c | 22 | ||||
-rw-r--r-- | lib/psci/psci_system_off.c | 10 |
12 files changed, 79 insertions, 59 deletions
diff --git a/lib/psci/aarch32/psci_helpers.S b/lib/psci/aarch32/psci_helpers.S index 63d7e708..5cc192e6 100644 --- a/lib/psci/aarch32/psci_helpers.S +++ b/lib/psci/aarch32/psci_helpers.S @@ -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 diff --git a/lib/psci/aarch64/psci_helpers.S b/lib/psci/aarch64/psci_helpers.S index 88db1c96..add968a7 100644 --- a/lib/psci/aarch64/psci_helpers.S +++ b/lib/psci/aarch64/psci_helpers.S @@ -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 diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c index 97aeb832..2928c33e 100644 --- a/lib/psci/psci_common.c +++ b/lib/psci/psci_common.c @@ -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" /* diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c index b4a25fb0..5c0e952a 100644 --- a/lib/psci/psci_main.c +++ b/lib/psci/psci_main.c @@ -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" /******************************************************************************* diff --git a/lib/psci/psci_mem_protect.c b/lib/psci/psci_mem_protect.c index 857146b6..481051f9 100644 --- a/lib/psci/psci_mem_protect.c +++ b/lib/psci/psci_mem_protect.c @@ -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) diff --git a/lib/psci/psci_off.c b/lib/psci/psci_off.c index 944f8bff..ac03e059 100644 --- a/lib/psci/psci_off.c +++ b/lib/psci/psci_off.c @@ -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" /****************************************************************************** diff --git a/lib/psci/psci_on.c b/lib/psci/psci_on.c index f38900cf..aa6b324e 100644 --- a/lib/psci/psci_on.c +++ b/lib/psci/psci_on.c @@ -4,15 +4,17 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch.h> -#include <arch_helpers.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 <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" /* diff --git a/lib/psci/psci_private.h b/lib/psci/psci_private.h index 82b951db..68ec7fb6 100644 --- a/lib/psci/psci_private.h +++ b/lib/psci/psci_private.h @@ -7,14 +7,15 @@ #ifndef PSCI_PRIVATE_H #define PSCI_PRIVATE_H +#include <stdbool.h> + #include <arch.h> #include <arch_helpers.h> -#include <bakery_lock.h> -#include <bl_common.h> -#include <cpu_data.h> -#include <psci.h> -#include <spinlock.h> -#include <stdbool.h> +#include <common/bl_common.h> +#include <lib/bakery_lock.h> +#include <lib/el3_runtime/cpu_data.h> +#include <lib/psci/psci.h> +#include <lib/spinlock.h> /* * The PSCI capability which are provided by the generic code but does not diff --git a/lib/psci/psci_setup.c b/lib/psci/psci_setup.c index 6b3081eb..b9467d3e 100644 --- a/lib/psci/psci_setup.c +++ b/lib/psci/psci_setup.c @@ -4,15 +4,17 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <assert.h> +#include <stddef.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 <errata_report.h> -#include <platform.h> -#include <stddef.h> +#include <lib/el3_runtime/context_mgmt.h> +#include <lib/cpus/errata_report.h> +#include <plat/common/platform.h> + #include "psci_private.h" /******************************************************************************* diff --git a/lib/psci/psci_stat.c b/lib/psci/psci_stat.c index 6f6a7d4f..772a1840 100644 --- a/lib/psci/psci_stat.c +++ b/lib/psci/psci_stat.c @@ -5,9 +5,12 @@ */ #include <assert.h> -#include <debug.h> -#include <platform.h> + #include <platform_def.h> + +#include <common/debug.h> +#include <plat/common/platform.h> + #include "psci_private.h" #ifndef PLAT_MAX_PWR_LVL_STATES diff --git a/lib/psci/psci_suspend.c b/lib/psci/psci_suspend.c index e00819de..8a752c1a 100644 --- a/lib/psci/psci_suspend.c +++ b/lib/psci/psci_suspend.c @@ -4,19 +4,21 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <assert.h> +#include <stddef.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 <cpu_data.h> -#include <debug.h> -#include <platform.h> -#include <pmf.h> -#include <pubsub_events.h> -#include <runtime_instr.h> -#include <stddef.h> +#include <lib/el3_runtime/context_mgmt.h> +#include <lib/el3_runtime/cpu_data.h> +#include <lib/el3_runtime/pubsub_events.h> +#include <lib/pmf/pmf.h> +#include <lib/runtime_instr.h> +#include <plat/common/platform.h> + #include "psci_private.h" /******************************************************************************* diff --git a/lib/psci/psci_system_off.c b/lib/psci/psci_system_off.c index 7cac4e93..141d69ef 100644 --- a/lib/psci/psci_system_off.c +++ b/lib/psci/psci_system_off.c @@ -4,12 +4,14 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch_helpers.h> #include <assert.h> -#include <console.h> -#include <debug.h> -#include <platform.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" void __dead2 psci_system_off(void) |