From 97043ac98e13a726dbf8b3b41654dca759e3da2c Mon Sep 17 00:00:00 2001 From: Dan Handley Date: Wed, 9 Apr 2014 13:14:54 +0100 Subject: [PATCH] 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 --- bl1/aarch64/bl1_arch_setup.c | 3 +-- bl1/aarch64/bl1_exceptions.S | 6 ++---- bl1/bl1_main.c | 10 +++++----- bl2/aarch64/bl2_arch_setup.c | 2 +- bl2/aarch64/bl2_entrypoint.S | 2 +- bl2/bl2_main.c | 10 ++++------ bl31/aarch64/bl31_arch_setup.c | 5 ++++- bl31/aarch64/bl31_entrypoint.S | 3 +-- bl31/aarch64/context.S | 3 ++- bl31/aarch64/runtime_exceptions.S | 6 +++--- bl31/bl31_main.c | 11 ++++------- bl31/context_mgmt.c | 10 ++++------ bl31/runtime_svc.c | 16 +++------------- bl32/tsp/aarch64/tsp_entrypoint.S | 3 +-- bl32/tsp/aarch64/tsp_request.S | 2 +- bl32/tsp/tsp_main.c | 9 +++++---- common/aarch64/early_exceptions.S | 5 +---- common/bl_common.c | 13 +++++-------- drivers/arm/cci400/cci400.c | 4 ++-- drivers/arm/gic/gic_v3.c | 4 +--- drivers/arm/pl011/pl011.c | 2 +- drivers/arm/pl011/pl011_console.c | 2 +- drivers/arm/tzc400/tzc400.c | 6 +++--- drivers/io/io_fip.c | 14 +++++++------- drivers/io/io_memmap.c | 6 +++--- drivers/io/io_semihosting.c | 2 +- include/bl1/bl1.h | 10 +++++----- include/bl2/bl2.h | 12 ++++++++---- include/bl31/bl31.h | 17 ++++++++++++----- include/bl31/cm_macros.S | 5 +++++ include/bl31/context.h | 6 +++--- include/bl31/context_mgmt.h | 5 ++--- include/bl31/runtime_svc.h | 6 ++++-- include/bl31/services/psci.h | 5 +++++ include/bl32/bl32.h | 13 ++++++++----- include/bl32/payloads/tsp.h | 6 +++--- include/common/asm_macros.S | 3 +++ include/common/bl_common.h | 3 ++- include/common/debug.h | 4 ---- include/drivers/arm/pl011.h | 3 +++ include/drivers/arm/tzc400.h | 3 --- include/drivers/io_driver.h | 2 ++ include/drivers/io_fip.h | 2 ++ include/drivers/io_memmap.h | 2 ++ include/drivers/io_semihosting.h | 2 ++ include/lib/aarch64/arch.h | 1 - include/lib/aarch64/arch_helpers.h | 5 +---- include/lib/bakery_lock.h | 2 -- include/lib/io_storage.h | 6 +----- include/lib/mmio.h | 4 ---- include/lib/semihosting.h | 3 +++ lib/aarch64/cache_helpers.S | 2 +- lib/aarch64/misc_helpers.S | 3 +-- lib/aarch64/sysreg_helpers.S | 2 +- lib/aarch64/tlb_helpers.S | 1 - lib/aarch64/xlat_helpers.c | 3 +-- lib/io_storage.c | 5 ++--- lib/locks/bakery/bakery_lock.c | 7 +++---- lib/semihosting/semihosting.c | 3 +-- plat/common/aarch64/platform_helpers.S | 2 +- plat/common/aarch64/platform_mp_stack.S | 2 +- plat/common/aarch64/platform_up_stack.S | 2 +- plat/fvp/aarch64/bl1_plat_helpers.S | 4 ++-- plat/fvp/aarch64/plat_common.c | 5 ++++- plat/fvp/aarch64/plat_helpers.S | 3 ++- plat/fvp/bl1_plat_setup.c | 6 ++++-- plat/fvp/bl2_plat_setup.c | 6 +++--- plat/fvp/bl31_plat_setup.c | 6 +++++- plat/fvp/bl32_plat_setup.c | 6 ++---- plat/fvp/drivers/pwrc/fvp_pwrc.c | 7 +------ plat/fvp/plat_gic.c | 6 +++--- plat/fvp/plat_io_storage.c | 12 ++++++------ plat/fvp/plat_pm.c | 12 +++--------- plat/fvp/plat_topology.c | 1 - plat/fvp/platform.h | 20 +++++++++++++------- services/spd/tspd/tspd_common.c | 9 +++------ services/spd/tspd/tspd_helpers.S | 2 -- services/spd/tspd/tspd_main.c | 12 ++++-------- services/spd/tspd/tspd_pm.c | 12 +++--------- services/spd/tspd/tspd_private.h | 21 ++++++++++++++------- services/std_svc/psci/psci_afflvl_off.c | 10 +++------- services/std_svc/psci/psci_afflvl_on.c | 14 +++++--------- services/std_svc/psci/psci_afflvl_suspend.c | 10 ++++------ services/std_svc/psci/psci_common.c | 11 ++++------- services/std_svc/psci/psci_entry.S | 4 +--- services/std_svc/psci/psci_main.c | 8 ++------ services/std_svc/psci/psci_private.h | 3 +-- services/std_svc/psci/psci_setup.c | 12 ++++++------ services/std_svc/std_svc_setup.c | 9 ++++----- 89 files changed, 258 insertions(+), 294 deletions(-) diff --git a/bl1/aarch64/bl1_arch_setup.c b/bl1/aarch64/bl1_arch_setup.c index 417a5366a..758b8e8fe 100644 --- a/bl1/aarch64/bl1_arch_setup.c +++ b/bl1/aarch64/bl1_arch_setup.c @@ -28,9 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include -#include -#include /******************************************************************************* * Function that does the first bit of architectural setup that affects diff --git a/bl1/aarch64/bl1_exceptions.S b/bl1/aarch64/bl1_exceptions.S index e57f2288a..68d088b7b 100644 --- a/bl1/aarch64/bl1_exceptions.S +++ b/bl1/aarch64/bl1_exceptions.S @@ -29,11 +29,9 @@ */ #include -#include -#include -#include -#include #include +#include +#include .globl bl1_exceptions diff --git a/bl1/bl1_main.c b/bl1/bl1_main.c index 05af75a88..de7bc3180 100644 --- a/bl1/bl1_main.c +++ b/bl1/bl1_main.c @@ -28,13 +28,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include +#include #include -#include -#include +#include +#include #include +#include +#include #include "bl1_private.h" /******************************************************************************* diff --git a/bl2/aarch64/bl2_arch_setup.c b/bl2/aarch64/bl2_arch_setup.c index 7ecf669ba..0eafd1598 100644 --- a/bl2/aarch64/bl2_arch_setup.c +++ b/bl2/aarch64/bl2_arch_setup.c @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include -#include /******************************************************************************* * Place holder function to perform any S-EL1 specific architectural setup. At diff --git a/bl2/aarch64/bl2_entrypoint.S b/bl2/aarch64/bl2_entrypoint.S index 6bc779a05..b8af9a55d 100644 --- a/bl2/aarch64/bl2_entrypoint.S +++ b/bl2/aarch64/bl2_entrypoint.S @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include +#include .globl bl2_entrypoint diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c index 6f6ea51bf..ac2855911 100644 --- a/bl2/bl2_main.c +++ b/bl2/bl2_main.c @@ -28,16 +28,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include +#include #include -#include -#include -#include +#include #include #include #include +#include +#include #include "bl2_private.h" /******************************************************************************* diff --git a/bl31/aarch64/bl31_arch_setup.c b/bl31/aarch64/bl31_arch_setup.c index 793b8958e..acaa6b571 100644 --- a/bl31/aarch64/bl31_arch_setup.c +++ b/bl31/aarch64/bl31_arch_setup.c @@ -28,9 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include -#include #include +#include +#include +#include /******************************************************************************* * 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 c04bc181b..39fa605ee 100644 --- a/bl31/aarch64/bl31_entrypoint.S +++ b/bl31/aarch64/bl31_entrypoint.S @@ -28,10 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include #include +#include #include diff --git a/bl31/aarch64/context.S b/bl31/aarch64/context.S index 2b2e7bf84..45d4a2255 100644 --- a/bl31/aarch64/context.S +++ b/bl31/aarch64/context.S @@ -28,8 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include +#include /* ----------------------------------------------------- * The following function strictly follows the AArch64 diff --git a/bl31/aarch64/runtime_exceptions.S b/bl31/aarch64/runtime_exceptions.S index b89a76897..53cc176e0 100644 --- a/bl31/aarch64/runtime_exceptions.S +++ b/bl31/aarch64/runtime_exceptions.S @@ -29,11 +29,11 @@ */ #include -#include -#include -#include #include #include +#include +#include +#include .globl runtime_exceptions .globl el3_exit diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c index 907c4877b..cf826d01b 100644 --- a/bl31/bl31_main.c +++ b/bl31/bl31_main.c @@ -28,17 +28,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include +#include #include -#include -#include -#include +#include #include #include -#include #include +#include +#include /******************************************************************************* diff --git a/bl31/context_mgmt.c b/bl31/context_mgmt.c index 09b3bb8bb..8d1396e2e 100644 --- a/bl31/context_mgmt.c +++ b/bl31/context_mgmt.c @@ -28,15 +28,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include #include -#include +#include #include -#include +#include #include +#include +#include /******************************************************************************* * 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 8ec2f0b21..9a68e50fe 100644 --- a/bl31/runtime_svc.c +++ b/bl31/runtime_svc.c @@ -28,20 +28,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include +#include +#include +#include /******************************************************************************* * The 'rt_svc_descs' array holds the runtime service descriptors exported by diff --git a/bl32/tsp/aarch64/tsp_entrypoint.S b/bl32/tsp/aarch64/tsp_entrypoint.S index 8bfe454a1..97d54f659 100644 --- a/bl32/tsp/aarch64/tsp_entrypoint.S +++ b/bl32/tsp/aarch64/tsp_entrypoint.S @@ -28,10 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include -#include #include +#include .globl tsp_entrypoint diff --git a/bl32/tsp/aarch64/tsp_request.S b/bl32/tsp/aarch64/tsp_request.S index da7d6e6ac..6aa087367 100644 --- a/bl32/tsp/aarch64/tsp_request.S +++ b/bl32/tsp/aarch64/tsp_request.S @@ -28,8 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include +#include .globl tsp_get_magic diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c index 083c43094..a667ffc23 100644 --- a/bl32/tsp/tsp_main.c +++ b/bl32/tsp/tsp_main.c @@ -28,13 +28,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include -#include -#include +#include +#include #include +#include #include +#include +#include /******************************************************************************* * Lock to control access to the console diff --git a/common/aarch64/early_exceptions.S b/common/aarch64/early_exceptions.S index 41bff97f3..90f5421b0 100644 --- a/common/aarch64/early_exceptions.S +++ b/common/aarch64/early_exceptions.S @@ -28,11 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include #include +#include .globl early_exceptions diff --git a/common/bl_common.c b/common/bl_common.c index e96bfa053..af2b7b74c 100644 --- a/common/bl_common.c +++ b/common/bl_common.c @@ -28,17 +28,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include +#include #include -#include -#include -#include +#include #include -#include #include +#include +#include +#include unsigned long page_align(unsigned long value, unsigned dir) { diff --git a/drivers/arm/cci400/cci400.c b/drivers/arm/cci400/cci400.c index 4ca55b18b..02f7f9556 100644 --- a/drivers/arm/cci400/cci400.c +++ b/drivers/arm/cci400/cci400.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include +#include +#include static inline unsigned long get_slave_iface_base(unsigned long mpidr) { diff --git a/drivers/arm/gic/gic_v3.c b/drivers/arm/gic/gic_v3.c index d658a61b3..f42966296 100644 --- a/drivers/arm/gic/gic_v3.c +++ b/drivers/arm/gic/gic_v3.c @@ -28,11 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include -#include -#include #include +#include uintptr_t gicv3_get_rdist(uintptr_t gicr_base, uint64_t mpidr) { diff --git a/drivers/arm/pl011/pl011.c b/drivers/arm/pl011/pl011.c index 8288cd819..f12bd23d0 100644 --- a/drivers/arm/pl011/pl011.c +++ b/drivers/arm/pl011/pl011.c @@ -28,9 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include -#include void pl011_setbaudrate(unsigned long base_addr, unsigned int baudrate) { diff --git a/drivers/arm/pl011/pl011_console.c b/drivers/arm/pl011/pl011_console.c index 1a684ff6d..3b0e237f3 100644 --- a/drivers/arm/pl011/pl011_console.c +++ b/drivers/arm/pl011/pl011_console.c @@ -28,10 +28,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include -#include static unsigned long uart_base; diff --git a/drivers/arm/tzc400/tzc400.c b/drivers/arm/tzc400/tzc400.c index 56c6dea72..c1716db44 100644 --- a/drivers/arm/tzc400/tzc400.c +++ b/drivers/arm/tzc400/tzc400.c @@ -29,10 +29,10 @@ */ #include -#include -#include -#include #include +#include +#include +#include static uint32_t tzc_read_build_config(uint64_t base) { diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c index 482e06848..b2dcfccfd 100644 --- a/drivers/io/io_fip.c +++ b/drivers/io/io_fip.c @@ -28,17 +28,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include #include -#include +#include +#include #include -#include #include #include -#include +#include +#include +#include +#include +#include /* Useful for printing UUIDs when debugging.*/ #define PRINT_UUID2(x) \ diff --git a/drivers/io/io_memmap.c b/drivers/io/io_memmap.c index 2e70e9699..a40e61207 100644 --- a/drivers/io/io_memmap.c +++ b/drivers/io/io_memmap.c @@ -29,10 +29,10 @@ */ #include -#include -#include -#include #include +#include +#include +#include /* 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 diff --git a/drivers/io/io_semihosting.c b/drivers/io/io_semihosting.c index 89c844b2b..a37693df6 100644 --- a/drivers/io/io_semihosting.c +++ b/drivers/io/io_semihosting.c @@ -29,8 +29,8 @@ */ #include -#include #include +#include #include diff --git a/include/bl1/bl1.h b/include/bl1/bl1.h index 1750a1f05..d8afae460 100644 --- a/include/bl1/bl1.h +++ b/include/bl1/bl1.h @@ -31,16 +31,16 @@ #ifndef __BL1_H__ #define __BL1_H__ -#include -#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__ */ diff --git a/include/bl2/bl2.h b/include/bl2/bl2.h index 9a5094ff9..25b6f9cd3 100644 --- a/include/bl2/bl2.h +++ b/include/bl2/bl2.h @@ -31,18 +31,22 @@ #ifndef __BL2_H__ #define __BL2_H__ -#include - /****************************************** * 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__ */ diff --git a/include/bl31/bl31.h b/include/bl31/bl31.h index 6dd759640..b60e32cec 100644 --- a/include/bl31/bl31.h +++ b/include/bl31/bl31.h @@ -31,13 +31,19 @@ #ifndef __BL31_H__ #define __BL31_H__ -#include +#include /******************************************************************************* * 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__ */ diff --git a/include/bl31/cm_macros.S b/include/bl31/cm_macros.S index 9eeec1899..d26495662 100644 --- a/include/bl31/cm_macros.S +++ b/include/bl31/cm_macros.S @@ -27,6 +27,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#include +#include + + /* --------------------------------------------- * Zero out the callee saved register to prevent * leakage of secure state into the normal world diff --git a/include/bl31/context.h b/include/bl31/context.h index c7eda7df0..989b2e6a4 100644 --- a/include/bl31/context.h +++ b/include/bl31/context.h @@ -31,9 +31,6 @@ #ifndef __CONTEXT_H__ #define __CONTEXT_H__ -#include -#include - /******************************************************************************* * Constants that allow assembler code to access members of and the 'gp_regs' * structure at their correct offsets. @@ -171,6 +168,9 @@ #ifndef __ASSEMBLY__ +#include +#include + /* * Common constants to help define the 'cpu_context' structure and its * members below. diff --git a/include/bl31/context_mgmt.h b/include/bl31/context_mgmt.h index 35f7c8ccd..efcdcd28e 100644 --- a/include/bl31/context_mgmt.h +++ b/include/bl31/context_mgmt.h @@ -31,9 +31,8 @@ #ifndef __CM_H__ #define __CM_H__ -#include +#include -#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__ */ diff --git a/include/bl31/runtime_svc.h b/include/bl31/runtime_svc.h index ac85fa3f2..12b5db8b6 100644 --- a/include/bl31/runtime_svc.h +++ b/include/bl31/runtime_svc.h @@ -30,8 +30,6 @@ #ifndef __RUNTIME_SVC_H__ #define __RUNTIME_SVC_H__ -#include -#include /******************************************************************************* * Bit definitions inside the function id as per the SMC calling convention @@ -122,6 +120,10 @@ #ifndef __ASSEMBLY__ +#include +#include +#include + /* Various flags passed to SMC handlers */ #define SMC_FROM_SECURE (0 << 0) #define SMC_FROM_NON_SECURE (1 << 0) diff --git a/include/bl31/services/psci.h b/include/bl31/services/psci.h index ab7b7bdd0..570fe5b8a 100644 --- a/include/bl31/services/psci.h +++ b/include/bl31/services/psci.h @@ -31,6 +31,7 @@ #ifndef __PSCI_H__ #define __PSCI_H__ + /******************************************************************************* * Defines for runtime services func ids ******************************************************************************/ @@ -131,6 +132,10 @@ #define PSCI_NUM_AFFS 32ull #ifndef __ASSEMBLY__ + +#include + + /******************************************************************************* * Structure populated by platform specific code to export routines which * perform common low level pm functions diff --git a/include/bl32/bl32.h b/include/bl32/bl32.h index e46988193..323948767 100644 --- a/include/bl32/bl32.h +++ b/include/bl32/bl32.h @@ -31,15 +31,18 @@ #ifndef __BL32_H__ #define __BL32_H__ -#ifndef __ASSEMBLY__ #include -#include +/****************************************** + * 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__ */ diff --git a/include/bl32/payloads/tsp.h b/include/bl32/payloads/tsp.h index 4ac7a1aaf..1f542d536 100644 --- a/include/bl32/payloads/tsp.h +++ b/include/bl32/payloads/tsp.h @@ -31,9 +31,6 @@ #ifndef __TSP_H__ #define __TSP_H__ -#include -#include - /* * 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 +#include /* For CACHE_WRITEBACK_GRANULE */ #include typedef void (*tsp_generic_fptr_t)(uint64_t arg0, diff --git a/include/common/asm_macros.S b/include/common/asm_macros.S index 8bcb7d28b..6cf1a19f7 100644 --- a/include/common/asm_macros.S +++ b/include/common/asm_macros.S @@ -28,6 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include + + .macro func_prologue stp x29, x30, [sp, #-0x10]! mov x29,sp diff --git a/include/common/bl_common.h b/include/common/bl_common.h index 1eb6d79a4..9fba9c067 100644 --- a/include/common/bl_common.h +++ b/include/common/bl_common.h @@ -58,7 +58,8 @@ #ifndef __ASSEMBLY__ -#include + +#include /* For __dead2 */ /******************************************************************************* * Structure used for telling the next BL how much of a particular type of diff --git a/include/common/debug.h b/include/common/debug.h index f82947779..e4fa31e58 100644 --- a/include/common/debug.h +++ b/include/common/debug.h @@ -31,9 +31,6 @@ #ifndef __DEBUG_H__ #define __DEBUG_H__ -/* Do not try to call this from ASM code. */ -#ifndef __ASSEMBLY__ - #include /* 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__ */ diff --git a/include/drivers/arm/pl011.h b/include/drivers/arm/pl011.h index 5ad2fc7d3..28aef54a6 100644 --- a/include/drivers/arm/pl011.h +++ b/include/drivers/arm/pl011.h @@ -31,6 +31,9 @@ #ifndef __PL011_H__ #define __PL011_H__ +#include + + /* PL011 Registers */ #define UARTDR 0x000 #define UARTRSR 0x004 diff --git a/include/drivers/arm/tzc400.h b/include/drivers/arm/tzc400.h index 7ac82ae63..b4aa3ba59 100644 --- a/include/drivers/arm/tzc400.h +++ b/include/drivers/arm/tzc400.h @@ -147,8 +147,6 @@ /* 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__ */ diff --git a/include/drivers/io_driver.h b/include/drivers/io_driver.h index cade5e706..cc01d3b2a 100644 --- a/include/drivers/io_driver.h +++ b/include/drivers/io_driver.h @@ -31,7 +31,9 @@ #ifndef __IO_DRIVER_H__ #define __IO_DRIVER_H__ +#include #include /* For MAX_IO_DEVICES */ +#include /* Generic IO entity structure,representing an accessible IO construct on the diff --git a/include/drivers/io_fip.h b/include/drivers/io_fip.h index 56dd1e0fc..212570d81 100644 --- a/include/drivers/io_fip.h +++ b/include/drivers/io_fip.h @@ -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__ */ diff --git a/include/drivers/io_memmap.h b/include/drivers/io_memmap.h index 5fa7bc987..0e59ecbd4 100644 --- a/include/drivers/io_memmap.h +++ b/include/drivers/io_memmap.h @@ -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__ */ diff --git a/include/drivers/io_semihosting.h b/include/drivers/io_semihosting.h index 7dc632dd7..eab290a75 100644 --- a/include/drivers/io_semihosting.h +++ b/include/drivers/io_semihosting.h @@ -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__ */ diff --git a/include/lib/aarch64/arch.h b/include/lib/aarch64/arch.h index 32167eb3b..d7e65b38e 100644 --- a/include/lib/aarch64/arch.h +++ b/include/lib/aarch64/arch.h @@ -31,7 +31,6 @@ #ifndef __ARCH_H__ #define __ARCH_H__ -#include /******************************************************************************* * MIDR bit definitions diff --git a/include/lib/aarch64/arch_helpers.h b/include/lib/aarch64/arch_helpers.h index f55c0033c..565b1b488 100644 --- a/include/lib/aarch64/arch_helpers.h +++ b/include/lib/aarch64/arch_helpers.h @@ -31,10 +31,8 @@ #ifndef __ARCH_HELPERS_H__ #define __ARCH_HELPERS_H__ -#include +#include /* For __dead2 */ -#ifndef __ASSEMBLY__ -#include /******************************************************************************* * 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__ */ diff --git a/include/lib/bakery_lock.h b/include/lib/bakery_lock.h index 0def06748..e6744a51e 100644 --- a/include/lib/bakery_lock.h +++ b/include/lib/bakery_lock.h @@ -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__ */ diff --git a/include/lib/io_storage.h b/include/lib/io_storage.h index 59fd3f479..b6c5f9f58 100644 --- a/include/lib/io_storage.h +++ b/include/lib/io_storage.h @@ -31,10 +31,7 @@ #ifndef __IO_H__ #define __IO_H__ -#ifndef __ASSEMBLY__ - -#include -#include /* For ssize_t */ +#include /* 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__ */ diff --git a/include/lib/mmio.h b/include/lib/mmio.h index c79c3f5c5..d3c2cae51 100644 --- a/include/lib/mmio.h +++ b/include/lib/mmio.h @@ -31,8 +31,6 @@ #ifndef __MMIO_H__ #define __MMIO_H__ -#ifndef __ASSEMBLY__ - #include 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__ */ diff --git a/include/lib/semihosting.h b/include/lib/semihosting.h index e688618a3..9d0b39f75 100644 --- a/include/lib/semihosting.h +++ b/include/lib/semihosting.h @@ -31,6 +31,9 @@ #ifndef __SEMIHOSTING_H__ #define __SEMIHOSTING_H__ +#include /* For ssize_t */ + + #define SEMIHOSTING_SYS_OPEN 0x01 #define SEMIHOSTING_SYS_CLOSE 0x02 #define SEMIHOSTING_SYS_WRITE0 0x04 diff --git a/lib/aarch64/cache_helpers.S b/lib/aarch64/cache_helpers.S index 2696d901c..2649ad0e0 100644 --- a/lib/aarch64/cache_helpers.S +++ b/lib/aarch64/cache_helpers.S @@ -28,7 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include .globl dcisw diff --git a/lib/aarch64/misc_helpers.S b/lib/aarch64/misc_helpers.S index e3b4ab582..e7b233135 100644 --- a/lib/aarch64/misc_helpers.S +++ b/lib/aarch64/misc_helpers.S @@ -28,8 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include +#include #include .globl enable_irq diff --git a/lib/aarch64/sysreg_helpers.S b/lib/aarch64/sysreg_helpers.S index 8e816f036..61468f956 100644 --- a/lib/aarch64/sysreg_helpers.S +++ b/lib/aarch64/sysreg_helpers.S @@ -28,7 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include .globl read_vbar_el1 diff --git a/lib/aarch64/tlb_helpers.S b/lib/aarch64/tlb_helpers.S index 42449747b..ec1558b09 100644 --- a/lib/aarch64/tlb_helpers.S +++ b/lib/aarch64/tlb_helpers.S @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include .globl tlbialle1 diff --git a/lib/aarch64/xlat_helpers.c b/lib/aarch64/xlat_helpers.c index 87d24ec9f..d401ffc42 100644 --- a/lib/aarch64/xlat_helpers.c +++ b/lib/aarch64/xlat_helpers.c @@ -28,9 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include +#include /******************************************************************************* * Helper to create a level 1/2 table descriptor which points to a level 2/3 diff --git a/lib/io_storage.c b/lib/io_storage.c index c3b94bb0f..01ca1c686 100644 --- a/lib/io_storage.c +++ b/lib/io_storage.c @@ -28,11 +28,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ - -#include #include -#include #include +#include +#include #define MAX_DEVICES(plat_data) \ diff --git a/lib/locks/bakery/bakery_lock.c b/lib/locks/bakery/bakery_lock.c index 3cb9248ea..6d4ab87bb 100644 --- a/lib/locks/bakery/bakery_lock.c +++ b/lib/locks/bakery/bakery_lock.c @@ -28,11 +28,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include - -#include #include +#include +#include +#include /* * Functions in this file implement Bakery Algorithm for mutual exclusion. diff --git a/lib/semihosting/semihosting.c b/lib/semihosting/semihosting.c index 3232cd544..1bce377cf 100644 --- a/lib/semihosting/semihosting.c +++ b/lib/semihosting/semihosting.c @@ -29,10 +29,9 @@ */ #include -#include #include -#include #include +#include #ifndef SEMIHOSTING_SUPPORTED #define SEMIHOSTING_SUPPORTED 1 diff --git a/plat/common/aarch64/platform_helpers.S b/plat/common/aarch64/platform_helpers.S index 29268ba4d..7e201213f 100644 --- a/plat/common/aarch64/platform_helpers.S +++ b/plat/common/aarch64/platform_helpers.S @@ -29,8 +29,8 @@ */ #include -#include #include +#include .weak platform_get_core_pos diff --git a/plat/common/aarch64/platform_mp_stack.S b/plat/common/aarch64/platform_mp_stack.S index 1438814ee..ebbf509b4 100644 --- a/plat/common/aarch64/platform_mp_stack.S +++ b/plat/common/aarch64/platform_mp_stack.S @@ -29,8 +29,8 @@ */ #include -#include #include +#include .local pcpu_dv_mem_stack diff --git a/plat/common/aarch64/platform_up_stack.S b/plat/common/aarch64/platform_up_stack.S index b321a4e27..880793d89 100644 --- a/plat/common/aarch64/platform_up_stack.S +++ b/plat/common/aarch64/platform_up_stack.S @@ -29,8 +29,8 @@ */ #include -#include #include +#include .local pcpu_dv_mem_stack diff --git a/plat/fvp/aarch64/bl1_plat_helpers.S b/plat/fvp/aarch64/bl1_plat_helpers.S index 64f230db0..92075ea4c 100644 --- a/plat/fvp/aarch64/bl1_plat_helpers.S +++ b/plat/fvp/aarch64/bl1_plat_helpers.S @@ -29,9 +29,9 @@ */ #include -#include -#include #include +#include +#include #include "../drivers/pwrc/fvp_pwrc.h" .globl platform_get_entrypoint diff --git a/plat/fvp/aarch64/plat_common.c b/plat/fvp/aarch64/plat_common.c index 40e6b3243..c8e529d4f 100644 --- a/plat/fvp/aarch64/plat_common.c +++ b/plat/fvp/aarch64/plat_common.c @@ -28,9 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include +#include +#include #include +#include #include #include diff --git a/plat/fvp/aarch64/plat_helpers.S b/plat/fvp/aarch64/plat_helpers.S index ab826f4c0..005790357 100644 --- a/plat/fvp/aarch64/plat_helpers.S +++ b/plat/fvp/aarch64/plat_helpers.S @@ -29,8 +29,9 @@ */ #include -#include #include +#include +#include .globl plat_report_exception diff --git a/plat/fvp/bl1_plat_setup.c b/plat/fvp/bl1_plat_setup.c index 818c4e3f2..e92303dea 100644 --- a/plat/fvp/bl1_plat_setup.c +++ b/plat/fvp/bl1_plat_setup.c @@ -28,12 +28,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include -#include +#include +#include #include #include #include +#include +#include /******************************************************************************* * Declarations of linker defined symbols which will help us find the layout diff --git a/plat/fvp/bl2_plat_setup.c b/plat/fvp/bl2_plat_setup.c index 8517497ed..a4960aa1d 100644 --- a/plat/fvp/bl2_plat_setup.c +++ b/plat/fvp/bl2_plat_setup.c @@ -28,12 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include -#include -#include +#include #include +#include #include +#include /******************************************************************************* * Declarations of linker defined symbols which will help us find the layout diff --git a/plat/fvp/bl31_plat_setup.c b/plat/fvp/bl31_plat_setup.c index 5abe2368d..aa7b2d86f 100644 --- a/plat/fvp/bl31_plat_setup.c +++ b/plat/fvp/bl31_plat_setup.c @@ -28,9 +28,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include +#include +#include #include +#include +#include +#include #include "drivers/pwrc/fvp_pwrc.h" /******************************************************************************* diff --git a/plat/fvp/bl32_plat_setup.c b/plat/fvp/bl32_plat_setup.c index 3226ea23b..b71800e40 100644 --- a/plat/fvp/bl32_plat_setup.c +++ b/plat/fvp/bl32_plat_setup.c @@ -28,13 +28,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include -#include -#include #include +#include #include +#include /******************************************************************************* * Declarations of linker defined symbols which will help us find the layout diff --git a/plat/fvp/drivers/pwrc/fvp_pwrc.c b/plat/fvp/drivers/pwrc/fvp_pwrc.c index 175d41c03..7a7f5168a 100644 --- a/plat/fvp/drivers/pwrc/fvp_pwrc.c +++ b/plat/fvp/drivers/pwrc/fvp_pwrc.c @@ -28,13 +28,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include -#include -#include #include +#include #include "fvp_pwrc.h" /* diff --git a/plat/fvp/plat_gic.c b/plat/fvp/plat_gic.c index be892ac37..8457af1ad 100644 --- a/plat/fvp/plat_gic.c +++ b/plat/fvp/plat_gic.c @@ -28,12 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include -#include +#include #include #include -#include +#include +#include /******************************************************************************* diff --git a/plat/fvp/plat_io_storage.c b/plat/fvp/plat_io_storage.c index 371f56719..3727d26a0 100644 --- a/plat/fvp/plat_io_storage.c +++ b/plat/fvp/plat_io_storage.c @@ -29,15 +29,15 @@ */ #include -#include -#include -#include +#include #include -#include -#include /* For FOPEN_MODE_... */ #include #include -#include +#include +#include +#include +#include /* For FOPEN_MODE_... */ +#include /* IO devices */ static io_plat_data_t io_data; diff --git a/plat/fvp/plat_pm.c b/plat/fvp/plat_pm.c index da940c1f6..c80d315b6 100644 --- a/plat/fvp/plat_pm.c +++ b/plat/fvp/plat_pm.c @@ -28,18 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include #include -#include -#include -#include -#include +#include #include #include -#include -/* Only included for error codes */ +#include +#include #include #include "drivers/pwrc/fvp_pwrc.h" diff --git a/plat/fvp/plat_topology.c b/plat/fvp/plat_topology.c index 99f325948..04b409ecb 100644 --- a/plat/fvp/plat_topology.c +++ b/plat/fvp/plat_topology.c @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include /* TODO: Reusing psci error codes & state information. Get our own! */ diff --git a/plat/fvp/platform.h b/plat/fvp/platform.h index 098f499d6..1ffdc982f 100644 --- a/plat/fvp/platform.h +++ b/plat/fvp/platform.h @@ -32,10 +32,6 @@ #define __PLATFORM_H__ #include -#include -#include -#include -#include /******************************************************************************* @@ -340,11 +336,21 @@ #ifndef __ASSEMBLY__ +#include + + 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); diff --git a/services/spd/tspd/tspd_common.c b/services/spd/tspd/tspd_common.c index 181f2c8a3..13023d2ed 100644 --- a/services/spd/tspd/tspd_common.c +++ b/services/spd/tspd/tspd_common.c @@ -28,15 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include #include -#include +#include #include -#include #include +#include +#include #include "tspd_private.h" /******************************************************************************* diff --git a/services/spd/tspd/tspd_helpers.S b/services/spd/tspd/tspd_helpers.S index f9a32aa09..dd3b07b45 100644 --- a/services/spd/tspd/tspd_helpers.S +++ b/services/spd/tspd/tspd_helpers.S @@ -28,9 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include -#include #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 c8fc9f124..9fda3074b 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 -#include -#include #include -#include -#include +#include +#include +#include #include #include -#include +#include #include -#include -#include #include #include "tspd_private.h" diff --git a/services/spd/tspd/tspd_pm.c b/services/spd/tspd/tspd_pm.c index cc01a7288..2447d9e83 100644 --- a/services/spd/tspd/tspd_pm.c +++ b/services/spd/tspd/tspd_pm.c @@ -28,18 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include #include -#include -#include +#include +#include #include -#include -#include -#include -#include #include +#include #include "tspd_private.h" /******************************************************************************* diff --git a/services/spd/tspd/tspd_private.h b/services/spd/tspd/tspd_private.h index 8b768766e..81484e1cf 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 #include +#include +#include #include -#include -#include /******************************************************************************* * Secure Payload PM state information e.g. SP is suspended, uninitialised etc @@ -91,6 +90,9 @@ #ifndef __ASSEMBLY__ +#include +#include + /* 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__ */ diff --git a/services/std_svc/psci/psci_afflvl_off.c b/services/std_svc/psci/psci_afflvl_off.c index b39591251..e007bc30c 100644 --- a/services/std_svc/psci/psci_afflvl_off.c +++ b/services/std_svc/psci/psci_afflvl_off.c @@ -28,14 +28,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include +#include #include -#include -#include -#include +#include +#include #include "psci_private.h" typedef int (*afflvl_off_handler_t)(unsigned long, aff_map_node_t *); diff --git a/services/std_svc/psci/psci_afflvl_on.c b/services/std_svc/psci/psci_afflvl_on.c index a1c12a888..8f9bb4de1 100644 --- a/services/std_svc/psci/psci_afflvl_on.c +++ b/services/std_svc/psci/psci_afflvl_on.c @@ -28,18 +28,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include +#include +#include +#include #include #include +#include #include "psci_private.h" typedef int (*afflvl_on_handler_t)(unsigned long, diff --git a/services/std_svc/psci/psci_afflvl_suspend.c b/services/std_svc/psci/psci_afflvl_suspend.c index a8d098924..dc12f7a39 100644 --- a/services/std_svc/psci/psci_afflvl_suspend.c +++ b/services/std_svc/psci/psci_afflvl_suspend.c @@ -28,16 +28,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include #include -#include +#include +#include #include -#include -#include -#include +#include #include #include +#include #include "psci_private.h" typedef int (*afflvl_suspend_handler_t)(unsigned long, diff --git a/services/std_svc/psci/psci_common.c b/services/std_svc/psci/psci_common.c index 1ce28dc70..1d5c3621f 100644 --- a/services/std_svc/psci/psci_common.c +++ b/services/std_svc/psci/psci_common.c @@ -28,15 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include +#include #include -#include -#include -#include +#include +#include +#include #include -#include #include #include "psci_private.h" diff --git a/services/std_svc/psci/psci_entry.S b/services/std_svc/psci/psci_entry.S index 51d9b5700..e2c690db3 100644 --- a/services/std_svc/psci/psci_entry.S +++ b/services/std_svc/psci/psci_entry.S @@ -29,11 +29,9 @@ */ #include -#include -#include #include #include -#include "psci_private.h" +#include .globl psci_aff_on_finish_entry .globl psci_aff_suspend_finish_entry diff --git a/services/std_svc/psci/psci_main.c b/services/std_svc/psci/psci_main.c index fd20ad5b7..1bcf21661 100644 --- a/services/std_svc/psci/psci_main.c +++ b/services/std_svc/psci/psci_main.c @@ -28,15 +28,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include +#include #include -#include -#include +#include #include #include -#include #include "psci_private.h" /******************************************************************************* diff --git a/services/std_svc/psci/psci_private.h b/services/std_svc/psci/psci_private.h index e34ccfc7e..b0b5cc9f4 100644 --- a/services/std_svc/psci/psci_private.h +++ b/services/std_svc/psci/psci_private.h @@ -33,8 +33,8 @@ #include #include +#include -#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__ */ diff --git a/services/std_svc/psci/psci_setup.c b/services/std_svc/psci/psci_setup.c index 960c4b8b4..71d3f1e74 100644 --- a/services/std_svc/psci/psci_setup.c +++ b/services/std_svc/psci/psci_setup.c @@ -28,14 +28,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include +#include #include -#include -#include +#include +#include +#include #include -#include +#include +#include #include "psci_private.h" /******************************************************************************* diff --git a/services/std_svc/std_svc_setup.c b/services/std_svc/std_svc_setup.c index 40d709601..6cb031998 100644 --- a/services/std_svc/std_svc_setup.c +++ b/services/std_svc/std_svc_setup.c @@ -28,13 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include +#include +#include #include #include -#include -#include +#include +#include /* Standard Service UUID */ DEFINE_SVC_UUID(arm_svc_uid,