@@ -597,8 +597,9 @@ static int esp_algo_flash_write_xfer(struct target *target, uint32_t block_id, u
597597
598598static int esp_algo_flash_write_state_init (struct target * target ,
599599 struct esp_algorithm_run_data * run ,
600- struct esp_flash_write_state * state )
600+ void * arg )
601601{
602+ struct esp_flash_write_state * state = (struct esp_flash_write_state * )arg ;
602603 struct duration algo_time ;
603604
604605 /* clear control register, stub will set APPTRACE_HOST_CONNECT bit when it will be
@@ -660,8 +661,9 @@ static int esp_algo_flash_write_state_init(struct target *target,
660661
661662static void esp_algo_flash_write_state_cleanup (struct target * target ,
662663 struct esp_algorithm_run_data * run ,
663- struct esp_flash_write_state * state )
664+ void * arg )
664665{
666+ struct esp_flash_write_state * state = (struct esp_flash_write_state * )arg ;
665667 struct duration algo_time ;
666668
667669 if (!state -> target_buf )
@@ -756,8 +758,8 @@ int esp_algo_flash_write(struct flash_bank *bank, const uint8_t *buffer,
756758 run .stack_size = stack_size + ESP_STUB_UNZIP_BUFF_SIZE + stub_cfg -> stack_data_pool_sz ;
757759 run .usr_func = esp_algo_flash_rw_do ;
758760 run .usr_func_arg = & wr_state ;
759- run .usr_func_init = ( esp_algorithm_usr_func_init_t ) esp_algo_flash_write_state_init ;
760- run .usr_func_done = ( esp_algorithm_usr_func_done_t ) esp_algo_flash_write_state_cleanup ;
761+ run .usr_func_init = esp_algo_flash_write_state_init ;
762+ run .usr_func_done = esp_algo_flash_write_state_cleanup ;
761763 memset (& wr_state , 0 , sizeof (struct esp_flash_write_state ));
762764 wr_state .rw .buffer = esp_info -> compression ? compressed_buff : (uint8_t * )buffer ;
763765 wr_state .rw .count = esp_info -> compression ? compressed_len : count ;
@@ -864,8 +866,9 @@ static int esp_algo_flash_read_xfer(struct target *target, uint32_t block_id, ui
864866
865867static int esp_algo_flash_read_state_init (struct target * target ,
866868 struct esp_algorithm_run_data * run ,
867- struct esp_flash_read_state * state )
869+ void * arg )
868870{
871+ struct esp_flash_write_state * state = (struct esp_flash_write_state * )arg ;
869872 /* clear control register, stub will set APPTRACE_HOST_CONNECT bit when it will be
870873 * ready */
871874 int ret = state -> rw .apptrace -> ctrl_reg_write (target ,
@@ -919,7 +922,7 @@ int esp_algo_flash_read(struct flash_bank *bank, uint8_t *buffer,
919922 }
920923
921924 run .stack_size = stack_size + stub_cfg -> stack_data_pool_sz ;
922- run .usr_func_init = ( esp_algorithm_usr_func_init_t ) esp_algo_flash_read_state_init ;
925+ run .usr_func_init = esp_algo_flash_read_state_init ;
923926 run .usr_func = esp_algo_flash_rw_do ;
924927 run .usr_func_arg = & rd_state ;
925928 memset (& rd_state , 0 , sizeof (struct esp_flash_read_state ));
@@ -1058,8 +1061,9 @@ int esp_algo_flash_auto_probe(struct flash_bank *bank)
10581061
10591062static int esp_algo_flash_bp_op_state_init (struct target * target ,
10601063 struct esp_algorithm_run_data * run ,
1061- struct esp_flash_bp_op_state * state )
1064+ void * arg )
10621065{
1066+ struct esp_flash_bp_op_state * state = (struct esp_flash_bp_op_state * )arg ;
10631067 struct xtensa * xtensa = target -> arch_info ;
10641068
10651069 LOG_DEBUG ("SEC_SIZE %d" , state -> esp_info -> sec_sz );
@@ -1118,8 +1122,9 @@ static int esp_algo_flash_bp_op_state_init(struct target *target,
11181122
11191123static void esp_algo_flash_bp_op_state_cleanup (struct target * target ,
11201124 struct esp_algorithm_run_data * run ,
1121- struct esp_flash_bp_op_state * state )
1125+ void * arg )
11221126{
1127+ struct esp_flash_bp_op_state * state = (struct esp_flash_bp_op_state * )arg ;
11231128 if (!state -> target_buf )
11241129 return ;
11251130 target_free_working_area (target , state -> target_buf );
@@ -1183,8 +1188,8 @@ int esp_algo_flash_breakpoint_add(struct target *target, struct esp_flash_breakp
11831188
11841189 run .stack_size = stack_size ;
11851190 run .usr_func_arg = & op_state ;
1186- run .usr_func_init = ( esp_algorithm_usr_func_init_t ) esp_algo_flash_bp_op_state_init ;
1187- run .usr_func_done = ( esp_algorithm_usr_func_done_t ) esp_algo_flash_bp_op_state_cleanup ;
1191+ run .usr_func_init = esp_algo_flash_bp_op_state_init ;
1192+ run .usr_func_done = esp_algo_flash_bp_op_state_cleanup ;
11881193 run .check_preloaded_binary = esp_info -> stub_log_enabled ? false : esp_info -> check_preloaded_binary ;
11891194
11901195 init_mem_param (& mp [0 ], 1 /* First user arg */ , num_bps * size_bp_inst /* size in bytes */ , PARAM_OUT );
@@ -1267,8 +1272,8 @@ int esp_algo_flash_breakpoint_remove(struct target *target, struct esp_flash_bre
12671272
12681273 run .stack_size = stack_size ;
12691274 run .usr_func_arg = & op_state ;
1270- run .usr_func_init = ( esp_algorithm_usr_func_init_t ) esp_algo_flash_bp_op_state_init ;
1271- run .usr_func_done = ( esp_algorithm_usr_func_done_t ) esp_algo_flash_bp_op_state_cleanup ;
1275+ run .usr_func_init = esp_algo_flash_bp_op_state_init ;
1276+ run .usr_func_done = esp_algo_flash_bp_op_state_cleanup ;
12721277 run .check_preloaded_binary = esp_info -> stub_log_enabled ? false : esp_info -> check_preloaded_binary ;
12731278
12741279 init_mem_param (& mp [0 ], 1 /* First user arg */ , 1 + num_bps * size_bp_inst /* size in bytes */ , PARAM_OUT );
0 commit comments