diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2010-06-20 12:52:07 +0800 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2010-06-21 22:14:17 +0800 |
commit | decd417064b63c8eda69ad523a63fefd22036d16 (patch) | |
tree | 0621abb91e4464f84136bc4edd4886b8962b8cb0 /src/target | |
parent | d26b5236bac524ca33799f2c10f40f65755bdd08 (diff) | |
download | openocd_libswd-decd417064b63c8eda69ad523a63fefd22036d16.tar.gz openocd_libswd-decd417064b63c8eda69ad523a63fefd22036d16.tar.bz2 openocd_libswd-decd417064b63c8eda69ad523a63fefd22036d16.tar.xz openocd_libswd-decd417064b63c8eda69ad523a63fefd22036d16.zip |
target/avr: review scope of symbols
Add "static" qualifier to private functions.
Move duplicated global declarations from "target/avrt.c"
and "nor/avrf.c" to "target/avrt.h".
Remove unused declarations form "nor/avrf.c".
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/avrt.c | 68 | ||||
-rw-r--r-- | src/target/avrt.h | 5 |
2 files changed, 40 insertions, 33 deletions
diff --git a/src/target/avrt.c b/src/target/avrt.c index 17f7c241..3861199e 100644 --- a/src/target/avrt.c +++ b/src/target/avrt.c @@ -29,32 +29,28 @@ #define AVR_JTAG_INS_LEN 4 /* forward declarations */ -int avr_target_create(struct target *target, Jim_Interp *interp); -int avr_init_target(struct command_context *cmd_ctx, struct target *target); +static int avr_target_create(struct target *target, Jim_Interp *interp); +static int avr_init_target(struct command_context *cmd_ctx, struct target *target); -int avr_arch_state(struct target *target); -int avr_poll(struct target *target); -int avr_halt(struct target *target); -int avr_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution); -int avr_step(struct target *target, int current, uint32_t address, int handle_breakpoints); +static int avr_arch_state(struct target *target); +static int avr_poll(struct target *target); +static int avr_halt(struct target *target); +static int avr_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution); +static int avr_step(struct target *target, int current, uint32_t address, int handle_breakpoints); -int avr_assert_reset(struct target *target); -int avr_deassert_reset(struct target *target); -int avr_soft_reset_halt(struct target *target); +static int avr_assert_reset(struct target *target); +static int avr_deassert_reset(struct target *target); +static int avr_soft_reset_halt(struct target *target); /* IR and DR functions */ -int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out); -int avr_jtag_senddat(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int len); - -int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti); -int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti); -int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti); +static int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti); +static int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti); +static int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti); int mcu_write_dr_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti); int mcu_write_ir_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int ir_len, int rti); int mcu_write_dr_u16(struct jtag_tap *tap, uint16_t *ir_in, uint16_t ir_out, int dr_len, int rti); int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int ir_len, int rti); -int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti); -int mcu_execute_queue(void); +static int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int dr_len, int rti); struct target_type avr_target = { @@ -92,7 +88,7 @@ struct target_type avr_target = .init_target = avr_init_target, }; -int avr_target_create(struct target *target, Jim_Interp *interp) +static int avr_target_create(struct target *target, Jim_Interp *interp) { struct avr_common *avr = calloc(1, sizeof(struct avr_common)); @@ -102,19 +98,19 @@ int avr_target_create(struct target *target, Jim_Interp *interp) return ERROR_OK; } -int avr_init_target(struct command_context *cmd_ctx, struct target *target) +static int avr_init_target(struct command_context *cmd_ctx, struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_arch_state(struct target *target) +static int avr_arch_state(struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_poll(struct target *target) +static int avr_poll(struct target *target) { if ((target->state == TARGET_RUNNING) || (target->state == TARGET_DEBUG_RUNNING)) { @@ -125,25 +121,26 @@ int avr_poll(struct target *target) return ERROR_OK; } -int avr_halt(struct target *target) +static int avr_halt(struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution) +static int avr_resume(struct target *target, int current, uint32_t address, + int handle_breakpoints, int debug_execution) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_step(struct target *target, int current, uint32_t address, int handle_breakpoints) +static int avr_step(struct target *target, int current, uint32_t address, int handle_breakpoints) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_assert_reset(struct target *target) +static int avr_assert_reset(struct target *target) { target->state = TARGET_RESET; @@ -151,7 +148,7 @@ int avr_assert_reset(struct target *target) return ERROR_OK; } -int avr_deassert_reset(struct target *target) +static int avr_deassert_reset(struct target *target) { target->state = TARGET_RUNNING; @@ -159,13 +156,14 @@ int avr_deassert_reset(struct target *target) return ERROR_OK; } -int avr_soft_reset_halt(struct target *target) +static int avr_soft_reset_halt(struct target *target) { LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } -int avr_jtag_senddat(struct jtag_tap *tap, uint32_t* dr_in, uint32_t dr_out, int len) +int avr_jtag_senddat(struct jtag_tap *tap, uint32_t* dr_in, uint32_t dr_out, + int len) { return mcu_write_dr_u32(tap, dr_in, dr_out, len, 1); } @@ -176,7 +174,8 @@ int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out) } /* IR and DR functions */ -int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti) +static int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, + int ir_len, int rti) { if (NULL == tap) { @@ -196,7 +195,8 @@ int mcu_write_ir(struct jtag_tap *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_l return ERROR_OK; } -int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_len, int rti) +static int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, + int dr_len, int rti) { if (NULL == tap) { @@ -211,7 +211,8 @@ int mcu_write_dr(struct jtag_tap *tap, uint8_t *dr_in, uint8_t *dr_out, int dr_l return ERROR_OK; } -int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti) +static int mcu_write_ir_u8(struct jtag_tap *tap, uint8_t *ir_in, + uint8_t ir_out, int ir_len, int rti) { if (ir_len > 8) { @@ -276,7 +277,8 @@ int mcu_write_ir_u32(struct jtag_tap *tap, uint32_t *ir_in, uint32_t ir_out, int return ERROR_OK; } -int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, int dr_len, int rti) +static int mcu_write_dr_u32(struct jtag_tap *tap, uint32_t *dr_in, + uint32_t dr_out, int dr_len, int rti) { if (dr_len > 32) { diff --git a/src/target/avrt.h b/src/target/avrt.h index 221296a9..221f9240 100644 --- a/src/target/avrt.h +++ b/src/target/avrt.h @@ -32,4 +32,9 @@ struct avr_common struct mcu_jtag jtag_info; }; +int mcu_execute_queue(void); +int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out); +int avr_jtag_senddat(struct jtag_tap *tap, uint32_t *dr_in, uint32_t dr_out, + int len); + #endif /* AVRT_H */ |