From: Zach W. <zw...@us...> - 2009-11-09 18:46:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3885ab5a5af7ece410ce3eeb1059da3ea950436a (commit) via 42cafc9369088d2a5d5f633358a2a42aa7bbc0de (commit) via 994a63c3fee11b8c65891ead6b03b2b716044541 (commit) via 81fbc637185fb0007dbe84c866794800851295b5 (commit) via 5e9d18f027954c5f5e883934d6c54cb20817ea9f (commit) via 1712d7835e0fbba60d578b52b21b95b046805757 (commit) from 4882647f3ee7fc0680c49fbd27a484359fd7e86a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3885ab5a5af7ece410ce3eeb1059da3ea950436a Author: Zachary T Welch <zw...@su...> Date: Mon Nov 9 04:22:23 2009 -0800 src/target: remove 'extern' and wrap headers Remove extern keywords from function prototypes and wrap long lines. diff --git a/src/target/algorithm.h b/src/target/algorithm.h index 15e3cf2..600580c 100644 --- a/src/target/algorithm.h +++ b/src/target/algorithm.h @@ -45,9 +45,12 @@ typedef struct reg_param_s enum param_direction direction; } reg_param_t; -extern void init_mem_param(mem_param_t *param, uint32_t address, uint32_t size, enum param_direction direction); -extern void destroy_mem_param(mem_param_t *param); -extern void init_reg_param(reg_param_t *param, char *reg_name, uint32_t size, enum param_direction direction); -extern void destroy_reg_param(reg_param_t *param); +void init_mem_param(mem_param_t *param, + uint32_t address, uint32_t size, enum param_direction dir); +void destroy_mem_param(mem_param_t *param); + +void init_reg_param(reg_param_t *param, + char *reg_name, uint32_t size, enum param_direction dir); +void destroy_reg_param(reg_param_t *param); #endif /* ALGORITHM_H */ diff --git a/src/target/arm926ejs.h b/src/target/arm926ejs.h index 01e3c09..0712c53 100644 --- a/src/target/arm926ejs.h +++ b/src/target/arm926ejs.h @@ -46,10 +46,12 @@ target_to_arm926(struct target_s *target) } -extern int arm926ejs_init_arch_info(target_t *target, arm926ejs_common_t *arm926ejs, jtag_tap_t *tap); -extern int arm926ejs_register_commands(struct command_context_s *cmd_ctx); -extern int arm926ejs_arch_state(struct target_s *target); -extern int arm926ejs_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); -extern int arm926ejs_soft_reset_halt(struct target_s *target); +int arm926ejs_init_arch_info(target_t *target, + arm926ejs_common_t *arm926ejs, jtag_tap_t *tap); +int arm926ejs_register_commands(struct command_context_s *cmd_ctx); +int arm926ejs_arch_state(struct target_s *target); +int arm926ejs_write_memory(struct target_s *target, + uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); +int arm926ejs_soft_reset_halt(struct target_s *target); #endif /* ARM926EJS_H */ diff --git a/src/target/arm966e.h b/src/target/arm966e.h index e8346f9..8d0ee50 100644 --- a/src/target/arm966e.h +++ b/src/target/arm966e.h @@ -41,8 +41,9 @@ target_to_arm966(struct target_s *target) arm9tdmi_common.arm7_9_common.armv4_5_common); } -extern int arm966e_init_arch_info(target_t *target, arm966e_common_t *arm966e, jtag_tap_t *tap); -extern int arm966e_register_commands(struct command_context_s *cmd_ctx); -extern int arm966e_write_cp15(target_t *target, int reg_addr, uint32_t value); +int arm966e_init_arch_info(target_t *target, + arm966e_common_t *arm966e, jtag_tap_t *tap); +int arm966e_register_commands(struct command_context_s *cmd_ctx); +int arm966e_write_cp15(target_t *target, int reg_addr, uint32_t value); #endif /* ARM966E_H */ diff --git a/src/target/arm9tdmi.h b/src/target/arm9tdmi.h index 8bf2713..c098d82 100644 --- a/src/target/arm9tdmi.h +++ b/src/target/arm9tdmi.h @@ -51,34 +51,34 @@ enum arm9tdmi_vector ARM9TDMI_FIQ_VECTOR = 0x80, }; -extern int arm9tdmi_init_target(struct command_context_s *cmd_ctx, - struct target_s *target); +int arm9tdmi_init_target(struct command_context_s *cmd_ctx, + struct target_s *target); int arm9tdmi_examine(struct target_s *target); -extern int arm9tdmi_init_arch_info(target_t *target, - arm9tdmi_common_t *arm9tdmi, jtag_tap_t *tap); -extern int arm9tdmi_register_commands(struct command_context_s *cmd_ctx); +int arm9tdmi_init_arch_info(target_t *target, + arm9tdmi_common_t *arm9tdmi, jtag_tap_t *tap); +int arm9tdmi_register_commands(struct command_context_s *cmd_ctx); -extern int arm9tdmi_clock_out(arm_jtag_t *jtag_info, - uint32_t instr, uint32_t out, uint32_t *in, int sysspeed); -extern int arm9tdmi_clock_data_in(arm_jtag_t *jtag_info, uint32_t *in); -extern int arm9tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, - void *in, int size, int be); -extern void arm9tdmi_read_core_regs(target_t *target, - uint32_t mask, uint32_t* core_regs[16]); -extern void arm9tdmi_write_core_regs(target_t *target, - uint32_t mask, uint32_t core_regs[16]); +int arm9tdmi_clock_out(arm_jtag_t *jtag_info, + uint32_t instr, uint32_t out, uint32_t *in, int sysspeed); +int arm9tdmi_clock_data_in(arm_jtag_t *jtag_info, uint32_t *in); +int arm9tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, + void *in, int size, int be); +void arm9tdmi_read_core_regs(target_t *target, + uint32_t mask, uint32_t* core_regs[16]); +void arm9tdmi_write_core_regs(target_t *target, + uint32_t mask, uint32_t core_regs[16]); -extern int arm9tdmi_examine_debug_reason(target_t *target); +int arm9tdmi_examine_debug_reason(target_t *target); -extern void arm9tdmi_load_word_regs(target_t *target, uint32_t mask); -extern void arm9tdmi_load_hword_reg(target_t *target, int num); -extern void arm9tdmi_load_byte_reg(target_t *target, int num); -extern void arm9tdmi_store_word_regs(target_t *target, uint32_t mask); -extern void arm9tdmi_store_hword_reg(target_t *target, int num); -extern void arm9tdmi_store_byte_reg(target_t *target, int num); +void arm9tdmi_load_word_regs(target_t *target, uint32_t mask); +void arm9tdmi_load_hword_reg(target_t *target, int num); +void arm9tdmi_load_byte_reg(target_t *target, int num); +void arm9tdmi_store_word_regs(target_t *target, uint32_t mask); +void arm9tdmi_store_hword_reg(target_t *target, int num); +void arm9tdmi_store_byte_reg(target_t *target, int num); -extern void arm9tdmi_branch_resume(target_t *target); -extern void arm9tdmi_enable_single_step(target_t *target, uint32_t next_pc); -extern void arm9tdmi_disable_single_step(target_t *target); +void arm9tdmi_branch_resume(target_t *target); +void arm9tdmi_enable_single_step(target_t *target, uint32_t next_pc); +void arm9tdmi_disable_single_step(target_t *target); #endif /* ARM9TDMI_H */ diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 3ff883a..442b45c 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -111,39 +111,48 @@ static inline uint8_t dap_ap_get_select(swjdp_common_t *swjdp) } /* Internal functions used in the module, partial transactions, use with caution */ -extern int dap_dp_write_reg(swjdp_common_t *swjdp, uint32_t value, uint8_t reg_addr); -/* extern int swjdp_write_apacc(swjdp_common_t *swjdp, uint32_t value, uint8_t reg_addr); */ -extern int dap_dp_read_reg(swjdp_common_t *swjdp, uint32_t *value, uint8_t reg_addr); -/* extern int swjdp_read_apacc(swjdp_common_t *swjdp, uint32_t *value, uint8_t reg_addr); */ -extern int dap_setup_accessport(swjdp_common_t *swjdp, uint32_t csw, uint32_t tar); -extern int dap_ap_select(swjdp_common_t *swjdp,uint8_t apsel); - -extern int dap_ap_write_reg(swjdp_common_t *swjdp, uint32_t reg_addr, uint8_t* out_value_buf); -extern int dap_ap_write_reg_u32(swjdp_common_t *swjdp, uint32_t reg_addr, uint32_t value); -extern int dap_ap_read_reg(swjdp_common_t *swjdp, uint32_t reg_addr, uint8_t *in_value_buf); -extern int dap_ap_read_reg_u32(swjdp_common_t *swjdp, uint32_t reg_addr, uint32_t *value); +int dap_dp_write_reg(swjdp_common_t *swjdp, uint32_t value, uint8_t reg_addr); +/* int swjdp_write_apacc(swjdp_common_t *swjdp, uint32_t value, uint8_t reg_addr); */ +int dap_dp_read_reg(swjdp_common_t *swjdp, uint32_t *value, uint8_t reg_addr); +/* int swjdp_read_apacc(swjdp_common_t *swjdp, uint32_t *value, uint8_t reg_addr); */ +int dap_setup_accessport(swjdp_common_t *swjdp, uint32_t csw, uint32_t tar); +int dap_ap_select(swjdp_common_t *swjdp,uint8_t apsel); + +int dap_ap_write_reg(swjdp_common_t *swjdp, uint32_t addr, uint8_t* out_buf); +int dap_ap_write_reg_u32(swjdp_common_t *swjdp, uint32_t addr, uint32_t value); +int dap_ap_read_reg(swjdp_common_t *swjdp, uint32_t addr, uint8_t *in_buf); +int dap_ap_read_reg_u32(swjdp_common_t *swjdp, uint32_t addr, uint32_t *value); /* External interface, partial operations must be completed with swjdp_transaction_endcheck() */ -extern int swjdp_transaction_endcheck(swjdp_common_t *swjdp); +int swjdp_transaction_endcheck(swjdp_common_t *swjdp); /* MEM-AP memory mapped bus single uint32_t register transfers, without endcheck */ -extern int mem_ap_read_u32(swjdp_common_t *swjdp, uint32_t address, uint32_t *value); -extern int mem_ap_write_u32(swjdp_common_t *swjdp, uint32_t address, uint32_t value); +int mem_ap_read_u32(swjdp_common_t *swjdp, uint32_t address, uint32_t *value); +int mem_ap_write_u32(swjdp_common_t *swjdp, uint32_t address, uint32_t value); /* MEM-AP memory mapped bus transfers, single registers, complete transactions */ -extern int mem_ap_read_atomic_u32(swjdp_common_t *swjdp, uint32_t address, uint32_t *value); -extern int mem_ap_write_atomic_u32(swjdp_common_t *swjdp, uint32_t address, uint32_t value); +int mem_ap_read_atomic_u32(swjdp_common_t *swjdp, + uint32_t address, uint32_t *value); +int mem_ap_write_atomic_u32(swjdp_common_t *swjdp, + uint32_t address, uint32_t value); /* MEM-AP memory mapped bus block transfers */ -extern int mem_ap_read_buf_u8(swjdp_common_t *swjdp, uint8_t *buffer, int count, uint32_t address); -extern int mem_ap_read_buf_u16(swjdp_common_t *swjdp, uint8_t *buffer, int count, uint32_t address); -extern int mem_ap_read_buf_u32(swjdp_common_t *swjdp, uint8_t *buffer, int count, uint32_t address); -extern int mem_ap_write_buf_u8(swjdp_common_t *swjdp, uint8_t *buffer, int count, uint32_t address); -extern int mem_ap_write_buf_u16(swjdp_common_t *swjdp, uint8_t *buffer, int count, uint32_t address); -extern int mem_ap_write_buf_u32(swjdp_common_t *swjdp, uint8_t *buffer, int count, uint32_t address); +int mem_ap_read_buf_u8(swjdp_common_t *swjdp, + uint8_t *buffer, int count, uint32_t address); +int mem_ap_read_buf_u16(swjdp_common_t *swjdp, + uint8_t *buffer, int count, uint32_t address); +int mem_ap_read_buf_u32(swjdp_common_t *swjdp, + uint8_t *buffer, int count, uint32_t address); + +int mem_ap_write_buf_u8(swjdp_common_t *swjdp, + uint8_t *buffer, int count, uint32_t address); +int mem_ap_write_buf_u16(swjdp_common_t *swjdp, + uint8_t *buffer, int count, uint32_t address); +int mem_ap_write_buf_u32(swjdp_common_t *swjdp, + uint8_t *buffer, int count, uint32_t address); /* Initialisation of the debug system, power domains and registers */ -extern int ahbap_debugport_init(swjdp_common_t *swjdp); +int ahbap_debugport_init(swjdp_common_t *swjdp); /* Commands for user dap access */ diff --git a/src/target/arm_disassembler.h b/src/target/arm_disassembler.h index b841d6c..8021e7c 100644 --- a/src/target/arm_disassembler.h +++ b/src/target/arm_disassembler.h @@ -197,11 +197,13 @@ typedef struct arm_instruction_s } arm_instruction_t; -extern int arm_evaluate_opcode(uint32_t opcode, uint32_t address, arm_instruction_t *instruction); -extern int thumb_evaluate_opcode(uint16_t opcode, uint32_t address, arm_instruction_t *instruction); -extern int thumb2_opcode(target_t *target, uint32_t address, +int arm_evaluate_opcode(uint32_t opcode, uint32_t address, arm_instruction_t *instruction); -extern int arm_access_size(arm_instruction_t *instruction); +int thumb_evaluate_opcode(uint16_t opcode, uint32_t address, + arm_instruction_t *instruction); +int thumb2_opcode(target_t *target, uint32_t address, + arm_instruction_t *instruction); +int arm_access_size(arm_instruction_t *instruction); #define COND(opcode) (arm_condition_strings[(opcode & 0xf0000000) >> 28]) diff --git a/src/target/arm_jtag.h b/src/target/arm_jtag.h index f4b04e8..c7d12cb 100644 --- a/src/target/arm_jtag.h +++ b/src/target/arm_jtag.h @@ -36,9 +36,10 @@ typedef struct arm_jtag_s uint32_t intest_instr; } arm_jtag_t; -extern int arm_jtag_set_instr(arm_jtag_t *jtag_info, uint32_t new_instr, void *verify_capture); -extern int arm_jtag_scann(arm_jtag_t *jtag_info, uint32_t new_scan_chain); -extern int arm_jtag_setup_connection(arm_jtag_t *jtag_info); +int arm_jtag_set_instr(arm_jtag_t *jtag_info, + uint32_t new_instr, void *verify_capture); +int arm_jtag_scann(arm_jtag_t *jtag_info, uint32_t new_scan_chain); +int arm_jtag_setup_connection(arm_jtag_t *jtag_info); /* JTAG buffers to host, be and le buffers, flipping variants */ int arm_jtag_buf_to_u32_flip(uint8_t *in_buf, void *priv, struct scan_field_s *field); diff --git a/src/target/arm_simulator.h b/src/target/arm_simulator.h index bad904b..9e7b040 100644 --- a/src/target/arm_simulator.h +++ b/src/target/arm_simulator.h @@ -37,12 +37,11 @@ struct arm_sim_interface enum armv4_5_mode (*get_mode)(struct arm_sim_interface *sim); }; - /* armv4_5 version */ -extern int arm_simulate_step(struct target_s *target, uint32_t *dry_run_pc); +int arm_simulate_step(struct target_s *target, uint32_t *dry_run_pc); /* a generic arm simulator. Caller must implement the sim interface */ -extern int arm_simulate_step_core(target_t *target, uint32_t *dry_run_pc, struct arm_sim_interface *sim); - +int arm_simulate_step_core(target_t *target, + uint32_t *dry_run_pc, struct arm_sim_interface *sim); #endif /* ARM_SIMULATOR_H */ diff --git a/src/target/armv4_5.h b/src/target/armv4_5.h index fb7926b..d76ce75 100644 --- a/src/target/armv4_5.h +++ b/src/target/armv4_5.h @@ -108,7 +108,8 @@ typedef struct armv4_5_core_reg_s armv4_5_common_t *armv4_5_common; } armv4_5_core_reg_t; -extern reg_cache_t* armv4_5_build_reg_cache(target_t *target, armv4_5_common_t *armv4_5_common); +reg_cache_t* armv4_5_build_reg_cache(target_t *target, + armv4_5_common_t *armv4_5_common); /* map psr mode bits to linear number */ static __inline int armv4_5_mode_to_number(enum armv4_5_mode mode) @@ -147,15 +148,20 @@ static __inline enum armv4_5_mode armv4_5_number_to_mode(int number) } }; -extern int armv4_5_arch_state(struct target_s *target); -extern int armv4_5_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_size); +int armv4_5_arch_state(struct target_s *target); +int armv4_5_get_gdb_reg_list(target_t *target, + reg_t **reg_list[], int *reg_list_size); -extern int armv4_5_register_commands(struct command_context_s *cmd_ctx); -extern int armv4_5_init_arch_info(target_t *target, armv4_5_common_t *armv4_5); +int armv4_5_register_commands(struct command_context_s *cmd_ctx); +int armv4_5_init_arch_info(target_t *target, armv4_5_common_t *armv4_5); -extern int armv4_5_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info); +int armv4_5_run_algorithm(struct target_s *target, + int num_mem_params, mem_param_t *mem_params, + int num_reg_params, reg_param_t *reg_params, + uint32_t entry_point, uint32_t exit_point, + int timeout_ms, void *arch_info); -extern int armv4_5_invalidate_core_regs(target_t *target); +int armv4_5_invalidate_core_regs(target_t *target); /* ARM mode instructions */ diff --git a/src/target/armv4_5_cache.h b/src/target/armv4_5_cache.h index 44bc212..71e3203 100644 --- a/src/target/armv4_5_cache.h +++ b/src/target/armv4_5_cache.h @@ -42,10 +42,13 @@ typedef struct armv4_5_cache_common_s int d_u_cache_enabled; } armv4_5_cache_common_t; -extern int armv4_5_identify_cache(uint32_t cache_type_reg, armv4_5_cache_common_t *cache); -extern int armv4_5_cache_state(uint32_t cp15_control_reg, armv4_5_cache_common_t *cache); +int armv4_5_identify_cache(uint32_t cache_type_reg, + armv4_5_cache_common_t *cache); +int armv4_5_cache_state(uint32_t cp15_control_reg, + armv4_5_cache_common_t *cache); -extern int armv4_5_handle_cache_info_command(struct command_context_s *cmd_ctx, armv4_5_cache_common_t *armv4_5_cache); +int armv4_5_handle_cache_info_command(struct command_context_s *cmd_ctx, + armv4_5_cache_common_t *armv4_5_cache); enum { diff --git a/src/target/armv4_5_mmu.h b/src/target/armv4_5_mmu.h index 0c9b550..b0c39a7 100644 --- a/src/target/armv4_5_mmu.h +++ b/src/target/armv4_5_mmu.h @@ -42,9 +42,17 @@ enum extern char* armv4_5_page_type_names[]; -extern uint32_t armv4_5_mmu_translate_va(target_t *target, armv4_5_mmu_common_t *armv4_5_mmu, uint32_t va, int *type, uint32_t *cb, int *domain, uint32_t *ap); -extern int armv4_5_mmu_read_physical(target_t *target, armv4_5_mmu_common_t *armv4_5_mmu, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); -extern int armv4_5_mmu_write_physical(target_t *target, armv4_5_mmu_common_t *armv4_5_mmu, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); +uint32_t armv4_5_mmu_translate_va(target_t *target, + armv4_5_mmu_common_t *armv4_5_mmu, uint32_t va, int *type, + uint32_t *cb, int *domain, uint32_t *ap); + +int armv4_5_mmu_read_physical(target_t *target, + armv4_5_mmu_common_t *armv4_5_mmu, + uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); + +int armv4_5_mmu_write_physical(target_t *target, + armv4_5_mmu_common_t *armv4_5_mmu, + uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); enum { diff --git a/src/target/armv7m.h b/src/target/armv7m.h index 217f0e3..7601685 100644 --- a/src/target/armv7m.h +++ b/src/target/armv7m.h @@ -50,7 +50,7 @@ enum armv7m_regtype ARMV7M_REGISTER_MEMMAP }; -extern char *armv7m_exception_string(int number); +char *armv7m_exception_string(int number); /* offsets into armv7m core register cache */ enum @@ -134,24 +134,31 @@ typedef struct armv7m_core_reg_s armv7m_common_t *armv7m_common; } armv7m_core_reg_t; -extern reg_cache_t *armv7m_build_reg_cache(target_t *target); -extern enum armv7m_mode armv7m_number_to_mode(int number); -extern int armv7m_mode_to_number(enum armv7m_mode mode); +reg_cache_t *armv7m_build_reg_cache(target_t *target); +enum armv7m_mode armv7m_number_to_mode(int number); +int armv7m_mode_to_number(enum armv7m_mode mode); -extern int armv7m_arch_state(struct target_s *target); -extern int armv7m_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_size); +int armv7m_arch_state(struct target_s *target); +int armv7m_get_gdb_reg_list(target_t *target, + reg_t **reg_list[], int *reg_list_size); -extern int armv7m_register_commands(struct command_context_s *cmd_ctx); -extern int armv7m_init_arch_info(target_t *target, armv7m_common_t *armv7m); +int armv7m_register_commands(struct command_context_s *cmd_ctx); +int armv7m_init_arch_info(target_t *target, armv7m_common_t *armv7m); -extern int armv7m_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info); +int armv7m_run_algorithm(struct target_s *target, + int num_mem_params, mem_param_t *mem_params, + int num_reg_params, reg_param_t *reg_params, + uint32_t entry_point, uint32_t exit_point, + int timeout_ms, void *arch_info); -extern int armv7m_invalidate_core_regs(target_t *target); +int armv7m_invalidate_core_regs(target_t *target); -extern int armv7m_restore_context(target_t *target); +int armv7m_restore_context(target_t *target); -extern int armv7m_checksum_memory(struct target_s *target, uint32_t address, uint32_t count, uint32_t* checksum); -extern int armv7m_blank_check_memory(struct target_s *target, uint32_t address, uint32_t count, uint32_t* blank); +int armv7m_checksum_memory(struct target_s *target, + uint32_t address, uint32_t count, uint32_t* checksum); +int armv7m_blank_check_memory(struct target_s *target, + uint32_t address, uint32_t count, uint32_t* blank); /* Thumb mode instructions */ diff --git a/src/target/breakpoints.h b/src/target/breakpoints.h index 9145966..781c91b 100644 --- a/src/target/breakpoints.h +++ b/src/target/breakpoints.h @@ -58,12 +58,17 @@ typedef struct watchpoint_s int unique_id; } watchpoint_t; -extern void breakpoint_clear_target(struct target_s *target); -extern int breakpoint_add(struct target_s *target, uint32_t address, uint32_t length, enum breakpoint_type type); -extern void breakpoint_remove(struct target_s *target, uint32_t address); -extern breakpoint_t* breakpoint_find(struct target_s *target, uint32_t address); -extern int watchpoint_add(struct target_s *target, uint32_t address, uint32_t length, enum watchpoint_rw rw, uint32_t value, uint32_t mask); -extern void watchpoint_remove(struct target_s *target, uint32_t address); -extern void watchpoint_clear_target(struct target_s *target); +void breakpoint_clear_target(struct target_s *target); +int breakpoint_add(struct target_s *target, + uint32_t address, uint32_t length, enum breakpoint_type type); +void breakpoint_remove(struct target_s *target, uint32_t address); + +breakpoint_t* breakpoint_find(struct target_s *target, uint32_t address); + +void watchpoint_clear_target(struct target_s *target); +int watchpoint_add(struct target_s *target, + uint32_t address, uint32_t length, + enum watchpoint_rw rw, uint32_t value, uint32_t mask); +void watchpoint_remove(struct target_s *target, uint32_t address); #endif /* BREAKPOINTS_H */ diff --git a/src/target/cortex_a8.h b/src/target/cortex_a8.h index b4cb327..42cb062 100644 --- a/src/target/cortex_a8.h +++ b/src/target/cortex_a8.h @@ -143,8 +143,13 @@ target_to_cortex_a8(struct target_s *target) armv7a_common.armv4_5_common); } -extern int cortex_a8_init_arch_info(target_t *target, cortex_a8_common_t *cortex_a8, jtag_tap_t *tap); -int cortex_a8_read_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); -int cortex_a8_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); +int cortex_a8_init_arch_info(target_t *target, + cortex_a8_common_t *cortex_a8, jtag_tap_t *tap); +int cortex_a8_read_memory(struct target_s *target, + uint32_t address, uint32_t size, + uint32_t count, uint8_t *buffer); +int cortex_a8_write_memory(struct target_s *target, + uint32_t address, uint32_t size, + uint32_t count, uint8_t *buffer); #endif /* CORTEX_A8_H */ diff --git a/src/target/embeddedice.h b/src/target/embeddedice.h index 08e42c9..b1ba989 100644 --- a/src/target/embeddedice.h +++ b/src/target/embeddedice.h @@ -93,17 +93,25 @@ typedef struct embeddedice_reg_s arm_jtag_t *jtag_info; } embeddedice_reg_t; -extern reg_cache_t* embeddedice_build_reg_cache(target_t *target, arm7_9_common_t *arm7_9); -extern int embeddedice_setup(target_t *target); -extern int embeddedice_read_reg(reg_t *reg); -extern void embeddedice_write_reg(reg_t *reg, uint32_t value); -extern int embeddedice_read_reg_w_check(reg_t *reg, uint8_t* check_value, uint8_t* check_mask); -extern void embeddedice_store_reg(reg_t *reg); -extern void embeddedice_set_reg(reg_t *reg, uint32_t value); -extern int embeddedice_set_reg_w_exec(reg_t *reg, uint8_t *buf); -extern int embeddedice_receive(arm_jtag_t *jtag_info, uint32_t *data, uint32_t size); -extern int embeddedice_send(arm_jtag_t *jtag_info, uint32_t *data, uint32_t size); -extern int embeddedice_handshake(arm_jtag_t *jtag_info, int hsbit, uint32_t timeout); +reg_cache_t* embeddedice_build_reg_cache(target_t *target, + arm7_9_common_t *arm7_9); + +int embeddedice_setup(target_t *target); + +int embeddedice_read_reg(reg_t *reg); +int embeddedice_read_reg_w_check(reg_t *reg, + uint8_t* check_value, uint8_t* check_mask); + +void embeddedice_write_reg(reg_t *reg, uint32_t value); +void embeddedice_store_reg(reg_t *reg); + +void embeddedice_set_reg(reg_t *reg, uint32_t value); +int embeddedice_set_reg_w_exec(reg_t *reg, uint8_t *buf); + +int embeddedice_receive(arm_jtag_t *jtag_info, uint32_t *data, uint32_t size); +int embeddedice_send(arm_jtag_t *jtag_info, uint32_t *data, uint32_t size); + +int embeddedice_handshake(arm_jtag_t *jtag_info, int hsbit, uint32_t timeout); /* If many embeddedice_write_reg() follow eachother, then the >1 invocations can be this faster version of * embeddedice_write_reg diff --git a/src/target/etb.h b/src/target/etb.h index 0eeb02b..cc58b65 100644 --- a/src/target/etb.h +++ b/src/target/etb.h @@ -56,6 +56,6 @@ typedef struct etb_reg_s extern etm_capture_driver_t etb_capture_driver; -extern reg_cache_t* etb_build_reg_cache(etb_t *etb); +reg_cache_t* etb_build_reg_cache(etb_t *etb); #endif /* ETB_H */ diff --git a/src/target/etm.h b/src/target/etm.h index b2426c7..c751aac 100644 --- a/src/target/etm.h +++ b/src/target/etm.h @@ -200,8 +200,10 @@ typedef enum BR_RSVD7 = 0x7, /* reserved */ } etmv1_branch_reason_t; -extern reg_cache_t* etm_build_reg_cache(target_t *target, arm_jtag_t *jtag_info, etm_context_t *etm_ctx); -extern int etm_setup(target_t *target); +reg_cache_t* etm_build_reg_cache(target_t *target, + arm_jtag_t *jtag_info, etm_context_t *etm_ctx); + +int etm_setup(target_t *target); int etm_register_commands(struct command_context_s *cmd_ctx); diff --git a/src/target/image.h b/src/target/image.h index 551524e..8b70b3b 100644 --- a/src/target/image.h +++ b/src/target/image.h @@ -100,12 +100,16 @@ typedef struct image_mot_s uint8_t *buffer; } image_mot_t; -extern int image_open(image_t *image, char *url, char *type_string); -extern int image_read_section(image_t *image, int section, uint32_t offset, uint32_t size, uint8_t *buffer, uint32_t *size_read); -extern void image_close(image_t *image); -extern int image_add_section(image_t *image, uint32_t base, uint32_t size, int flags, uint8_t *data); +int image_open(image_t *image, char *url, char *type_string); +int image_read_section(image_t *image, int section, uint32_t offset, + uint32_t size, uint8_t *buffer, uint32_t *size_read); +void image_close(image_t *image); -extern int image_calculate_checksum(uint8_t* buffer, uint32_t nbytes, uint32_t* checksum); +int image_add_section(image_t *image, uint32_t base, uint32_t size, + int flags, uint8_t *data); + +int image_calculate_checksum(uint8_t* buffer, uint32_t nbytes, + uint32_t* checksum); #define ERROR_IMAGE_FORMAT_ERROR (-1400) #define ERROR_IMAGE_TYPE_UNKNOWN (-1401) diff --git a/src/target/mips32.h b/src/target/mips32.h index bc88bc3..005798d 100644 --- a/src/target/mips32.h +++ b/src/target/mips32.h @@ -124,18 +124,32 @@ typedef struct mips32_core_reg_s #define MIPS32_SDBBP 0x7000003F #define MIPS16_SDBBP 0xE801 -extern int mips32_arch_state(struct target_s *target); -extern int mips32_init_arch_info(target_t *target, mips32_common_t *mips32, jtag_tap_t *tap); -extern int mips32_restore_context(target_t *target); -extern int mips32_save_context(target_t *target); -extern reg_cache_t *mips32_build_reg_cache(target_t *target); -extern int mips32_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info); -extern int mips32_configure_break_unit(struct target_s *target); -extern int mips32_enable_interrupts(struct target_s *target, int enable); -extern int mips32_examine(struct target_s *target); - -extern int mips32_register_commands(struct command_context_s *cmd_ctx); -extern int mips32_invalidate_core_regs(target_t *target); -extern int mips32_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_size); +int mips32_arch_state(struct target_s *target); + +int mips32_init_arch_info(target_t *target, + mips32_common_t *mips32, jtag_tap_t *tap); + +int mips32_restore_context(target_t *target); +int mips32_save_context(target_t *target); + +reg_cache_t *mips32_build_reg_cache(target_t *target); + +int mips32_run_algorithm(struct target_s *target, + int num_mem_params, mem_param_t *mem_params, + int num_reg_params, reg_param_t *reg_params, + uint32_t entry_point, uint32_t exit_point, + int timeout_ms, void *arch_info); + +int mips32_configure_break_unit(struct target_s *target); + +int mips32_enable_interrupts(struct target_s *target, int enable); + +int mips32_examine(struct target_s *target); + +int mips32_register_commands(struct command_context_s *cmd_ctx); + +int mips32_invalidate_core_regs(target_t *target); +int mips32_get_gdb_reg_list(target_t *target, + reg_t **reg_list[], int *reg_list_size); #endif /*MIPS32_H*/ diff --git a/src/target/mips32_dmaacc.h b/src/target/mips32_dmaacc.h index e44ddad..c8a64fb 100644 --- a/src/target/mips32_dmaacc.h +++ b/src/target/mips32_dmaacc.h @@ -34,15 +34,23 @@ #define RETRY_ATTEMPTS 0 -extern int mips32_dmaacc_read_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int count, void *buf); -extern int mips32_dmaacc_write_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int count, void *buf); +int mips32_dmaacc_read_mem(mips_ejtag_t *ejtag_info, + uint32_t addr, int size, int count, void *buf); +int mips32_dmaacc_write_mem(mips_ejtag_t *ejtag_info, + uint32_t addr, int size, int count, void *buf); -extern int mips32_dmaacc_read_mem8(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint8_t *buf); -extern int mips32_dmaacc_read_mem16(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint16_t *buf); -extern int mips32_dmaacc_read_mem32(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint32_t *buf); +int mips32_dmaacc_read_mem8(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint8_t *buf); +int mips32_dmaacc_read_mem16(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint16_t *buf); +int mips32_dmaacc_read_mem32(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint32_t *buf); -extern int mips32_dmaacc_write_mem8(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint8_t *buf); -extern int mips32_dmaacc_write_mem16(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint16_t *buf); -extern int mips32_dmaacc_write_mem32(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint32_t *buf); +int mips32_dmaacc_write_mem8(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint8_t *buf); +int mips32_dmaacc_write_mem16(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint16_t *buf); +int mips32_dmaacc_write_mem32(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint32_t *buf); #endif diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h index 8443f87..866f6f5 100644 --- a/src/target/mips32_pracc.h +++ b/src/target/mips32_pracc.h @@ -37,22 +37,34 @@ #define NEG16(v) (((~(v)) + 1) & 0xFFFF) /*#define NEG18(v) (((~(v)) + 1) & 0x3FFFF)*/ -extern int mips32_pracc_read_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int count, void *buf); -extern int mips32_pracc_write_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int count, void *buf); +int mips32_pracc_read_mem(mips_ejtag_t *ejtag_info, + uint32_t addr, int size, int count, void *buf); +int mips32_pracc_write_mem(mips_ejtag_t *ejtag_info, + uint32_t addr, int size, int count, void *buf); -extern int mips32_pracc_read_mem8(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint8_t *buf); -extern int mips32_pracc_read_mem16(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint16_t *buf); -extern int mips32_pracc_read_mem32(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint32_t *buf); -extern int mips32_pracc_read_u32(mips_ejtag_t *ejtag_info, uint32_t addr, uint32_t *buf); +int mips32_pracc_read_mem8(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint8_t *buf); +int mips32_pracc_read_mem16(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint16_t *buf); +int mips32_pracc_read_mem32(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint32_t *buf); +int mips32_pracc_read_u32(mips_ejtag_t *ejtag_info, + uint32_t addr, uint32_t *buf); -extern int mips32_pracc_write_mem8(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint8_t *buf); -extern int mips32_pracc_write_mem16(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint16_t *buf); -extern int mips32_pracc_write_mem32(mips_ejtag_t *ejtag_info, uint32_t addr, int count, uint32_t *buf); -extern int mips32_pracc_write_u32(mips_ejtag_t *ejtag_info, uint32_t addr, uint32_t *buf); +int mips32_pracc_write_mem8(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint8_t *buf); +int mips32_pracc_write_mem16(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint16_t *buf); +int mips32_pracc_write_mem32(mips_ejtag_t *ejtag_info, + uint32_t addr, int count, uint32_t *buf); +int mips32_pracc_write_u32(mips_ejtag_t *ejtag_info, + uint32_t addr, uint32_t *buf); -extern int mips32_pracc_read_regs(mips_ejtag_t *ejtag_info, uint32_t *regs); -extern int mips32_pracc_write_regs(mips_ejtag_t *ejtag_info, uint32_t *regs); +int mips32_pracc_read_regs(mips_ejtag_t *ejtag_info, uint32_t *regs); +int mips32_pracc_write_regs(mips_ejtag_t *ejtag_info, uint32_t *regs); -extern int mips32_pracc_exec(mips_ejtag_t *ejtag_info, int code_len, uint32_t *code, int num_param_in, uint32_t *param_in, int num_param_out, uint32_t *param_out, int cycle); +int mips32_pracc_exec(mips_ejtag_t *ejtag_info, int code_len, uint32_t *code, + int num_param_in, uint32_t *param_in, + int num_param_out, uint32_t *param_out, int cycle); #endif diff --git a/src/target/mips_ejtag.h b/src/target/mips_ejtag.h index 274392a..69ede52 100644 --- a/src/target/mips_ejtag.h +++ b/src/target/mips_ejtag.h @@ -111,15 +111,16 @@ typedef struct mips_ejtag_s uint32_t ejtag_ctrl; } mips_ejtag_t; -extern int mips_ejtag_set_instr(mips_ejtag_t *ejtag_info, int new_instr, void *delete_me_and_submit_patch); -extern int mips_ejtag_enter_debug(mips_ejtag_t *ejtag_info); -extern int mips_ejtag_exit_debug(mips_ejtag_t *ejtag_info); -extern int mips_ejtag_get_impcode(mips_ejtag_t *ejtag_info, uint32_t *impcode); -extern int mips_ejtag_get_idcode(mips_ejtag_t *ejtag_info, uint32_t *idcode); -extern int mips_ejtag_drscan_32(mips_ejtag_t *ejtag_info, uint32_t *data); +int mips_ejtag_set_instr(mips_ejtag_t *ejtag_info, + int new_instr, void *delete_me_and_submit_patch); +int mips_ejtag_enter_debug(mips_ejtag_t *ejtag_info); +int mips_ejtag_exit_debug(mips_ejtag_t *ejtag_info); +int mips_ejtag_get_impcode(mips_ejtag_t *ejtag_info, uint32_t *impcode); +int mips_ejtag_get_idcode(mips_ejtag_t *ejtag_info, uint32_t *idcode); +int mips_ejtag_drscan_32(mips_ejtag_t *ejtag_info, uint32_t *data); -extern int mips_ejtag_init(mips_ejtag_t *ejtag_info); -extern int mips_ejtag_config_step(mips_ejtag_t *ejtag_info, int enable_step); -extern int mips_ejtag_read_debug(mips_ejtag_t *ejtag_info, uint32_t* debug_reg); +int mips_ejtag_init(mips_ejtag_t *ejtag_info); +int mips_ejtag_config_step(mips_ejtag_t *ejtag_info, int enable_step); +int mips_ejtag_read_debug(mips_ejtag_t *ejtag_info, uint32_t* debug_reg); #endif /* MIPS_EJTAG */ diff --git a/src/target/mips_m4k.h b/src/target/mips_m4k.h index 8e81d8f..e11f06a 100644 --- a/src/target/mips_m4k.h +++ b/src/target/mips_m4k.h @@ -35,17 +35,19 @@ typedef struct mips_m4k_common_s mips32_common_t mips32_common; } mips_m4k_common_t; -extern int mips_m4k_bulk_write_memory(struct target_s *target, uint32_t address, uint32_t count, uint8_t *buffer); - -extern void mips_m4k_enable_breakpoints(struct target_s *target); -extern int mips_m4k_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint); -extern int mips_m4k_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint); -extern int mips_m4k_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint); -extern int mips_m4k_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint); -extern int mips_m4k_set_watchpoint(struct target_s *target, watchpoint_t *watchpoint); -extern int mips_m4k_unset_watchpoint(struct target_s *target, watchpoint_t *watchpoint); -extern int mips_m4k_add_watchpoint(struct target_s *target, watchpoint_t *watchpoint); -extern int mips_m4k_remove_watchpoint(struct target_s *target, watchpoint_t *watchpoint); -extern void mips_m4k_enable_watchpoints(struct target_s *target); +int mips_m4k_bulk_write_memory(struct target_s *target, + uint32_t address, uint32_t count, uint8_t *buffer); + +void mips_m4k_enable_breakpoints(struct target_s *target); +int mips_m4k_set_breakpoint(struct target_s *target, breakpoint_t *bp); +int mips_m4k_unset_breakpoint(struct target_s *target, breakpoint_t *bp); +int mips_m4k_add_breakpoint(struct target_s *target, breakpoint_t *bp); +int mips_m4k_remove_breakpoint(struct target_s *target, breakpoint_t *bp); + +void mips_m4k_enable_watchpoints(struct target_s *target); +int mips_m4k_set_watchpoint(struct target_s *target, watchpoint_t *wp); +int mips_m4k_unset_watchpoint(struct target_s *target, watchpoint_t *wp); +int mips_m4k_add_watchpoint(struct target_s *target, watchpoint_t *wp); +int mips_m4k_remove_watchpoint(struct target_s *target, watchpoint_t *wp); #endif /*MIPS_M4K_H*/ diff --git a/src/target/register.h b/src/target/register.h index d139379..e7904e5 100644 --- a/src/target/register.h +++ b/src/target/register.h @@ -62,10 +62,13 @@ typedef struct reg_arch_type_s struct reg_arch_type_s *next; } reg_arch_type_t; -extern reg_t* register_get_by_name(reg_cache_t *first, char *name, int search_all); -extern reg_cache_t** register_get_last_cache_p(reg_cache_t **first); -extern int register_reg_arch_type(int (*get)(reg_t *reg), int (*set)(reg_t *reg, uint8_t *buf)); -extern reg_arch_type_t* register_get_arch_type(int id); -extern void register_init_dummy(reg_t *reg); +reg_t* register_get_by_name(reg_cache_t *first, char *name, int search_all); +reg_cache_t** register_get_last_cache_p(reg_cache_t **first); + +int register_reg_arch_type(int (*get)(reg_t *reg), + int (*set)(reg_t *reg, uint8_t *buf)); +reg_arch_type_t* register_get_arch_type(int id); + +void register_init_dummy(reg_t *reg); #endif /* REGISTER_H */ diff --git a/src/target/target_request.h b/src/target/target_request.h index b457bd9..433c592 100644 --- a/src/target/target_request.h +++ b/src/target/target_request.h @@ -42,8 +42,9 @@ typedef struct debug_msg_receiver_s struct debug_msg_receiver_s *next; } debug_msg_receiver_t; -extern int target_request(target_t *target, uint32_t request); -extern int delete_debug_msg_receiver(struct command_context_s *cmd_ctx, target_t *target); -extern int target_request_register_commands(struct command_context_s *cmd_ctx); +int target_request(target_t *target, uint32_t request); +int delete_debug_msg_receiver(struct command_context_s *cmd_ctx, + target_t *target); +int target_request_register_commands(struct command_context_s *cmd_ctx); #endif /* TARGET_REQUEST_H */ diff --git a/src/target/trace.h b/src/target/trace.h index 0a9ccc5..f6615f5 100644 --- a/src/target/trace.h +++ b/src/target/trace.h @@ -51,8 +51,8 @@ typedef enum trace_status TRACE_OVERFLOWED = 0x8, } trace_status_t; -extern int trace_point(struct target_s *target, uint32_t number); -extern int trace_register_commands(struct command_context_s *cmd_ctx); +int trace_point(struct target_s *target, uint32_t number); +int trace_register_commands(struct command_context_s *cmd_ctx); #define ERROR_TRACE_IMAGE_UNAVAILABLE -(1500) #define ERROR_TRACE_INSTRUCTION_UNAVAILABLE -(1501) commit 42cafc9369088d2a5d5f633358a2a42aa7bbc0de Author: Zachary T Welch <zw...@su...> Date: Mon Nov 9 04:21:36 2009 -0800 target.h: remove extern keyword and wrap Removes 'extern' keyword from function prototypes and wraps long lines. diff --git a/src/target/target.h b/src/target/target.h index 1bbf40f..5a61170 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -249,53 +249,65 @@ typedef struct target_timer_callback_s struct target_timer_callback_s *next; } target_timer_callback_t; -extern int target_register_commands(struct command_context_s *cmd_ctx); -extern int target_register_user_commands(struct command_context_s *cmd_ctx); -extern int target_init(struct command_context_s *cmd_ctx); -extern int target_examine(void); -extern int handle_target(void *priv); -extern int target_process_reset(struct command_context_s *cmd_ctx, enum target_reset_mode reset_mode); - -extern int target_register_event_callback(int (*callback)(struct target_s *target, enum target_event event, void *priv), void *priv); -extern int target_unregister_event_callback(int (*callback)(struct target_s *target, enum target_event event, void *priv), void *priv); -extern int target_poll(target_t *target); -extern int target_resume(target_t *target, int current, uint32_t address, int handle_breakpoints, int debug_execution); -extern int target_halt(target_t *target); -extern int target_call_event_callbacks(target_t *target, enum target_event event); - -/* The period is very approximate, the callback can happen much more often +int target_register_commands(struct command_context_s *cmd_ctx); +int target_register_user_commands(struct command_context_s *cmd_ctx); +int target_init(struct command_context_s *cmd_ctx); +int target_examine(void); +int handle_target(void *priv); +int target_process_reset(struct command_context_s *cmd_ctx, + enum target_reset_mode reset_mode); + +int target_register_event_callback( + int (*callback)(struct target_s *target, + enum target_event event, void *priv), + void *priv); +int target_unregister_event_callback( + int (*callback)(struct target_s *target, + enum target_event event, void *priv), + void *priv); +int target_poll(target_t *target); +int target_resume(target_t *target, int current, uint32_t address, + int handle_breakpoints, int debug_execution); +int target_halt(target_t *target); +int target_call_event_callbacks(target_t *target, enum target_event event); + +/** + * The period is very approximate, the callback can happen much more often * or much more rarely than specified */ -extern int target_register_timer_callback(int (*callback)(void *priv), int time_ms, int periodic, void *priv); -extern int target_unregister_timer_callback(int (*callback)(void *priv), void *priv); -extern int target_call_timer_callbacks(void); -/* invoke this to ensure that e.g. polling timer callbacks happen before +int target_register_timer_callback(int (*callback)(void *priv), + int time_ms, int periodic, void *priv); +int target_unregister_timer_callback(int (*callback)(void *priv), void *priv); + +int target_call_timer_callbacks(void); +/** + * Invoke this to ensure that e.g. polling timer callbacks happen before * a syncrhonous command completes. */ -extern int target_call_timer_callbacks_now(void); +int target_call_timer_callbacks_now(void); -extern target_t* get_current_target(struct command_context_s *cmd_ctx); -extern target_t *get_target(const char *id); +target_t* get_current_target(struct command_context_s *cmd_ctx); +target_t *get_target(const char *id); /** * Get the target name. * * This routine is a wrapper for the target->type->name field. */ -extern const char *target_get_name(struct target_s *target); +const char *target_get_name(struct target_s *target); /** * Examine the specified @a target. * * This routine is a wrapper for target->type->examine. */ -extern int target_examine_one(struct target_s *target); +int target_examine_one(struct target_s *target); /// @returns @c true if the target has been examined. -extern bool target_was_examined(struct target_s *target); +bool target_was_examined(struct target_s *target); /// Sets the @c examined flag for the given target. -extern void target_set_examined(struct target_s *target); +void target_set_examined(struct target_s *target); /// Reset the @c examined flag for the given target. -extern void target_reset_examined(struct target_s *target); +void target_reset_examined(struct target_s *target); /** @@ -303,28 +315,28 @@ extern void target_reset_examined(struct target_s *target); * * This routine is a wrapper for target->type->add_breakpoint. */ -extern int target_add_breakpoint(struct target_s *target, +int target_add_breakpoint(struct target_s *target, struct breakpoint_s *breakpoint); /** * Remove the @a breakpoint for @a target. * * This routine is a wrapper for target->type->remove_breakpoint. */ -extern int target_remove_breakpoint(struct target_s *target, +int target_remove_breakpoint(struct target_s *target, struct breakpoint_s *breakpoint); /** * Add the @a watchpoint for @a target. * * This routine is a wrapper for target->type->add_watchpoint. */ -extern int target_add_watchpoint(struct target_s *target, +int target_add_watchpoint(struct target_s *target, struct watchpoint_s *watchpoint); /** * Remove the @a watchpoint for @a target. * * This routine is a wrapper for target->type->remove_watchpoint. */ -extern int target_remove_watchpoint(struct target_s *target, +int target_remove_watchpoint(struct target_s *target, struct watchpoint_s *watchpoint); /** @@ -332,7 +344,7 @@ extern int target_remove_watchpoint(struct target_s *target, * * This routine is a wrapper for target->type->get_gdb_reg_list. */ -extern int target_get_gdb_reg_list(struct target_s *target, +int target_get_gdb_reg_list(struct target_s *target, struct reg_s **reg_list[], int *reg_list_size); /** @@ -347,7 +359,7 @@ int target_step(struct target_s *target, * * This routine is a wrapper for target->type->run_algorithm. */ -extern int target_run_algorithm(struct target_s *target, +int target_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_param, uint32_t entry_point, uint32_t exit_point, @@ -359,7 +371,7 @@ extern int target_run_algorithm(struct target_s *target, * * This routine is a wrapper for target->type->read_memory. */ -extern int target_read_memory(struct target_s *target, +int target_read_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); /** * Write @a count items of @a size bytes to the memory of @a target at @@ -367,7 +379,7 @@ extern int target_read_memory(struct target_s *target, * * This routine is wrapper for target->type->write_memory. */ -extern int target_write_memory(struct target_s *target, +int target_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer); /** @@ -377,7 +389,7 @@ extern int target_write_memory(struct target_s *target, * * This routine is wrapper for target->type->bulk_write_memory. */ -extern int target_bulk_write_memory(struct target_s *target, +int target_bulk_write_memory(struct target_s *target, uint32_t address, uint32_t count, uint8_t *buffer); /* @@ -404,11 +416,15 @@ extern int target_bulk_write_memory(struct target_s *target, * write operation, thus making this fn suitable to e.g. write to special * peripheral registers which do not support byte operations. */ -extern int target_write_buffer(struct target_s *target, uint32_t address, uint32_t size, uint8_t *buffer); -extern int target_read_buffer(struct target_s *target, uint32_t address, uint32_t size, uint8_t *buffer); -extern int target_checksum_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t* crc); -extern int target_blank_check_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t* blank); -extern int target_wait_state(target_t *target, enum target_state state, int ms); +int target_write_buffer(struct target_s *target, + uint32_t address, uint32_t size, uint8_t *buffer); +int target_read_buffer(struct target_s *target, + uint32_t address, uint32_t size, uint8_t *buffer); +int target_checksum_memory(struct target_s *target, + uint32_t address, uint32_t size, uint32_t* crc); +int target_blank_check_memory(struct target_s *target, + uint32_t address, uint32_t size, uint32_t* blank); +int target_wait_state(target_t *target, enum target_state state, int ms); /** Return the *name* of this targets current state */ const char *target_state_name( target_t *target ); @@ -424,23 +440,25 @@ const char *target_state_name( target_t *target ); * upon resuming or resetting the CPU. * */ -extern int target_alloc_working_area(struct target_s *target, uint32_t size, working_area_t **area); -extern int target_free_working_area(struct target_s *target, working_area_t *area); -extern int target_free_working_area_restore(struct target_s *target, working_area_t *area, int restore); -extern void target_free_all_working_areas(struct target_s *target); -extern void target_free_all_working_areas_restore(struct target_s *target, int restore); +int target_alloc_working_area(struct target_s *target, + uint32_t size, working_area_t **area); +int target_free_working_area(struct target_s *target, working_area_t *area); +int target_free_working_area_restore(struct target_s *target, + working_area_t *area, int restore); +void target_free_all_working_areas(struct target_s *target); +void target_free_all_working_areas_restore(struct target_s *target, int restore); extern target_t *all_targets; extern target_event_callback_t *target_event_callbacks; extern target_timer_callback_t *target_timer_callbacks; -extern uint32_t target_buffer_get_u32(target_t *target, const uint8_t *buffer); -extern uint16_t target_buffer_get_u16(target_t *target, const uint8_t *buffer); -extern uint8_t target_buffer_get_u8 (target_t *target, const uint8_t *buffer); -extern void target_buffer_set_u32(target_t *target, uint8_t *buffer, uint32_t value); -extern void target_buffer_set_u16(target_t *target, uint8_t *buffer, uint16_t value); -extern void target_buffer_set_u8 (target_t *target, uint8_t *buffer, uint8_t value); +uint32_t target_buffer_get_u32(target_t *target, const uint8_t *buffer); +uint16_t target_buffer_get_u16(target_t *target, const uint8_t *buffer); +uint8_t target_buffer_get_u8 (target_t *target, const uint8_t *buffer); +void target_buffer_set_u32(target_t *target, uint8_t *buffer, uint32_t value); +void target_buffer_set_u16(target_t *target, uint8_t *buffer, uint16_t value); +void target_buffer_set_u8 (target_t *target, uint8_t *buffer, uint8_t value); int target_read_u32(struct target_s *target, uint32_t address, uint32_t *value); int target_read_u16(struct target_s *target, uint32_t address, uint16_t *value); @@ -468,6 +486,7 @@ void target_all_handle_event(enum target_event e); #define ERROR_TARGET_NOT_EXAMINED (-311) extern const Jim_Nvp nvp_error_target[]; -extern const char *target_strerror_safe(int err); + +const char *target_strerror_safe(int err); #endif /* TARGET_H */ commit 994a63c3fee11b8c65891ead6b03b2b716044541 Author: Zachary T Welch <zw...@su...> Date: Mon Nov 9 03:38:34 2009 -0800 src/{server,pld,svf,xsvf}: remove 'extern' keyword Removes 'extern' keyword from function declarations in header filess. diff --git a/src/pld/pld.h b/src/pld/pld.h index e4cfc07..c6d3c92 100644 --- a/src/pld/pld.h +++ b/src/pld/pld.h @@ -39,9 +39,11 @@ typedef struct pld_device_s struct pld_device_s *next; } pld_device_t; -extern int pld_register_commands(struct command_context_s *cmd_ctx); -extern int pld_init(struct command_context_s *cmd_ctx); -extern pld_device_t *get_pld_device_by_num(int num); +int pld_register_commands(struct command_context_s *cmd_ctx); + +int pld_init(struct command_context_s *cmd_ctx); + +pld_device_t *get_pld_device_by_num(int num); #define ERROR_PLD_DEVICE_INVALID (-1000) #define ERROR_PLD_FILE_LOAD_FAILED (-1001) diff --git a/src/server/gdb_server.h b/src/server/gdb_server.h index ea981f3..4e334bc 100644 --- a/src/server/gdb_server.h +++ b/src/server/gdb_server.h @@ -54,8 +54,8 @@ typedef struct gdb_service_s struct target_s *target; } gdb_service_t; -extern int gdb_init(void); -extern int gdb_register_commands(command_context_t *command_context); +int gdb_init(void); +int gdb_register_commands(command_context_t *command_context); #define ERROR_GDB_BUFFER_TOO_SMALL (-800) #define ERROR_GDB_TIMEOUT (-801) diff --git a/src/server/server.h b/src/server/server.h index dab28ec..d4f1b6b 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -69,11 +69,17 @@ typedef struct service_s struct service_s *next; } service_t; -extern int add_service(char *name, enum connection_type type, unsigned short port, int max_connections, new_connection_handler_t new_connection_handler, input_handler_t input_handler, connection_closed_handler_t connection_closed_handler, void *priv); -extern int server_init(void); -extern int server_quit(void); -extern int server_loop(command_context_t *command_context); -extern int server_register_commands(command_context_t *context); +int add_service(char *name, enum connection_type type, unsigned short port, + int max_connections, new_connection_handler_t new_connection_handler, + input_handler_t in_handler, connection_closed_handler_t close_handler, + void *priv); + +int server_init(void); +int server_quit(void); + +int server_loop(command_context_t *command_context); + +int server_register_commands(command_context_t *context); int server_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, unsigned short *port); diff --git a/src/server/tcl_server.h b/src/server/tcl_server.h index c90dc8e..d6c9e10 100644 --- a/src/server/tcl_server.h +++ b/src/server/tcl_server.h @@ -22,7 +22,7 @@ #include "server.h" -extern int tcl_init(void); -extern int tcl_register_commands(command_context_t *cmd_ctx); +int tcl_init(void); +int tcl_register_commands(command_context_t *cmd_ctx); #endif /* _TCL_SERVER_H_ */ diff --git a/src/server/telnet_server.h b/src/server/telnet_server.h index 541d720..8f0d24a 100644 --- a/src/server/telnet_server.h +++ b/src/server/telnet_server.h @@ -68,7 +68,7 @@ typedef struct telnet_service_s char *banner; } telnet_service_t; -extern int telnet_init(char *banner); -extern int telnet_register_commands(command_context_t *command_context); +int telnet_init(char *banner); +int telnet_register_commands(command_context_t *command_context); #endif /* TELNET_SERVER_H */ diff --git a/src/svf/svf.h b/src/svf/svf.h index 83123fc..329fea9 100644 --- a/src/svf/svf.h +++ b/src/svf/svf.h @@ -22,7 +22,7 @@ #include "command.h" -extern int svf_register_commands(struct command_context_s *cmd_ctx); +int svf_register_commands(struct command_context_s *cmd_ctx); /** * svf_add_statemove() moves from the current state to @a goal_state. @@ -35,7 +35,7 @@ extern int svf_register_commands(struct command_context_s *cmd_ctx); * SVF specification for single-argument STATE commands (and also used * for various other state transitions). */ -extern int svf_add_statemove(tap_state_t goal_state); +int svf_add_statemove(tap_state_t goal_state); /** * svf_tap_state_is_stable() returns true for stable non-SHIFT states @@ -43,6 +43,6 @@ extern int svf_add_statemove(tap_state_t goal_state); * @param state The TAP state in question * @return true iff the state is stable and not a SHIFT state. */ -extern bool svf_tap_state_is_stable(tap_state_t state); +bool svf_tap_state_is_stable(tap_state_t state); #endif /* SVF_H */ diff --git a/src/xsvf/xsvf.h b/src/xsvf/xsvf.h index 017af88..93cccf0 100644 --- a/src/xsvf/xsvf.h +++ b/src/xsvf/xsvf.h @@ -22,7 +22,7 @@ #include "command.h" -extern int xsvf_register_commands(struct command_context_s *cmd_ctx); +int xsvf_register_commands(struct command_context_s *cmd_ctx); #define ERROR_XSVF_EOF (-200) #define ERROR_XSVF_FAILED (-201) commit 81fbc637185fb0007dbe84c866794800851295b5 Author: Zachary T Welch <zw...@su...> Date: Mon Nov 9 03:10:11 2009 -0800 src/flash: remove 'extern' and wrap headers Removes 'extern' keywords from function prototypes in the flash headers. Wraps long lines to fit into 80 columns. Adds multiple inclusion protection for s3c2xx_nand.h. diff --git a/src/flash/flash.h b/src/flash/flash.h index 05c4b2c..fd3c4c2 100644 --- a/src/flash/flash.h +++ b/src/flash/flash.h @@ -127,7 +127,8 @@ typedef struct flash_driver_s * * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*flash_bank_command)(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); + int (*flash_bank_command)(struct command_context_s *cmd_ctx, + char *cmd, char **args, int argc, struct flash_bank_s *bank); /** * Bank/sector erase routine (target-specific). When @@ -166,7 +167,8 @@ typedef struct flash_driver_s * @param count The number of bytes to write. * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*write)(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count); + int (*write)(struct flash_bank_s *bank, + uint8_t *buffer, uint32_t offset, uint32_t count); /** * Probe to determine what kind of flash is present. @@ -265,15 +267,16 @@ typedef struct flash_bank_s } flash_bank_t; /// Registers the 'flash' subsystem commands -extern int flash_register_commands(struct command_context_s *cmd_ctx); +int flash_register_commands(struct command_context_s *cmd_ctx); /// Initializes the 'flash' subsystem drivers -extern int flash_init_drivers(struct command_context_s *cmd_ctx); +int flash_init_drivers(struct command_context_s *cmd_ctx); /** * Erases @a length bytes in the @a target flash, starting at @a addr. * @returns ERROR_OK if successful; otherwise, an error code. */ -extern int flash_erase_address_range(struct target_s *target, uint32_t addr, uint32_t length); +int flash_erase_address_range(struct target_s *target, + uint32_t addr, uint32_t length); /** * Writes @a image into the @a target flash. The @a written parameter * will contain the @@ -284,35 +287,36 @@ extern int flash_erase_address_range(struct target_s *target, uint32_t addr, uin * erase the corresponding banks or sectors before programming. * @returns ERROR_OK if successful; otherwise, an error code. */ -extern int flash_write(struct target_s *target, struct image_s *image, uint32_t *written, int erase); +int flash_write(struct target_s *target, + struct image_s *image, uint32_t *written, int erase); /** * Forces targets to re-examine their erase/protection state. * This routine must be called when the system may modify the status. */ -extern void flash_set_dirty(void); +void flash_set_dirty(void); /// @returns The number of flash banks currently defined. -extern int flash_get_bank_count(void); +int flash_get_bank_count(void); /** * Provides default erased-bank check handling. Checks to see if * the flash driver knows they are erased; if things look uncertain, * this routine will call default_flash_mem_blank_check() to confirm. * @returns ERROR_OK if successful; otherwise, an error code. */ -extern int default_flash_blank_check(struct flash_bank_s *bank); +int default_flash_blank_check(struct flash_bank_s *bank); /** * Provides a default blank flash memory check. Ensures the contents * of the given bank have truly been erased. * @param bank The flash bank. * @returns ERROR_OK if successful; otherwise, an error code. */ -extern int default_flash_mem_blank_check(struct flash_bank_s *bank); +int default_flash_mem_blank_check(struct flash_bank_s *bank); /** * Returns a flash bank by the specified flash_bank_s bank_number, @a num. * @param num The flash bank number. * @returns A flash_bank_t for flash bank @a num, or NULL */ -extern flash_bank_t *get_flash_bank_by_num(int num); +flash_bank_t *get_flash_bank_by_num(int num); /** * Retreives @a bank from a command argument, reporting errors parsing * the bank identifier or retreiving the specified bank. @@ -321,21 +325,21 @@ extern flash_bank_t *get_flash_bank_by_num(int num); * @param bank On output, contians a pointer to the bank or NULL. * @returns ERROR_OK on success, or an error indicating the problem. */ -int flash_command_get... [truncated message content] |