Commit 97043ac9 authored by Dan Handley's avatar Dan Handley
Browse files

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
parent fb037bfb
......@@ -28,9 +28,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <arch.h>
#include <arch_helpers.h>
#include <platform.h>
#include <assert.h>
/*******************************************************************************
* Function that does the first bit of architectural setup that affects
......
......@@ -29,11 +29,9 @@
*/
#include <arch.h>
#include <asm_macros.S>
#include <bl_common.h>
#include <bl1.h>
#include <platform.h>
#include <runtime_svc.h>
#include <asm_macros.S>
.globl bl1_exceptions
......
......@@ -28,13 +28,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <arch.h>
#include <arch_helpers.h>
#include <platform.h>
#include <semihosting.h>
#include <assert.h>
#include <bl_common.h>
#include <bl1.h>
#include <platform.h>
#include <stdio.h>
#include "bl1_private.h"
/*******************************************************************************
......
......@@ -28,8 +28,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <arch.h>
#include <arch_helpers.h>
#include <platform.h>
/*******************************************************************************
* Place holder function to perform any S-EL1 specific architectural setup. At
......
......@@ -28,9 +28,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bl_common.h>
#include <arch.h>
#include <asm_macros.S>
#include <bl_common.h>
.globl bl2_entrypoint
......
......@@ -28,16 +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 <bl2.h>
#include <debug.h>
#include <platform.h>
#include <stdio.h>
#include "bl2_private.h"
/*******************************************************************************
......
......@@ -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
......
......@@ -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>
......
......@@ -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
......
......@@ -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
......
......@@ -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>
/*******************************************************************************
......
......@@ -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
......
......@@ -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
......
......@@ -28,10 +28,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bl_common.h>
#include <arch.h>
#include <tsp.h>
#include <asm_macros.S>
#include <tsp.h>
.globl tsp_entrypoint
......
......@@ -28,8 +28,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tsp.h>
#include <asm_macros.S>
#include <tsp.h>
.globl tsp_get_magic
......
......@@ -28,13 +28,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bl32.h>
#include <tsp.h>
#include <arch_helpers.h>
#include <stdio.h>
#include <platform.h>
#include <bl_common.h>
#include <bl32.h>
#include <debug.h>
#include <platform.h>
#include <spinlock.h>
#include <stdio.h>
#include <tsp.h>
/*******************************************************************************
* Lock to control access to the console
......
......@@ -28,11 +28,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <arch.h>
#include <bl_common.h>
#include <platform.h>
#include <runtime_svc.h>
#include <asm_macros.S>
#include <runtime_svc.h>
.globl early_exceptions
......
......@@ -28,17 +28,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <string.h>
#include <errno.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 <io_storage.h>
#include <debug.h>
#include <io_storage.h>
#include <platform.h>
#include <stdio.h>
unsigned long page_align(unsigned long value, unsigned dir)
{
......
......@@ -28,9 +28,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <assert.h>
#include <platform.h>
#include <cci400.h>
#include <mmio.h>
#include <platform.h>
static inline unsigned long get_slave_iface_base(unsigned long mpidr)
{
......
......@@ -28,11 +28,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdint.h>
#include <arch.h>
#include <platform.h>
#include <gic_v3.h>
#include <debug.h>
#include <gic_v3.h>
uintptr_t gicv3_get_rdist(uintptr_t gicr_base, uint64_t mpidr)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment