OpenOCD
esp_algorithm.h File Reference
Include dependency graph for esp_algorithm.h:
This graph shows which files directly or indirectly include this file:

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
 

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...
 

Macro Definition Documentation

◆ ESP_IMAGE_ELF_PHF_EXEC

#define ESP_IMAGE_ELF_PHF_EXEC   0x1

Definition at line 136 of file esp_algorithm.h.

Function Documentation

◆ esp_algorithm_exec_func_image_va()

int esp_algorithm_exec_func_image_va ( struct target target,
struct esp_algorithm_run_data run,
uint32_t  num_args,
va_list  ap 
)

◆ esp_algorithm_exec_onboard_func_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().

◆ esp_algorithm_load_func_image()

◆ esp_algorithm_load_onboard_func()

◆ esp_algorithm_run_func_image()

static int esp_algorithm_run_func_image ( struct target target,
struct esp_algorithm_run_data run,
uint32_t  num_args,
  ... 
)
inlinestatic

Definition at line 324 of file esp_algorithm.h.

References esp_algorithm_run_func_image_va().

◆ esp_algorithm_run_func_image_va()

static int esp_algorithm_run_func_image_va ( struct target target,
struct esp_algorithm_run_data run,
uint32_t  num_args,
va_list  ap 
)
inlinestatic

Loads and runs stub from specified image.

This function should be used to run external stub code on target.

Parameters
targetPointer to target.
runPointer to algo run data.
num_argsNumber of stub arguments that follow.
Returns
ERROR_OK on success, otherwise ERROR_XXX. Stub return code is in run->ret_code.

Definition at line 311 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().

◆ esp_algorithm_run_onboard_func()

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,
  ... 
)
inlinestatic

Definition at line 371 of file esp_algorithm.h.

References esp_algorithm_run_onboard_func_va().

◆ esp_algorithm_run_onboard_func_va()

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 
)
inlinestatic

Runs pre-compiled on-board function.

This function should be used to run on-board stub code.

Parameters
targetPointer to target.
runPointer to algo run data.
func_entryAddress of the function to run.
num_argsNumber of function arguments that follow.
Returns
ERROR_OK on success, otherwise ERROR_XXX. Stub return code is in run->ret_code.

Definition at line 356 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().

◆ esp_algorithm_unload_func_image()

◆ esp_algorithm_unload_onboard_func()

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().

◆ esp_algorithm_user_arg_get_uint()

static uint64_t esp_algorithm_user_arg_get_uint ( struct esp_algorithm_run_data run,
int  arg_num 
)
inlinestatic

Get the value of an argument passed via registers from the stub main function.

Definition at line 404 of file esp_algorithm.h.

Referenced by esp_algorithm_run_debug_stub(), and esp_algorithm_run_image().

◆ esp_algorithm_user_arg_set_uint()

static void esp_algorithm_user_arg_set_uint ( struct esp_algorithm_run_data run,
int  arg_num,
uint64_t  val 
)
inlinestatic

Set the value of an argument passed via registers to the stub main function.

Definition at line 387 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().