Remove misleading typedef and redundant suffix from struct etm_context.
bool is_armv4;
/** Handle for the Embedded Trace Module, if one is present. */
- struct etm *etm;
+ struct etm_context *etm;
int (*full_context)(struct target_s *target);
int (*read_core_reg)(struct target_s *target,
return ERROR_OK;
}
-static int etb_init(etm_context_t *etm_ctx)
+static int etb_init(struct etm_context *etm_ctx)
{
struct etb *etb = etm_ctx->capture_driver_priv;
return ERROR_OK;
}
-static trace_status_t etb_status(etm_context_t *etm_ctx)
+static trace_status_t etb_status(struct etm_context *etm_ctx)
{
struct etb *etb = etm_ctx->capture_driver_priv;
reg_t *control = &etb->reg_cache->reg_list[ETB_CTRL];
return retval;
}
-static int etb_read_trace(etm_context_t *etm_ctx)
+static int etb_read_trace(struct etm_context *etm_ctx)
{
struct etb *etb = etm_ctx->capture_driver_priv;
int first_frame = 0;
return ERROR_OK;
}
-static int etb_start_capture(etm_context_t *etm_ctx)
+static int etb_start_capture(struct etm_context *etm_ctx)
{
struct etb *etb = etm_ctx->capture_driver_priv;
uint32_t etb_ctrl_value = 0x1;
return ERROR_OK;
}
-static int etb_stop_capture(etm_context_t *etm_ctx)
+static int etb_stop_capture(struct etm_context *etm_ctx)
{
struct etb *etb = etm_ctx->capture_driver_priv;
reg_t *etb_ctrl_reg = &etb->reg_cache->reg_list[ETB_CTRL];
struct etb
{
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
struct jtag_tap *tap;
uint32_t cur_scan_chain;
struct reg_cache *reg_cache;
/* 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 reg_t *etm_reg_lookup(struct etm_context *etm_ctx, unsigned id)
{
struct reg_cache *cache = etm_ctx->reg_cache;
int i;
}
struct reg_cache *etm_build_reg_cache(target_t *target,
- struct arm_jtag *jtag_info, etm_context_t *etm_ctx)
+ struct arm_jtag *jtag_info, struct etm_context *etm_ctx)
{
struct reg_cache *reg_cache = malloc(sizeof(struct reg_cache));
reg_t *reg_list = NULL;
int retval;
uint32_t etm_ctrl_value;
struct arm *arm = target_to_arm(target);
- etm_context_t *etm_ctx = arm->etm;
+ struct etm_context *etm_ctx = arm->etm;
reg_t *etm_ctrl_reg;
etm_ctrl_reg = etm_reg_lookup(etm_ctx, ETM_CTRL);
NULL
};
-static int etm_read_instruction(etm_context_t *ctx, struct arm_instruction *instruction)
+static int etm_read_instruction(struct etm_context *ctx, struct arm_instruction *instruction)
{
int i;
int section = -1;
return ERROR_OK;
}
-static int etmv1_next_packet(etm_context_t *ctx, uint8_t *packet, int apo)
+static int etmv1_next_packet(struct etm_context *ctx, uint8_t *packet, int apo)
{
while (ctx->data_index < ctx->trace_depth)
{
return -1;
}
-static int etmv1_branch_address(etm_context_t *ctx)
+static int etmv1_branch_address(struct etm_context *ctx)
{
int retval;
uint8_t packet;
return 0;
}
-static int etmv1_data(etm_context_t *ctx, int size, uint32_t *data)
+static int etmv1_data(struct etm_context *ctx, int size, uint32_t *data)
{
int j;
uint8_t buf[4];
return 0;
}
-static int etmv1_analyze_trace(etm_context_t *ctx, struct command_context_s *cmd_ctx)
+static int etmv1_analyze_trace(struct etm_context *ctx, struct command_context_s *cmd_ctx)
{
int retval;
struct arm_instruction instruction;
{
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");
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)
return ERROR_FAIL;
}
- etm_ctx = calloc(1, sizeof(etm_context_t));
+ etm_ctx = calloc(1, sizeof(struct etm_context));
if (!etm_ctx) {
LOG_DEBUG("out of memory");
return ERROR_FAIL;
{
target_t *target;
struct arm *arm;
- etm_context_t *etm;
+ struct etm_context *etm;
reg_t *etm_sys_config_reg;
int max_port_size;
uint32_t config;
{
target_t *target;
struct arm *arm;
- etm_context_t *etm;
+ struct etm_context *etm;
trace_status_t trace_status;
target = get_current_target(cmd_ctx);
{
target_t *target;
struct arm *arm;
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
if (argc < 1)
{
struct fileio file;
target_t *target;
struct arm *arm;
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
uint32_t i;
if (argc != 1)
struct fileio file;
target_t *target;
struct arm *arm;
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
uint32_t i;
if (argc != 1)
{
target_t *target;
struct arm *arm;
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
target = get_current_target(cmd_ctx);
arm = target_to_arm(target);
{
target_t *target;
struct arm *arm;
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
reg_t *etm_ctrl_reg;
target = get_current_target(cmd_ctx);
{
target_t *target;
struct arm *arm;
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
reg_t *etm_ctrl_reg;
target = get_current_target(cmd_ctx);
{
target_t *target;
struct arm *arm;
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
int retval;
target = get_current_target(cmd_ctx);
} etmv1_tracemode_t;
/* forward-declare ETM context */
-struct etm;
+struct etm_context;
struct etm_capture_driver
{
char *name;
int (*register_commands)(struct command_context_s *cmd_ctx);
- int (*init)(struct etm *etm_ctx);
- trace_status_t (*status)(struct etm *etm_ctx);
- int (*read_trace)(struct etm *etm_ctx);
- int (*start_capture)(struct etm *etm_ctx);
- int (*stop_capture)(struct etm *etm_ctx);
+ int (*init)(struct etm_context *etm_ctx);
+ trace_status_t (*status)(struct etm_context *etm_ctx);
+ int (*read_trace)(struct etm_context *etm_ctx);
+ int (*start_capture)(struct etm_context *etm_ctx);
+ int (*stop_capture)(struct etm_context *etm_ctx);
};
enum
* this will have to be split into version independent elements
* and a version specific part
*/
-typedef struct etm
+struct etm_context
{
target_t *target; /* target this ETM is connected to */
struct reg_cache *reg_cache; /* ETM register cache */
uint32_t last_branch_reason; /* type of last branch encountered */
uint32_t last_ptr; /* address of the last data access */
uint32_t last_instruction; /* index of last executed (to calc timings) */
-} etm_context_t;
+};
/* PIPESTAT values */
typedef enum
} etmv1_branch_reason_t;
struct reg_cache* etm_build_reg_cache(target_t *target,
- struct arm_jtag *jtag_info, etm_context_t *etm_ctx);
+ struct arm_jtag *jtag_info, struct etm_context *etm_ctx);
int etm_setup(target_t *target);
return ERROR_OK;
}
-static int etm_dummy_init(etm_context_t *etm_ctx)
+static int etm_dummy_init(struct etm_context *etm_ctx)
{
return ERROR_OK;
}
-static trace_status_t etm_dummy_status(etm_context_t *etm_ctx)
+static trace_status_t etm_dummy_status(struct etm_context *etm_ctx)
{
return TRACE_IDLE;
}
-static int etm_dummy_read_trace(etm_context_t *etm_ctx)
+static int etm_dummy_read_trace(struct etm_context *etm_ctx)
{
return ERROR_OK;
}
-static int etm_dummy_start_capture(etm_context_t *etm_ctx)
+static int etm_dummy_start_capture(struct etm_context *etm_ctx)
{
return ERROR_ETM_PORTMODE_NOT_SUPPORTED;
}
-static int etm_dummy_stop_capture(etm_context_t *etm_ctx)
+static int etm_dummy_stop_capture(struct etm_context *etm_ctx)
{
return ERROR_OK;
}
return ERROR_OK;
}
-static int oocd_trace_init(etm_context_t *etm_ctx)
+static int oocd_trace_init(struct etm_context *etm_ctx)
{
uint8_t trash[256];
struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
return ERROR_OK;
}
-static trace_status_t oocd_trace_status(etm_context_t *etm_ctx)
+static trace_status_t oocd_trace_status(struct etm_context *etm_ctx)
{
struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
uint32_t status;
return etm_ctx->capture_status;
}
-static int oocd_trace_read_trace(etm_context_t *etm_ctx)
+static int oocd_trace_read_trace(struct etm_context *etm_ctx)
{
struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
uint32_t status, address;
return ERROR_OK;
}
-static int oocd_trace_start_capture(etm_context_t *etm_ctx)
+static int oocd_trace_start_capture(struct etm_context *etm_ctx)
{
struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
uint32_t control = 0x1; /* 0x1: enabled */
return ERROR_OK;
}
-static int oocd_trace_stop_capture(etm_context_t *etm_ctx)
+static int oocd_trace_stop_capture(struct etm_context *etm_ctx)
{
struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
struct oocd_trace
{
- etm_context_t *etm_ctx;
+ struct etm_context *etm_ctx;
char *tty;
int tty_fd;
struct termios oldtio, newtio;