summaryrefslogtreecommitdiff
path: root/services/spd
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 /services/spd
parentf5478dedf9e096d9539362b38ceb096b940ba3e2 (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 'services/spd')
-rw-r--r--services/spd/opteed/opteed_common.c10
-rw-r--r--services/spd/opteed/opteed_main.c19
-rw-r--r--services/spd/opteed/opteed_pm.c12
-rw-r--r--services/spd/opteed/opteed_private.h10
-rw-r--r--services/spd/opteed/teesmc_opteed_macros.h2
-rw-r--r--services/spd/tlkd/tlkd_common.c8
-rw-r--r--services/spd/tlkd/tlkd_main.c16
-rw-r--r--services/spd/tlkd/tlkd_pm.c11
-rw-r--r--services/spd/tlkd/tlkd_private.h10
-rw-r--r--services/spd/trusty/generic-arm64-smcall.c5
-rw-r--r--services/spd/trusty/trusty.c19
-rw-r--r--services/spd/tspd/tspd_common.c14
-rw-r--r--services/spd/tspd/tspd_main.c22
-rw-r--r--services/spd/tspd/tspd_pm.c14
-rw-r--r--services/spd/tspd/tspd_private.h10
15 files changed, 103 insertions, 79 deletions
diff --git a/services/spd/opteed/opteed_common.c b/services/spd/opteed/opteed_common.c
index e5e2be77..9aa19c5b 100644
--- a/services/spd/opteed/opteed_common.c
+++ b/services/spd/opteed/opteed_common.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
#include <string.h>
-#include <utils.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/utils.h>
+
#include "opteed_private.h"
/*******************************************************************************
diff --git a/services/spd/opteed/opteed_main.c b/services/spd/opteed/opteed_main.c
index 59d6ed29..160a693b 100644
--- a/services/spd/opteed/opteed_main.c
+++ b/services/spd/opteed/opteed_main.c
@@ -14,22 +14,23 @@
* handle the request locally or delegate it to the Secure Payload. It is also
* responsible for initialising and maintaining communication with the SP.
******************************************************************************/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl31.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
#include <errno.h>
-#include <platform.h>
-#include <runtime_svc.h>
#include <stddef.h>
-#include <uuid.h>
+
+#include <arch_helpers.h>
+#include <bl31/bl31.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
+#include <tools_share/uuid.h>
+
#include "opteed_private.h"
#include "teesmc_opteed.h"
#include "teesmc_opteed_macros.h"
-
/*******************************************************************************
* Address of the entrypoint vector table in OPTEE. It is
* initialised once on the primary core after a cold boot.
diff --git a/services/spd/opteed/opteed_pm.c b/services/spd/opteed/opteed_pm.c
index b1336517..719eeb74 100644
--- a/services/spd/opteed/opteed_pm.c
+++ b/services/spd/opteed/opteed_pm.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
+
#include "opteed_private.h"
/*******************************************************************************
diff --git a/services/spd/opteed/opteed_private.h b/services/spd/opteed/opteed_private.h
index 1a67fce7..847b9c5c 100644
--- a/services/spd/opteed/opteed_private.h
+++ b/services/spd/opteed/opteed_private.h
@@ -7,11 +7,12 @@
#ifndef OPTEED_PRIVATE_H
#define OPTEED_PRIVATE_H
+#include <platform_def.h>
+
#include <arch.h>
+#include <bl31/interrupt_mgmt.h>
#include <context.h>
-#include <interrupt_mgmt.h>
-#include <platform_def.h>
-#include <psci.h>
+#include <lib/psci/psci.h>
/*******************************************************************************
* OPTEE PM state information e.g. OPTEE is suspended, uninitialised etc
@@ -80,9 +81,10 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
#include <stdint.h>
+#include <lib/cassert.h>
+
typedef uint32_t optee_vector_isn_t;
typedef struct optee_vectors {
diff --git a/services/spd/opteed/teesmc_opteed_macros.h b/services/spd/opteed/teesmc_opteed_macros.h
index 0068dc73..9d8a1697 100644
--- a/services/spd/opteed/teesmc_opteed_macros.h
+++ b/services/spd/opteed/teesmc_opteed_macros.h
@@ -6,7 +6,7 @@
#ifndef TEESMC_OPTEED_MACROS_H
#define TEESMC_OPTEED_MACROS_H
-#include <runtime_svc.h>
+#include <common/runtime_svc.h>
#define TEESMC_OPTEED_RV(func_num) \
((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) | \
diff --git a/services/spd/tlkd/tlkd_common.c b/services/spd/tlkd/tlkd_common.c
index 6fec91bc..2f0194eb 100644
--- a/services/spd/tlkd/tlkd_common.c
+++ b/services/spd/tlkd/tlkd_common.c
@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
#include <string.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <lib/el3_runtime/context_mgmt.h>
+
#include "tlkd_private.h"
#define AT_MASK 3
diff --git a/services/spd/tlkd/tlkd_main.c b/services/spd/tlkd/tlkd_main.c
index cee7ef86..ffe3319e 100644
--- a/services/spd/tlkd/tlkd_main.c
+++ b/services/spd/tlkd/tlkd_main.c
@@ -15,16 +15,18 @@
******************************************************************************/
#include <arch_helpers.h>
#include <assert.h>
-#include <bl31.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
#include <errno.h>
-#include <platform.h>
-#include <runtime_svc.h>
#include <stddef.h>
+
+#include <bl31/bl31.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
+#include <tools_share/uuid.h>
+
#include <tlk.h>
-#include <uuid.h>
#include "tlkd_private.h"
extern const spd_pm_ops_t tlkd_pm_ops;
diff --git a/services/spd/tlkd/tlkd_pm.c b/services/spd/tlkd/tlkd_pm.c
index 2cd2fbbe..de34bf6b 100644
--- a/services/spd/tlkd/tlkd_pm.c
+++ b/services/spd/tlkd/tlkd_pm.c
@@ -4,12 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <psci.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/psci/psci.h>
#include <tlk.h>
#include "tlkd_private.h"
diff --git a/services/spd/tlkd/tlkd_private.h b/services/spd/tlkd/tlkd_private.h
index 525cc3ae..53f9e20c 100644
--- a/services/spd/tlkd/tlkd_private.h
+++ b/services/spd/tlkd/tlkd_private.h
@@ -7,11 +7,12 @@
#ifndef TLKD_PRIVATE_H
#define TLKD_PRIVATE_H
+#include <platform_def.h>
+
#include <arch.h>
+#include <bl31/interrupt_mgmt.h>
#include <context.h>
-#include <interrupt_mgmt.h>
-#include <platform_def.h>
-#include <psci.h>
+#include <lib/psci/psci.h>
/*
* This flag is used by the TLKD to determine if the SP is servicing a yielding
@@ -72,9 +73,10 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
#include <stdint.h>
+#include <lib/cassert.h>
+
/* AArch64 callee saved general purpose register context structure. */
DEFINE_REG_STRUCT(c_rt_regs, TLKD_C_RT_CTX_ENTRIES);
diff --git a/services/spd/trusty/generic-arm64-smcall.c b/services/spd/trusty/generic-arm64-smcall.c
index 6f766c4d..771e2cfb 100644
--- a/services/spd/trusty/generic-arm64-smcall.c
+++ b/services/spd/trusty/generic-arm64-smcall.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <runtime_svc.h>
#include <stdio.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+
#include "generic-arm64-smcall.h"
int trusty_disable_serial_debug;
diff --git a/services/spd/trusty/trusty.c b/services/spd/trusty/trusty.c
index 33358362..b6ebeeba 100644
--- a/services/spd/trusty/trusty.c
+++ b/services/spd/trusty/trusty.c
@@ -4,18 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <assert.h> /* for context_mgmt.h */
-#include <bl31.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
-#include <runtime_svc.h>
+#include <assert.h>
#include <stdbool.h>
#include <string.h>
+#include <arch_helpers.h>
+#include <bl31/bl31.h>
+#include <bl31/interrupt_mgmt.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
+
#include "sm_err.h"
#include "smcall.h"
diff --git a/services/spd/tspd/tspd_common.c b/services/spd/tspd/tspd_common.c
index de54dbe9..063fd01f 100644
--- a/services/spd/tspd/tspd_common.c
+++ b/services/spd/tspd/tspd_common.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
#include <string.h>
-#include <tsp.h>
-#include <utils.h>
+
+#include <arch_helpers.h>
+#include <bl32/tsp/tsp.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/utils.h>
+
#include "tspd_private.h"
/*******************************************************************************
diff --git a/services/spd/tspd/tspd_main.c b/services/spd/tspd/tspd_main.c
index d2acda8d..d2bd43f7 100644
--- a/services/spd/tspd/tspd_main.c
+++ b/services/spd/tspd/tspd_main.c
@@ -14,20 +14,22 @@
* handle the request locally or delegate it to the Secure Payload. It is also
* responsible for initialising and maintaining communication with the SP.
******************************************************************************/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl31.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <ehf.h>
#include <errno.h>
-#include <platform.h>
-#include <runtime_svc.h>
#include <stddef.h>
#include <string.h>
-#include <tsp.h>
-#include <uuid.h>
+
+#include <arch_helpers.h>
+#include <bl31/bl31.h>
+#include <bl31/ehf.h>
+#include <bl32/tsp/tsp.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
+#include <tools_share/uuid.h>
+
#include "tspd_private.h"
/*******************************************************************************
diff --git a/services/spd/tspd/tspd_pm.c b/services/spd/tspd/tspd_pm.c
index 9414c154..b95ee8fb 100644
--- a/services/spd/tspd/tspd_pm.c
+++ b/services/spd/tspd/tspd_pm.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <tsp.h>
+
+#include <arch_helpers.h>
+#include <bl32/tsp/tsp.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <plat/common/platform.h>
+
#include "tspd_private.h"
/*******************************************************************************
diff --git a/services/spd/tspd/tspd_private.h b/services/spd/tspd/tspd_private.h
index e2e333d0..50f3b875 100644
--- a/services/spd/tspd/tspd_private.h
+++ b/services/spd/tspd/tspd_private.h
@@ -7,11 +7,12 @@
#ifndef TSPD_PRIVATE_H
#define TSPD_PRIVATE_H
+#include <platform_def.h>
+
#include <arch.h>
+#include <bl31/interrupt_mgmt.h>
#include <context.h>
-#include <interrupt_mgmt.h>
-#include <platform_def.h>
-#include <psci.h>
+#include <lib/psci/psci.h>
/*******************************************************************************
* Secure Payload PM state information e.g. SP is suspended, uninitialised etc
@@ -127,9 +128,10 @@
#ifndef __ASSEMBLY__
-#include <cassert.h>
#include <stdint.h>
+#include <lib/cassert.h>
+
/*
* The number of arguments to save during a SMC call for TSP.
* Currently only x1 and x2 are used by TSP.