summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-03-19 22:04:45 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-03-20 11:16:49 +0100
commit96949890ee29ab4b3ca15802302c5d93358b69e1 (patch)
tree5b7ca2428f594a96f3c716b3524c3d274bf05e71
parent3b310dbac5ae1db7fb768aa0789bbe101137c7e1 (diff)
downloadopenocd_libswd-96949890ee29ab4b3ca15802302c5d93358b69e1.tar.gz
openocd_libswd-96949890ee29ab4b3ca15802302c5d93358b69e1.tar.bz2
openocd_libswd-96949890ee29ab4b3ca15802302c5d93358b69e1.tar.xz
openocd_libswd-96949890ee29ab4b3ca15802302c5d93358b69e1.zip
jtag: move towards making out_value const
These were relatively straightforward fixes which are backwards compatible. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-rw-r--r--src/flash/nor/str9xpec.c7
-rw-r--r--src/pld/virtex2.c7
-rw-r--r--src/target/arm_jtag.c2
-rw-r--r--src/target/mips_ejtag.c6
-rw-r--r--src/target/xscale.c2
5 files changed, 13 insertions, 11 deletions
diff --git a/src/flash/nor/str9xpec.c b/src/flash/nor/str9xpec.c
index 732226f5..a93b6a27 100644
--- a/src/flash/nor/str9xpec.c
+++ b/src/flash/nor/str9xpec.c
@@ -44,13 +44,14 @@ int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end
struct scan_field field;
field.num_bits = tap->ir_length;
- field.out_value = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
- buf_set_u32(field.out_value, 0, field.num_bits, new_instr);
+ void * t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
+ field.out_value = t;
+ buf_set_u32(t, 0, field.num_bits, new_instr);
field.in_value = NULL;
jtag_add_ir_scan(tap, &field, end_state);
- free(field.out_value);
+ free(t);
}
return ERROR_OK;
diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c
index b2833fae..19637366 100644
--- a/src/pld/virtex2.c
+++ b/src/pld/virtex2.c
@@ -36,13 +36,14 @@ static int virtex2_set_instr(struct jtag_tap *tap, uint32_t new_instr)
struct scan_field field;
field.num_bits = tap->ir_length;
- field.out_value = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
- buf_set_u32(field.out_value, 0, field.num_bits, new_instr);
+ void * t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
+ field.out_value = t;
+ buf_set_u32(t, 0, field.num_bits, new_instr);
field.in_value = NULL;
jtag_add_ir_scan(tap, &field, TAP_IDLE);
- free(field.out_value);
+ free(t);
}
return ERROR_OK;
diff --git a/src/target/arm_jtag.c b/src/target/arm_jtag.c
index f8b5f4f4..8cc44289 100644
--- a/src/target/arm_jtag.c
+++ b/src/target/arm_jtag.c
@@ -40,7 +40,7 @@ int arm_jtag_set_instr_inner(struct arm_jtag *jtag_info, uint32_t new_instr, vo
field.num_bits = tap->ir_length;
field.out_value = t;
- buf_set_u32(field.out_value, 0, field.num_bits, new_instr);
+ buf_set_u32(t, 0, field.num_bits, new_instr);
field.in_value = NULL;
if (no_verify_capture == NULL)
diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c
index 37e1f09f..98b27f0b 100644
--- a/src/target/mips_ejtag.c
+++ b/src/target/mips_ejtag.c
@@ -43,7 +43,7 @@ int mips_ejtag_set_instr(struct mips_ejtag *ejtag_info, int new_instr)
field.num_bits = tap->ir_length;
field.out_value = t;
- buf_set_u32(field.out_value, 0, field.num_bits, new_instr);
+ buf_set_u32(t, 0, field.num_bits, new_instr);
field.in_value = NULL;
jtag_add_ir_scan(tap, &field, TAP_IDLE);
@@ -105,7 +105,7 @@ int mips_ejtag_drscan_32(struct mips_ejtag *ejtag_info, uint32_t *data)
field.num_bits = 32;
field.out_value = t;
- buf_set_u32(field.out_value, 0, field.num_bits, *data);
+ buf_set_u32(t, 0, field.num_bits, *data);
field.in_value = r;
jtag_add_dr_scan(tap, 1, &field, TAP_IDLE);
@@ -136,7 +136,7 @@ int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint32_t *data)
field.num_bits = 8;
field.out_value = t;
- buf_set_u32(field.out_value, 0, field.num_bits, *data);
+ buf_set_u32(t, 0, field.num_bits, *data);
field.in_value = r;
jtag_add_dr_scan(tap, 1, &field, TAP_IDLE);
diff --git a/src/target/xscale.c b/src/target/xscale.c
index f0e2311f..0f1953d8 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -171,7 +171,7 @@ static int xscale_jtag_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_s
memset(&field, 0, sizeof field);
field.num_bits = tap->ir_length;
field.out_value = scratch;
- buf_set_u32(field.out_value, 0, field.num_bits, new_instr);
+ buf_set_u32(scratch, 0, field.num_bits, new_instr);
jtag_add_ir_scan(tap, &field, end_state);
}