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
......@@ -7,7 +7,7 @@
#ifndef CORTEX_A57_H
#define CORTEX_A57_H
#include <utils_def.h>
#include <lib/utils_def.h>
/* Cortex-A57 midr for revision 0 */
#define CORTEX_A57_MIDR 0x410FD070
......
......@@ -6,7 +6,8 @@
#ifndef CORTEX_A72_H
#define CORTEX_A72_H
#include <utils_def.h>
#include <lib/utils_def.h>
/* Cortex-A72 midr for revision 0 */
#define CORTEX_A72_MIDR 0x410FD080
......
......@@ -7,7 +7,7 @@
#define CPU_MACROS_S
#include <arch.h>
#include <errata_report.h>
#include <lib/cpus/errata_report.h>
#if defined(IMAGE_BL1) || defined(IMAGE_BL32) || (defined(IMAGE_BL2) && BL2_AT_EL3)
#define IMAGE_AT_EL3
......
......@@ -6,7 +6,8 @@
#ifndef CORTEX_A57_H
#define CORTEX_A57_H
#include <utils_def.h>
#include <lib/utils_def.h>
/* Cortex-A57 midr for revision 0 */
#define CORTEX_A57_MIDR U(0x410FD070)
......
......@@ -6,7 +6,8 @@
#ifndef CORTEX_A72_H
#define CORTEX_A72_H
#include <utils_def.h>
#include <lib/utils_def.h>
/* Cortex-A72 midr for revision 0 */
#define CORTEX_A72_MIDR 0x410FD080
......
......@@ -7,7 +7,7 @@
#ifndef CORTEX_A75_H
#define CORTEX_A75_H
#include <utils_def.h>
#include <lib/utils_def.h>
/* Cortex-A75 MIDR */
#define CORTEX_A75_MIDR U(0x410fd0a0)
......
......@@ -7,7 +7,7 @@
#ifndef CORTEX_ARES_H
#define CORTEX_ARES_H
#include <utils_def.h>
#include <lib/utils_def.h>
/* Cortex-ARES MIDR for revision 0 */
#define CORTEX_ARES_MIDR U(0x410fd0c0)
......
......@@ -7,7 +7,7 @@
#define CPU_MACROS_S
#include <arch.h>
#include <errata_report.h>
#include <lib/cpus/errata_report.h>
#define CPU_IMPL_PN_MASK (MIDR_IMPL_MASK << MIDR_IMPL_SHIFT) | \
(MIDR_PN_MASK << MIDR_PN_SHIFT)
......
......@@ -7,7 +7,7 @@
#ifndef DSU_DEF_H
#define DSU_DEF_H
#include <utils_def.h>
#include <lib/utils_def.h>
/********************************************************************
* DSU control registers definitions *
......
......@@ -11,8 +11,8 @@
#include <arch.h>
#include <arch_helpers.h>
#include <spinlock.h>
#include <utils_def.h>
#include <lib/spinlock.h>
#include <lib/utils_def.h>
#if DEBUG
void print_errata_status(void);
......
......@@ -7,7 +7,7 @@
#ifndef CONTEXT_H
#define CONTEXT_H
#include <utils_def.h>
#include <lib/utils_def.h>
/*******************************************************************************
* Constants that allow assembler code to access members of and the 'regs'
......@@ -26,9 +26,10 @@
#ifndef __ASSEMBLY__
#include <cassert.h>
#include <stdint.h>
#include <lib/cassert.h>
/*
* Common constants to help define the 'cpu_context' structure and its
* members below.
......
......@@ -7,7 +7,7 @@
#ifndef CONTEXT_H
#define CONTEXT_H
#include <utils_def.h>
#include <lib/utils_def.h>
/*******************************************************************************
* Constants that allow assembler code to access members of and the 'gp_regs'
......@@ -180,10 +180,12 @@
#ifndef __ASSEMBLY__
#include <cassert.h>
#include <platform_def.h> /* for CACHE_WRITEBACK_GRANULE */
#include <stdint.h>
#include <platform_def.h> /* for CACHE_WRITEBACK_GRANULE */
#include <lib/cassert.h>
/*
* Common constants to help define the 'cpu_context' structure and its
* members below.
......
......@@ -7,11 +7,12 @@
#ifndef CONTEXT_MGMT_H
#define CONTEXT_MGMT_H
#include <arch.h>
#include <assert.h>
#include <context.h>
#include <stdint.h>
#include <arch.h>
/*******************************************************************************
* Forward declarations
******************************************************************************/
......
......@@ -7,9 +7,10 @@
#ifndef CPU_DATA_H
#define CPU_DATA_H
#include <ehf.h>
#include <platform_def.h> /* CACHE_WRITEBACK_GRANULE required */
#include <bl31/ehf.h>
#ifdef AARCH32
#if CRASH_REPORTING
......@@ -51,9 +52,9 @@
#ifndef __ASSEMBLY__
#include <arch_helpers.h>
#include <cassert.h>
#include <lib/cassert.h>
#include <lib/psci/psci.h>
#include <platform_def.h>
#include <psci.h>
#include <stdint.h>
/* Offsets for the cpu_data structure */
......
......@@ -30,11 +30,12 @@
/* For the compiler ... */
#include <arch_helpers.h>
#include <assert.h>
#include <cdefs.h>
#include <stddef.h>
#include <arch_helpers.h>
#define __pubsub_section(event) __section("__pubsub_" #event)
/*
......
......@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <pubsub.h>
#include <lib/el3_runtime/pubsub.h>
/*
* This file defines a list of pubsub events, declared using
......
......@@ -7,11 +7,13 @@
#ifndef AMU_H
#define AMU_H
#include <cassert.h>
#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
#include <utils_def.h>
#include <platform_def.h>
#include <lib/cassert.h>
#include <lib/utils_def.h>
/* All group 0 counters */
#define AMU_GROUP0_COUNTERS_MASK U(0xf)
......
......@@ -71,7 +71,8 @@
#ifndef __ASSEMBLY__
#include <assert.h>
#include <ras_arch.h>
#include <lib/extensions/ras_arch.h>
struct err_record_info;
......
......@@ -184,7 +184,7 @@
#include <arch_helpers.h>
#include <assert.h>
#include <context.h>
#include <mmio.h>
#include <lib/mmio.h>
#include <stdint.h>
/*
......
......@@ -8,9 +8,11 @@
#define ASSERT_H
#include <cdefs.h>
#include <debug.h>
#include <platform_def.h>
#include <common/debug.h>
#ifndef PLAT_LOG_LEVEL_ASSERT
#define PLAT_LOG_LEVEL_ASSERT LOG_LEVEL
#endif
......
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