Reduce deep nesting of header files
authorDan Handley <dan.handley@arm.com>
Wed, 9 Apr 2014 12:14:54 +0000 (13:14 +0100)
committerDan Handley <dan.handley@arm.com>
Tue, 6 May 2014 12:57:48 +0000 (13:57 +0100)
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

89 files changed:
bl1/aarch64/bl1_arch_setup.c
bl1/aarch64/bl1_exceptions.S
bl1/bl1_main.c
bl2/aarch64/bl2_arch_setup.c
bl2/aarch64/bl2_entrypoint.S
bl2/bl2_main.c
bl31/aarch64/bl31_arch_setup.c
bl31/aarch64/bl31_entrypoint.S
bl31/aarch64/context.S
bl31/aarch64/runtime_exceptions.S
bl31/bl31_main.c
bl31/context_mgmt.c
bl31/runtime_svc.c
bl32/tsp/aarch64/tsp_entrypoint.S
bl32/tsp/aarch64/tsp_request.S
bl32/tsp/tsp_main.c
common/aarch64/early_exceptions.S
common/bl_common.c
drivers/arm/cci400/cci400.c
drivers/arm/gic/gic_v3.c
drivers/arm/pl011/pl011.c
drivers/arm/pl011/pl011_console.c
drivers/arm/tzc400/tzc400.c
drivers/io/io_fip.c
drivers/io/io_memmap.c
drivers/io/io_semihosting.c
include/bl1/bl1.h
include/bl2/bl2.h
include/bl31/bl31.h
include/bl31/cm_macros.S
include/bl31/context.h
include/bl31/context_mgmt.h
include/bl31/runtime_svc.h
include/bl31/services/psci.h
include/bl32/bl32.h
include/bl32/payloads/tsp.h
include/common/asm_macros.S
include/common/bl_common.h
include/common/debug.h
include/drivers/arm/pl011.h
include/drivers/arm/tzc400.h
include/drivers/io_driver.h
include/drivers/io_fip.h
include/drivers/io_memmap.h
include/drivers/io_semihosting.h
include/lib/aarch64/arch.h
include/lib/aarch64/arch_helpers.h
include/lib/bakery_lock.h
include/lib/io_storage.h
include/lib/mmio.h
include/lib/semihosting.h
lib/aarch64/cache_helpers.S
lib/aarch64/misc_helpers.S
lib/aarch64/sysreg_helpers.S
lib/aarch64/tlb_helpers.S
lib/aarch64/xlat_helpers.c
lib/io_storage.c
lib/locks/bakery/bakery_lock.c
lib/semihosting/semihosting.c
plat/common/aarch64/platform_helpers.S
plat/common/aarch64/platform_mp_stack.S
plat/common/aarch64/platform_up_stack.S
plat/fvp/aarch64/bl1_plat_helpers.S
plat/fvp/aarch64/plat_common.c
plat/fvp/aarch64/plat_helpers.S
plat/fvp/bl1_plat_setup.c
plat/fvp/bl2_plat_setup.c
plat/fvp/bl31_plat_setup.c
plat/fvp/bl32_plat_setup.c
plat/fvp/drivers/pwrc/fvp_pwrc.c
plat/fvp/plat_gic.c
plat/fvp/plat_io_storage.c
plat/fvp/plat_pm.c
plat/fvp/plat_topology.c
plat/fvp/platform.h
services/spd/tspd/tspd_common.c
services/spd/tspd/tspd_helpers.S
services/spd/tspd/tspd_main.c
services/spd/tspd/tspd_pm.c
services/spd/tspd/tspd_private.h
services/std_svc/psci/psci_afflvl_off.c
services/std_svc/psci/psci_afflvl_on.c
services/std_svc/psci/psci_afflvl_suspend.c
services/std_svc/psci/psci_common.c
services/std_svc/psci/psci_entry.S
services/std_svc/psci/psci_main.c
services/std_svc/psci/psci_private.h
services/std_svc/psci/psci_setup.c
services/std_svc/std_svc_setup.c

index 417a5366a409fb786d75efd30ae2f544dbd59405..758b8e8febdf2f9469fc6fa34524a10b95abd879 100644 (file)
@@ -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
index e57f2288aada290ef85575b964b2f31ae0fad4bb..68d088b7bac8fc637502afbda8a74f624761cfcd 100644 (file)
  */
 
 #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
 
index 05af75a88b4fe57c591f5a961cdf29247fbb8fac..de7bc3180c8da6b7313b35c2a4482367a7de8796 100644 (file)
  * 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"
 
 /*******************************************************************************
index 7ecf669ba2afac922581c978edb8fbfde5c59a81..0eafd1598f255b02e2b72e184d869a22b82bf9ae 100644 (file)
@@ -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
index 6bc779a05592377f19344f7c60b12a60b5e965a9..b8af9a55d63d9523a46f01c7283fc2dfe9f7f460 100644 (file)
@@ -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
index 6f6ea51bfe1db23aa6555231a0fdf3b7ca724326..ac28559118bace5688f0182167b3bad4f5869add 100644 (file)
  * 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"
 
 /*******************************************************************************
index 793b8958e1ec2868015e9b4044d9656dbb0afd48..acaa6b5710407b182999697df7763494ff4bbe77 100644 (file)
  * 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
index c04bc181b665a0150777c83a4d2aa9f112360b1e..39fa605ee0826ac1ac8ee7464e2ba963f73ea4d1 100644 (file)
  * 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>
 
 
index 2b2e7bf8435f8b0bd057ed77f8d12805ff6c9a91..45d4a2255d8cbbbc591a3407f00bdb89c76c5e7c 100644 (file)
@@ -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
index b89a76897a71d340df9e39b2d56312f1151c8c12..53cc176e05230fec6bd446f010e52fd1c18d8379 100644 (file)
  */
 
 #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
index 907c4877bf66417748f0a6d6d6abe97a98abdfa1..cf826d01bd672a4ac86b5a9f87ba08b1d48b63dc 100644 (file)
  * 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>
 
 
 /*******************************************************************************
index 09b3bb8bbf6a60e5c41f4b8173f266f36bd69321..8d1396e2ec085a2d73d011eddaa68a42d25ebaf8 100644 (file)
  * 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
index 8ec2f0b21866c7e5f3c4765f9adb13ff439f0665..9a68e50fe4459987b50b38444ce29fc1b58a68f7 100644 (file)
  * 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
index 8bfe454a10c778a1e0e10e716b971c41a41cc267..97d54f6597f31c666907f42495302b5d2f01c2b5 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <bl_common.h>
 #include <arch.h>
-#include <tsp.h>
 #include <asm_macros.S>
+#include <tsp.h>
 
 
        .globl  tsp_entrypoint
index da7d6e6aca09c266ec6ce169ebd166a826a13da8..6aa08736793902cb38be7142f4e1686de8341245 100644 (file)
@@ -28,8 +28,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <tsp.h>
 #include <asm_macros.S>
+#include <tsp.h>
 
        .globl tsp_get_magic
 
index 083c43094d6a90831e5e44d9115fef57034a0602..a667ffc23ad6f3fbba9a962483cdfe3d5aedc9fb 100644 (file)
  * 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
index 41bff97f37e19e44d4e966b7093d0fdaacd32add..90f5421b0b6a0d24768d085f220115f24bc66c69 100644 (file)
  * 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
 
index e96bfa05364fd18994415b4fdd7d68183649872b..af2b7b74cd1c4f3b8d4ccf604091cfc0e3e04170 100644 (file)
  * 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)
 {
index 4ca55b18bfa34e89b9316840fbc41e093a9dbe54..02f7f9556e1ab90a905524e0bfa68cc85ffa66d3 100644 (file)
@@ -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)
 {
index d658a61b3f85ab57fad8b9aa8f6f1cfe69ce5789..f429662960cda10ee814d465facdef06a6a4cdaa 100644 (file)
  * 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)
 {
index 8288cd819ee3883b70bbe0213ff6c17f2a460069..f12bd23d0c4e3cd121c7e29299a2c67bae3ad59e 100644 (file)
@@ -28,9 +28,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <assert.h>
 #include <platform.h>
 #include <pl011.h>
-#include <assert.h>
 
 void pl011_setbaudrate(unsigned long base_addr, unsigned int baudrate)
 {
index 1a684ff6dc9f1f8792307d94228337f91f5b7d8a..3b0e237f380e78f0d7e657c5bd6ecb54f5193006 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <assert.h>
 #include <console.h>
 #include <platform.h>
 #include <pl011.h>
-#include <assert.h>
 
 static unsigned long uart_base;
 
index 56c6dea72c9ae251b3225de694fcc1579117ff81..c1716db44a7a79bf1e4b5d2902775359c91b2aec 100644 (file)
  */
 
 #include <assert.h>
-#include <arch_helpers.h>
-#include <tzc400.h>
-#include <mmio.h>
 #include <debug.h>
+#include <mmio.h>
+#include <stddef.h>
+#include <tzc400.h>
 
 static uint32_t tzc_read_build_config(uint64_t base)
 {
index 482e0684824f1f67a013967bc6bdf87fdef298d9..b2dcfccfd5119acb4506daf15c94b620bf1f0560 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <stdint.h>
-#include <uuid.h>
-#include <errno.h>
-#include <string.h>
 #include <assert.h>
-#include <platform.h>
+#include <debug.h>
+#include <errno.h>
 #include <firmware_image_package.h>
-#include <io_storage.h>
 #include <io_driver.h>
 #include <io_fip.h>
-#include <debug.h>
+#include <io_storage.h>
+#include <platform.h>
+#include <stdint.h>
+#include <string.h>
+#include <uuid.h>
 
 /* Useful for printing UUIDs when debugging.*/
 #define PRINT_UUID2(x)                                                         \
index 2e70e96992b95059058af78f668a89fac1631644..a40e61207ae872c96c29c8fa13f8f29a1ea88352 100644 (file)
  */
 
 #include <assert.h>
-#include <string.h>
-#include <io_storage.h>
-#include <io_driver.h>
 #include <debug.h>
+#include <io_driver.h>
+#include <io_storage.h>
+#include <string.h>
 
 /* As we need to be able to keep state for seek, only one file can be open
  * at a time. Make this a structure and point to the entity->info. When we
index 89c844b2b5ad51b3992103d98d594be8580a271a..a37693df671f6a65dd3d40496e1a19aca8b8629b 100644 (file)
@@ -29,8 +29,8 @@
  */
 
 #include <assert.h>
-#include <io_storage.h>
 #include <io_driver.h>
+#include <io_storage.h>
 #include <semihosting.h>
 
 
index 1750a1f059f6570f553298a54db9002c8fd64595..d8afae460f51f25c31cf2aa0eae6bf83f938db73 100644 (file)
 #ifndef __BL1_H__
 #define __BL1_H__
 
-#include <bl_common.h>
 
-#ifndef __ASSEMBLY__
+/******************************************
+ * Forward declarations
+ *****************************************/
+struct meminfo;
 
 /******************************************
  * Function prototypes
  *****************************************/
 extern void bl1_platform_setup(void);
-extern meminfo_t *bl1_plat_sec_mem_layout(void);
-
-#endif /*__ASSEMBLY__*/
+extern struct meminfo *bl1_plat_sec_mem_layout(void);
 
 #endif /* __BL1_H__ */
index 9a5094ff9cdc0396fe7dfc4b6f2df7115b71500b..25b6f9cd3508a62e6cf08d664ee8d1f2c35e553c 100644 (file)
 #ifndef __BL2_H__
 #define __BL2_H__
 
-#include <bl_common.h>
-
 /******************************************
  * Data declarations
  *****************************************/
 extern unsigned long long bl2_entrypoint;
 
+/******************************************
+ * Forward declarations
+ *****************************************/
+struct meminfo;
+struct bl31_args;
+
 /******************************************
  * Function prototypes
  *****************************************/
 extern void bl2_platform_setup(void);
-extern meminfo_t *bl2_plat_sec_mem_layout(void);
-extern bl31_args_t *bl2_get_bl31_args_ptr(void);
+extern struct meminfo *bl2_plat_sec_mem_layout(void);
+extern struct bl31_args *bl2_get_bl31_args_ptr(void);
 
 #endif /* __BL2_H__ */
index 6dd7596406d89a5fc28af3a123ac55a170a82b93..b60e32cec7222bf5944c211cd59fde3c7b2da8b4 100644 (file)
 #ifndef __BL31_H__
 #define __BL31_H__
 
-#include <bl_common.h>
+#include <stdint.h>
 
 /*******************************************************************************
  * Data declarations
  ******************************************************************************/
 extern unsigned long bl31_entrypoint;
 
+/******************************************
+ * Forward declarations
+ *****************************************/
+struct meminfo;
+struct el_change_info;
+
 /*******************************************************************************
  * Function prototypes
  ******************************************************************************/
@@ -46,9 +52,10 @@ extern void bl31_next_el_arch_setup(uint32_t security_state);
 extern void bl31_set_next_image_type(uint32_t type);
 extern uint32_t bl31_get_next_image_type(void);
 extern void bl31_prepare_next_image_entry();
-extern el_change_info_t *bl31_get_next_image_info(uint32_t type);
+extern struct el_change_info *bl31_get_next_image_info(uint32_t type);
 extern void bl31_platform_setup(void);
-extern meminfo_t *bl31_plat_get_bl32_mem_layout(void);
-extern meminfo_t *bl31_plat_sec_mem_layout(void);
-extern void bl31_register_bl32_init(int32_t (*)(meminfo_t *));
+extern struct meminfo *bl31_plat_get_bl32_mem_layout(void);
+extern struct meminfo *bl31_plat_sec_mem_layout(void);
+extern void bl31_register_bl32_init(int32_t (*)(struct meminfo *));
+
 #endif /* __BL31_H__ */
index 9eeec1899889cfaafe3c59d8ca30409e607d68c1..d26495662a7a0c630cc77015d8e5342dcbae15a3 100644 (file)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+
+#include <arch.h>
+#include <context.h>
+
+
        /* ---------------------------------------------
         * Zero out the callee saved register to prevent
         * leakage of secure state into the normal world
index c7eda7df021e74ffb8b388ec03e71ab30cc7f9a6..989b2e6a4451599e6c8eef3bfea95d37f82694d4 100644 (file)
@@ -31,9 +31,6 @@
 #ifndef __CONTEXT_H__
 #define __CONTEXT_H__
 
-#include <arch.h>
-#include <cassert.h>
-
 /*******************************************************************************
  * Constants that allow assembler code to access members of and the 'gp_regs'
  * structure at their correct offsets.
 
 #ifndef __ASSEMBLY__
 
+#include <cassert.h>
+#include <stdint.h>
+
 /*
  * Common constants to help define the 'cpu_context' structure and its
  * members below.
index 35f7c8ccd2fdbf54f9583ca0e3b16703d4b6fbb7..efcdcd28e4b409f3a9833119bf2e774d439e8801 100644 (file)
@@ -31,9 +31,8 @@
 #ifndef __CM_H__
 #define __CM_H__
 
-#include <context.h>
+#include <stdint.h>
 
-#ifndef __ASSEMBLY__
 /*******************************************************************************
  * Function & variable prototypes
  ******************************************************************************/
@@ -51,5 +50,5 @@ extern void cm_set_el3_eret_context(uint32_t security_state, uint64_t entrypoint
 extern void cm_set_el3_elr(uint32_t security_state, uint64_t entrypoint);
 extern void cm_set_next_eret_context(uint32_t security_state);
 extern void cm_init_exception_stack(uint64_t mpidr, uint32_t security_state);
-#endif /*__ASSEMBLY__*/
+
 #endif /* __CM_H__ */
index ac85fa3f2ef7b68e7b3e3ede8f38cbd26c6a9d23..12b5db8b6e0c9136df662433d8d21a993bcab492 100644 (file)
@@ -30,8 +30,6 @@
 
 #ifndef __RUNTIME_SVC_H__
 #define __RUNTIME_SVC_H__
-#include <psci.h>
-#include <cassert.h>
 
 /*******************************************************************************
  * Bit definitions inside the function id as per the SMC calling convention
 
 #ifndef __ASSEMBLY__
 
+#include <cassert.h>
+#include <context.h>
+#include <stdint.h>
+
 /* Various flags passed to SMC handlers */
 #define SMC_FROM_SECURE                (0 << 0)
 #define SMC_FROM_NON_SECURE    (1 << 0)
index ab7b7bdd00cd627374f70421952f24ab582aed8c..570fe5b8ab3b5c71fee38ce42fe7dd88df9ce7b5 100644 (file)
@@ -31,6 +31,7 @@
 #ifndef __PSCI_H__
 #define __PSCI_H__
 
+
 /*******************************************************************************
  * Defines for runtime services func ids
  ******************************************************************************/
 #define PSCI_NUM_AFFS          32ull
 
 #ifndef __ASSEMBLY__
+
+#include <stdint.h>
+
+
 /*******************************************************************************
  * Structure populated by platform specific code to export routines which
  * perform common low level pm functions
index e46988193ebac308fb5310431165be54e769582d..323948767db7d300303fa8a3aa9acef7bde67d2a 100644 (file)
 #ifndef __BL32_H__
 #define __BL32_H__
 
-#ifndef __ASSEMBLY__
 #include <stdint.h>
 
-#include <bl_common.h>
+/******************************************
+ * Forward declarations
+ *****************************************/
+struct meminfo;
 
+/******************************************
+ * Function prototypes
+ *****************************************/
 extern void bl32_platform_setup(void);
-extern meminfo_t *bl32_plat_sec_mem_layout(void);
+extern struct meminfo *bl32_plat_sec_mem_layout(void);
 extern uint64_t bl32_main(void);
 
-#endif /* __ASSEMBLY__ */
-
 #endif /* __BL32_H__ */
index 4ac7a1aaf131fb37de2e0ea40ecfce133c1b4938..1f542d5366060a7b139ddcb3af514cefb6257e14 100644 (file)
@@ -31,9 +31,6 @@
 #ifndef __TSP_H__
 #define __TSP_H__
 
-#include <platform.h>
-#include <cassert.h>
-
 /*
  * SMC function IDs that TSP uses to signal various forms of completions
  * to the secure payload dispatcher.
@@ -86,6 +83,9 @@
 #define TSP_ARGS_END           0x40
 
 #ifndef __ASSEMBLY__
+
+#include <cassert.h>
+#include <platform.h>  /* For CACHE_WRITEBACK_GRANULE */
 #include <stdint.h>
 
 typedef void (*tsp_generic_fptr_t)(uint64_t arg0,
index 8bcb7d28b08b05ae7fb5862a07f1e8aad44727d6..6cf1a19f7a59628c6189c12b543db5f94d06e6f2 100644 (file)
@@ -28,6 +28,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <arch.h>
+
+
        .macro  func_prologue
        stp     x29, x30, [sp, #-0x10]!
        mov     x29,sp
index 1eb6d79a459bc8d77e1b759e895fa342bc6f52bb..9fba9c067d3ea71966e6a17c3fb9004a9e2b6cd1 100644 (file)
@@ -58,7 +58,8 @@
 
 
 #ifndef __ASSEMBLY__
-#include <stdio.h>
+
+#include <cdefs.h> /* For __dead2 */
 
 /*******************************************************************************
  * Structure used for telling the next BL how much of a particular type of
index f82947779ad167f06d681bfdf4f027cfed2540d6..e4fa31e584fdeb2402ff5a866d70faddf7586beb 100644 (file)
@@ -31,9 +31,6 @@
 #ifndef __DEBUG_H__
 #define __DEBUG_H__
 
-/* Do not try to call this from ASM code. */
-#ifndef __ASSEMBLY__
-
 #include <stdio.h>
 
 /* If building the project with DEBUG disabled the INFO and WARN macros
@@ -66,5 +63,4 @@ static inline void __attribute__((noreturn)) panic(void)
                ;
 }
 
-#endif /* __ASSEMBLY__ */
 #endif /* __DEBUG_H__ */
index 5ad2fc7d36673275bd6929a1d95a2747b0fcc3be..28aef54a63f1a943e374148604621fbfc63d37c6 100644 (file)
@@ -31,6 +31,9 @@
 #ifndef __PL011_H__
 #define __PL011_H__
 
+#include <mmio.h>
+
+
 /* PL011 Registers */
 #define UARTDR                    0x000
 #define UARTRSR                   0x004
index 7ac82ae635984aad9c718d55dfd2cb3366cac41f..b4aa3ba59d8cb642cb1e3dafdfea19ecd89f1be0 100644 (file)
 /* Filters are bit mapped 0 to 3. */
 #define TZC400_COMPONENT_ID    0xb105f00d
 
-#ifndef __ASSEMBLY__
-
 /*******************************************************************************
  * Function & variable prototypes
  ******************************************************************************/
@@ -205,6 +203,5 @@ void tzc_enable_filters(const tzc_instance_t *controller);
 void tzc_disable_filters(const tzc_instance_t *controller);
 void tzc_set_action(const tzc_instance_t *controller, tzc_action_t action);
 
-#endif /*__ASSEMBLY__*/
 
 #endif /* __TZC400__ */
index cade5e706991bfc942f804cb24db6b61e2706d16..cc01d3b2add87cf983a79393802763e1310dd18b 100644 (file)
@@ -31,7 +31,9 @@
 #ifndef __IO_DRIVER_H__
 #define __IO_DRIVER_H__
 
+#include <io_storage.h>
 #include <platform.h>   /* For MAX_IO_DEVICES */
+#include <stdint.h>
 
 
 /* Generic IO entity structure,representing an accessible IO construct on the
index 56dd1e0fcaf61992ab8fc386b39bbb956cce1fa9..212570d81de5b9b41184f78e2c14f6dc6aa74a38 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef __IO_FIP_H__
 #define __IO_FIP_H__
 
+struct io_dev_connector;
+
 int register_io_dev_fip(struct io_dev_connector **dev_con);
 
 #endif /* __IO_FIP_H__ */
index 5fa7bc987bec92e18af43b437a5d0cc23cace4e4..0e59ecbd4f3874fe5b8d8e8c8283d5c5aac64ff2 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef __IO_MEMMAP_H__
 #define __IO_MEMMAP_H__
 
+struct io_dev_connector;
+
 int register_io_dev_memmap(struct io_dev_connector **dev_con);
 
 #endif /* __IO_MEMMAP_H__ */
index 7dc632dd77411d52e9b62bcdd4480cc2277c4c2e..eab290a75e6815b8b4c06fad7856cbca24e6299a 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef __IO_SH_H__
 #define __IO_SH_H__
 
+struct io_dev_connector;
+
 int register_io_dev_sh(struct io_dev_connector **dev_con);
 
 #endif /* __IO_SH_H__ */
index 32167eb3b15105ffb88a88463916c942a81f59d3..d7e65b38ebea584f019f18cead0817cf726cd003 100644 (file)
@@ -31,7 +31,6 @@
 #ifndef __ARCH_H__
 #define __ARCH_H__
 
-#include <bl_common.h>
 
 /*******************************************************************************
  * MIDR bit definitions
index f55c0033c2bfb9d9820a8428821615d7e0a4315b..565b1b4882a1de669b41c72d63879840e7af295f 100644 (file)
 #ifndef __ARCH_HELPERS_H__
 #define __ARCH_HELPERS_H__
 
-#include <arch.h>
+#include <cdefs.h> /* For __dead2 */
 
-#ifndef __ASSEMBLY__
-#include <stdio.h>
 
 /*******************************************************************************
  * Aarch64 translation tables manipulation helper prototypes
@@ -268,6 +266,5 @@ extern void write_cpuectlr(unsigned long);
 extern void write_cptr_el2(unsigned long);
 extern void write_cptr_el3(unsigned long);
 
-#endif /*__ASSEMBLY__*/
 
 #endif /* __ARCH_HELPERS_H__ */
index 0def06748295dcfc2e69d763b2e33636a0621287..e6744a51ef52b59e68e2bff402df14a2dfd9a02c 100644 (file)
@@ -35,7 +35,6 @@
 
 #define BAKERY_LOCK_MAX_CPUS           PLATFORM_CORE_COUNT
 
-#ifndef __ASSEMBLY__
 typedef struct bakery_lock {
        int owner;
        volatile char entering[BAKERY_LOCK_MAX_CPUS];
@@ -48,6 +47,5 @@ void bakery_lock_init(bakery_lock_t *bakery);
 void bakery_lock_get(unsigned long mpidr, bakery_lock_t *bakery);
 void bakery_lock_release(unsigned long mpidr, bakery_lock_t *bakery);
 int bakery_lock_try(unsigned long mpidr, bakery_lock_t *bakery);
-#endif /*__ASSEMBLY__*/
 
 #endif /* __BAKERY_LOCK_H__ */
index 59fd3f47921840321ed6f33a997559e43559c821..b6c5f9f5894d4becfe52f142339b447b09e45cdb 100644 (file)
 #ifndef __IO_H__
 #define __IO_H__
 
-#ifndef __ASSEMBLY__
-
-#include <stdint.h>
-#include <stdio.h>     /* For ssize_t */
+#include <stdio.h> /* For ssize_t */
 
 
 /* Device type which can be used to enable policy decisions about which device
@@ -128,5 +125,4 @@ int io_write(io_handle handle, const void *buffer, size_t length,
 int io_close(io_handle handle);
 
 
-#endif /* __ASSEMBLY__ */
 #endif /* __IO_H__ */
index c79c3f5c586af621e36fc5409b8c162880bf846e..d3c2cae5154900276edd5774ef8c7d1d0c17a2c1 100644 (file)
@@ -31,8 +31,6 @@
 #ifndef __MMIO_H__
 #define __MMIO_H__
 
-#ifndef __ASSEMBLY__
-
 #include <stdint.h>
 
 extern void mmio_write_8(uintptr_t addr, uint8_t value);
@@ -44,6 +42,4 @@ extern uint32_t mmio_read_32(uintptr_t addr);
 extern void mmio_write_64(uintptr_t addr, uint64_t value);
 extern uint64_t mmio_read_64(uintptr_t addr);
 
-#endif /*__ASSEMBLY__*/
-
 #endif /* __MMIO_H__ */
index e688618a3265d78608515ff832049042b04d70cc..9d0b39f75a49638731a7832e3ee11ab749603b6c 100644 (file)
@@ -31,6 +31,9 @@
 #ifndef __SEMIHOSTING_H__
 #define __SEMIHOSTING_H__
 
+#include <stdio.h> /* For ssize_t */
+
+
 #define SEMIHOSTING_SYS_OPEN            0x01
 #define SEMIHOSTING_SYS_CLOSE           0x02
 #define SEMIHOSTING_SYS_WRITE0          0x04
index 2696d901cee60ea5b808dc3f22cf52b5ec395123..2649ad0e047d87b768b6655a77ce2c7268332fb1 100644 (file)
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <arch_helpers.h>
+#include <arch.h>
 #include <asm_macros.S>
 
        .globl  dcisw
index e3b4ab5823625dbc0db78babaf36f0d6c1e762ba..e7b233135719322cb6d2921ad1c56b4cb401f689 100644 (file)
@@ -28,8 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <arch_helpers.h>
-#include <runtime_svc.h>
+#include <arch.h>
 #include <asm_macros.S>
 
        .globl  enable_irq
index 8e816f036b5a3ffdbe1504db03bb6f50c221eb7e..61468f956a3a4fe59ca0221533bc4feaf8145f71 100644 (file)
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <arch_helpers.h>
+#include <arch.h>
 #include <asm_macros.S>
 
        .globl  read_vbar_el1
index 42449747b6829d7e639539ab877bd4e720d3dfd6..ec1558b09f85714a89526c8df5684bbec51548e2 100644 (file)
@@ -28,7 +28,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <arch_helpers.h>
 #include <asm_macros.S>
 
        .globl  tlbialle1
index 87d24ec9fb33a0285bbaeadc79c82e4db78448db..d401ffc42409decc1e88dce8b19809b2d3615967 100644 (file)
@@ -28,9 +28,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <string.h>
-#include <assert.h>
 #include <arch.h>
+#include <assert.h>
 
 /*******************************************************************************
  * Helper to create a level 1/2 table descriptor which points to a level 2/3
index c3b94bb0f58897aef75fb14e06349a7c78d228d7..01ca1c686a5ca3669de92c27d3c56db91b345541 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-
-#include <stddef.h>
 #include <assert.h>
-#include <io_storage.h>
 #include <io_driver.h>
+#include <io_storage.h>
+#include <stddef.h>
 
 
 #define MAX_DEVICES(plat_data)                                         \
index 3cb9248eaacbadfce23ff84ec2ef8df4d322e660..6d4ab87bb08501fc4bb4fff075a62584e543fe8d 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <arch_helpers.h>
 #include <assert.h>
-#include <string.h>
-
 #include <bakery_lock.h>
-#include <arch_helpers.h>
+#include <string.h>
 
 /*
  * Functions in this file implement Bakery Algorithm for mutual exclusion.
index 3232cd5445f10bbd05f5da8d1ece7f81d46f396a..1bce377cf3685e9d294ac899a3c2f7efaa82f5f3 100644 (file)
  */
 
 #include <assert.h>
-#include <string.h>
 #include <errno.h>
-#include <stdio.h>
 #include <semihosting.h>
+#include <string.h>
 
 #ifndef SEMIHOSTING_SUPPORTED
 #define SEMIHOSTING_SUPPORTED  1
index 29268ba4d5c0fa62e1626816ade2c2d7c80eb19a..7e201213fe8b4ac01738d7a6fffbaac674e49d43 100644 (file)
@@ -29,8 +29,8 @@
  */
 
 #include <arch.h>
-#include <platform.h>
 #include <asm_macros.S>
+#include <platform.h>
 
 
        .weak   platform_get_core_pos
index 1438814ee6a2bfc4e7264c0fde3c3f5813d59c7a..ebbf509b4b7b7b3c00bf8da237cd7f14a4e96316 100644 (file)
@@ -29,8 +29,8 @@
  */
 
 #include <arch.h>
-#include <platform.h>
 #include <asm_macros.S>
+#include <platform.h>
 
 
        .local  pcpu_dv_mem_stack
index b321a4e2721383439eeddc98cb6cd90909db8870..880793d890c44450c6c9ed650dd1d71d03e6e570 100644 (file)
@@ -29,8 +29,8 @@
  */
 
 #include <arch.h>
-#include <platform.h>
 #include <asm_macros.S>
+#include <platform.h>
 
 
        .local  pcpu_dv_mem_stack
index 64f230db0d40490ac9a83f8169f13d8b5fe1a841..92075ea4cc78eb1f6353c766802d96e5ea0e96e8 100644 (file)
@@ -29,9 +29,9 @@
  */
 
 #include <arch.h>
-#include <platform.h>
-#include <gic_v2.h>
 #include <asm_macros.S>
+#include <gic_v2.h>
+#include <platform.h>
 #include "../drivers/pwrc/fvp_pwrc.h"
 
        .globl  platform_get_entrypoint
index 40e6b324391dc069df3d0a6aba4430386787081b..c8e529d4f4467369916df537ee583f721b40214a 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <assert.h>
+#include <arch.h>
 #include <arch_helpers.h>
+#include <assert.h>
+#include <bl_common.h>
 #include <debug.h>
+#include <mmio.h>
 #include <platform.h>
 #include <xlat_tables.h>
 
index ab826f4c0c3571af5c3562b62b73cf0391817dcf..00579035733457a767a88a6da3c76d4dc631904b 100644 (file)
@@ -29,8 +29,9 @@
  */
 
 #include <arch.h>
-#include <platform.h>
 #include <asm_macros.S>
+#include <bl_common.h>
+#include <platform.h>
 
        .globl  plat_report_exception
 
index 818c4e3f226e6dd418dd7d369a2368cbc21b0c95..e92303dea1084de5dde6af33345245a9ebc2b0a8 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <assert.h>
 #include <arch_helpers.h>
-#include <platform.h>
+#include <assert.h>
+#include <bl_common.h>
 #include <bl1.h>
 #include <console.h>
 #include <cci400.h>
+#include <mmio.h>
+#include <platform.h>
 
 /*******************************************************************************
  * Declarations of linker defined symbols which will help us find the layout
index 8517497ede240b8e846b4d44fa92039eead6bcd4..a4960aa1dcfecaa2e74aaef034c9f1ce7913ae9b 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <assert.h>
 #include <arch_helpers.h>
-#include <platform.h>
-#include <bl2.h>
+#include <assert.h>
 #include <bl_common.h>
+#include <bl2.h>
 #include <console.h>
+#include <platform.h>
 
 /*******************************************************************************
  * Declarations of linker defined symbols which will help us find the layout
index 5abe2368d2bfb5b7fefbf44371ed48f314cb2e59..aa7b2d86ff7fe04355b5626ee94348a907bbacb3 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <platform.h>
 #include <arch.h>
+#include <bl_common.h>
+#include <bl31.h>
 #include <console.h>
+#include <mmio.h>
+#include <platform.h>
+#include <stddef.h>
 #include "drivers/pwrc/fvp_pwrc.h"
 
 /*******************************************************************************
index 3226ea23b05b28df42ba83f0fe81f6f39d7fe908..b71800e40ed890199471576eb33a92729f8895fe 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <string.h>
-#include <assert.h>
 #include <arch_helpers.h>
-#include <platform.h>
-#include <bl32.h>
 #include <bl_common.h>
+#include <bl32.h>
 #include <console.h>
+#include <platform.h>
 
 /*******************************************************************************
  * Declarations of linker defined symbols which will help us find the layout
index 175d41c039bd1cdb10287bf80c292ae1f9e4e982..7a7f5168adfd95a4b62efadaab3f8b2e1f3e8640 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-#include <assert.h>
-#include <arch_helpers.h>
-#include <platform.h>
 #include <bakery_lock.h>
+#include <mmio.h>
 #include "fvp_pwrc.h"
 
 /*
index be892ac37867b782a6f1254f57cb6b8fe328d9ce..8457af1ad1c04aae5c6098c4766cc1fb9cf3e4ba 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <stdint.h>
 #include <arch_helpers.h>
-#include <platform.h>
+#include <debug.h>
 #include <gic_v2.h>
 #include <gic_v3.h>
-#include <debug.h>
+#include <platform.h>
+#include <stdint.h>
 
 
 /*******************************************************************************
index 371f5671938691868f7d24a002902f7f7192f26e..3727d26a0671706992936b27d5c9ca12988c9bbc 100644 (file)
  */
 
 #include <assert.h>
-#include <string.h>
-#include <platform.h>
-#include <io_storage.h>
+#include <debug.h>
 #include <io_driver.h>
-#include <io_semihosting.h>
-#include <semihosting.h>       /* For FOPEN_MODE_... */
 #include <io_fip.h>
 #include <io_memmap.h>
-#include <debug.h>
+#include <io_storage.h>
+#include <io_semihosting.h>
+#include <platform.h>
+#include <semihosting.h>       /* For FOPEN_MODE_... */
+#include <string.h>
 
 /* IO devices */
 static io_plat_data_t io_data;
index da940c1f62293934d8c7a7d67c940b9c67c700bc..c80d315b6786dca58c732a870da42b040da14fca 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
 #include <arch_helpers.h>
-#include <console.h>
-#include <platform.h>
-#include <bl_common.h>
-#include <bl31.h>
+#include <assert.h>
 #include <bakery_lock.h>
 #include <cci400.h>
-#include <gic_v2.h>
-/* Only included for error codes */
+#include <mmio.h>
+#include <platform.h>
 #include <psci.h>
 #include "drivers/pwrc/fvp_pwrc.h"
 
index 99f325948d383861661e2dde5348d0b7fc784975..04b409ecb158c333d6b4fc84e61c847daf6ed3c9 100644 (file)
@@ -28,7 +28,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <string.h>
 #include <assert.h>
 #include <platform.h>
 /* TODO: Reusing psci error codes & state information. Get our own! */
index 098f499d64bf07229ab53b9362b888436b9a0ed3..1ffdc982f8a1bedbcbf4a388c2d52ecd8be559b6 100644 (file)
 #define __PLATFORM_H__
 
 #include <arch.h>
-#include <mmio.h>
-#include <psci.h>
-#include <bl_common.h>
-#include <io_storage.h>
 
 
 /*******************************************************************************
 
 #ifndef __ASSEMBLY__
 
+#include <stdint.h>
+
+
 typedef volatile struct mailbox {
        unsigned long value
        __attribute__((__aligned__(CACHE_WRITEBACK_GRANULE)));
 } mailbox_t;
 
+/*******************************************************************************
+ * Forward declarations
+ ******************************************************************************/
+struct plat_pm_ops;
+struct meminfo;
+struct io_dev_info;
+
 /*******************************************************************************
  * Function and variable prototypes
  ******************************************************************************/
@@ -364,11 +370,11 @@ extern unsigned long warm_boot_entrypoint;
 extern void bl1_plat_arch_setup(void);
 extern void bl2_plat_arch_setup(void);
 extern void bl31_plat_arch_setup(void);
-extern int platform_setup_pm(plat_pm_ops_t **);
+extern int platform_setup_pm(struct plat_pm_ops **);
 extern unsigned int platform_get_core_pos(unsigned long mpidr);
 extern void disable_mmu(void);
 extern void enable_mmu(void);
-extern void configure_mmu(meminfo_t *,
+extern void configure_mmu(struct meminfo *,
                          unsigned long,
                          unsigned long,
                          unsigned long,
@@ -395,7 +401,7 @@ extern unsigned int plat_get_aff_state(unsigned int, unsigned long);
 /* Declarations for plat_io_storage.c */
 extern void io_setup(void);
 extern int plat_get_image_source(const char *image_name,
-               io_dev_handle *dev_handle, void **image_spec);
+               struct io_dev_info **dev_handle, void **image_spec);
 
 /* Declarations for plat_security.c */
 extern void plat_security_setup(void);
index 181f2c8a3470a5001613f5e987dd4238bf4d5f60..13023d2edfc5d3254ed23a3ab9f6ef19bb780b6c 100644 (file)
  * 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"
 
 /*******************************************************************************
index f9a32aa09935af060f8f20bf28efe866cf5685d4..dd3b07b452616b087e3d7433d6242cb97f5adc2e 100644 (file)
@@ -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
index c8fc9f124ad23f80f6f213f7468a191176dcf06e..9fda3074b67f267146307c85ea59844ae83a747c 100644 (file)
  * 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"
 
index cc01a72882480707e25189396935f743a22628d3..2447d9e837c44010bca69e58775742d4a31d994f 100644 (file)
  * 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"
 
 /*******************************************************************************
index 8b768766ee13235939a0d84ea88dde82ca139673..81484e1cf3e88d6507c7f4fa416fcf23ec2b313d 100644 (file)
  * 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);
 
@@ -120,6 +122,11 @@ typedef struct tsp_context {
 /* TSPD power management handlers */
 extern const spd_pm_ops_t tspd_pm;
 
+/*******************************************************************************
+ * Forward declarations
+ ******************************************************************************/
+struct entry_info;
+
 /*******************************************************************************
  * Function & Data prototypes
  ******************************************************************************/
@@ -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__ */
index b395912518a424b224891e5d95abe443060228e4..e007bc30c650e2911286ba7144284ababf13be80 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <debug.h>
+#include <arch.h>
 #include <arch_helpers.h>
-#include <console.h>
-#include <platform.h>
-#include <psci.h>
+#include <assert.h>
+#include <string.h>
 #include "psci_private.h"
 
 typedef int (*afflvl_off_handler_t)(unsigned long, aff_map_node_t *);
index a1c12a888fd8a8133993ae72342370040623c485..8f9bb4de15afb7e6938c75c939542fa79a30a383 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <stdio.h>
-#include <stdint.h>
-#include <string.h>
+#include <arch.h>
+#include <arch_helpers.h>
 #include <assert.h>
+#include <bl_common.h>
 #include <bl31.h>
-#include <debug.h>
-#include <arch_helpers.h>
-#include <console.h>
-#include <platform.h>
-#include <psci.h>
 #include <context_mgmt.h>
 #include <runtime_svc.h>
+#include <stddef.h>
 #include "psci_private.h"
 
 typedef int (*afflvl_on_handler_t)(unsigned long,
index a8d09892436f9c24deca175b7c422d41ac6bb2b2..dc12f7a3911943019186ca4b6ab8ae0614e33c60 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <stdio.h>
-#include <string.h>
 #include <assert.h>
-#include <debug.h>
+#include <bl_common.h>
+#include <arch.h>
 #include <arch_helpers.h>
-#include <console.h>
-#include <platform.h>
-#include <psci.h>
+#include <context.h>
 #include <context_mgmt.h>
 #include <runtime_svc.h>
+#include <stddef.h>
 #include "psci_private.h"
 
 typedef int (*afflvl_suspend_handler_t)(unsigned long,
index 1ce28dc704c5b029f1ba65db61b30fdea903fe52..1d5c3621f05e479b6d25deb23dac5caeaab3d9fb 100644 (file)
  * 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 <psci.h>
+#include <assert.h>
+#include <bl_common.h>
+#include <context.h>
 #include <context_mgmt.h>
-#include <runtime_svc.h>
 #include <debug.h>
 #include "psci_private.h"
 
index 51d9b5700a4e2d6e8480c28baa2e1901fa77717c..e2c690db3a7e51b4a9fb664199f8ad8cfa26c9d9 100644 (file)
  */
 
 #include <arch.h>
-#include <platform.h>
-#include <runtime_svc.h>
 #include <asm_macros.S>
 #include <cm_macros.S>
-#include "psci_private.h"
+#include <psci.h>
 
        .globl  psci_aff_on_finish_entry
        .globl  psci_aff_suspend_finish_entry
index fd20ad5b739e1c2cf5063b5267734036e5555a4f..1bcf21661fdc765d8b5fa2503c23271df081f7d9 100644 (file)
  * 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 <assert.h>
 #include <runtime_svc.h>
 #include <debug.h>
-#include <context_mgmt.h>
 #include "psci_private.h"
 
 /*******************************************************************************
index e34ccfc7eb7dd29a96f715f3c381c0d50504d630..b0b5cc9f49b4c645122e437041bdb917a40f844e 100644 (file)
@@ -33,8 +33,8 @@
 
 #include <arch.h>
 #include <bakery_lock.h>
+#include <psci.h>
 
-#ifndef __ASSEMBLY__
 /*******************************************************************************
  * The following two data structures hold the generic information to bringup
  * a suspended/hotplugged out cpu
@@ -156,6 +156,5 @@ extern int psci_afflvl_suspend(unsigned long,
                               int);
 extern unsigned int psci_afflvl_suspend_finish(unsigned long, int, int);
 
-#endif /*__ASSEMBLY__*/
 
 #endif /* __PSCI_PRIVATE_H__ */
index 960c4b8b4e6fbc5b36c469de7c7e40d432152813..71d3f1e74c672915cb1c2a565ac565f01b8a4b40 100644 (file)
  * 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 <assert.h>
+#include <bl_common.h>
+#include <context.h>
 #include <context_mgmt.h>
-#include <runtime_svc.h>
+#include <platform.h>
+#include <stddef.h>
 #include "psci_private.h"
 
 /*******************************************************************************
index 40d709601e0d0e1b7280b9766d9b5d79cd57c06e..6cb03199815f4b93989fc9ac228042b5c938a434 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <stdint.h>
-#include <uuid.h>
-#include <context_mgmt.h>
+#include <debug.h>
+#include <psci.h>
 #include <runtime_svc.h>
 #include <std_svc.h>
-#include <psci.h>
-#include <debug.h>
+#include <stdint.h>
+#include <uuid.h>
 
 /* Standard Service UUID */
 DEFINE_SVC_UUID(arm_svc_uid,