projects
/
fw
/
openocd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reg_t -> struct reg
[fw/openocd]
/
src
/
target
/
etm.c
diff --git
a/src/target/etm.c
b/src/target/etm.c
index 9952279d2f76ec497f92f4e3ffcf33a3812602cf..0aa1a73911554a8f4fa827d9efe5aea0679d38a2 100644
(file)
--- a/
src/target/etm.c
+++ b/
src/target/etm.c
@@
-216,12
+216,12
@@
static const struct etm_reg_info etm_outputs[] = {
static int etm_reg_arch_type = -1;
static int etm_reg_arch_type = -1;
-static int etm_get_reg(
reg_t
*reg);
-static int etm_read_reg_w_check(
reg_t
*reg,
+static int etm_get_reg(
struct reg
*reg);
+static int etm_read_reg_w_check(
struct reg
*reg,
uint8_t* check_value, uint8_t* check_mask);
static int etm_register_user_commands(struct command_context_s *cmd_ctx);
uint8_t* check_value, uint8_t* check_mask);
static int etm_register_user_commands(struct command_context_s *cmd_ctx);
-static int etm_set_reg_w_exec(
reg_t
*reg, uint8_t *buf);
-static int etm_write_reg(
reg_t
*reg, uint32_t value);
+static int etm_set_reg_w_exec(
struct reg
*reg, uint8_t *buf);
+static int etm_write_reg(
struct reg
*reg, uint32_t value);
static command_t *etm_cmd;
static command_t *etm_cmd;
@@
-229,9
+229,9
@@
static command_t *etm_cmd;
/* Look up register by ID ... most ETM instances only
* support a subset of the possible registers.
*/
/* Look up register by ID ... most ETM instances only
* support a subset of the possible registers.
*/
-static
reg_t *etm_reg_lookup(etm_context_
t *etm_ctx, unsigned id)
+static
struct reg *etm_reg_lookup(struct etm_contex
t *etm_ctx, unsigned id)
{
{
-
reg_cache_t
*cache = etm_ctx->reg_cache;
+
struct reg_cache
*cache = etm_ctx->reg_cache;
int i;
for (i = 0; i < cache->num_regs; i++) {
int i;
for (i = 0; i < cache->num_regs; i++) {
@@
-248,10
+248,10
@@
static reg_t *etm_reg_lookup(etm_context_t *etm_ctx, unsigned id)
}
static void etm_reg_add(unsigned bcd_vers, struct arm_jtag *jtag_info,
}
static void etm_reg_add(unsigned bcd_vers, struct arm_jtag *jtag_info,
-
reg_cache_t
*cache, struct etm_reg *ereg,
+
struct reg_cache
*cache, struct etm_reg *ereg,
const struct etm_reg_info *r, unsigned nreg)
{
const struct etm_reg_info *r, unsigned nreg)
{
-
reg_t
*reg = cache->reg_list;
+
struct reg
*reg = cache->reg_list;
reg += cache->num_regs;
ereg += cache->num_regs;
reg += cache->num_regs;
ereg += cache->num_regs;
@@
-279,11
+279,11
@@
static void etm_reg_add(unsigned bcd_vers, struct arm_jtag *jtag_info,
}
}
}
}
-
reg_cache_t
*etm_build_reg_cache(target_t *target,
- struct arm_jtag *jtag_info,
etm_context_
t *etm_ctx)
+
struct reg_cache
*etm_build_reg_cache(target_t *target,
+ struct arm_jtag *jtag_info,
struct etm_contex
t *etm_ctx)
{
{
-
reg_cache_t *reg_cache = malloc(sizeof(reg_cache_t
));
-
reg_t
*reg_list = NULL;
+
struct reg_cache *reg_cache = malloc(sizeof(struct reg_cache
));
+
struct reg
*reg_list = NULL;
struct etm_reg *arch_info = NULL;
unsigned bcd_vers, config;
struct etm_reg *arch_info = NULL;
unsigned bcd_vers, config;
@@
-293,7
+293,7
@@
reg_cache_t *etm_build_reg_cache(target_t *target,
etm_set_reg_w_exec);
/* the actual registers are kept in two arrays */
etm_set_reg_w_exec);
/* the actual registers are kept in two arrays */
- reg_list = calloc(128, sizeof(
reg_t
));
+ reg_list = calloc(128, sizeof(
struct reg
));
arch_info = calloc(128, sizeof(struct etm_reg));
/* fill in values for the reg cache */
arch_info = calloc(128, sizeof(struct etm_reg));
/* fill in values for the reg cache */
@@
-391,7
+391,7
@@
reg_cache_t *etm_build_reg_cache(target_t *target,
/* the ETM might have an ETB connected */
if (strcmp(etm_ctx->capture_driver->name, "etb") == 0)
{
/* the ETM might have an ETB connected */
if (strcmp(etm_ctx->capture_driver->name, "etb") == 0)
{
-
etb_t
*etb = etm_ctx->capture_driver_priv;
+
struct etb
*etb = etm_ctx->capture_driver_priv;
if (!etb)
{
if (!etb)
{
@@
-411,12
+411,12
@@
reg_cache_t *etm_build_reg_cache(target_t *target,
return reg_cache;
}
return reg_cache;
}
-static int etm_read_reg(
reg_t
*reg)
+static int etm_read_reg(
struct reg
*reg)
{
return etm_read_reg_w_check(reg, NULL, NULL);
}
{
return etm_read_reg_w_check(reg, NULL, NULL);
}
-static int etm_store_reg(
reg_t
*reg)
+static int etm_store_reg(
struct reg
*reg)
{
return etm_write_reg(reg, buf_get_u32(reg->value, 0, reg->size));
}
{
return etm_write_reg(reg, buf_get_u32(reg->value, 0, reg->size));
}
@@
-426,8
+426,8
@@
int etm_setup(target_t *target)
int retval;
uint32_t etm_ctrl_value;
struct arm *arm = target_to_arm(target);
int retval;
uint32_t etm_ctrl_value;
struct arm *arm = target_to_arm(target);
-
etm_context_
t *etm_ctx = arm->etm;
-
reg_t
*etm_ctrl_reg;
+
struct etm_contex
t *etm_ctx = arm->etm;
+
struct reg
*etm_ctrl_reg;
etm_ctrl_reg = etm_reg_lookup(etm_ctx, ETM_CTRL);
if (!etm_ctrl_reg)
etm_ctrl_reg = etm_reg_lookup(etm_ctx, ETM_CTRL);
if (!etm_ctrl_reg)
@@
-467,7
+467,7
@@
int etm_setup(target_t *target)
return ERROR_OK;
}
return ERROR_OK;
}
-static int etm_get_reg(
reg_t
*reg)
+static int etm_get_reg(
struct reg
*reg)
{
int retval;
{
int retval;
@@
-486,7
+486,7
@@
static int etm_get_reg(reg_t *reg)
return ERROR_OK;
}
return ERROR_OK;
}
-static int etm_read_reg_w_check(
reg_t
*reg,
+static int etm_read_reg_w_check(
struct reg
*reg,
uint8_t* check_value, uint8_t* check_mask)
{
struct etm_reg *etm_reg = reg->arch_info;
uint8_t* check_value, uint8_t* check_mask)
{
struct etm_reg *etm_reg = reg->arch_info;
@@
-542,7
+542,7
@@
static int etm_read_reg_w_check(reg_t *reg,
return ERROR_OK;
}
return ERROR_OK;
}
-static int etm_set_reg(
reg_t
*reg, uint32_t value)
+static int etm_set_reg(
struct reg
*reg, uint32_t value)
{
int retval;
{
int retval;
@@
-559,7
+559,7
@@
static int etm_set_reg(reg_t *reg, uint32_t value)
return ERROR_OK;
}
return ERROR_OK;
}
-static int etm_set_reg_w_exec(
reg_t
*reg, uint8_t *buf)
+static int etm_set_reg_w_exec(
struct reg
*reg, uint8_t *buf)
{
int retval;
{
int retval;
@@
-573,7
+573,7
@@
static int etm_set_reg_w_exec(reg_t *reg, uint8_t *buf)
return ERROR_OK;
}
return ERROR_OK;
}
-static int etm_write_reg(
reg_t
*reg, uint32_t value)
+static int etm_write_reg(
struct reg
*reg, uint32_t value)
{
struct etm_reg *etm_reg = reg->arch_info;
const struct etm_reg_info *r = etm_reg->reg_info;
{
struct etm_reg *etm_reg = reg->arch_info;
const struct etm_reg_info *r = etm_reg->reg_info;
@@
-636,7
+636,7
@@
static struct etm_capture_driver *etm_capture_drivers[] =
NULL
};
NULL
};
-static int etm_read_instruction(
etm_context_t *ctx, arm_instruction_t
*instruction)
+static int etm_read_instruction(
struct etm_context *ctx, struct arm_instruction
*instruction)
{
int i;
int section = -1;
{
int i;
int section = -1;
@@
-704,7
+704,7
@@
static int etm_read_instruction(etm_context_t *ctx, arm_instruction_t *instructi
return ERROR_OK;
}
return ERROR_OK;
}
-static int etmv1_next_packet(
etm_context_
t *ctx, uint8_t *packet, int apo)
+static int etmv1_next_packet(
struct etm_contex
t *ctx, uint8_t *packet, int apo)
{
while (ctx->data_index < ctx->trace_depth)
{
{
while (ctx->data_index < ctx->trace_depth)
{
@@
-769,7
+769,7
@@
static int etmv1_next_packet(etm_context_t *ctx, uint8_t *packet, int apo)
return -1;
}
return -1;
}
-static int etmv1_branch_address(
etm_context_
t *ctx)
+static int etmv1_branch_address(
struct etm_contex
t *ctx)
{
int retval;
uint8_t packet;
{
int retval;
uint8_t packet;
@@
-855,7
+855,7
@@
static int etmv1_branch_address(etm_context_t *ctx)
return 0;
}
return 0;
}
-static int etmv1_data(
etm_context_
t *ctx, int size, uint32_t *data)
+static int etmv1_data(
struct etm_contex
t *ctx, int size, uint32_t *data)
{
int j;
uint8_t buf[4];
{
int j;
uint8_t buf[4];
@@
-884,10
+884,10
@@
static int etmv1_data(etm_context_t *ctx, int size, uint32_t *data)
return 0;
}
return 0;
}
-static int etmv1_analyze_trace(
etm_context_
t *ctx, struct command_context_s *cmd_ctx)
+static int etmv1_analyze_trace(
struct etm_contex
t *ctx, struct command_context_s *cmd_ctx)
{
int retval;
{
int retval;
-
arm_instruction_t
instruction;
+
struct arm_instruction
instruction;
/* read the trace data if it wasn't read already */
if (ctx->trace_depth == 0)
/* read the trace data if it wasn't read already */
if (ctx->trace_depth == 0)
@@
-1251,7
+1251,7
@@
COMMAND_HANDLER(handle_etm_tracemode_command)
{
target_t *target = get_current_target(cmd_ctx);
struct arm *arm = target_to_arm(target);
{
target_t *target = get_current_target(cmd_ctx);
struct arm *arm = target_to_arm(target);
- struct etm *etm;
+ struct etm
_context
*etm;
if (!is_arm(arm)) {
command_print(cmd_ctx, "ETM: current target isn't an ARM");
if (!is_arm(arm)) {
command_print(cmd_ctx, "ETM: current target isn't an ARM");
@@
-1340,7
+1340,7
@@
COMMAND_HANDLER(handle_etm_tracemode_command)
/* only update ETM_CTRL register if tracemode changed */
if (etm->tracemode != tracemode)
{
/* only update ETM_CTRL register if tracemode changed */
if (etm->tracemode != tracemode)
{
-
reg_t
*etm_ctrl_reg;
+
struct reg
*etm_ctrl_reg;
etm_ctrl_reg = etm_reg_lookup(etm, ETM_CTRL);
if (!etm_ctrl_reg)
etm_ctrl_reg = etm_reg_lookup(etm, ETM_CTRL);
if (!etm_ctrl_reg)
@@
-1374,7
+1374,7
@@
COMMAND_HANDLER(handle_etm_config_command)
target_t *target;
struct arm *arm;
etm_portmode_t portmode = 0x0;
target_t *target;
struct arm *arm;
etm_portmode_t portmode = 0x0;
- struct etm *etm_ctx;
+ struct etm
_context
*etm_ctx;
int i;
if (argc != 5)
int i;
if (argc != 5)
@@
-1477,7
+1477,7
@@
COMMAND_HANDLER(handle_etm_config_command)
return ERROR_FAIL;
}
return ERROR_FAIL;
}
- etm_ctx = calloc(1, sizeof(
etm_context_
t));
+ etm_ctx = calloc(1, sizeof(
struct etm_contex
t));
if (!etm_ctx) {
LOG_DEBUG("out of memory");
return ERROR_FAIL;
if (!etm_ctx) {
LOG_DEBUG("out of memory");
return ERROR_FAIL;
@@
-1523,8
+1523,8
@@
COMMAND_HANDLER(handle_etm_info_command)
{
target_t *target;
struct arm *arm;
{
target_t *target;
struct arm *arm;
-
etm_context_
t *etm;
-
reg_t
*etm_sys_config_reg;
+
struct etm_contex
t *etm;
+
struct reg
*etm_sys_config_reg;
int max_port_size;
uint32_t config;
int max_port_size;
uint32_t config;
@@
-1655,7
+1655,7
@@
COMMAND_HANDLER(handle_etm_status_command)
{
target_t *target;
struct arm *arm;
{
target_t *target;
struct arm *arm;
-
etm_context_
t *etm;
+
struct etm_contex
t *etm;
trace_status_t trace_status;
target = get_current_target(cmd_ctx);
trace_status_t trace_status;
target = get_current_target(cmd_ctx);
@@
-1675,7
+1675,7
@@
COMMAND_HANDLER(handle_etm_status_command)
/* ETM status */
if (etm->bcd_vers >= 0x11) {
/* ETM status */
if (etm->bcd_vers >= 0x11) {
-
reg_t
*reg;
+
struct reg
*reg;
reg = etm_reg_lookup(etm, ETM_STATUS);
if (!reg)
reg = etm_reg_lookup(etm, ETM_STATUS);
if (!reg)
@@
-1731,7
+1731,7
@@
COMMAND_HANDLER(handle_etm_image_command)
{
target_t *target;
struct arm *arm;
{
target_t *target;
struct arm *arm;
-
etm_context_
t *etm_ctx;
+
struct etm_contex
t *etm_ctx;
if (argc < 1)
{
if (argc < 1)
{
@@
-1761,7
+1761,7
@@
COMMAND_HANDLER(handle_etm_image_command)
command_print(cmd_ctx, "previously loaded image found and closed");
}
command_print(cmd_ctx, "previously loaded image found and closed");
}
- etm_ctx->image = malloc(sizeof(
image_t
));
+ etm_ctx->image = malloc(sizeof(
struct image
));
etm_ctx->image->base_address_set = 0;
etm_ctx->image->start_address_set = 0;
etm_ctx->image->base_address_set = 0;
etm_ctx->image->start_address_set = 0;
@@
-1791,7
+1791,7
@@
COMMAND_HANDLER(handle_etm_dump_command)
struct fileio file;
target_t *target;
struct arm *arm;
struct fileio file;
target_t *target;
struct arm *arm;
-
etm_context_
t *etm_ctx;
+
struct etm_contex
t *etm_ctx;
uint32_t i;
if (argc != 1)
uint32_t i;
if (argc != 1)
@@
-1859,7
+1859,7
@@
COMMAND_HANDLER(handle_etm_load_command)
struct fileio file;
target_t *target;
struct arm *arm;
struct fileio file;
target_t *target;
struct arm *arm;
-
etm_context_
t *etm_ctx;
+
struct etm_contex
t *etm_ctx;
uint32_t i;
if (argc != 1)
uint32_t i;
if (argc != 1)
@@
-1942,7
+1942,7
@@
COMMAND_HANDLER(handle_etm_trigger_percent_command)
{
target_t *target;
struct arm *arm;
{
target_t *target;
struct arm *arm;
-
etm_context_
t *etm_ctx;
+
struct etm_contex
t *etm_ctx;
target = get_current_target(cmd_ctx);
arm = target_to_arm(target);
target = get_current_target(cmd_ctx);
arm = target_to_arm(target);
@@
-1983,8
+1983,8
@@
COMMAND_HANDLER(handle_etm_start_command)
{
target_t *target;
struct arm *arm;
{
target_t *target;
struct arm *arm;
-
etm_context_
t *etm_ctx;
-
reg_t
*etm_ctrl_reg;
+
struct etm_contex
t *etm_ctx;
+
struct reg
*etm_ctrl_reg;
target = get_current_target(cmd_ctx);
arm = target_to_arm(target);
target = get_current_target(cmd_ctx);
arm = target_to_arm(target);
@@
-2031,8
+2031,8
@@
COMMAND_HANDLER(handle_etm_stop_command)
{
target_t *target;
struct arm *arm;
{
target_t *target;
struct arm *arm;
-
etm_context_
t *etm_ctx;
-
reg_t
*etm_ctrl_reg;
+
struct etm_contex
t *etm_ctx;
+
struct reg
*etm_ctrl_reg;
target = get_current_target(cmd_ctx);
arm = target_to_arm(target);
target = get_current_target(cmd_ctx);
arm = target_to_arm(target);
@@
-2070,7
+2070,7
@@
COMMAND_HANDLER(handle_etm_analyze_command)
{
target_t *target;
struct arm *arm;
{
target_t *target;
struct arm *arm;
-
etm_context_
t *etm_ctx;
+
struct etm_contex
t *etm_ctx;
int retval;
target = get_current_target(cmd_ctx);
int retval;
target = get_current_target(cmd_ctx);