aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-11 04:30:41 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-11 04:30:41 +0000
commitfbcb57baf842a84898dcc1cbe9a8b56d2a0028e1 (patch)
tree9468a8c2fd8ed83ff2d6643e4f6f3e80a92240c5
parent0643263d68bcddc56eaa7e3678b7502798410711 (diff)
Audit and eliminate redundant #include directives in src/flash sources.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1712 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/flash/aduc702x.c9
-rw-r--r--src/flash/at91sam7.c10
-rw-r--r--src/flash/avrf.c8
-rw-r--r--src/flash/cfi.c11
-rw-r--r--src/flash/ecos.c14
-rw-r--r--src/flash/flash.c17
-rw-r--r--src/flash/lpc2000.c7
-rw-r--r--src/flash/lpc288x.c10
-rw-r--r--src/flash/lpc3180_nand_controller.c8
-rw-r--r--src/flash/mflash.c15
-rw-r--r--src/flash/nand.c14
-rw-r--r--src/flash/nand_ecc.c4
-rw-r--r--src/flash/non_cfi.c8
-rw-r--r--src/flash/ocl.c11
-rw-r--r--src/flash/orion_nand.c8
-rw-r--r--src/flash/pic32mx.c9
-rw-r--r--src/flash/s3c2410_nand.c9
-rw-r--r--src/flash/s3c2412_nand.c9
-rw-r--r--src/flash/s3c2440_nand.c9
-rw-r--r--src/flash/s3c2443_nand.c9
-rw-r--r--src/flash/s3c24xx_nand.c9
-rw-r--r--src/flash/stellaris.c12
-rw-r--r--src/flash/stm32x.c8
-rw-r--r--src/flash/str7x.c9
-rw-r--r--src/flash/str9x.c11
-rw-r--r--src/flash/str9xpec.c12
-rw-r--r--src/flash/tms470.c4
27 files changed, 21 insertions, 243 deletions
diff --git a/src/flash/aduc702x.c b/src/flash/aduc702x.c
index 5b80e0c6..2a9c1c26 100644
--- a/src/flash/aduc702x.c
+++ b/src/flash/aduc702x.c
@@ -23,18 +23,11 @@
#include "config.h"
#endif
-#include "replacements.h"
-#include "time_support.h"
#include "flash.h"
-#include "target.h"
-#include "log.h"
#include "armv4_5.h"
-#include "algorithm.h"
#include "binarybuffer.h"
+#include "time_support.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
static int aduc702x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
static int aduc702x_register_commands(struct command_context_s *cmd_ctx);
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c
index 8bb572f9..c840d505 100644
--- a/src/flash/at91sam7.c
+++ b/src/flash/at91sam7.c
@@ -39,19 +39,9 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "at91sam7.h"
-
-#include "flash.h"
-#include "target.h"
-#include "log.h"
#include "binarybuffer.h"
-#include "types.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
static int at91sam7_register_commands(struct command_context_s *cmd_ctx);
static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
diff --git a/src/flash/avrf.c b/src/flash/avrf.c
index 9d32e6d1..307e54e8 100644
--- a/src/flash/avrf.c
+++ b/src/flash/avrf.c
@@ -21,18 +21,10 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "avrf.h"
#include "avrt.h"
#include "flash.h"
-#include "target.h"
-#include "log.h"
-#include "algorithm.h"
-#include "binarybuffer.h"
-#include <stdlib.h>
-#include <string.h>
/* AVR_JTAG_Instructions */
#define AVR_JTAG_INS_LEN 4
diff --git a/src/flash/cfi.c b/src/flash/cfi.c
index edc4645f..0eb44d6b 100644
--- a/src/flash/cfi.c
+++ b/src/flash/cfi.c
@@ -23,22 +23,11 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "cfi.h"
#include "non_cfi.h"
-
-#include "flash.h"
-#include "target.h"
-#include "log.h"
#include "armv4_5.h"
-#include "algorithm.h"
#include "binarybuffer.h"
-#include "types.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
static int cfi_register_commands(struct command_context_s *cmd_ctx);
static int cfi_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
diff --git a/src/flash/ecos.c b/src/flash/ecos.c
index bc31fdd4..3c2b456b 100644
--- a/src/flash/ecos.c
+++ b/src/flash/ecos.c
@@ -21,20 +21,10 @@
#include "config.h"
#endif
-#include <string.h>
-
-#include "replacements.h"
-
#include "flash.h"
+#include "embeddedice.h"
+#include "image.h"
-#include "target.h"
-
-#include "flash.h"
-#include "target.h"
-#include "log.h"
-#include "binarybuffer.h"
-#include "../target/embeddedice.h"
-#include "types.h"
static int ecosflash_register_commands(struct command_context_s *cmd_ctx);
static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
diff --git a/src/flash/flash.c b/src/flash/flash.c
index 0ad6c7a6..4f4d272a 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -28,22 +28,9 @@
#endif
#include "flash.h"
-#include "command.h"
-#include "target.h"
-#include "time_support.h"
-#include "fileio.h"
#include "image.h"
-#include "log.h"
-#include "armv4_5.h"
-#include "algorithm.h"
-#include "binarybuffer.h"
-#include "armv7m.h"
-
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <errno.h>
+#include "time_support.h"
+
#include <inttypes.h>
/* command handlers */
diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c
index db0602f1..2708d535 100644
--- a/src/flash/lpc2000.c
+++ b/src/flash/lpc2000.c
@@ -23,16 +23,9 @@
#endif
#include "lpc2000.h"
-
-#include "flash.h"
-#include "target.h"
-#include "log.h"
#include "armv4_5.h"
-#include "algorithm.h"
#include "binarybuffer.h"
-#include <stdlib.h>
-#include <string.h>
/* flash programming support for Philips LPC2xxx devices
* currently supported devices:
diff --git a/src/flash/lpc288x.c b/src/flash/lpc288x.c
index 1f478964..505dd1e3 100644
--- a/src/flash/lpc288x.c
+++ b/src/flash/lpc288x.c
@@ -31,19 +31,9 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "lpc288x.h"
-
-#include "flash.h"
-#include "target.h"
-#include "log.h"
#include "binarybuffer.h"
-#include "types.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#define LOAD_TIMER_ERASE 0
#define LOAD_TIMER_WRITE 1
diff --git a/src/flash/lpc3180_nand_controller.c b/src/flash/lpc3180_nand_controller.c
index c24e30aa..ffe7ce2b 100644
--- a/src/flash/lpc3180_nand_controller.c
+++ b/src/flash/lpc3180_nand_controller.c
@@ -22,15 +22,7 @@
#endif
#include "lpc3180_nand_controller.h"
-
-#include "replacements.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <string.h>
-
#include "nand.h"
-#include "target.h"
static int lpc3180_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct nand_device_s *device);
static int lpc3180_register_commands(struct command_context_s *cmd_ctx);
diff --git a/src/flash/mflash.c b/src/flash/mflash.c
index 451d942b..8913e166 100644
--- a/src/flash/mflash.c
+++ b/src/flash/mflash.c
@@ -21,20 +21,11 @@
#include "config.h"
#endif
-#include <ctype.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <inttypes.h>
-
-#include "command.h"
-#include "log.h"
-#include "target.h"
+#include "mflash.h"
#include "time_support.h"
#include "fileio.h"
-#include "mflash.h"
+#include "log.h"
+
static int s3c2440_set_gpio_to_output (mflash_gpio_num_t gpio);
static int s3c2440_set_gpio_output_val (mflash_gpio_num_t gpio, u8 val);
diff --git a/src/flash/nand.c b/src/flash/nand.c
index 67f15374..8efed037 100644
--- a/src/flash/nand.c
+++ b/src/flash/nand.c
@@ -24,20 +24,12 @@
#include "config.h"
#endif
-#include "replacements.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include <errno.h>
-
#include "nand.h"
-#include "flash.h"
#include "time_support.h"
#include "fileio.h"
-#include "image.h"
+
+#include <inttypes.h>
+
static int handle_nand_list_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int handle_nand_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
diff --git a/src/flash/nand_ecc.c b/src/flash/nand_ecc.c
index 91dd8c6b..c1a18835 100644
--- a/src/flash/nand_ecc.c
+++ b/src/flash/nand_ecc.c
@@ -41,10 +41,6 @@
#include "config.h"
#endif
-#include "replacements.h"
-
-#include <inttypes.h>
-
#include "nand.h"
/*
diff --git a/src/flash/non_cfi.c b/src/flash/non_cfi.c
index 20aa9f1e..3e86e0da 100644
--- a/src/flash/non_cfi.c
+++ b/src/flash/non_cfi.c
@@ -23,13 +23,9 @@
#include "config.h"
#endif
-#include <stdlib.h>
-
-#include "log.h"
-
-#include "flash.h"
-#include "cfi.h"
#include "non_cfi.h"
+#include "cfi.h"
+
#define KB 1024
#define MB (1024*1024)
diff --git a/src/flash/ocl.c b/src/flash/ocl.c
index ec8c20dc..e2099a11 100644
--- a/src/flash/ocl.c
+++ b/src/flash/ocl.c
@@ -21,21 +21,10 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "ocl.h"
-
#include "flash.h"
-#include "target.h"
-#include "log.h"
-#include "binarybuffer.h"
-#include "types.h"
#include "embeddedice.h"
-#include "arm7_9_common.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
static int ocl_register_commands(struct command_context_s *cmd_ctx);
static int ocl_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
diff --git a/src/flash/orion_nand.c b/src/flash/orion_nand.c
index 678eb94c..fb5a3403 100644
--- a/src/flash/orion_nand.c
+++ b/src/flash/orion_nand.c
@@ -26,17 +26,11 @@
#include "config.h"
#endif
-#include "replacements.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <string.h>
-
#include "nand.h"
-#include "target.h"
#include "armv4_5.h"
#include "binarybuffer.h"
+
typedef struct orion_nand_controller_s
{
struct target_s *target;
diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c
index 94ec7458..2a5ce641 100644
--- a/src/flash/pic32mx.c
+++ b/src/flash/pic32mx.c
@@ -27,18 +27,9 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "pic32mx.h"
-#include "flash.h"
-#include "target.h"
-#include "log.h"
#include "mips32.h"
-#include "algorithm.h"
-#include "binarybuffer.h"
-#include <stdlib.h>
-#include <string.h>
static
struct pic32mx_devs_s {
diff --git a/src/flash/s3c2410_nand.c b/src/flash/s3c2410_nand.c
index 8d218f8f..951677c5 100644
--- a/src/flash/s3c2410_nand.c
+++ b/src/flash/s3c2410_nand.c
@@ -28,15 +28,8 @@
#include "config.h"
#endif
-#include "replacements.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "nand.h"
#include "s3c24xx_nand.h"
-#include "target.h"
+
static int s3c2410_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct nand_device_s *device);
static int s3c2410_init(struct nand_device_s *device);
diff --git a/src/flash/s3c2412_nand.c b/src/flash/s3c2412_nand.c
index 11e54e71..271b3c40 100644
--- a/src/flash/s3c2412_nand.c
+++ b/src/flash/s3c2412_nand.c
@@ -28,15 +28,8 @@
#include "config.h"
#endif
-#include "replacements.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "nand.h"
#include "s3c24xx_nand.h"
-#include "target.h"
+
static int s3c2412_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct nand_device_s *device);
static int s3c2412_init(struct nand_device_s *device);
diff --git a/src/flash/s3c2440_nand.c b/src/flash/s3c2440_nand.c
index 862a013d..61aace65 100644
--- a/src/flash/s3c2440_nand.c
+++ b/src/flash/s3c2440_nand.c
@@ -28,15 +28,8 @@
#include "config.h"
#endif
-#include "replacements.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "nand.h"
#include "s3c24xx_nand.h"
-#include "target.h"
+
static int s3c2440_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct nand_device_s *device);
static int s3c2440_init(struct nand_device_s *device);
diff --git a/src/flash/s3c2443_nand.c b/src/flash/s3c2443_nand.c
index aa12966c..7dc3aa3a 100644
--- a/src/flash/s3c2443_nand.c
+++ b/src/flash/s3c2443_nand.c
@@ -28,15 +28,8 @@
#include "config.h"
#endif
-#include "replacements.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "nand.h"
#include "s3c24xx_nand.h"
-#include "target.h"
+
static int s3c2443_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct nand_device_s *device);
static int s3c2443_init(struct nand_device_s *device);
diff --git a/src/flash/s3c24xx_nand.c b/src/flash/s3c24xx_nand.c
index 380f320f..ecd48eea 100644
--- a/src/flash/s3c24xx_nand.c
+++ b/src/flash/s3c24xx_nand.c
@@ -28,15 +28,8 @@
#include "config.h"
#endif
-#include "replacements.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "nand.h"
#include "s3c24xx_nand.h"
-#include "target.h"
+
s3c24xx_nand_controller_t *
s3c24xx_nand_device_command(struct command_context_s *cmd_ctx, char *cmd,
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c
index 61e30f5d..38ded4f1 100644
--- a/src/flash/stellaris.c
+++ b/src/flash/stellaris.c
@@ -28,20 +28,10 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "stellaris.h"
-#include "cortex_m3.h"
-
-#include "flash.h"
-#include "target.h"
-#include "log.h"
+#include "armv7m.h"
#include "binarybuffer.h"
-#include "types.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#define DID0_VER(did0) ((did0>>28)&0x07)
static int stellaris_register_commands(struct command_context_s *cmd_ctx);
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index e151fc57..2a3b764c 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -24,18 +24,10 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "stm32x.h"
-#include "flash.h"
-#include "target.h"
-#include "log.h"
#include "armv7m.h"
-#include "algorithm.h"
#include "binarybuffer.h"
-#include <stdlib.h>
-#include <string.h>
static int stm32x_register_commands(struct command_context_s *cmd_ctx);
static int stm32x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
diff --git a/src/flash/str7x.c b/src/flash/str7x.c
index 1d9396be..ffd01fa0 100644
--- a/src/flash/str7x.c
+++ b/src/flash/str7x.c
@@ -24,19 +24,10 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "str7x.h"
-#include "flash.h"
-#include "target.h"
-#include "log.h"
#include "armv4_5.h"
-#include "algorithm.h"
#include "binarybuffer.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
str7x_mem_layout_t mem_layout_str7bank0[] = {
{0x00000000, 0x02000, 0x01},
diff --git a/src/flash/str9x.c b/src/flash/str9x.c
index fbba4fec..32445ae2 100644
--- a/src/flash/str9x.c
+++ b/src/flash/str9x.c
@@ -27,20 +27,9 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "str9x.h"
-#include "flash.h"
-#include "target.h"
-#include "log.h"
-#include "armv4_5.h"
#include "arm966e.h"
-#include "algorithm.h"
-#include "binarybuffer.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
static u32 bank1start = 0x00080000;
diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c
index f6ffa6e4..dc195c14 100644
--- a/src/flash/str9xpec.c
+++ b/src/flash/str9xpec.c
@@ -24,21 +24,9 @@
#include "config.h"
#endif
-#include "replacements.h"
-
#include "str9xpec.h"
-#include "flash.h"
-#include "target.h"
-#include "log.h"
-#include "armv4_5.h"
#include "arm7_9_common.h"
-#include "jtag.h"
-#include "binarybuffer.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <getopt.h>
static int str9xpec_register_commands(struct command_context_s *cmd_ctx);
static int str9xpec_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
diff --git a/src/flash/tms470.c b/src/flash/tms470.c
index 91f0cc0f..1d7497f1 100644
--- a/src/flash/tms470.c
+++ b/src/flash/tms470.c
@@ -21,10 +21,8 @@
#include "config.h"
#endif
-#include "log.h"
#include "tms470.h"
-#include <string.h>
-#include <unistd.h>
+
static int tms470_register_commands(struct command_context_s *cmd_ctx);
static int tms470_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);