Sanitise includes of include/drivers across codebase
Enforce full include path for includes.
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 with the same name).
Change-Id: I45e912b16c9fff81f50840dad7e7f90ed6637b2a
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/tftf/framework/debug.c b/tftf/framework/debug.c
index 0927ed4..66fc03b 100644
--- a/tftf/framework/debug.c
+++ b/tftf/framework/debug.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <console.h>
#include <debug.h>
+#include <drivers/console.h>
void __attribute__((__noreturn__)) do_panic(const char *file, int line)
{
diff --git a/tftf/framework/framework.mk b/tftf/framework/framework.mk
index 81061d4..4e5dc2e 100644
--- a/tftf/framework/framework.mk
+++ b/tftf/framework/framework.mk
@@ -12,11 +12,9 @@
TFTF_INCLUDES := \
-I${AUTOGEN_DIR} \
-Itftf/framework/include \
+ -Iinclude \
-Iinclude/common \
-Iinclude/common/${ARCH} \
- -Iinclude/drivers \
- -Iinclude/drivers/arm \
- -Iinclude/drivers/io \
-Iinclude/lib \
-Iinclude/lib/${ARCH} \
-Iinclude/lib/extensions \
diff --git a/tftf/framework/main.c b/tftf/framework/main.c
index 02b5438..7f987c0 100644
--- a/tftf/framework/main.c
+++ b/tftf/framework/main.c
@@ -5,9 +5,9 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <mmio.h>
#include <nvm.h>
diff --git a/tftf/framework/timer/timer_framework.c b/tftf/framework/timer/timer_framework.c
index 0b0a7a5..38106cf 100644
--- a/tftf/framework/timer/timer_framework.c
+++ b/tftf/framework/timer/timer_framework.c
@@ -6,8 +6,8 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <errno.h>
#include <irq.h>
#include <mmio.h>
diff --git a/tftf/tests/framework_validation_tests/test_validation_irq.c b/tftf/tests/framework_validation_tests/test_validation_irq.c
index 2e9e373..67f5c29 100644
--- a/tftf/tests/framework_validation_tests/test_validation_irq.c
+++ b/tftf/tests/framework_validation_tests/test_validation_irq.c
@@ -5,7 +5,7 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <platform.h>
#include <sgi.h>
diff --git a/tftf/tests/framework_validation_tests/test_validation_sgi.c b/tftf/tests/framework_validation_tests/test_validation_sgi.c
index 806bc58..7f81b2b 100644
--- a/tftf/tests/framework_validation_tests/test_validation_sgi.c
+++ b/tftf/tests/framework_validation_tests/test_validation_sgi.c
@@ -5,8 +5,8 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <platform.h>
#include <sgi.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
index 5f9393d..9afd910 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
@@ -6,8 +6,8 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
+#include <drivers/arm/arm_gic.h>
#include <events.h>
#include <irq.h>
#include <plat_topology.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
index 64f6c81..4732796 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
@@ -6,10 +6,10 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <cassert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <events.h>
#include <irq.h>
#include <math_utils.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c
index 78e8799..afb352b 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/system_suspend/test_psci_system_suspend.c
@@ -6,11 +6,11 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_v2.h>
#include <events.h>
-#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c
index 55de1fa..1690ca3 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/validate_power_state/test_validate_power_state.c
@@ -5,8 +5,8 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <events.h>
#include <irq.h>
#include <plat_topology.h>
diff --git a/tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c b/tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c
index 5b500be..6f629e8 100644
--- a/tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c
+++ b/tftf/tests/runtime_services/standard_service/psci/system_tests/test_psci_system_suspend_stress.c
@@ -6,11 +6,11 @@
#include <arch.h>
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_v2.h>
#include <events.h>
-#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c b/tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c
index dc357c1..ca8b63d 100644
--- a/tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c
+++ b/tftf/tests/runtime_services/standard_service/sdei/system_tests/test_sdei.c
@@ -6,11 +6,11 @@
#include <arch_helpers.h>
#include <debug.h>
+#include <drivers/arm/private_timer.h>
#include <events.h>
#include <plat_topology.h>
#include <platform.h>
#include <power_management.h>
-#include <private_timer.h>
#include <sdei.h>
#include <tftf_lib.h>
#include <timer.h>
diff --git a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
index b8bfcfe..c206c3d 100644
--- a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
+++ b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
@@ -5,11 +5,11 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gic_v2.h>
#include <events.h>
-#include <gic_common.h>
-#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
index 6eaf046..a52f67a 100644
--- a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
+++ b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
@@ -5,11 +5,11 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gic_v2.h>
#include <events.h>
-#include <gic_common.h>
-#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
#include <platform.h>
diff --git a/tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c b/tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c
index 0128ffa..19f3781 100644
--- a/tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c
+++ b/tftf/tests/runtime_services/trusted_os/tsp/test_normal_int_switch.c
@@ -5,9 +5,9 @@
*/
#include <arch_helpers.h>
-#include <arm_gic.h>
#include <assert.h>
#include <debug.h>
+#include <drivers/arm/arm_gic.h>
#include <irq.h>
#include <mmio.h>
#include <platform.h>