From db094c2e60176b3c63ce788159b04a7024ad1010 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 16 Nov 2009 00:35:05 -0800 Subject: [PATCH] target: don't implicitly include "algorithm.h" Most files in the tree seem to have ended up including this, and *quite* needlessly ... only code implementing or using downloadable algorithms actually needs these declarations. So take it out of the header files which included it, and put it in files which use it ... reduce needless interdependencies. Also: "algorithm.h" doesn't need to include "types.h" again; it already comes from a different header. Signed-off-by: David Brownell --- src/flash/aduc702x.c | 1 + src/flash/arm_nandio.c | 5 +++-- src/flash/cfi.c | 1 + src/flash/ecos.c | 1 + src/flash/lpc2000.c | 1 + src/flash/lpc2900.c | 1 + src/flash/stellaris.c | 1 + src/flash/stm32x.c | 1 + src/flash/str7x.c | 1 + src/flash/str9x.c | 1 + src/target/algorithm.h | 2 -- src/target/arm11.c | 1 + src/target/arm7_9_common.c | 1 + src/target/armv4_5.c | 1 + src/target/armv7m.c | 1 + src/target/target.h | 3 ++- 16 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/flash/aduc702x.c b/src/flash/aduc702x.c index c2a188486..643705cae 100644 --- a/src/flash/aduc702x.c +++ b/src/flash/aduc702x.c @@ -27,6 +27,7 @@ #include "armv4_5.h" #include "binarybuffer.h" #include "time_support.h" +#include "algorithm.h" static int aduc702x_build_sector_list(struct flash_bank *bank); diff --git a/src/flash/arm_nandio.c b/src/flash/arm_nandio.c index 63eb0413a..81697fa5c 100644 --- a/src/flash/arm_nandio.c +++ b/src/flash/arm_nandio.c @@ -26,6 +26,7 @@ #include "arm_nandio.h" #include "armv4_5.h" +#include "algorithm.h" /* @@ -43,8 +44,8 @@ int arm_nandwrite(struct arm_nand_data *nand, uint8_t *data, int size) { struct target *target = nand->target; struct armv4_5_algorithm algo; - struct arm *armv4_5 = target->arch_info; - struct reg_param reg_params[3]; + struct arm *armv4_5 = target->arch_info; + struct reg_param reg_params[3]; uint32_t target_buf; uint32_t exit = 0; int retval; diff --git a/src/flash/cfi.c b/src/flash/cfi.c index 17f5c32bc..c0ad50dd1 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -27,6 +27,7 @@ #include "non_cfi.h" #include "armv4_5.h" #include "binarybuffer.h" +#include "algorithm.h" #define CFI_MAX_BUS_WIDTH 4 diff --git a/src/flash/ecos.c b/src/flash/ecos.c index 0525fbe3c..c12ed9d24 100644 --- a/src/flash/ecos.c +++ b/src/flash/ecos.c @@ -24,6 +24,7 @@ #include "flash.h" #include "embeddedice.h" #include "image.h" +#include "algorithm.h" #if 0 diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c index df1f0824b..09bb13f21 100644 --- a/src/flash/lpc2000.c +++ b/src/flash/lpc2000.c @@ -29,6 +29,7 @@ #include "armv4_5.h" #include "armv7m.h" #include "binarybuffer.h" +#include "algorithm.h" /* flash programming support for NXP LPC17xx and LPC2xxx devices diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c index 556a15124..35f15070a 100644 --- a/src/flash/lpc2900.c +++ b/src/flash/lpc2900.c @@ -27,6 +27,7 @@ #include "flash.h" #include "binarybuffer.h" #include "armv4_5.h" +#include "algorithm.h" /* 1024 bytes */ diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index 56762d165..7b9467545 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -31,6 +31,7 @@ #include "stellaris.h" #include "armv7m.h" #include "binarybuffer.h" +#include "algorithm.h" #define DID0_VER(did0) ((did0 >> 28)&0x07) diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c index 7ac06a68f..70727158b 100644 --- a/src/flash/stm32x.c +++ b/src/flash/stm32x.c @@ -27,6 +27,7 @@ #include "stm32x.h" #include "armv7m.h" #include "binarybuffer.h" +#include "algorithm.h" static int stm32x_mass_erase(struct flash_bank *bank); diff --git a/src/flash/str7x.c b/src/flash/str7x.c index 71709bb02..19ee160ea 100644 --- a/src/flash/str7x.c +++ b/src/flash/str7x.c @@ -27,6 +27,7 @@ #include "str7x.h" #include "armv4_5.h" #include "binarybuffer.h" +#include "algorithm.h" struct str7x_mem_layout mem_layout_str7bank0[] = { diff --git a/src/flash/str9x.c b/src/flash/str9x.c index 1506cb59d..870871cc7 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -29,6 +29,7 @@ #include "str9x.h" #include "arm966e.h" +#include "algorithm.h" static uint32_t bank1start = 0x00080000; diff --git a/src/target/algorithm.h b/src/target/algorithm.h index 80f081dbf..abb8ecfc6 100644 --- a/src/target/algorithm.h +++ b/src/target/algorithm.h @@ -20,8 +20,6 @@ #ifndef ALGORITHM_H #define ALGORITHM_H -#include "types.h" - enum param_direction { PARAM_IN, diff --git a/src/target/arm11.c b/src/target/arm11.c index f4e2c0d56..cdeb42003 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -33,6 +33,7 @@ #include "arm_simulator.h" #include "time_support.h" #include "target_type.h" +#include "algorithm.h" #if 0 diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index b07111eb8..76c79c3ab 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -36,6 +36,7 @@ #include "arm7_9_common.h" #include "time_support.h" #include "arm_simulator.h" +#include "algorithm.h" /** diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 47b32adde..e6e0bd7e3 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -31,6 +31,7 @@ #include "breakpoints.h" #include "arm_disassembler.h" #include "binarybuffer.h" +#include "algorithm.h" char* armv4_5_core_reg_list[] = diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 6c6a9ec60..3f9e7f55a 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -36,6 +36,7 @@ #include "breakpoints.h" #include "armv7m.h" +#include "algorithm.h" #define ARRAY_SIZE(x) ((int)(sizeof(x)/sizeof((x)[0]))) diff --git a/src/target/target.h b/src/target/target.h index 06105ee6d..75bc4f022 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -28,7 +28,6 @@ #include -#include "algorithm.h" #include "command.h" struct reg; @@ -36,6 +35,8 @@ struct trace; struct command_context; struct breakpoint; struct watchpoint; +struct mem_param; +struct reg_param; /** -- 2.30.2