OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | esp_algorithm_hw |
struct | esp_algorithm_image |
API defined below allows executing pieces of code on target without breaking the execution of the running program. More... | |
struct | esp_algorithm_mem_args |
Algorithm stub in-memory arguments. More... | |
struct | esp_algorithm_reg_args |
Algorithm stub register arguments. More... | |
struct | esp_algorithm_run_data |
Algorithm run data. More... | |
struct | esp_algorithm_stub |
Algorithm stub data. More... | |
Macros | |
#define | ESP_IMAGE_ELF_PHF_EXEC 0x1 |
Typedefs | |
typedef int(* | esp_algorithm_func_t) (struct target *target, struct esp_algorithm_run_data *run, void *arg) |
Algorithm run function. More... | |
typedef void(* | esp_algorithm_usr_func_done_t) (struct target *target, struct esp_algorithm_run_data *run, void *usr_arg) |
Algorithm's arguments cleanup function. More... | |
typedef int(* | esp_algorithm_usr_func_init_t) (struct target *target, struct esp_algorithm_run_data *run, void *usr_arg) |
Algorithm's arguments setup function. More... | |
typedef int(* | esp_algorithm_usr_func_t) (struct target *target, void *usr_arg) |
Host part of algorithm. More... | |
Functions | |
int | esp_algorithm_exec_func_image_va (struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args, va_list ap) |
int | esp_algorithm_exec_onboard_func_va (struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args, va_list ap) |
int | esp_algorithm_load_func_image (struct target *target, struct esp_algorithm_run_data *run) |
int | esp_algorithm_load_onboard_func (struct target *target, target_addr_t func_addr, struct esp_algorithm_run_data *run) |
static int | esp_algorithm_run_func_image (struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args,...) |
static int | esp_algorithm_run_func_image_va (struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args, va_list ap) |
Loads and runs stub from specified image. More... | |
static int | esp_algorithm_run_onboard_func (struct target *target, struct esp_algorithm_run_data *run, target_addr_t func_addr, uint32_t num_args,...) |
static int | esp_algorithm_run_onboard_func_va (struct target *target, struct esp_algorithm_run_data *run, target_addr_t func_addr, uint32_t num_args, va_list ap) |
Runs pre-compiled on-board function. More... | |
int | esp_algorithm_unload_func_image (struct target *target, struct esp_algorithm_run_data *run) |
int | esp_algorithm_unload_onboard_func (struct target *target, struct esp_algorithm_run_data *run) |
static uint64_t | esp_algorithm_user_arg_get_uint (struct esp_algorithm_run_data *run, int arg_num) |
Get the value of an argument passed via registers from the stub main function. More... | |
static void | esp_algorithm_user_arg_set_uint (struct esp_algorithm_run_data *run, int arg_num, uint64_t val) |
Set the value of an argument passed via registers to the stub main function. More... | |
#define ESP_IMAGE_ELF_PHF_EXEC 0x1 |
Definition at line 134 of file esp_algorithm.h.
typedef int(* esp_algorithm_func_t) (struct target *target, struct esp_algorithm_run_data *run, void *arg) |
Algorithm run function.
target | Pointer to target. |
run | Pointer to algo run data. |
arg | Function specific argument. |
Definition at line 202 of file esp_algorithm.h.
typedef void(* esp_algorithm_usr_func_done_t) (struct target *target, struct esp_algorithm_run_data *run, void *usr_arg) |
Algorithm's arguments cleanup function.
This function will be called just after stub exit. It can be used to cleanup stub memory parameters.
target | Pointer to target. |
run | Pointer to algo run data. |
usr_arg | Function specific argument. The same as for esp_algorithm_usr_func_t. |
Definition at line 243 of file esp_algorithm.h.
typedef int(* esp_algorithm_usr_func_init_t) (struct target *target, struct esp_algorithm_run_data *run, void *usr_arg) |
Algorithm's arguments setup function.
This function will be called just before stub start. It must return when all operations with running stub are completed. It can be used to prepare stub memory parameters.
target | Pointer to target. |
run | Pointer to algo run data. |
usr_arg | Function specific argument. The same as for esp_algorithm_usr_func_t. |
Definition at line 228 of file esp_algorithm.h.
Host part of algorithm.
This function will be called while stub is running on target. It can be used for communication with stub.
target | Pointer to target. |
usr_arg | Function specific argument. |
Definition at line 214 of file esp_algorithm.h.
int esp_algorithm_exec_func_image_va | ( | struct target * | target, |
struct esp_algorithm_run_data * | run, | ||
uint32_t | num_args, | ||
va_list | ap | ||
) |
Definition at line 518 of file esp_algorithm.c.
References ERROR_FAIL, esp_algorithm_run_image(), esp_algorithm_run_data::image, esp_algorithm_image::image, image::start_address, and image::start_address_set.
Referenced by esp_algorithm_run_func_image_va().
int esp_algorithm_exec_onboard_func_va | ( | struct target * | target, |
struct esp_algorithm_run_data * | run, | ||
uint32_t | num_args, | ||
va_list | ap | ||
) |
Definition at line 589 of file esp_algorithm.c.
References esp_algorithm_run_debug_stub().
Referenced by esp_algorithm_run_onboard_func_va().
int esp_algorithm_load_func_image | ( | struct target * | target, |
struct esp_algorithm_run_data * | run | ||
) |
Definition at line 299 of file esp_algorithm.c.
References working_area::address, ALIGN_UP, target::backup_working_area, imagesection::base_address, image::base_address, image::base_address_set, esp_algorithm_image::bss_size, esp_algorithm_stub::code, esp_algorithm_stub::data, esp_algorithm_image::dram_org, duration_elapsed(), duration_measure(), duration_start(), esp_algorithm_stub::entry, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, esp_algorithm_unload_func_image(), ESP_IMAGE_ELF_PHF_EXEC, imagesection::flags, esp_algorithm_run_data::hw, esp_algorithm_run_data::image, esp_algorithm_image::image, esp_algorithm_image::iram_len, esp_algorithm_image::iram_org, load_section_from_image(), LOG_DEBUG, LOG_ERROR, NULL, image::num_sections, esp_algorithm_stub::padding, esp_algorithm_image::reverse, reverse_binary(), image::sections, imagesection::size, esp_algorithm_stub::stack, esp_algorithm_stub::stack_addr, esp_algorithm_run_data::stack_size, image::start_address, esp_algorithm_run_data::stub, esp_algorithm_hw::stub_tramp_get, TARGET_ADDR_FMT, target_alloc_working_area(), target_write_buffer(), esp_algorithm_stub::tramp, esp_algorithm_stub::tramp_addr, and esp_algorithm_stub::tramp_mapped_addr.
Referenced by esp_algorithm_run_func_image_va().
int esp_algorithm_load_onboard_func | ( | struct target * | target, |
target_addr_t | func_addr, | ||
struct esp_algorithm_run_data * | run | ||
) |
Definition at line 529 of file esp_algorithm.c.
References duration_elapsed(), duration_measure(), duration_start(), esp_algorithm_stub::entry, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, esp_algorithm_unload_onboard_func(), esp_algorithm_run_data::hw, LOG_DEBUG, LOG_ERROR, NULL, esp_algorithm_run_data::on_board, esp_algorithm_stub::stack_addr, esp_algorithm_run_data::stack_size, esp_algorithm_run_data::stub, esp_algorithm_hw::stub_tramp_get, target_write_buffer(), esp_algorithm_stub::tramp_addr, and esp_algorithm_stub::tramp_mapped_addr.
Referenced by esp_algorithm_run_onboard_func_va().
|
inlinestatic |
Definition at line 329 of file esp_algorithm.h.
References esp_algorithm_run_func_image_va().
|
inlinestatic |
Loads and runs stub from specified image.
This function should be used to run external stub code on target.
target | Pointer to target. |
run | Pointer to algo run data. |
num_args | Number of stub arguments that follow. |
Definition at line 316 of file esp_algorithm.h.
References ERROR_OK, esp_algorithm_exec_func_image_va(), esp_algorithm_load_func_image(), and esp_algorithm_unload_func_image().
Referenced by esp_algorithm_run_func_image(), and esp_xtensa_smp_run_func_image().
|
inlinestatic |
Definition at line 376 of file esp_algorithm.h.
References esp_algorithm_run_onboard_func_va().
|
inlinestatic |
Runs pre-compiled on-board function.
This function should be used to run on-board stub code.
target | Pointer to target. |
run | Pointer to algo run data. |
func_entry | Address of the function to run. |
num_args | Number of function arguments that follow. |
Definition at line 361 of file esp_algorithm.h.
References ERROR_OK, esp_algorithm_exec_onboard_func_va(), esp_algorithm_load_onboard_func(), and esp_algorithm_unload_onboard_func().
Referenced by esp_algorithm_run_onboard_func(), and esp_xtensa_smp_run_onboard_func().
int esp_algorithm_unload_func_image | ( | struct target * | target, |
struct esp_algorithm_run_data * | run | ||
) |
Definition at line 502 of file esp_algorithm.c.
References esp_algorithm_stub::code, esp_algorithm_stub::data, ERROR_FAIL, ERROR_OK, NULL, esp_algorithm_stub::padding, esp_algorithm_stub::stack, esp_algorithm_run_data::stub, target_free_all_working_areas(), and esp_algorithm_stub::tramp.
Referenced by esp_algorithm_load_func_image(), and esp_algorithm_run_func_image_va().
int esp_algorithm_unload_onboard_func | ( | struct target * | target, |
struct esp_algorithm_run_data * | run | ||
) |
Definition at line 584 of file esp_algorithm.c.
References ERROR_OK.
Referenced by esp_algorithm_load_onboard_func(), and esp_algorithm_run_onboard_func_va().
|
inlinestatic |
Get the value of an argument passed via registers from the stub main function.
Definition at line 409 of file esp_algorithm.h.
Referenced by esp_algorithm_run_debug_stub(), and esp_algorithm_run_image().
|
inlinestatic |
Set the value of an argument passed via registers to the stub main function.
Definition at line 392 of file esp_algorithm.h.
References buf_set_u32(), buf_set_u64(), esp_algorithm_reg_args::first_user_param, esp_algorithm_reg_args::params, esp_algorithm_run_data::reg_args, reg_param::size, and reg_param::value.
Referenced by esp_algorithm_run_image(), and esp_xtensa_algo_init().