summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-12-14 00:18:21 +0000
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2019-01-04 10:43:17 +0000
commit09d40e0e08283a249e7dce0e106c07c5141f9b7e (patch)
tree46e7af7b5be2738948b359b2a07078e4cf1bbec1 /common
parentf5478dedf9e096d9539362b38ceb096b940ba3e2 (diff)
Sanitise includes across codebase
Enforce full include path for includes. Deprecate old paths. The following folders inside include/lib have been left unchanged: - include/lib/cpus/${ARCH} - include/lib/el3_runtime/${ARCH} The reason for this change is that having a global namespace for includes isn't a good idea. It defeats one of the advantages of having folders and it introduces problems that are sometimes subtle (because you may not know the header you are actually including if there are two of them). For example, this patch had to be created because two headers were called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform to avoid collision."). More recently, this patch has had similar problems: 46f9b2c3a282 ("drivers: add tzc380 support"). This problem was introduced in commit 4ecca33988b9 ("Move include and source files to logical locations"). At that time, there weren't too many headers so it wasn't a real issue. However, time has shown that this creates problems. Platforms that want to preserve the way they include headers may add the removed paths to PLAT_INCLUDES, but this is discouraged. Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'common')
-rw-r--r--common/aarch64/debug.S2
-rw-r--r--common/aarch64/early_exceptions.S2
-rw-r--r--common/backtrace/backtrace.c7
-rw-r--r--common/bl_common.c19
-rw-r--r--common/desc_image_load.c7
-rw-r--r--common/fdt_wrappers.c8
-rw-r--r--common/image_decompress.c9
-rw-r--r--common/runtime_svc.c5
-rw-r--r--common/tf_log.c7
9 files changed, 37 insertions, 29 deletions
diff --git a/common/aarch64/debug.S b/common/aarch64/debug.S
index 4478d0d0..da740ef2 100644
--- a/common/aarch64/debug.S
+++ b/common/aarch64/debug.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <debug.h>
+#include <common/debug.h>
.globl asm_print_str
.globl asm_print_hex
diff --git a/common/aarch64/early_exceptions.S b/common/aarch64/early_exceptions.S
index ba94f6cb..36a87246 100644
--- a/common/aarch64/early_exceptions.S
+++ b/common/aarch64/early_exceptions.S
@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
/* -----------------------------------------------------------------------------
* Very simple stackless exception handlers used by BL2 and BL31 stages.
diff --git a/common/backtrace/backtrace.c b/common/backtrace/backtrace.c
index a91d0657..bf60a08a 100644
--- a/common/backtrace/backtrace.c
+++ b/common/backtrace/backtrace.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <console.h>
-#include <debug.h>
#include <stdbool.h>
#include <stdint.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+
/* Maximum number of entries in the backtrace to display */
#define UNWIND_LIMIT 20U
diff --git a/common/bl_common.c b/common/bl_common.c
index d12a17cf..b2d22c19 100644
--- a/common/bl_common.c
+++ b/common/bl_common.c
@@ -4,18 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <auth_mod.h>
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
-#include <io_storage.h>
-#include <platform.h>
#include <string.h>
-#include <utils.h>
-#include <xlat_tables_defs.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/auth/auth_mod.h>
+#include <drivers/io/io_storage.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <plat/common/platform.h>
#if TRUSTED_BOARD_BOOT
# ifdef DYN_DISABLE_AUTH
diff --git a/common/desc_image_load.c b/common/desc_image_load.c
index b07fba33..ada02f8d 100644
--- a/common/desc_image_load.c
+++ b/common/desc_image_load.c
@@ -4,12 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <desc_image_load.h>
-
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
static bl_load_info_t bl_load_info;
static bl_params_t next_bl_params;
diff --git a/common/fdt_wrappers.c b/common/fdt_wrappers.c
index 31dafb2e..e67fdb00 100644
--- a/common/fdt_wrappers.c
+++ b/common/fdt_wrappers.c
@@ -7,11 +7,13 @@
/* Helper functions to offer easier navigation of Device Tree Blob */
#include <assert.h>
-#include <debug.h>
-#include <fdt_wrappers.h>
-#include <libfdt.h>
#include <string.h>
+#include <libfdt.h>
+
+#include <common/debug.h>
+#include <common/fdt_wrappers.h>
+
/*
* Read cells from a given property of the given node. At most 2 cells of the
* property are read, and pointer is updated. Returns 0 on success, and -1 upon
diff --git a/common/image_decompress.c b/common/image_decompress.c
index 7bd02b1d..a4586ae6 100644
--- a/common/image_decompress.c
+++ b/common/image_decompress.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <image_decompress.h>
#include <stdint.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/image_decompress.h>
+
static uintptr_t decompressor_buf_base;
static uint32_t decompressor_buf_size;
static decompressor_t *decompressor;
diff --git a/common/runtime_svc.c b/common/runtime_svc.c
index c30c0ecb..09ce787d 100644
--- a/common/runtime_svc.c
+++ b/common/runtime_svc.c
@@ -5,11 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <runtime_svc.h>
#include <string.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+
/*******************************************************************************
* The 'rt_svc_descs' array holds the runtime service descriptors exported by
* services by placing them in the 'rt_svc_descs' linker section.
diff --git a/common/tf_log.c b/common/tf_log.c
index 07021856..3e174dda 100644
--- a/common/tf_log.c
+++ b/common/tf_log.c
@@ -4,9 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdarg.h>
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
+#include <stdio.h>
+
+#include <common/debug.h>
+#include <plat/common/platform.h>
/* Set the default maximum log level to the `LOG_LEVEL` build flag */
static unsigned int max_log_level = LOG_LEVEL;