summaryrefslogtreecommitdiff
path: root/services/spd
diff options
context:
space:
mode:
authorDan Handley <dan.handley@arm.com>2014-04-09 13:14:54 +0100
committerDan Handley <dan.handley@arm.com>2014-05-06 13:57:48 +0100
commit97043ac98e13a726dbf8b3b41654dca759e3da2c (patch)
tree18133148dea88d9a2313113111b24b56e8130505 /services/spd
parentfb037bfb7cbf7b404c069b4ebac5a10059d948b1 (diff)
Reduce deep nesting of header files
Reduce the number of header files included from other header files as much as possible without splitting the files. Use forward declarations where possible. This allows removal of some unnecessary "#ifndef __ASSEMBLY__" statements. Also, review the .c and .S files for which header files really need including and reorder the #include statements alphabetically. Fixes ARM-software/tf-issues#31 Change-Id: Iec92fb976334c77453e010b60bcf56f3be72bd3e
Diffstat (limited to 'services/spd')
-rw-r--r--services/spd/tspd/tspd_common.c9
-rw-r--r--services/spd/tspd/tspd_helpers.S2
-rw-r--r--services/spd/tspd/tspd_main.c12
-rw-r--r--services/spd/tspd/tspd_pm.c12
-rw-r--r--services/spd/tspd/tspd_private.h21
5 files changed, 24 insertions, 32 deletions
diff --git a/services/spd/tspd/tspd_common.c b/services/spd/tspd/tspd_common.c
index 181f2c8..13023d2 100644
--- a/services/spd/tspd/tspd_common.c
+++ b/services/spd/tspd/tspd_common.c
@@ -28,15 +28,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <assert.h>
#include <arch_helpers.h>
-#include <platform.h>
+#include <assert.h>
#include <bl_common.h>
-#include <runtime_svc.h>
#include <context_mgmt.h>
+#include <platform.h>
+#include <string.h>
#include "tspd_private.h"
/*******************************************************************************
diff --git a/services/spd/tspd/tspd_helpers.S b/services/spd/tspd/tspd_helpers.S
index f9a32aa..dd3b07b 100644
--- a/services/spd/tspd/tspd_helpers.S
+++ b/services/spd/tspd/tspd_helpers.S
@@ -28,9 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <context.h>
#include <asm_macros.S>
-#include <cm_macros.S>
#include "tspd_private.h"
.global tspd_enter_sp
diff --git a/services/spd/tspd/tspd_main.c b/services/spd/tspd/tspd_main.c
index c8fc9f1..9fda307 100644
--- a/services/spd/tspd/tspd_main.c
+++ b/services/spd/tspd/tspd_main.c
@@ -38,18 +38,14 @@
* handle the request locally or delegate it to the Secure Payload. It is also
* responsible for initialising and maintaining communication with the SP.
******************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
#include <arch_helpers.h>
-#include <console.h>
-#include <platform.h>
+#include <assert.h>
+#include <bl_common.h>
+#include <bl31.h>
#include <context_mgmt.h>
#include <runtime_svc.h>
-#include <bl31.h>
+#include <stddef.h>
#include <tsp.h>
-#include <psci.h>
-#include <debug.h>
#include <uuid.h>
#include "tspd_private.h"
diff --git a/services/spd/tspd/tspd_pm.c b/services/spd/tspd/tspd_pm.c
index cc01a72..2447d9e 100644
--- a/services/spd/tspd/tspd_pm.c
+++ b/services/spd/tspd/tspd_pm.c
@@ -28,18 +28,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
#include <arch_helpers.h>
-#include <console.h>
-#include <platform.h>
+#include <assert.h>
+#include <bl_common.h>
#include <context_mgmt.h>
-#include <runtime_svc.h>
-#include <bl31.h>
-#include <bl32.h>
-#include <psci.h>
#include <debug.h>
+#include <tsp.h>
#include "tspd_private.h"
/*******************************************************************************
diff --git a/services/spd/tspd/tspd_private.h b/services/spd/tspd/tspd_private.h
index 8b76876..81484e1 100644
--- a/services/spd/tspd/tspd_private.h
+++ b/services/spd/tspd/tspd_private.h
@@ -28,14 +28,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __SPD_PRIVATE_H__
-#define __SPD_PRIVATE_H__
+#ifndef __TSPD_PRIVATE_H__
+#define __TSPD_PRIVATE_H__
-#include <context.h>
#include <arch.h>
+#include <context.h>
+#include <platform.h>
#include <psci.h>
-#include <tsp.h>
-#include <cassert.h>
/*******************************************************************************
* Secure Payload PM state information e.g. SP is suspended, uninitialised etc
@@ -91,6 +90,9 @@
#ifndef __ASSEMBLY__
+#include <cassert.h>
+#include <stdint.h>
+
/* AArch64 callee saved general purpose register context structure. */
DEFINE_REG_STRUCT(c_rt_regs, TSPD_C_RT_CTX_ENTRIES);
@@ -121,6 +123,11 @@ typedef struct tsp_context {
extern const spd_pm_ops_t tspd_pm;
/*******************************************************************************
+ * Forward declarations
+ ******************************************************************************/
+struct entry_info;
+
+/*******************************************************************************
* Function & Data prototypes
******************************************************************************/
extern uint64_t tspd_enter_sp(uint64_t *c_rt_ctx);
@@ -132,7 +139,7 @@ extern int32_t tspd_init_secure_context(uint64_t entrypoint,
uint64_t mpidr,
tsp_context_t *tsp_ctx);
extern tsp_context_t tspd_sp_context[TSPD_CORE_COUNT];
-extern entry_info_t *tsp_entry_info;
+extern struct entry_info *tsp_entry_info;
#endif /*__ASSEMBLY__*/
-#endif /* __SPD_PRIVATE_H__ */
+#endif /* __TSPD_PRIVATE_H__ */