summaryrefslogtreecommitdiff
path: root/services
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
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')
-rw-r--r--services/arm_arch_svc/arm_arch_svc_setup.c14
-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
-rw-r--r--services/std_svc/sdei/sdei_event.c4
-rw-r--r--services/std_svc/sdei/sdei_intr_mgmt.c18
-rw-r--r--services/std_svc/sdei/sdei_main.c26
-rw-r--r--services/std_svc/sdei/sdei_private.h21
-rw-r--r--services/std_svc/sdei/sdei_state.c4
-rw-r--r--services/std_svc/spm/aarch64/spm_shim_exceptions.S2
-rw-r--r--services/std_svc/spm/spci.c17
-rw-r--r--services/std_svc/spm/spm_buffers.c4
-rw-r--r--services/std_svc/spm/spm_main.c29
-rw-r--r--services/std_svc/spm/spm_private.h7
-rw-r--r--services/std_svc/spm/spm_setup.c20
-rw-r--r--services/std_svc/spm/spm_shim_private.h3
-rw-r--r--services/std_svc/spm/spm_xlat.c16
-rw-r--r--services/std_svc/spm/sprt.c15
-rw-r--r--services/std_svc/spm_deprecated/aarch64/spm_shim_exceptions.S2
-rw-r--r--services/std_svc/spm_deprecated/spm_main.c27
-rw-r--r--services/std_svc/spm_deprecated/spm_private.h5
-rw-r--r--services/std_svc/spm_deprecated/spm_setup.c17
-rw-r--r--services/std_svc/spm_deprecated/spm_shim_private.h3
-rw-r--r--services/std_svc/spm_deprecated/spm_xlat.c8
-rw-r--r--services/std_svc/std_svc_setup.c23
37 files changed, 257 insertions, 210 deletions
diff --git a/services/arm_arch_svc/arm_arch_svc_setup.c b/services/arm_arch_svc/arm_arch_svc_setup.c
index 3a5299fd..dfbe02cd 100644
--- a/services/arm_arch_svc/arm_arch_svc_setup.c
+++ b/services/arm_arch_svc/arm_arch_svc_setup.c
@@ -4,14 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_arch_svc.h>
-#include <debug.h>
-#include <errata_report.h>
-#include <runtime_svc.h>
-#include <smccc.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/cpus/errata_report.h>
+#include <lib/cpus/wa_cve_2017_5715.h>
+#include <lib/cpus/wa_cve_2018_3639.h>
+#include <lib/smccc.h>
+#include <services/arm_arch_svc.h>
#include <smccc_helpers.h>
-#include <wa_cve_2017_5715.h>
-#include <wa_cve_2018_3639.h>
static int32_t smccc_version(void)
{
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.
diff --git a/services/std_svc/sdei/sdei_event.c b/services/std_svc/sdei/sdei_event.c
index ec69b9d2..0b608e1b 100644
--- a/services/std_svc/sdei/sdei_event.c
+++ b/services/std_svc/sdei/sdei_event.c
@@ -5,7 +5,9 @@
*/
#include <assert.h>
-#include <utils.h>
+
+#include <lib/utils.h>
+
#include "sdei_private.h"
#define MAP_OFF(_map, _mapping) ((_map) - (_mapping)->map)
diff --git a/services/std_svc/sdei/sdei_intr_mgmt.c b/services/std_svc/sdei/sdei_intr_mgmt.c
index fa778c04..b8799cd4 100644
--- a/services/std_svc/sdei/sdei_intr_mgmt.c
+++ b/services/std_svc/sdei/sdei_intr_mgmt.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <cassert.h>
-#include <debug.h>
-#include <ehf.h>
-#include <interrupt_mgmt.h>
-#include <runtime_svc.h>
-#include <sdei.h>
#include <string.h>
+
+#include <arch_helpers.h>
+#include <bl31/ehf.h>
+#include <bl31/interrupt_mgmt.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/cassert.h>
+#include <services/sdei.h>
+
#include "sdei_private.h"
/* x0-x17 GPREGS context */
diff --git a/services/std_svc/sdei/sdei_main.c b/services/std_svc/sdei/sdei_main.c
index 990d0287..04241776 100644
--- a/services/std_svc/sdei/sdei_main.c
+++ b/services/std_svc/sdei/sdei_main.c
@@ -6,20 +6,22 @@
#include <arch_helpers.h>
#include <assert.h>
-#include <bl31.h>
-#include <bl_common.h>
-#include <cassert.h>
-#include <context.h>
-#include <debug.h>
-#include <ehf.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
-#include <pubsub.h>
-#include <runtime_svc.h>
-#include <sdei.h>
#include <stddef.h>
#include <string.h>
-#include <utils.h>
+
+#include <bl31/bl31.h>
+#include <bl31/ehf.h>
+#include <bl31/interrupt_mgmt.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <context.h>
+#include <lib/cassert.h>
+#include <lib/el3_runtime/pubsub.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+#include <services/sdei.h>
+
#include "sdei_private.h"
#define MAJOR_VERSION 1ULL
diff --git a/services/std_svc/sdei/sdei_private.h b/services/std_svc/sdei/sdei_private.h
index 82126674..b945394d 100644
--- a/services/std_svc/sdei/sdei_private.h
+++ b/services/std_svc/sdei/sdei_private.h
@@ -7,19 +7,20 @@
#ifndef SDEI_PRIVATE_H
#define SDEI_PRIVATE_H
-#include <arch_helpers.h>
-#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
#include <errno.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
-#include <sdei.h>
-#include <setjmp.h>
-#include <spinlock.h>
#include <stdbool.h>
#include <stdint.h>
-#include <utils_def.h>
+
+#include <arch_helpers.h>
+#include <bl31/interrupt_mgmt.h>
+#include <common/debug.h>
+#include <context.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/spinlock.h>
+#include <lib/utils_def.h>
+#include <plat/common/platform.h>
+#include <services/sdei.h>
+#include <setjmp.h>
#ifdef AARCH32
# error SDEI is implemented only for AArch64 systems
diff --git a/services/std_svc/sdei/sdei_state.c b/services/std_svc/sdei/sdei_state.c
index 66657862..1b448e62 100644
--- a/services/std_svc/sdei/sdei_state.c
+++ b/services/std_svc/sdei/sdei_state.c
@@ -5,8 +5,10 @@
*/
#include <assert.h>
-#include <cassert.h>
#include <stdbool.h>
+
+#include <lib/cassert.h>
+
#include "sdei_private.h"
/* Aliases for SDEI handler states: 'R'unning, 'E'nabled, and re'G'istered */
diff --git a/services/std_svc/spm/aarch64/spm_shim_exceptions.S b/services/std_svc/spm/aarch64/spm_shim_exceptions.S
index 9c218dfe..dab61501 100644
--- a/services/std_svc/spm/aarch64/spm_shim_exceptions.S
+++ b/services/std_svc/spm/aarch64/spm_shim_exceptions.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
/* -----------------------------------------------------------------------------
diff --git a/services/std_svc/spm/spci.c b/services/std_svc/spm/spci.c
index 5e4ff918..44a0acd6 100644
--- a/services/std_svc/spm/spci.c
+++ b/services/std_svc/spm/spci.c
@@ -5,17 +5,18 @@
*/
#include <assert.h>
-#include <context_mgmt.h>
-#include <debug.h>
#include <errno.h>
-#include <smccc.h>
+#include <string.h>
+
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/smccc.h>
+#include <lib/spinlock.h>
+#include <lib/utils.h>
+#include <services/spci_svc.h>
+#include <services/sprt_svc.h>
#include <smccc_helpers.h>
-#include <spci_svc.h>
-#include <spinlock.h>
#include <sprt_host.h>
-#include <sprt_svc.h>
-#include <string.h>
-#include <utils.h>
#include "spm_private.h"
diff --git a/services/std_svc/spm/spm_buffers.c b/services/std_svc/spm/spm_buffers.c
index 747337af..0c26a74b 100644
--- a/services/std_svc/spm/spm_buffers.c
+++ b/services/std_svc/spm/spm_buffers.c
@@ -5,9 +5,9 @@
*/
#include <arch_helpers.h>
+#include <lib/spinlock.h>
+#include <lib/utils_def.h>
#include <platform_def.h>
-#include <spinlock.h>
-#include <utils_def.h>
/*******************************************************************************
* Secure Service response global array. All the responses to the requests done
diff --git a/services/std_svc/spm/spm_main.c b/services/std_svc/spm/spm_main.c
index 460d1fb3..adfffd58 100644
--- a/services/std_svc/spm/spm_main.c
+++ b/services/std_svc/spm/spm_main.c
@@ -4,23 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl31.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <ehf.h>
#include <errno.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
-#include <runtime_svc.h>
-#include <smccc.h>
-#include <smccc_helpers.h>
-#include <spinlock.h>
#include <string.h>
-#include <sprt_svc.h>
-#include <utils.h>
-#include <xlat_tables_v2.h>
+
+#include <arch_helpers.h>
+#include <bl31/bl31.h>
+#include <bl31/ehf.h>
+#include <bl31/interrupt_mgmt.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/smccc.h>
+#include <lib/spinlock.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+#include <plat/common/platform.h>
+#include <services/sprt_svc.h>
+#include <smccc_helpers.h>
#include "spm_private.h"
diff --git a/services/std_svc/spm/spm_private.h b/services/std_svc/spm/spm_private.h
index c1aad933..1d5a88e8 100644
--- a/services/std_svc/spm/spm_private.h
+++ b/services/std_svc/spm/spm_private.h
@@ -34,10 +34,11 @@
#ifndef __ASSEMBLY__
-#include <spinlock.h>
-#include <sp_res_desc.h>
#include <stdint.h>
-#include <xlat_tables_v2.h>
+
+#include <lib/xlat_tables/xlat_tables_v2.h>
+#include <lib/spinlock.h>
+#include <services/sp_res_desc.h>
typedef enum sp_state {
SP_STATE_RESET = 0,
diff --git a/services/std_svc/spm/spm_setup.c b/services/std_svc/spm/spm_setup.c
index aca779f5..3aabc200 100644
--- a/services/std_svc/spm/spm_setup.c
+++ b/services/std_svc/spm/spm_setup.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <string.h>
+
+#include <platform_def.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <common_def.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform_def.h>
-#include <platform.h>
-#include <sp_res_desc.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+#include <plat/common/common_def.h>
+#include <plat/common/platform.h>
+#include <services/sp_res_desc.h>
#include <sprt_host.h>
-#include <string.h>
-#include <xlat_tables_v2.h>
#include "spm_private.h"
#include "spm_shim_private.h"
diff --git a/services/std_svc/spm/spm_shim_private.h b/services/std_svc/spm/spm_shim_private.h
index f2a7e052..7fe9692b 100644
--- a/services/std_svc/spm/spm_shim_private.h
+++ b/services/std_svc/spm/spm_shim_private.h
@@ -8,7 +8,8 @@
#define SPM_SHIM_PRIVATE_H
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Assembly source */
IMPORT_SYM(uintptr_t, spm_shim_exceptions_ptr, SPM_SHIM_EXCEPTIONS_PTR);
diff --git a/services/std_svc/spm/spm_xlat.c b/services/std_svc/spm/spm_xlat.c
index bbe392dd..57ad7424 100644
--- a/services/std_svc/spm/spm_xlat.c
+++ b/services/std_svc/spm/spm_xlat.c
@@ -8,14 +8,16 @@
#include <arch_helpers.h>
#include <assert.h>
#include <errno.h>
-#include <object_pool.h>
-#include <platform_def.h>
-#include <platform.h>
-#include <sp_res_desc.h>
#include <string.h>
-#include <utils.h>
-#include <utils_def.h>
-#include <xlat_tables_v2.h>
+
+#include <platform_def.h>
+
+#include <lib/object_pool.h>
+#include <lib/utils.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+#include <plat/common/platform.h>
+#include <services/sp_res_desc.h>
#include "spm_private.h"
#include "spm_shim_private.h"
diff --git a/services/std_svc/spm/sprt.c b/services/std_svc/spm/sprt.c
index 034dced7..f6af49fc 100644
--- a/services/std_svc/spm/sprt.c
+++ b/services/std_svc/spm/sprt.c
@@ -4,17 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <context_mgmt.h>
-#include <debug.h>
#include <errno.h>
#include <limits.h>
-#include <platform.h>
-#include <smccc.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/smccc.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+#include <services/sprt_svc.h>
#include <smccc_helpers.h>
-#include <sprt_svc.h>
-#include <utils.h>
#include "spm_private.h"
diff --git a/services/std_svc/spm_deprecated/aarch64/spm_shim_exceptions.S b/services/std_svc/spm_deprecated/aarch64/spm_shim_exceptions.S
index 9c218dfe..dab61501 100644
--- a/services/std_svc/spm_deprecated/aarch64/spm_shim_exceptions.S
+++ b/services/std_svc/spm_deprecated/aarch64/spm_shim_exceptions.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
/* -----------------------------------------------------------------------------
diff --git a/services/std_svc/spm_deprecated/spm_main.c b/services/std_svc/spm_deprecated/spm_main.c
index 880e86e4..540f257b 100644
--- a/services/std_svc/spm_deprecated/spm_main.c
+++ b/services/std_svc/spm_deprecated/spm_main.c
@@ -6,21 +6,22 @@
#include <arch_helpers.h>
#include <assert.h>
-#include <bl31.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <ehf.h>
#include <errno.h>
-#include <mm_svc.h>
-#include <platform.h>
-#include <runtime_svc.h>
-#include <secure_partition.h>
-#include <smccc.h>
+
+#include <bl31/bl31.h>
+#include <bl31/ehf.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/smccc.h>
+#include <lib/spinlock.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+#include <plat/common/platform.h>
+#include <services/mm_svc.h>
+#include <services/secure_partition.h>
+#include <services/spm_svc.h>
#include <smccc_helpers.h>
-#include <spinlock.h>
-#include <spm_svc.h>
-#include <utils.h>
-#include <xlat_tables_v2.h>
#include "spm_private.h"
diff --git a/services/std_svc/spm_deprecated/spm_private.h b/services/std_svc/spm_deprecated/spm_private.h
index ec3f48ea..8e94a282 100644
--- a/services/std_svc/spm_deprecated/spm_private.h
+++ b/services/std_svc/spm_deprecated/spm_private.h
@@ -31,9 +31,10 @@
#ifndef __ASSEMBLY__
-#include <spinlock.h>
#include <stdint.h>
-#include <xlat_tables_v2.h>
+
+#include <lib/spinlock.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
typedef enum sp_state {
SP_STATE_RESET = 0,
diff --git a/services/std_svc/spm_deprecated/spm_setup.c b/services/std_svc/spm_deprecated/spm_setup.c
index 0d61306f..d458f4a6 100644
--- a/services/std_svc/spm_deprecated/spm_setup.c
+++ b/services/std_svc/spm_deprecated/spm_setup.c
@@ -4,18 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <string.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <common_def.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#include <platform_def.h>
-#include <platform.h>
-#include <secure_partition.h>
-#include <string.h>
-#include <xlat_tables_v2.h>
+#include <plat/common/common_def.h>
+#include <plat/common/platform.h>
+#include <services/secure_partition.h>
#include "spm_private.h"
#include "spm_shim_private.h"
diff --git a/services/std_svc/spm_deprecated/spm_shim_private.h b/services/std_svc/spm_deprecated/spm_shim_private.h
index f2a7e052..7fe9692b 100644
--- a/services/std_svc/spm_deprecated/spm_shim_private.h
+++ b/services/std_svc/spm_deprecated/spm_shim_private.h
@@ -8,7 +8,8 @@
#define SPM_SHIM_PRIVATE_H
#include <stdint.h>
-#include <utils_def.h>
+
+#include <lib/utils_def.h>
/* Assembly source */
IMPORT_SYM(uintptr_t, spm_shim_exceptions_ptr, SPM_SHIM_EXCEPTIONS_PTR);
diff --git a/services/std_svc/spm_deprecated/spm_xlat.c b/services/std_svc/spm_deprecated/spm_xlat.c
index 35271386..f54168e3 100644
--- a/services/std_svc/spm_deprecated/spm_xlat.c
+++ b/services/std_svc/spm_deprecated/spm_xlat.c
@@ -8,11 +8,11 @@
#include <arch_helpers.h>
#include <assert.h>
#include <errno.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#include <platform_def.h>
-#include <platform.h>
-#include <secure_partition.h>
-#include <spm_svc.h>
-#include <xlat_tables_v2.h>
+#include <plat/common/platform.h>
+#include <services/secure_partition.h>
+#include <services/spm_svc.h>
#include "spm_private.h"
#include "spm_shim_private.h"
diff --git a/services/std_svc/std_svc_setup.c b/services/std_svc/std_svc_setup.c
index 86ecdf7b..7a34655f 100644
--- a/services/std_svc/std_svc_setup.c
+++ b/services/std_svc/std_svc_setup.c
@@ -5,18 +5,19 @@
*/
#include <assert.h>
-#include <cpu_data.h>
-#include <debug.h>
-#include <pmf.h>
-#include <psci.h>
-#include <runtime_instr.h>
-#include <runtime_svc.h>
-#include <sdei.h>
-#include <smccc_helpers.h>
-#include <spm_svc.h>
-#include <std_svc.h>
#include <stdint.h>
-#include <uuid.h>
+
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/pmf/pmf.h>
+#include <lib/psci/psci.h>
+#include <lib/runtime_instr.h>
+#include <services/sdei.h>
+#include <services/spm_svc.h>
+#include <services/std_svc.h>
+#include <smccc_helpers.h>
+#include <tools_share/uuid.h>
/* Standard Service UUID */
static uuid_t arm_svc_uid = {