From: Antonio Borneo Date: Mon, 16 Aug 2021 17:08:23 +0000 (+0200) Subject: armv7m.h: relax dependency from 'arm_adi_v5.h' X-Git-Tag: v0.12.0-rc1~504 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=c4e6034e26b40cc440356eb35b3372b220806e5e armv7m.h: relax dependency from 'arm_adi_v5.h' The include file 'armv7m.h' includes 'arm_adi_v5.h' only to get the definition of 'struct adiv5_ap', but doesn't need the struct content. Reducing the cross dependencies speeds-up the compile time during code development by avoiding re-compiling file. Relax the dependency by locally declaring 'struct adiv5_ap' in 'armv7m.h' and remove the include of 'arm_adi_v5.h'. Fix the other files that have now lost the includes file that 'arm_adi_v5.h' depends from. Change-Id: Ic0d40b17db6045fa43f348bda83eaf211a6b347d Signed-off-by: Antonio Borneo Reviewed-on: https://review.openocd.org/c/openocd/+/6468 Tested-by: jenkins Reviewed-by: Daniel Goehring Reviewed-by: Tarek BOCHKATI --- diff --git a/src/flash/nor/at91sam4l.c b/src/flash/nor/at91sam4l.c index f8c6f64906..77dc07f7c6 100644 --- a/src/flash/nor/at91sam4l.c +++ b/src/flash/nor/at91sam4l.c @@ -22,6 +22,7 @@ #include "imp.h" +#include #include /* At this time, the SAM4L Flash is available in these capacities: diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c index d4ac4c9981..5cefd1766e 100644 --- a/src/flash/nor/at91samd.c +++ b/src/flash/nor/at91samd.c @@ -23,6 +23,7 @@ #include "imp.h" #include "helper/binarybuffer.h" +#include #include #define SAMD_NUM_PROT_BLOCKS 16 diff --git a/src/flash/nor/atsame5.c b/src/flash/nor/atsame5.c index 203c470cab..9ab0e81130 100644 --- a/src/flash/nor/atsame5.c +++ b/src/flash/nor/atsame5.c @@ -28,6 +28,7 @@ #include "helper/binarybuffer.h" #include +#include #include /* A note to prefixing. diff --git a/src/flash/nor/bluenrg-x.c b/src/flash/nor/bluenrg-x.c index a686e83d39..60eccefaf0 100644 --- a/src/flash/nor/bluenrg-x.c +++ b/src/flash/nor/bluenrg-x.c @@ -20,6 +20,7 @@ #include "config.h" #endif +#include #include "helper/types.h" #include #include diff --git a/src/flash/nor/cc3220sf.c b/src/flash/nor/cc3220sf.c index b296538414..723e605c70 100644 --- a/src/flash/nor/cc3220sf.c +++ b/src/flash/nor/cc3220sf.c @@ -21,6 +21,7 @@ #include "imp.h" #include "cc3220sf.h" +#include #include #include #include diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c index 3aa4c6bb52..edb4eb58fe 100644 --- a/src/flash/nor/kinetis.c +++ b/src/flash/nor/kinetis.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include diff --git a/src/flash/nor/kinetis_ke.c b/src/flash/nor/kinetis_ke.c index 513b072dde..dc3b37ecb1 100644 --- a/src/flash/nor/kinetis_ke.c +++ b/src/flash/nor/kinetis_ke.c @@ -41,6 +41,7 @@ #include "imp.h" #include #include +#include #include #include diff --git a/src/flash/nor/max32xxx.c b/src/flash/nor/max32xxx.c index d11af90946..e7a690d3a5 100644 --- a/src/flash/nor/max32xxx.c +++ b/src/flash/nor/max32xxx.c @@ -21,6 +21,7 @@ #endif #include "imp.h" +#include #include #include diff --git a/src/flash/nor/nrf5.c b/src/flash/nor/nrf5.c index 8870164d28..c96415547b 100644 --- a/src/flash/nor/nrf5.c +++ b/src/flash/nor/nrf5.c @@ -23,6 +23,7 @@ #endif #include "imp.h" +#include #include #include #include diff --git a/src/flash/nor/psoc6.c b/src/flash/nor/psoc6.c index b8b520237e..a929d33043 100644 --- a/src/flash/nor/psoc6.c +++ b/src/flash/nor/psoc6.c @@ -24,6 +24,7 @@ #include #include "imp.h" +#include #include "target/target.h" #include "target/cortex_m.h" #include "target/breakpoints.h" diff --git a/src/flash/nor/sim3x.c b/src/flash/nor/sim3x.c index 20b5e39728..2938ed1ab4 100644 --- a/src/flash/nor/sim3x.c +++ b/src/flash/nor/sim3x.c @@ -27,6 +27,7 @@ #include #include #include +#include #include /* SI32_DEVICEID0 */ diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index d2638c152d..6135c95745 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -30,6 +30,7 @@ #include "jtag/interface.h" #include "imp.h" #include +#include #include #define DID0_VER(did0) ((did0 >> 28)&0x07) diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index 3ef8bf894e..a363cd42de 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "bits.h" #include "stm32l4x.h" diff --git a/src/flash/nor/stmqspi.c b/src/flash/nor/stmqspi.c index 0abd8449b7..8278601db2 100644 --- a/src/flash/nor/stmqspi.c +++ b/src/flash/nor/stmqspi.c @@ -40,6 +40,7 @@ #endif #include "imp.h" +#include #include #include #include diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c index e8e2472eee..4bd07b49f3 100644 --- a/src/jtag/drivers/stlink_usb.c +++ b/src/jtag/drivers/stlink_usb.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 68da020a13..ffc8ca875d 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -44,6 +44,8 @@ #include "algorithm.h" #include "register.h" #include "semihosting_common.h" +#include +#include #if 0 #define _DEBUG_INSTRUCTION_EXECUTION_ diff --git a/src/target/armv7m.h b/src/target/armv7m.h index f3eb90f248..2816a91452 100644 --- a/src/target/armv7m.h +++ b/src/target/armv7m.h @@ -25,10 +25,11 @@ #ifndef OPENOCD_TARGET_ARMV7M_H #define OPENOCD_TARGET_ARMV7M_H -#include "arm_adi_v5.h" #include "arm.h" #include "armv7m_trace.h" +struct adiv5_ap; + extern const int armv7m_psp_reg_map[]; extern const int armv7m_msp_reg_map[]; diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 08f2eb9117..5deb9bf4ae 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -34,6 +34,7 @@ #include "cortex_m.h" #include "target_request.h" #include "target_type.h" +#include "arm_adi_v5.h" #include "arm_disassembler.h" #include "register.h" #include "arm_opcodes.h" diff --git a/src/target/hla_target.c b/src/target/hla_target.c index 91861054f4..c67c9cc897 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -37,6 +37,7 @@ #include "target_type.h" #include "armv7m.h" #include "cortex_m.h" +#include "arm_adi_v5.h" #include "arm_semihosting.h" #include "target_request.h" #include