16 uint32_t num_args, va_list ap);
28 #include "../../../contrib/loaders/trampoline/espressif/xtensa/esp_xtensa_stub_tramp_win.inc"
36 LOG_ERROR(
"Running stubs is not supported for cores without windowed registers option!");
48 if (stack_addr & 0xFUL) {
70 uint32_t num_args, va_list ap)
73 static const char *
const arg_regs[] = {
"a2",
"a3",
"a4",
"a5",
"a6" };
79 LOG_ERROR(
"Too many algo user args %u! Max %zu args are supported.", num_args,
ARRAY_SIZE(arg_regs));
114 uint32_t arg = va_arg(ap, uint32_t);
121 for (
unsigned int i = 1; i < num_args; i++) {
122 uint32_t arg = va_arg(ap, uint32_t);
void init_reg_param(struct reg_param *param, char *reg_name, uint32_t size, enum param_direction direction)
void destroy_reg_param(struct reg_param *param)
static void buf_set_u32(uint8_t *_buffer, unsigned int first, unsigned int num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
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.
static int esp_xtensa_algo_cleanup(struct target *target, struct esp_algorithm_run_data *run)
static int esp_xtensa_algo_init(struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args, va_list ap)
static const uint8_t esp_xtensa_stub_tramp_win[]
static int esp_xtensa_algo_regs_init_start(struct target *target, struct esp_algorithm_run_data *run)
const struct esp_algorithm_hw xtensa_algo_hw
static const uint8_t * esp_xtensa_stub_tramp_get(struct target *target, size_t *size)
#define ESP_XTENSA_STUB_ARGS_FUNC_START
Index of the first user-defined algo arg.
#define LOG_TARGET_DEBUG(target, fmt_str,...)
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
size_t size
Size of the control block search area.
int(* algo_init)(struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args, va_list ap)
struct reg_param * params
Algorithm register params.
uint32_t first_user_param
The first several reg_params can be used by stub itself (e.g.
uint32_t count
Number of register params.
struct esp_algorithm_reg_args reg_args
Algorithm register arguments.
void * arch_info
Algorithm arch-specific info.
struct esp_algorithm_stub stub
Stub.
target_addr_t stack_addr
Address of the target buffer for stack.
void * ainfo
Algorithm's arch-specific info.
target_addr_t entry
Entry addr.
enum xtensa_mode core_mode
User can set this to specify which core mode algorithm should be run in.
Represents a generic Xtensa core.
struct xtensa_config * core_config
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
Holds the interface to Xtensa cores.
static struct xtensa * target_to_xtensa(struct target *target)