Commit 09d40e0e authored by Antonio Nino Diaz's avatar Antonio Nino Diaz
Browse files

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: e0ea0928 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3 ("drivers: add tzc380 support").

This problem was introduced in commit 4ecca339

 ("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: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
parent f5478ded
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#define INTERRUPT_MGMT_H #define INTERRUPT_MGMT_H
#include <arch.h> #include <arch.h>
#include <utils_def.h> #include <lib/utils_def.h>
/******************************************************************************* /*******************************************************************************
* Constants for the types of interrupts recognised by the IM framework * Constants for the types of interrupts recognised by the IM framework
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef TLK_H #ifndef TLK_H
#define TLK_H #define TLK_H
#include <utils_def.h> #include <lib/utils_def.h>
/* /*
* Generate function IDs for the Trusted OS/Apps * Generate function IDs for the Trusted OS/Apps
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
#ifndef BL_COMMON_H #ifndef BL_COMMON_H
#define BL_COMMON_H #define BL_COMMON_H
#include <ep_info.h> #include <common/ep_info.h>
#include <param_header.h> #include <common/param_header.h>
#include <utils_def.h> #include <lib/utils_def.h>
#define UP U(1) #define UP U(1)
#define DOWN U(0) #define DOWN U(0)
...@@ -58,11 +58,11 @@ ...@@ -58,11 +58,11 @@
#define SERROR_AARCH32 U(0xf) #define SERROR_AARCH32 U(0xf)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <cassert.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <utils_def.h> /* To retain compatibility */
#include <lib/cassert.h>
/* /*
* Declarations of linker defined symbols to help determine memory layout of * Declarations of linker defined symbols to help determine memory layout of
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef DEBUG_H #ifndef DEBUG_H
#define DEBUG_H #define DEBUG_H
#include <utils_def.h> #include <lib/utils_def.h>
/* /*
* The log output macros print output to the console. These macros produce * The log output macros print output to the console. These macros produce
...@@ -28,12 +28,14 @@ ...@@ -28,12 +28,14 @@
#define LOG_LEVEL_VERBOSE U(50) #define LOG_LEVEL_VERBOSE U(50)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <cdefs.h> #include <cdefs.h>
#include <console.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <drivers/console.h>
/* /*
* Define Log Markers corresponding to each log level which will * Define Log Markers corresponding to each log level which will
* be embedded in the format string and is expected by tf_log() to determine * be embedded in the format string and is expected by tf_log() to determine
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#ifndef DESC_IMAGE_LOAD_H #ifndef DESC_IMAGE_LOAD_H
#define DESC_IMAGE_LOAD_H #define DESC_IMAGE_LOAD_H
#include <bl_common.h> #include <common/bl_common.h>
/* Following structure is used to store BL ep/image info. */ /* Following structure is used to store BL ep/image info. */
typedef struct bl_mem_params_node { typedef struct bl_mem_params_node {
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef EP_INFO_H #ifndef EP_INFO_H
#define EP_INFO_H #define EP_INFO_H
#include <param_header.h> #include <common/param_header.h>
#include <utils_def.h> #include <lib/utils_def.h>
#define SECURE U(0x0) #define SECURE U(0x0)
#define NON_SECURE U(0x1) #define NON_SECURE U(0x1)
...@@ -64,9 +64,10 @@ ...@@ -64,9 +64,10 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <cassert.h>
#include <stdint.h> #include <stdint.h>
#include <lib/cassert.h>
typedef struct aapcs64_params { typedef struct aapcs64_params {
u_register_t arg0; u_register_t arg0;
u_register_t arg1; u_register_t arg1;
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#define PARAM_HEADER_H #define PARAM_HEADER_H
#include <stdbool.h> #include <stdbool.h>
#include <utils_def.h>
#include <lib/utils_def.h>
/* Param header types */ /* Param header types */
#define PARAM_EP U(0x01) #define PARAM_EP U(0x01)
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#ifndef RUNTIME_SVC_H #ifndef RUNTIME_SVC_H
#define RUNTIME_SVC_H #define RUNTIME_SVC_H
#include <bl_common.h> /* to include exception types */ #include <common/bl_common.h> /* to include exception types */
#include <cassert.h> #include <lib/cassert.h>
#include <lib/utils_def.h>
#include <smccc_helpers.h> /* to include SMCCC definitions */ #include <smccc_helpers.h> /* to include SMCCC definitions */
#include <utils_def.h>
/******************************************************************************* /*******************************************************************************
* Structure definition, typedefs & constants for the runtime service framework * Structure definition, typedefs & constants for the runtime service framework
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef TBBR_IMG_DEF_H #ifndef TBBR_IMG_DEF_H
#define TBBR_IMG_DEF_H #define TBBR_IMG_DEF_H
#include <utils_def.h> #include <lib/utils_def.h>
/* Firmware Image Package */ /* Firmware Image Package */
#define FIP_IMAGE_ID U(0) #define FIP_IMAGE_ID U(0)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef CCI_H #ifndef CCI_H
#define CCI_H #define CCI_H
#include <utils_def.h> #include <lib/utils_def.h>
/* Slave interface offsets from PERIPHBASE */ /* Slave interface offsets from PERIPHBASE */
#define SLAVE_IFACE6_OFFSET UL(0x7000) #define SLAVE_IFACE6_OFFSET UL(0x7000)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef GIC_COMMON_H #ifndef GIC_COMMON_H
#define GIC_COMMON_H #define GIC_COMMON_H
#include <utils_def.h> #include <lib/utils_def.h>
/******************************************************************************* /*******************************************************************************
* GIC Distributor interface general definitions * GIC Distributor interface general definitions
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef GICV2_H #ifndef GICV2_H
#define GICV2_H #define GICV2_H
#include <gic_common.h> #include <drivers/arm/gic_common.h>
/******************************************************************************* /*******************************************************************************
* GICv2 miscellaneous definitions * GICv2 miscellaneous definitions
...@@ -119,9 +119,10 @@ ...@@ -119,9 +119,10 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <cdefs.h> #include <cdefs.h>
#include <interrupt_props.h>
#include <stdint.h> #include <stdint.h>
#include <common/interrupt_props.h>
/******************************************************************************* /*******************************************************************************
* This structure describes some of the implementation defined attributes of * This structure describes some of the implementation defined attributes of
* the GICv2 IP. It is used by the platform port to specify these attributes * the GICv2 IP. It is used by the platform port to specify these attributes
......
...@@ -209,12 +209,13 @@ ...@@ -209,12 +209,13 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <arch_helpers.h>
#include <gic_common.h>
#include <interrupt_props.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <utils_def.h>
#include <arch_helpers.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gic_common.h>
#include <lib/utils_def.h>
static inline bool gicv3_is_intr_id_special_identifier(unsigned int id) static inline bool gicv3_is_intr_id_special_identifier(unsigned int id)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef PL011_H #ifndef PL011_H
#define PL011_H #define PL011_H
#include <console.h> #include <drivers/console.h>
/* PL011 Registers */ /* PL011 Registers */
#define UARTDR 0x000 #define UARTDR 0x000
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef PL061_GPIO_H #ifndef PL061_GPIO_H
#define PL061_GPIO_H #define PL061_GPIO_H
#include <gpio.h> #include <drivers/gpio.h>
void pl061_gpio_register(uintptr_t base_addr, int gpio_dev); void pl061_gpio_register(uintptr_t base_addr, int gpio_dev);
void pl061_gpio_init(void); void pl061_gpio_init(void);
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#define SMMU_V3_H #define SMMU_V3_H
#include <stdint.h> #include <stdint.h>
#include <utils_def.h>
#include <lib/utils_def.h>
/* SMMUv3 register offsets from device base */ /* SMMUv3 register offsets from device base */
#define SMMU_S_IDR1 U(0x8004) #define SMMU_S_IDR1 U(0x8004)
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
#ifndef SP804_DELAY_TIMER_H #ifndef SP804_DELAY_TIMER_H
#define SP804_DELAY_TIMER_H #define SP804_DELAY_TIMER_H
#include <delay_timer.h>
#include <stdint.h> #include <stdint.h>
#include <drivers/delay_timer.h>
uint32_t sp804_get_timer_value(void); uint32_t sp804_get_timer_value(void);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef SP805_H #ifndef SP805_H
#define SP805_H #define SP805_H
#include <utils_def.h> #include <lib/utils_def.h>
/* SP805 register offset */ /* SP805 register offset */
#define SP805_WDOG_LOAD_OFF UL(0x000) #define SP805_WDOG_LOAD_OFF UL(0x000)
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef TZC380_H #ifndef TZC380_H
#define TZC380_H #define TZC380_H
#include <tzc_common.h> #include <drivers/arm/tzc_common.h>
#include <utils_def.h> #include <lib/utils_def.h>
#define TZC380_CONFIGURATION_OFF U(0x000) #define TZC380_CONFIGURATION_OFF U(0x000)
#define ACTION_OFF U(0x004) #define ACTION_OFF U(0x004)
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef TZC400_H #ifndef TZC400_H
#define TZC400_H #define TZC400_H
#include <tzc_common.h> #include <drivers/arm/tzc_common.h>
#include <utils_def.h> #include <lib/utils_def.h>
#define BUILD_CONFIG_OFF U(0x000) #define BUILD_CONFIG_OFF U(0x000)
#define GATE_KEEPER_OFF U(0x008) #define GATE_KEEPER_OFF U(0x008)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment