]> git.sur5r.net Git - openocd/commitdiff
Audit and eliminate redundant #include directives in other target files.
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 11 May 2009 04:56:37 +0000 (04:56 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 11 May 2009 04:56:37 +0000 (04:56 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1715 b42882b7-edfa-0310-969c-e2dbd0fdcd60

34 files changed:
src/target/algorithm.c
src/target/avrt.c
src/target/avrt.h
src/target/breakpoints.c
src/target/cortex_a8.c
src/target/cortex_m3.c
src/target/embeddedice.c
src/target/embeddedice.h
src/target/etb.c
src/target/etb.h
src/target/etm.c
src/target/etm.h
src/target/etm_dummy.c
src/target/etm_dummy.h
src/target/feroceon.c
src/target/image.c
src/target/image.h
src/target/mips32.c
src/target/mips32.h
src/target/mips32_dmaacc.c
src/target/mips32_pracc.c
src/target/mips_ejtag.c
src/target/mips_ejtag.h
src/target/mips_m4k.c
src/target/mips_m4k.h
src/target/oocd_trace.c
src/target/oocd_trace.h
src/target/register.c
src/target/register.h
src/target/target_request.c
src/target/trace.c
src/target/trace.h
src/target/xscale.c
src/target/xscale.h

index c4450ac12cb7a1774bd5678ef74cd3e2e17cdbf3..a3672b201bb35d9f09fbbb89e229162415d06e3b 100644 (file)
 #endif
 
 #include "algorithm.h"
-
-#include "log.h"
-#include "configuration.h"
+#include "replacements.h"
 #include "binarybuffer.h"
 
-#include <stdlib.h>
-
 
 void init_mem_param(mem_param_t *param, u32 address, u32 size, enum param_direction direction)
 {
index e438fcc463a0d1ab8e8c9f214a216d80cfeab061..d0c866b66ea03cdd35d97f6e9f2167ad9132ffc5 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-
 #include "avrt.h"
-
-#include "register.h"
 #include "target.h"
-#include "log.h"
-#include "jtag.h"
-#include "binarybuffer.h"
-#include "time_support.h"
-#include "breakpoints.h"
-#include "fileio.h"
-
-#include <stdlib.h>
-#include <string.h>
 
-#include <unistd.h>
-#include <errno.h>
 
-#define AVR_JTAG_INS_LEN                                                       4
+#define AVR_JTAG_INS_LEN       4
 
 /* cli handling */
 int avr_register_commands(struct command_context_s *cmd_ctx);
index e840aaf96c24cc92d3094ebcccfbea15fb430d49..02bb00545e8211297757cf3219f6900127c64544 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef AVRT_H
 #define AVRT_H
 
+#include "jtag.h"
+
 typedef struct mcu_jtag_s
 {
        jtag_tap_t *tap;
index 6320d2ea83bbecb6a788e4662ac19062160d3d13..106095cd8cfb194bcc36a3a9f52c6e8ccf4696bd 100644 (file)
 #include "config.h"
 #endif
 
-#include <stdlib.h>
-
-#include "binarybuffer.h"
 #include "target.h"
 #include "log.h"
-#include "types.h"
-
 #include "breakpoints.h"
 
+
 static char *breakpoint_type_strings[] =
 {
        "hardware",
index d94e679ed68de61bdca7433b7b6fcd955c648bdf..1e36f336bbc25bef5b76057b4b3ec20f33011306 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-
 #include "cortex_a8.h"
-#include "armv7m.h"
-
-#include "register.h"
-#include "target.h"
 #include "target_request.h"
-#include "log.h"
-#include "jtag.h"
-#include "arm_jtag.h"
 
-#include <stdlib.h>
-#include <string.h>
 
 /* cli handling */
 int cortex_a8_register_commands(struct command_context_s *cmd_ctx);
index 86bb07f444a833d2680f6a0782d8a4dc3b9a501b..4a032ee0c13baae63144b396c8e48350127e9fe8 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-
 #include "cortex_m3.h"
-#include "armv7m.h"
-
-#include "register.h"
-#include "target.h"
 #include "target_request.h"
-#include "log.h"
-#include "jtag.h"
-#include "arm_jtag.h"
 
-#include <stdlib.h>
-#include <string.h>
 
 /* cli handling */
 int cortex_m3_register_commands(struct command_context_s *cmd_ctx);
index 892e82641e93d97b00b77e464e44bd8404da8672..28f14d7a69713ba185d8a0f7d6ce2e84ef03fd64 100644 (file)
 
 #include "embeddedice.h"
 
-#include "armv4_5.h"
-#include "arm7_9_common.h"
-
-#include "log.h"
-#include "arm_jtag.h"
-#include "types.h"
-#include "binarybuffer.h"
-#include "target.h"
-#include "register.h"
-#include "jtag.h"
-
-#include <stdlib.h>
 
 #if 0
 static bitfield_desc_t embeddedice_comms_ctrl_bitfield_desc[] =
index 8c4bc6f2d1072f363237a2748bb99f8cf24708a2..0c8329ee2ae87d9b6636ee7c77709151e92aa4c3 100644 (file)
@@ -26,9 +26,6 @@
 #ifndef EMBEDDED_ICE_H
 #define EMBEDDED_ICE_H
 
-#include "target.h"
-#include "register.h"
-#include "arm_jtag.h"
 #include "arm7_9_common.h"
 
 enum
index 71514a5e17182a9451673c8e7911e3ca4d8c2e4a..6ad283c65b6b12f16c8448d5913dab5aed0a847e 100644 (file)
 #include "config.h"
 #endif
 
-#include <string.h>
-
 #include "arm7_9_common.h"
 #include "etb.h"
-#include "etm.h"
-
-#include "log.h"
-#include "types.h"
-#include "binarybuffer.h"
-#include "target.h"
-#include "register.h"
-#include "jtag.h"
 
-#include <stdlib.h>
 
 static char* etb_reg_list[] =
 {
index 9c0504f5ef3484853deeb699234fd1d2d7f03220..e0f7dbe355111f23db3e45ecf85fe9aa75f22232 100644 (file)
 #ifndef ETB_H
 #define ETB_H
 
-#include "command.h"
-#include "target.h"
-#include "register.h"
-#include "arm_jtag.h"
-
-#include "etb.h"
 #include "etm.h"
 
 /* ETB registers */
index e8581220d5ae627eb958684dedae6bfd29537500..ef21511d9cd9cdd12cefe75265edad3e17ad5d65 100644 (file)
 #include "config.h"
 #endif
 
-#include <string.h>
-
 #include "etm.h"
 #include "etb.h"
-
-#include "armv4_5.h"
+#include "image.h"
 #include "arm7_9_common.h"
 #include "arm_disassembler.h"
-#include "arm_simulator.h"
-
-#include "log.h"
-#include "arm_jtag.h"
-#include "types.h"
-#include "binarybuffer.h"
-#include "target.h"
-#include "register.h"
-#include "jtag.h"
-#include "fileio.h"
-
-#include <stdlib.h>
+
 
 /* ETM register access functionality
  *
index 26e0d764dc6d44a9c088ace1fb9fd218f4fc08e6..df31600bed395e68b9a44cab1f814d635fae0cd6 100644 (file)
 #ifndef ETM_H
 #define ETM_H
 
-#include "image.h"
 #include "trace.h"
-#include "target.h"
-#include "register.h"
 #include "arm_jtag.h"
-
 #include "armv4_5.h"
 
+struct image_s;
+
 /* ETM registers (V1.3 protocol) */
 enum
 {
@@ -152,7 +150,7 @@ typedef struct etm_context_s
        etm_portmode_t portmode;                /* normal, multiplexed or demultiplexed */
        etmv1_tracemode_t tracemode;    /* type of information the trace contains (data, addres, contextID, ...) */
        armv4_5_state_t core_state;             /* current core state (ARM, Thumb, Jazelle) */
-       image_t *image;                                 /* source for target opcodes */
+       struct image_s *image;                                  /* source for target opcodes */
        u32 pipe_index;                                 /* current trace cycle */
        u32 data_index;                                 /* cycle holding next data packet */
        int data_half;                                  /* port half on a 16 bit port */
index ee83f172d934e3a75578161cd38a239f05ad032f..ee4c3e691aba98f3019fb736ee36d6fdc33df5f7 100644 (file)
 #include "config.h"
 #endif
 
-#include <string.h>
-
 #include "etm_dummy.h"
-#include "etm.h"
-
 #include "arm7_9_common.h"
-#include "log.h"
-#include "types.h"
-#include "binarybuffer.h"
-#include "target.h"
-#include "register.h"
-#include "jtag.h"
-
-#include <stdlib.h>
+
 
 static int handle_etm_dummy_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
index a271fd4601a3855a0cb990d7403acd05f7e1accb..0e712e34e3ef4a9bea5c0e72956184897a5fd9a7 100644 (file)
 #ifndef ETM_DUMMY_H
 #define ETM_DUMMY_H
 
-#include "command.h"
-#include "target.h"
-#include "register.h"
-#include "arm_jtag.h"
-
 #include "etm.h"
 
 extern etm_capture_driver_t etm_dummy_capture_driver;
index ccf32d8c680c1cc641b8eb3d54c811573a6c91b9..2bd2824ec8e3623ece715119f30fedccf41e9327 100644 (file)
 #endif
 
 #include "arm926ejs.h"
-#include "jtag.h"
-#include "log.h"
 
-#include <stdlib.h>
-#include <string.h>
 
 int feroceon_examine(struct target_s *target);
 int feroceon_target_create(struct target_s *target, Jim_Interp *interp);
index 8a166d68f9dc1cee3dfd4fcfaa5deb549cf4790f..71939e79b92e6cb73bae40a7e8d3df44396e848b 100644 (file)
 #include "config.h"
 #endif
 
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_ELF_H
-#include <elf.h>
-#endif
-
 #include "image.h"
-
-#include "types.h"
-#include "replacements.h"
+#include "target.h"
 #include "log.h"
 
-#include "fileio.h"
-#include "target.h"
 
 /* convert ELF header field to host endianness */
 #define field16(elf,field)\
index c23cdf58aaaaebe8ba1eb432ad0138ed0e8c02c5..855cb215e7dfffdd1b499cf181d1c18808131942 100644 (file)
 #ifndef IMAGE_H
 #define IMAGE_H
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "fileio.h"
 
 #ifdef HAVE_ELF_H
 #include <elf.h>
 #endif
-#include "replacements.h"
-#include "fileio.h"
-#include "target.h"
 
 #define IMAGE_MAX_ERROR_STRING         (256)
 #define IMAGE_MAX_SECTIONS                     (128)
@@ -85,7 +80,7 @@ typedef struct image_ihex_s
 
 typedef struct image_memory_s
 {
-       target_t *target;
+       struct target_s *target;
        u8 *cache;
        u32 cache_address;
 } image_memory_t;
index 48e2b3427cf2b0c6e6d95a76915807f927ef5c39..c109ed20fffd67e220716035a6e49e4c14be23eb 100644 (file)
 #endif
 
 #include "mips32.h"
-#include "jtag.h"
-#include "log.h"
 
-#include <stdlib.h>
-#include <string.h>
 
 char* mips32_core_reg_list[] =
 {
index 049ce8f50e73afec1bff4484ec887582b2e9168d..56c33faa9ba493dd1e5868b1ee02419280219916 100644 (file)
@@ -25,9 +25,9 @@
 
 #include "target.h"
 #include "register.h"
-#include "mips_ejtag.h"
 #include "mips32_pracc.h"
 
+
 #define MIPS32_COMMON_MAGIC            0xB320B320
 
 /* offsets into mips32 core register cache */
@@ -69,7 +69,7 @@ typedef struct mips32_common_s
 typedef struct mips32_core_reg_s
 {
        u32 num;
-       target_t *target;
+       struct target_s *target;
        mips32_common_t *mips32_common;
 } mips32_core_reg_t;
 
index ae95dd08e038d6c557a7b109f7e4404ac3f3a422..94fcf190b8532bdad91bd4e05c1c2ceae81a164d 100644 (file)
 #include "config.h"
 #endif
 
-#include <string.h>
-#include "log.h"
-#include "mips32.h"
 #include "mips32_dmaacc.h"
 
+
 /*
  * The following logic shamelessly cloned from HairyDairyMaid's wrt54g_debrick
  * to support the Broadcom BCM5352 SoC in the Linksys WRT54GL wireless router
index a5f36a93349ac3eb8fc8de7a105d411b7ae8778f..ff7bd86bf2d48da64368b46f762e94b6edc9c4f7 100644 (file)
@@ -74,8 +74,6 @@ Nico Coesel
 #include "config.h"
 #endif
 
-#include <string.h>
-#include "log.h"
 #include "mips32.h"
 #include "mips32_pracc.h"
 
index 0a4219f7cd28ef3af97692c4d55ddffc914b959c..09c3aaf06257c2996d37529aad7f2ecee61521d8 100644 (file)
 #include "mips32.h"
 #include "mips_ejtag.h"
 
-#include "binarybuffer.h"
-#include "log.h"
-#include "jtag.h"
-
-#include <stdlib.h>
 
 int mips_ejtag_set_instr(mips_ejtag_t *ejtag_info, int new_instr, void *delete_me_and_submit_patch)
 {
index a7d5c5d788aa9cf513e3252d9128c867c61dbb79..e9d076820abe857e99639b7bc7e27e807fbee964 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef MIPS_EJTAG
 #define MIPS_EJTAG
 
-#include "types.h"
 #include "jtag.h"
 
 /* tap instructions */
index 41b974ce5fdcf788ce59a4e7190c674095bb5303..f29d8ec7bbfe4189483a90ab75b230283a0d8744 100644 (file)
 #include "mips32.h"
 #include "mips_m4k.h"
 #include "mips32_dmaacc.h"
-#include "jtag.h"
-#include "log.h"
 
-#include <stdlib.h>
-#include <string.h>
 
 /* cli handling */
 
index ccc8e6e781180aa4b09d2d5067a60eee7fdb5768..3ecb7f4feb9a6ef17653fd7cbffaa199d7426b08 100644 (file)
@@ -23,8 +23,9 @@
 #ifndef MIPS_M4K_H
 #define MIPS_M4K_H
 
-#include "register.h"
-#include "target.h"
+#include "types.h"
+
+struct target_s;
 
 #define MIPSM4K_COMMON_MAGIC   0xB321B321
 
@@ -34,7 +35,7 @@ typedef struct mips_m4k_common_s
        mips32_common_t mips32_common;
 } mips_m4k_common_t;
 
-extern int mips_m4k_bulk_write_memory(target_t *target, u32 address, u32 count, u8 *buffer);
+extern int mips_m4k_bulk_write_memory(struct target_s *target, u32 address, u32 count, u8 *buffer);
 
 extern void mips_m4k_enable_breakpoints(struct target_s *target);
 extern int mips_m4k_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
index 14197beceeaff6ab2f22d0b69a14d89056a5d35d..dc96d13fc44039c8024febcfca0e45665f77fb38 100644 (file)
 #include "config.h"
 #endif
 
+// we must define _GNU_SOURCE to get strndup
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
-#include <string.h>
-#include <errno.h>
 
 #include "oocd_trace.h"
-#include "etm.h"
-
-#include "log.h"
-#include "types.h"
-#include "binarybuffer.h"
-#include "target.h"
-#include "register.h"
-#include "jtag.h"
 #include "arm7_9_common.h"
-#include "replacements.h"
 
-#include <stdlib.h>
 
 static int oocd_trace_register_commands(struct command_context_s *cmd_ctx);
 
index dfa6449e4ef79bc49e24aa237cb7bdb0f98a2143..6c3f7f922dace1feae10d6a1e43314eb10d6cc79 100644 (file)
 #ifndef OOCD_TRACE_H
 #define OOCD_TRACE_H
 
-#include "command.h"
-
 #include "etm.h"
 
 #include <termios.h>
-#include <unistd.h>
 
 /* registers */
 enum
index 37915eb494c48879c5c79ed2cff58bd0cdb1d64d..f68fb69eb260487263dd13ff3152c0edcff0f7fa 100644 (file)
 #endif
 
 #include "register.h"
-
 #include "log.h"
-#include "command.h"
 
-#include <string.h>
-#include <stdlib.h>
 
 reg_arch_type_t *reg_arch_types = NULL;
 
index e6ea09c6e5fd69b8891bf9e43ae60ee4b775c3ed..0fcdb918d302f583549a9499a30ca66a1e01ff7c 100644 (file)
@@ -24,7 +24,6 @@
 #define REGISTER_H
 
 #include "types.h"
-#include "target.h"
 
 struct target_s;
 
index 8d44a111cea4b5238e1a329ff15bc3c22691441d..5618405d5ffb35e43b1dc8c9c133f0e60ec0f0fc 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-#include "log.h"
-#include "target.h"
 #include "target_request.h"
 #include "binarybuffer.h"
-#include "command.h"
 #include "trace.h"
+#include "log.h"
 
-#include <stdlib.h>
-#include <string.h>
 
 static command_t *target_request_cmd = NULL;
 static int charmsg_mode = 0;
index 50f526a949acdd965dc55d3307e04b4b2c315044..2e7d45804b60e601c53ecafa1c6a960095dadb1c 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
 #include "log.h"
 #include "trace.h"
 #include "target.h"
-#include "command.h"
 
-#include <stdlib.h>
-#include <string.h>
 #include <inttypes.h>
 
 int trace_point(target_t *target, u32 number)
index f0e92f94b0deafb0672077e5a910e1bc30f912fc..92613161aa7203d8a41ebc5a8ddafc7a7247234f 100644 (file)
 #ifndef TRACE_H
 #define TRACE_H
 
-#include "target.h"
-#include "command.h"
 #include "types.h"
 
+struct target_s;
+struct command_context_s;
+
 typedef struct trace_point_s
 {
        u32 address;
index a18fe9af8df11bf49d6036ab256bc0d291a34b13..0497a47853cf36270ac1e33e3bbf5162dcebb585 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-
 #include "xscale.h"
-
 #include "arm7_9_common.h"
-#include "register.h"
-#include "target.h"
-#include "armv4_5.h"
 #include "arm_simulator.h"
 #include "arm_disassembler.h"
-#include "log.h"
-#include "jtag.h"
-#include "binarybuffer.h"
 #include "time_support.h"
-#include "breakpoints.h"
-#include "fileio.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <unistd.h>
-#include <errno.h>
-
+#include "image.h"
 
 /* cli handling */
 int xscale_register_commands(struct command_context_s *cmd_ctx);
index 2eacb0609bb2316ffaa61752ff5d3a005eae9be2..96e3fe2237bf93daffa26d5be8208b480e89462a 100644 (file)
 #ifndef XSCALE_H
 #define XSCALE_H
 
-#include "target.h"
-#include "register.h"
 #include "armv4_5.h"
 #include "armv4_5_mmu.h"
 #include "trace.h"
-#include "image.h"
 
 #define        XSCALE_COMMON_MAGIC 0x58534341
 
@@ -77,7 +74,7 @@ typedef struct xscale_trace_data_s
 typedef struct xscale_trace_s
 {
        trace_status_t capture_status;  /* current state of capture run */
-       image_t *image;                                 /* source for target opcodes */
+       struct image_s *image;                                  /* source for target opcodes */
        xscale_trace_data_t *data;              /* linked list of collected trace data */
        int buffer_enabled;                             /* whether trace buffer is enabled */
        int buffer_fill;                                /* maximum number of trace runs to read (-1 for wrap-around) */