]> git.sur5r.net Git - openocd/commitdiff
jtag: move towards making out_value const
authorØyvind Harboe <oyvind.harboe@zylin.com>
Fri, 19 Mar 2010 21:04:45 +0000 (22:04 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sat, 20 Mar 2010 10:16:49 +0000 (11:16 +0100)
These were relatively straightforward fixes which are
backwards compatible.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/flash/nor/str9xpec.c
src/pld/virtex2.c
src/target/arm_jtag.c
src/target/mips_ejtag.c
src/target/xscale.c

index 732226f598d292e423e5bdc9495b71ba4b27f770..a93b6a279ab3a772e49004101559ec214536996f 100644 (file)
@@ -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;
index b2833fae1d48ac30c95b30eeee8120470823f0bb..19637366adb44c70f08f49279d3143e7b15a625f 100644 (file)
@@ -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;
index f8b5f4f4f1fd652494a5575e839f045247d1e570..8cc44289ab6659cb68a61ae26d994df7b5f72c39 100644 (file)
@@ -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)
index 37e1f09fc464c45241b415525eeded0cc55a3cc4..98b27f0b78f60c5677d8c3f0468d8231131bce28 100644 (file)
@@ -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);
index f0e2311f905f0c1d4b785815fcfb4bdc5151ba3b..0f1953d83a47dc4b26ce38e5fbccff28f13c5617 100644 (file)
@@ -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);
        }