aboutsummaryrefslogtreecommitdiffstats
path: root/lib/psci
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-12-14 00:18:21 +0000
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2019-01-04 10:43:17 +0000
commit09d40e0e08283a249e7dce0e106c07c5141f9b7e (patch)
tree46e7af7b5be2738948b359b2a07078e4cf1bbec1 /lib/psci
parentf5478dedf9e096d9539362b38ceb096b940ba3e2 (diff)
downloadplatform_external_arm-trusted-firmware-09d40e0e08283a249e7dce0e106c07c5141f9b7e.tar.gz
platform_external_arm-trusted-firmware-09d40e0e08283a249e7dce0e106c07c5141f9b7e.tar.bz2
platform_external_arm-trusted-firmware-09d40e0e08283a249e7dce0e106c07c5141f9b7e.zip
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.S2
-rw-r--r--lib/psci/aarch64/psci_helpers.S2
-rw-r--r--lib/psci/psci_common.c16
-rw-r--r--lib/psci/psci_main.c18
-rw-r--r--lib/psci/psci_mem_protect.c4
-rw-r--r--lib/psci/psci_off.c14
-rw-r--r--lib/psci/psci_on.c16
-rw-r--r--lib/psci/psci_private.h13
-rw-r--r--lib/psci/psci_setup.c14
-rw-r--r--lib/psci/psci_stat.c7
-rw-r--r--lib/psci/psci_suspend.c22
-rw-r--r--lib/psci/psci_system_off.c10
12 files changed, 79 insertions, 59 deletions
diff --git a/lib/psci/aarch32/psci_helpers.S b/lib/psci/aarch32/psci_helpers.S
index 63d7e7088..5cc192e66 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 88db1c968..add968a7b 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 97aeb8323..2928c33e5 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 b4a25fb0a..5c0e952a9 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 857146b67..481051f95 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 944f8bff9..ac03e0596 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 f38900cf5..aa6b324ed 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 82b951db6..68ec7fb66 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 6b3081eb5..b9467d3e0 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 6f6a7d4f8..772a1840a 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 e00819de7..8a752c1a1 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 7cac4e937..141d69ef2 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)