Remove FSF address from GPL notices
[openocd.git] / src / target / etm.c
index ddeb9226e501ebe5b381fb22fa4462d60c833d6e..6a00c23a8b5600674ec85988272188bcdc5aea8c 100644 (file)
@@ -13,9 +13,7 @@
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -515,7 +513,7 @@ static int etm_read_reg_w_check(struct reg *reg,
        retval = arm_jtag_scann(etm_reg->jtag_info, 0x6, TAP_IDLE);
        if (retval != ERROR_OK)
                return retval;
-       retval = arm_jtag_set_instr(etm_reg->jtag_info,
+       retval = arm_jtag_set_instr(etm_reg->jtag_info->tap,
                        etm_reg->jtag_info->intest_instr,
                        NULL,
                        TAP_IDLE);
@@ -602,7 +600,7 @@ static int etm_write_reg(struct reg *reg, uint32_t value)
        retval = arm_jtag_scann(etm_reg->jtag_info, 0x6, TAP_IDLE);
        if (retval != ERROR_OK)
                return retval;
-       retval = arm_jtag_set_instr(etm_reg->jtag_info,
+       retval = arm_jtag_set_instr(etm_reg->jtag_info->tap,
                        etm_reg->jtag_info->intest_instr,
                        NULL,
                        TAP_IDLE);
@@ -1701,7 +1699,7 @@ COMMAND_HANDLER(handle_etm_image_command)
 
 COMMAND_HANDLER(handle_etm_dump_command)
 {
-       struct fileio file;
+       struct fileio *file;
        struct target *target;
        struct arm *arm;
        struct etm_context *etm_ctx;
@@ -1741,24 +1739,24 @@ COMMAND_HANDLER(handle_etm_dump_command)
        if (fileio_open(&file, CMD_ARGV[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
                return ERROR_FAIL;
 
-       fileio_write_u32(&file, etm_ctx->capture_status);
-       fileio_write_u32(&file, etm_ctx->control);
-       fileio_write_u32(&file, etm_ctx->trace_depth);
+       fileio_write_u32(file, etm_ctx->capture_status);
+       fileio_write_u32(file, etm_ctx->control);
+       fileio_write_u32(file, etm_ctx->trace_depth);
 
        for (i = 0; i < etm_ctx->trace_depth; i++) {
-               fileio_write_u32(&file, etm_ctx->trace_data[i].pipestat);
-               fileio_write_u32(&file, etm_ctx->trace_data[i].packet);
-               fileio_write_u32(&file, etm_ctx->trace_data[i].flags);
+               fileio_write_u32(file, etm_ctx->trace_data[i].pipestat);
+               fileio_write_u32(file, etm_ctx->trace_data[i].packet);
+               fileio_write_u32(file, etm_ctx->trace_data[i].flags);
        }
 
-       fileio_close(&file);
+       fileio_close(file);
 
        return ERROR_OK;
 }
 
 COMMAND_HANDLER(handle_etm_load_command)
 {
-       struct fileio file;
+       struct fileio *file;
        struct target *target;
        struct arm *arm;
        struct etm_context *etm_ctx;
@@ -1789,15 +1787,15 @@ COMMAND_HANDLER(handle_etm_load_command)
                return ERROR_FAIL;
 
        size_t filesize;
-       int retval = fileio_size(&file, &filesize);
+       int retval = fileio_size(file, &filesize);
        if (retval != ERROR_OK) {
-               fileio_close(&file);
+               fileio_close(file);
                return retval;
        }
 
        if (filesize % 4) {
                command_print(CMD_CTX, "size isn't a multiple of 4, no valid trace data");
-               fileio_close(&file);
+               fileio_close(file);
                return ERROR_FAIL;
        }
 
@@ -1808,28 +1806,28 @@ COMMAND_HANDLER(handle_etm_load_command)
 
        {
                uint32_t tmp;
-               fileio_read_u32(&file, &tmp); etm_ctx->capture_status = tmp;
-               fileio_read_u32(&file, &tmp); etm_ctx->control = tmp;
-               fileio_read_u32(&file, &etm_ctx->trace_depth);
+               fileio_read_u32(file, &tmp); etm_ctx->capture_status = tmp;
+               fileio_read_u32(file, &tmp); etm_ctx->control = tmp;
+               fileio_read_u32(file, &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");
-               fileio_close(&file);
+               fileio_close(file);
                return ERROR_FAIL;
        }
 
        for (i = 0; i < etm_ctx->trace_depth; i++) {
                uint32_t pipestat, packet, flags;
-               fileio_read_u32(&file, &pipestat);
-               fileio_read_u32(&file, &packet);
-               fileio_read_u32(&file, &flags);
+               fileio_read_u32(file, &pipestat);
+               fileio_read_u32(file, &packet);
+               fileio_read_u32(file, &flags);
                etm_ctx->trace_data[i].pipestat = pipestat & 0xff;
                etm_ctx->trace_data[i].packet = packet & 0xffff;
                etm_ctx->trace_data[i].flags = flags;
        }
 
-       fileio_close(&file);
+       fileio_close(file);
 
        return ERROR_OK;
 }

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)