aboutsummaryrefslogtreecommitdiff
path: root/include/arch
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 /include/arch
parentf5478dedf9e096d9539362b38ceb096b940ba3e2 (diff)
downloadtrusted-firmware-a-09d40e0e08283a249e7dce0e106c07c5141f9b7e.tar.gz
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 'include/arch')
-rw-r--r--include/arch/aarch32/arch.h2
-rw-r--r--include/arch/aarch32/arch_helpers.h3
-rw-r--r--include/arch/aarch32/asm_macros.S4
-rw-r--r--include/arch/aarch32/console_macros.S2
-rw-r--r--include/arch/aarch32/smccc_helpers.h6
-rw-r--r--include/arch/aarch64/arch.h2
-rw-r--r--include/arch/aarch64/arch_helpers.h3
-rw-r--r--include/arch/aarch64/asm_macros.S4
-rw-r--r--include/arch/aarch64/console_macros.S2
-rw-r--r--include/arch/aarch64/smccc_helpers.h6
10 files changed, 20 insertions, 14 deletions
diff --git a/include/arch/aarch32/arch.h b/include/arch/aarch32/arch.h
index 8260c54919..cbe272c23e 100644
--- a/include/arch/aarch32/arch.h
+++ b/include/arch/aarch32/arch.h
@@ -7,7 +7,7 @@
#ifndef ARCH_H
#define ARCH_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* MIDR bit definitions
diff --git a/include/arch/aarch32/arch_helpers.h b/include/arch/aarch32/arch_helpers.h
index a6fe14fb89..c2773c1392 100644
--- a/include/arch/aarch32/arch_helpers.h
+++ b/include/arch/aarch32/arch_helpers.h
@@ -7,11 +7,12 @@
#ifndef ARCH_HELPERS_H
#define ARCH_HELPERS_H
-#include <arch.h>
#include <cdefs.h>
#include <stdint.h>
#include <string.h>
+#include <arch.h>
+
/**********************************************************************
* Macros which create inline functions to read or write CPU system
* registers
diff --git a/include/arch/aarch32/asm_macros.S b/include/arch/aarch32/asm_macros.S
index c54f75c2d9..8408804fbd 100644
--- a/include/arch/aarch32/asm_macros.S
+++ b/include/arch/aarch32/asm_macros.S
@@ -7,8 +7,8 @@
#define ASM_MACROS_S
#include <arch.h>
-#include <asm_macros_common.S>
-#include <spinlock.h>
+#include <common/asm_macros_common.S>
+#include <lib/spinlock.h>
/*
* TLBI instruction with type specifier that implements the workaround for
diff --git a/include/arch/aarch32/console_macros.S b/include/arch/aarch32/console_macros.S
index ba6e7d050b..ed5088d5a2 100644
--- a/include/arch/aarch32/console_macros.S
+++ b/include/arch/aarch32/console_macros.S
@@ -6,7 +6,7 @@
#ifndef CONSOLE_MACROS_S
#define CONSOLE_MACROS_S
-#include <console.h>
+#include <drivers/console.h>
/*
* This macro encapsulates the common setup that has to be done at the end of
diff --git a/include/arch/aarch32/smccc_helpers.h b/include/arch/aarch32/smccc_helpers.h
index 67952ec509..d3e5e59c53 100644
--- a/include/arch/aarch32/smccc_helpers.h
+++ b/include/arch/aarch32/smccc_helpers.h
@@ -7,7 +7,7 @@
#ifndef SMCCC_HELPERS_H
#define SMCCC_HELPERS_H
-#include <smccc.h>
+#include <lib/smccc.h>
/* These are offsets to registers in smc_ctx_t */
#define SMC_CTX_GPREG_R0 U(0x0)
@@ -25,9 +25,11 @@
#define SMC_CTX_SIZE U(0x90)
#ifndef __ASSEMBLY__
-#include <cassert.h>
+
#include <stdint.h>
+#include <lib/cassert.h>
+
/*
* The generic structure to save arguments and callee saved registers during
* an SMC. Also this structure is used to store the result return values after
diff --git a/include/arch/aarch64/arch.h b/include/arch/aarch64/arch.h
index 72a14dcfa8..8a44d83f0c 100644
--- a/include/arch/aarch64/arch.h
+++ b/include/arch/aarch64/arch.h
@@ -7,7 +7,7 @@
#ifndef ARCH_H
#define ARCH_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* MIDR bit definitions
diff --git a/include/arch/aarch64/arch_helpers.h b/include/arch/aarch64/arch_helpers.h
index 7222b9dc74..b912b4223a 100644
--- a/include/arch/aarch64/arch_helpers.h
+++ b/include/arch/aarch64/arch_helpers.h
@@ -7,12 +7,13 @@
#ifndef ARCH_HELPERS_H
#define ARCH_HELPERS_H
-#include <arch.h>
#include <cdefs.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
+#include <arch.h>
+
/**********************************************************************
* Macros which create inline functions to read or write CPU system
* registers
diff --git a/include/arch/aarch64/asm_macros.S b/include/arch/aarch64/asm_macros.S
index dea3021377..387be4ca3e 100644
--- a/include/arch/aarch64/asm_macros.S
+++ b/include/arch/aarch64/asm_macros.S
@@ -7,8 +7,8 @@
#define ASM_MACROS_S
#include <arch.h>
-#include <asm_macros_common.S>
-#include <spinlock.h>
+#include <common/asm_macros_common.S>
+#include <lib/spinlock.h>
/*
* TLBI instruction with type specifier that implements the workaround for
diff --git a/include/arch/aarch64/console_macros.S b/include/arch/aarch64/console_macros.S
index 5c88d4f229..90ef420487 100644
--- a/include/arch/aarch64/console_macros.S
+++ b/include/arch/aarch64/console_macros.S
@@ -6,7 +6,7 @@
#ifndef CONSOLE_MACROS_S
#define CONSOLE_MACROS_S
-#include <console.h>
+#include <drivers/console.h>
/*
* This macro encapsulates the common setup that has to be done at the end of
diff --git a/include/arch/aarch64/smccc_helpers.h b/include/arch/aarch64/smccc_helpers.h
index efab18b0c4..e28697d7ef 100644
--- a/include/arch/aarch64/smccc_helpers.h
+++ b/include/arch/aarch64/smccc_helpers.h
@@ -7,12 +7,14 @@
#ifndef SMCCC_HELPERS_H
#define SMCCC_HELPERS_H
-#include <smccc.h>
+#include <lib/smccc.h>
#ifndef __ASSEMBLY__
-#include <context.h>
+
#include <stdbool.h>
+#include <context.h>
+
/* Convenience macros to return from SMC handler */
#define SMC_RET0(_h) { \
return (uint64_t) (_h); \