summaryrefslogtreecommitdiff
path: root/bl31
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 /bl31
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 'bl31')
-rw-r--r--bl31/aarch64/bl31_arch_setup.c5
-rw-r--r--bl31/aarch64/bl31_entrypoint.S3
-rw-r--r--bl31/aarch64/context.S3
-rw-r--r--bl31/aarch64/runtime_exceptions.S6
-rw-r--r--bl31/bl31_main.c11
-rw-r--r--bl31/context_mgmt.c10
-rw-r--r--bl31/runtime_svc.c14
7 files changed, 20 insertions, 32 deletions
diff --git a/bl31/aarch64/bl31_arch_setup.c b/bl31/aarch64/bl31_arch_setup.c
index 793b8958..acaa6b57 100644
--- a/bl31/aarch64/bl31_arch_setup.c
+++ b/bl31/aarch64/bl31_arch_setup.c
@@ -28,9 +28,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <arch.h>
#include <arch_helpers.h>
-#include <platform.h>
#include <assert.h>
+#include <bl_common.h>
+#include <bl31.h>
+#include <platform.h>
/*******************************************************************************
* This duplicates what the primary cpu did after a cold boot in BL1. The same
diff --git a/bl31/aarch64/bl31_entrypoint.S b/bl31/aarch64/bl31_entrypoint.S
index c04bc181..39fa605e 100644
--- a/bl31/aarch64/bl31_entrypoint.S
+++ b/bl31/aarch64/bl31_entrypoint.S
@@ -28,10 +28,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <bl_common.h>
-#include <platform.h>
#include <arch.h>
#include <asm_macros.S>
+#include <bl_common.h>
#include <cm_macros.S>
diff --git a/bl31/aarch64/context.S b/bl31/aarch64/context.S
index 2b2e7bf8..45d4a225 100644
--- a/bl31/aarch64/context.S
+++ b/bl31/aarch64/context.S
@@ -28,8 +28,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <context.h>
+#include <arch.h>
#include <asm_macros.S>
+#include <context.h>
/* -----------------------------------------------------
* The following function strictly follows the AArch64
diff --git a/bl31/aarch64/runtime_exceptions.S b/bl31/aarch64/runtime_exceptions.S
index b89a7689..53cc176e 100644
--- a/bl31/aarch64/runtime_exceptions.S
+++ b/bl31/aarch64/runtime_exceptions.S
@@ -29,11 +29,11 @@
*/
#include <arch.h>
-#include <runtime_svc.h>
-#include <platform.h>
-#include <context.h>
#include <asm_macros.S>
#include <cm_macros.S>
+#include <context.h>
+#include <platform.h>
+#include <runtime_svc.h>
.globl runtime_exceptions
.globl el3_exit
diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c
index 907c4877..cf826d01 100644
--- a/bl31/bl31_main.c
+++ b/bl31/bl31_main.c
@@ -28,17 +28,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
+#include <arch.h>
#include <arch_helpers.h>
-#include <console.h>
-#include <platform.h>
-#include <semihosting.h>
+#include <assert.h>
#include <bl_common.h>
#include <bl31.h>
-#include <runtime_svc.h>
#include <context_mgmt.h>
+#include <runtime_svc.h>
+#include <stdio.h>
/*******************************************************************************
diff --git a/bl31/context_mgmt.c b/bl31/context_mgmt.c
index 09b3bb8b..8d1396e2 100644
--- a/bl31/context_mgmt.c
+++ b/bl31/context_mgmt.c
@@ -28,15 +28,13 @@
* 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.h>
#include <context_mgmt.h>
+#include <platform.h>
+#include <runtime_svc.h>
/*******************************************************************************
* Data structure which holds the pointers to non-secure and secure security
diff --git a/bl31/runtime_svc.c b/bl31/runtime_svc.c
index 8ec2f0b2..9a68e50f 100644
--- a/bl31/runtime_svc.c
+++ b/bl31/runtime_svc.c
@@ -28,20 +28,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdio.h>
-#include <string.h>
+#include <debug.h>
#include <errno.h>
-#include <assert.h>
-#include <arch_helpers.h>
-#include <console.h>
-#include <platform.h>
-#include <semihosting.h>
-#include <bl_common.h>
-#include <psci.h>
#include <runtime_svc.h>
-#include <context.h>
-#include <debug.h>
-#include <context_mgmt.h>
+#include <string.h>
/*******************************************************************************
* The 'rt_svc_descs' array holds the runtime service descriptors exported by