etm_context_t -> struct etm_context
[openocd.git] / src / target / etm.c
index 0fc924914ff79bb0a059cbf8fb2401c32238d363..751ea421ad5993458d9e295443c285c2a1f56b93 100644 (file)
@@ -229,13 +229,13 @@ static command_t *etm_cmd;
 /* 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)
 {
-       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++) {
-               struct etm_reg_s *reg = cache->reg_list[i].arch_info;
+               struct etm_reg *reg = cache->reg_list[i].arch_info;
 
                if (reg->reg_info->addr == id)
                        return &cache->reg_list[i];
@@ -247,8 +247,8 @@ static reg_t *etm_reg_lookup(etm_context_t *etm_ctx, unsigned id)
        return NULL;
 }
 
-static void etm_reg_add(unsigned bcd_vers, arm_jtag_t *jtag_info,
-               reg_cache_t *cache, etm_reg_t *ereg,
+static void etm_reg_add(unsigned bcd_vers, struct arm_jtag *jtag_info,
+               struct reg_cache *cache, struct etm_reg *ereg,
                const struct etm_reg_info *r, unsigned nreg)
 {
        reg_t *reg = cache->reg_list;
@@ -279,12 +279,12 @@ static void etm_reg_add(unsigned bcd_vers, arm_jtag_t *jtag_info,
        }
 }
 
-reg_cache_t *etm_build_reg_cache(target_t *target,
-               arm_jtag_t *jtag_info, etm_context_t *etm_ctx)
+struct reg_cache *etm_build_reg_cache(target_t *target,
+               struct arm_jtag *jtag_info, struct etm_context *etm_ctx)
 {
-       reg_cache_t *reg_cache = malloc(sizeof(reg_cache_t));
+       struct reg_cache *reg_cache = malloc(sizeof(struct reg_cache));
        reg_t *reg_list = NULL;
-       etm_reg_t *arch_info = NULL;
+       struct etm_reg *arch_info = NULL;
        unsigned bcd_vers, config;
 
        /* register a register arch-type for etm registers only once */
@@ -294,7 +294,7 @@ reg_cache_t *etm_build_reg_cache(target_t *target,
 
        /* the actual registers are kept in two arrays */
        reg_list = calloc(128, sizeof(reg_t));
-       arch_info = calloc(128, sizeof(etm_reg_t));
+       arch_info = calloc(128, sizeof(struct etm_reg));
 
        /* fill in values for the reg cache */
        reg_cache->name = "etm registers";
@@ -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)
        {
-               etb_t *etb = etm_ctx->capture_driver_priv;
+               struct etb *etb = etm_ctx->capture_driver_priv;
 
                if (!etb)
                {
@@ -426,7 +426,7 @@ int etm_setup(target_t *target)
        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);
@@ -489,10 +489,10 @@ static int etm_get_reg(reg_t *reg)
 static int etm_read_reg_w_check(reg_t *reg,
                uint8_t* check_value, uint8_t* check_mask)
 {
-       etm_reg_t *etm_reg = reg->arch_info;
+       struct etm_reg *etm_reg = reg->arch_info;
        const struct etm_reg_info *r = etm_reg->reg_info;
        uint8_t reg_addr = r->addr & 0x7f;
-       scan_field_t fields[3];
+       struct scan_field fields[3];
 
        if (etm_reg->reg_info->mode == WO) {
                LOG_ERROR("BUG: can't read write-only register %s", r->name);
@@ -575,10 +575,10 @@ static int etm_set_reg_w_exec(reg_t *reg, uint8_t *buf)
 
 static int etm_write_reg(reg_t *reg, uint32_t value)
 {
-       etm_reg_t *etm_reg = reg->arch_info;
+       struct etm_reg *etm_reg = reg->arch_info;
        const struct etm_reg_info *r = etm_reg->reg_info;
        uint8_t reg_addr = r->addr & 0x7f;
-       scan_field_t fields[3];
+       struct scan_field fields[3];
 
        if (etm_reg->reg_info->mode == RO) {
                LOG_ERROR("BUG: can't write read--only register %s", r->name);
@@ -621,12 +621,12 @@ static int etm_write_reg(reg_t *reg, uint32_t value)
 /* ETM trace analysis functionality
  *
  */
-extern etm_capture_driver_t etm_dummy_capture_driver;
+extern struct etm_capture_driver etm_dummy_capture_driver;
 #if BUILD_OOCD_TRACE == 1
-extern etm_capture_driver_t oocd_trace_capture_driver;
+extern struct etm_capture_driver oocd_trace_capture_driver;
 #endif
 
-static etm_capture_driver_t *etm_capture_drivers[] =
+static struct etm_capture_driver *etm_capture_drivers[] =
 {
        &etb_capture_driver,
        &etm_dummy_capture_driver,
@@ -636,7 +636,7 @@ static etm_capture_driver_t *etm_capture_drivers[] =
        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;
@@ -704,7 +704,7 @@ static int etm_read_instruction(etm_context_t *ctx, arm_instruction_t *instructi
        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)
        {
@@ -769,7 +769,7 @@ static int etmv1_next_packet(etm_context_t *ctx, uint8_t *packet, int apo)
        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;
@@ -855,7 +855,7 @@ static int etmv1_branch_address(etm_context_t *ctx)
        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];
@@ -884,10 +884,10 @@ static int etmv1_data(etm_context_t *ctx, int size, uint32_t *data)
        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;
-       arm_instruction_t instruction;
+       struct arm_instruction instruction;
 
        /* read the trace data if it wasn't read already */
        if (ctx->trace_depth == 0)
@@ -1176,9 +1176,8 @@ static int etmv1_analyze_trace(etm_context_t *ctx, struct command_context_s *cmd
        return ERROR_OK;
 }
 
-static int handle_etm_tracemode_command_update(
-               struct command_context_s *cmd_ctx,
-               char **args, etmv1_tracemode_t *mode)
+static COMMAND_HELPER(handle_etm_tracemode_command_update,
+               etmv1_tracemode_t *mode)
 {
        etmv1_tracemode_t tracemode;
 
@@ -1252,7 +1251,7 @@ COMMAND_HANDLER(handle_etm_tracemode_command)
 {
        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");
@@ -1272,7 +1271,7 @@ COMMAND_HANDLER(handle_etm_tracemode_command)
        case 0:
                break;
        case 4:
-               handle_etm_tracemode_command_update(cmd_ctx, args, &tracemode);
+               CALL_COMMAND_HANDLER(handle_etm_tracemode_command_update, &tracemode);
                break;
        default:
                command_print(cmd_ctx, "usage: configure trace mode "
@@ -1375,7 +1374,7 @@ COMMAND_HANDLER(handle_etm_config_command)
        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)
@@ -1478,7 +1477,7 @@ COMMAND_HANDLER(handle_etm_config_command)
                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;
@@ -1524,7 +1523,7 @@ COMMAND_HANDLER(handle_etm_info_command)
 {
        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;
@@ -1656,7 +1655,7 @@ COMMAND_HANDLER(handle_etm_status_command)
 {
        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);
@@ -1732,7 +1731,7 @@ COMMAND_HANDLER(handle_etm_image_command)
 {
        target_t *target;
        struct arm *arm;
-       etm_context_t *etm_ctx;
+       struct etm_context *etm_ctx;
 
        if (argc < 1)
        {
@@ -1789,10 +1788,10 @@ COMMAND_HANDLER(handle_etm_image_command)
 
 COMMAND_HANDLER(handle_etm_dump_command)
 {
-       fileio_t file;
+       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)
@@ -1857,10 +1856,10 @@ COMMAND_HANDLER(handle_etm_dump_command)
 
 COMMAND_HANDLER(handle_etm_load_command)
 {
-       fileio_t file;
+       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)
@@ -1915,7 +1914,7 @@ COMMAND_HANDLER(handle_etm_load_command)
          fileio_read_u32(&file, &tmp); etm_ctx->tracemode = tmp;
          fileio_read_u32(&file, &etm_ctx->trace_depth);
        }
-       etm_ctx->trace_data = malloc(sizeof(etmv1_trace_data_t) * etm_ctx->trace_depth);
+       etm_ctx->trace_data = malloc(sizeof(struct etmv1_trace_data) * etm_ctx->trace_depth);
        if (etm_ctx->trace_data == NULL)
        {
                command_print(cmd_ctx, "not enough memory to perform operation");
@@ -1943,7 +1942,7 @@ COMMAND_HANDLER(handle_etm_trigger_percent_command)
 {
        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);
@@ -1984,7 +1983,7 @@ COMMAND_HANDLER(handle_etm_start_command)
 {
        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);
@@ -2032,7 +2031,7 @@ COMMAND_HANDLER(handle_etm_stop_command)
 {
        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);
@@ -2071,7 +2070,7 @@ COMMAND_HANDLER(handle_etm_analyze_command)
 {
        target_t *target;
        struct arm *arm;
-       etm_context_t *etm_ctx;
+       struct etm_context *etm_ctx;
        int retval;
 
        target = get_current_target(cmd_ctx);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)