etm_context_t -> struct etm_context
authorZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 17:35:48 +0000 (09:35 -0800)
committerZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 19:58:13 +0000 (11:58 -0800)
Remove misleading typedef and redundant suffix from struct etm_context.

src/target/armv4_5.h
src/target/etb.c
src/target/etb.h
src/target/etm.c
src/target/etm.h
src/target/etm_dummy.c
src/target/oocd_trace.c
src/target/oocd_trace.h

index 89879163b8a3e5ddb7153d4c03f2599cefd32235..3c65069e024dde1e3ba25998065884ac3483f71f 100644 (file)
@@ -96,7 +96,7 @@ typedef struct arm
        bool is_armv4;
 
        /** Handle for the Embedded Trace Module, if one is present. */
        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,
 
        int (*full_context)(struct target_s *target);
        int (*read_core_reg)(struct target_s *target,
index eed961b0d34626c58f0cdce1e2b291246276c44d..6f9562abd00e82b384af7447296aa6c0ac51caab 100644 (file)
@@ -415,7 +415,7 @@ static int etb_register_commands(struct command_context_s *cmd_ctx)
        return ERROR_OK;
 }
 
        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;
 
 {
        struct etb *etb = etm_ctx->capture_driver_priv;
 
@@ -432,7 +432,7 @@ static int etb_init(etm_context_t *etm_ctx)
        return ERROR_OK;
 }
 
        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];
 {
        struct etb *etb = etm_ctx->capture_driver_priv;
        reg_t *control = &etb->reg_cache->reg_list[ETB_CTRL];
@@ -484,7 +484,7 @@ static trace_status_t etb_status(etm_context_t *etm_ctx)
        return retval;
 }
 
        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;
 {
        struct etb *etb = etm_ctx->capture_driver_priv;
        int first_frame = 0;
@@ -634,7 +634,7 @@ static int etb_read_trace(etm_context_t *etm_ctx)
        return ERROR_OK;
 }
 
        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;
 {
        struct etb *etb = etm_ctx->capture_driver_priv;
        uint32_t etb_ctrl_value = 0x1;
@@ -668,7 +668,7 @@ static int etb_start_capture(etm_context_t *etm_ctx)
        return ERROR_OK;
 }
 
        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 *etb = etm_ctx->capture_driver_priv;
        reg_t *etb_ctrl_reg = &etb->reg_cache->reg_list[ETB_CTRL];
index e015bad19ee3bf8785ac4ba0818de8494ba17c22..49385ee90d0c99897f8cf8f2828ec9ed0804091c 100644 (file)
@@ -36,7 +36,7 @@ enum
 
 struct etb
 {
 
 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;
        struct jtag_tap *tap;
        uint32_t cur_scan_chain;
        struct reg_cache *reg_cache;
index 21044e544ada30230a1bd2cb6bc27be9fea78384..751ea421ad5993458d9e295443c285c2a1f56b93 100644 (file)
@@ -229,7 +229,7 @@ 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 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 *cache = etm_ctx->reg_cache;
        int i;
@@ -280,7 +280,7 @@ static void etm_reg_add(unsigned bcd_vers, struct arm_jtag *jtag_info,
 }
 
 struct reg_cache *etm_build_reg_cache(target_t *target,
 }
 
 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;
 {
        struct reg_cache *reg_cache = malloc(sizeof(struct reg_cache));
        reg_t *reg_list = NULL;
@@ -426,7 +426,7 @@ 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;
+       struct etm_context *etm_ctx = arm->etm;
        reg_t *etm_ctrl_reg;
 
        etm_ctrl_reg = etm_reg_lookup(etm_ctx, ETM_CTRL);
        reg_t *etm_ctrl_reg;
 
        etm_ctrl_reg = etm_reg_lookup(etm_ctx, ETM_CTRL);
@@ -636,7 +636,7 @@ static struct etm_capture_driver *etm_capture_drivers[] =
        NULL
 };
 
        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;
 {
        int i;
        int section = -1;
@@ -704,7 +704,7 @@ static int etm_read_instruction(etm_context_t *ctx, struct arm_instruction *inst
        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_context *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_context *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_context *ctx, int size, uint32_t *data)
 {
        int j;
        uint8_t buf[4];
 {
        int j;
        uint8_t buf[4];
@@ -884,7 +884,7 @@ 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_context *ctx, struct command_context_s *cmd_ctx)
 {
        int retval;
        struct arm_instruction instruction;
 {
        int retval;
        struct arm_instruction instruction;
@@ -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");
@@ -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_context));
        if (!etm_ctx) {
                LOG_DEBUG("out of memory");
                return ERROR_FAIL;
        if (!etm_ctx) {
                LOG_DEBUG("out of memory");
                return ERROR_FAIL;
@@ -1523,7 +1523,7 @@ COMMAND_HANDLER(handle_etm_info_command)
 {
        target_t *target;
        struct arm *arm;
 {
        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;
        reg_t *etm_sys_config_reg;
        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_context *etm;
        trace_status_t trace_status;
 
        target = get_current_target(cmd_ctx);
        trace_status_t trace_status;
 
        target = get_current_target(cmd_ctx);
@@ -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_context *etm_ctx;
 
        if (argc < 1)
        {
 
        if (argc < 1)
        {
@@ -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_context *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_context *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_context *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,7 +1983,7 @@ COMMAND_HANDLER(handle_etm_start_command)
 {
        target_t *target;
        struct arm *arm;
 {
        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);
        reg_t *etm_ctrl_reg;
 
        target = get_current_target(cmd_ctx);
@@ -2031,7 +2031,7 @@ COMMAND_HANDLER(handle_etm_stop_command)
 {
        target_t *target;
        struct arm *arm;
 {
        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);
        reg_t *etm_ctrl_reg;
 
        target = get_current_target(cmd_ctx);
@@ -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_context *etm_ctx;
        int retval;
 
        target = get_current_target(cmd_ctx);
        int retval;
 
        target = get_current_target(cmd_ctx);
index 63e31f1b64dab1dffdcf874d3e97c32774293c7b..3de54eef2a2f9abec1c9065e9ea7833acbf7c62d 100644 (file)
@@ -121,17 +121,17 @@ typedef enum
 } etmv1_tracemode_t;
 
 /* forward-declare ETM context */
 } 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);
 
 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
 };
 
 enum
@@ -152,7 +152,7 @@ struct etmv1_trace_data
  * this will have to be split into version independent elements
  * and a version specific part
  */
  * 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 */
 {
        target_t *target;               /* target this ETM is connected to */
        struct reg_cache *reg_cache;            /* ETM register cache */
@@ -179,7 +179,7 @@ typedef struct etm
        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) */
        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
 
 /* PIPESTAT values */
 typedef enum
@@ -208,7 +208,7 @@ typedef enum
 } etmv1_branch_reason_t;
 
 struct reg_cache* etm_build_reg_cache(target_t *target,
 } 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);
 
 
 int etm_setup(target_t *target);
 
index 4d975c6a5174053e5d3278cc5a922c04c333a57e..eb8377b7f014e69f89a077592c97c5b05b71b3f0 100644 (file)
@@ -69,27 +69,27 @@ static int etm_dummy_register_commands(struct command_context_s *cmd_ctx)
        return ERROR_OK;
 }
 
        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;
 }
 
 {
        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;
 }
 
 {
        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;
 }
 
 {
        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;
 }
 
 {
        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;
 }
index c5f8b808ad88958f29e93e85ceebf7417b4bf284..6011b68297b2f67ce8d8b767953ad2857973ecfc 100644 (file)
@@ -96,7 +96,7 @@ static int oocd_trace_read_memory(struct oocd_trace *oocd_trace, uint8_t *data,
        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;
 {
        uint8_t trash[256];
        struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
@@ -143,7 +143,7 @@ static int oocd_trace_init(etm_context_t *etm_ctx)
        return ERROR_OK;
 }
 
        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;
 {
        struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
        uint32_t status;
@@ -175,7 +175,7 @@ static trace_status_t oocd_trace_status(etm_context_t *etm_ctx)
        return etm_ctx->capture_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;
 {
        struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
        uint32_t status, address;
@@ -233,7 +233,7 @@ static int oocd_trace_read_trace(etm_context_t *etm_ctx)
        return ERROR_OK;
 }
 
        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 */
 {
        struct oocd_trace *oocd_trace = etm_ctx->capture_driver_priv;
        uint32_t control = 0x1; /* 0x1: enabled */
@@ -266,7 +266,7 @@ static int oocd_trace_start_capture(etm_context_t *etm_ctx)
        return ERROR_OK;
 }
 
        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 *oocd_trace = etm_ctx->capture_driver_priv;
 
index 49b4b890188ed5fcad146d73599abfc2811eb0d8..8234b65919a3e842cdc4e48235bbe350208edf3e 100644 (file)
@@ -48,7 +48,7 @@ enum
 
 struct oocd_trace
 {
 
 struct oocd_trace
 {
-       etm_context_t *etm_ctx;
+       struct etm_context *etm_ctx;
        char *tty;
        int tty_fd;
        struct termios oldtio, newtio;
        char *tty;
        int tty_fd;
        struct termios oldtio, newtio;

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)