]> git.sur5r.net Git - openocd/commitdiff
do not modify global end state from jtag_add_xxx()
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 4 Jun 2009 12:52:54 +0000 (12:52 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 4 Jun 2009 12:52:54 +0000 (12:52 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2047 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/jtag.c
src/jtag/zy1000.c

index 5738a0dc46df91d1b5ffd4e8a3de69503b7a5572..263b766514552d239cf92994ad61a1ac7b411db6 100644 (file)
@@ -396,9 +396,7 @@ static void jtag_prelude(tap_state_t state)
 
        assert(state!=TAP_INVALID);
 
-       jtag_add_end_state(state);
-
-       cmd_queue_cur_state = cmd_queue_end_state;
+       cmd_queue_cur_state = state;
 }
 
 void jtag_alloc_in_value32(scan_field_t *field)
@@ -411,7 +409,7 @@ void jtag_add_ir_scan_noverify(int in_num_fields, const scan_field_t *in_fields,
        int retval;
        jtag_prelude(state);
 
-       retval=interface_jtag_add_ir_scan(in_num_fields, in_fields, cmd_queue_end_state);
+       retval=interface_jtag_add_ir_scan(in_num_fields, in_fields, state);
        if (retval!=ERROR_OK)
                jtag_error=retval;
 
@@ -460,7 +458,7 @@ void jtag_add_plain_ir_scan(int in_num_fields, const scan_field_t *in_fields, ta
 
        jtag_prelude(state);
 
-       retval=interface_jtag_add_plain_ir_scan(in_num_fields, in_fields, cmd_queue_end_state);
+       retval=interface_jtag_add_plain_ir_scan(in_num_fields, in_fields, state);
        if (retval!=ERROR_OK)
                jtag_error=retval;
 }
@@ -548,7 +546,7 @@ void jtag_add_dr_scan(int in_num_fields, const scan_field_t *in_fields, tap_stat
 
        jtag_prelude(state);
 
-       retval=interface_jtag_add_dr_scan(in_num_fields, in_fields, cmd_queue_end_state);
+       retval=interface_jtag_add_dr_scan(in_num_fields, in_fields, state);
        if (retval!=ERROR_OK)
                jtag_error=retval;
 }
@@ -567,7 +565,7 @@ void jtag_add_plain_dr_scan(int in_num_fields, const scan_field_t *in_fields, ta
 
        jtag_prelude(state);
 
-       retval=interface_jtag_add_plain_dr_scan(in_num_fields, in_fields, cmd_queue_end_state);
+       retval=interface_jtag_add_plain_dr_scan(in_num_fields, in_fields, state);
        if (retval!=ERROR_OK)
                jtag_error=retval;
 }
@@ -578,13 +576,11 @@ void jtag_add_dr_out(jtag_tap_t* tap,
 {
        assert(end_state != TAP_INVALID);
 
-       cmd_queue_end_state = end_state;
-
-       cmd_queue_cur_state = cmd_queue_end_state;
+       cmd_queue_cur_state = end_state;
 
        interface_jtag_add_dr_out(tap,
                        num_fields, num_bits, value,
-                       cmd_queue_end_state);
+                       end_state);
 }
 
 void jtag_add_tlr(void)
@@ -644,7 +640,7 @@ void jtag_add_runtest(int num_cycles, tap_state_t state)
        jtag_prelude(state);
 
        /* executed by sw or hw fifo */
-       retval=interface_jtag_add_runtest(num_cycles, cmd_queue_end_state);
+       retval=interface_jtag_add_runtest(num_cycles, state);
        if (retval!=ERROR_OK)
                jtag_error=retval;
 }
index 6a4d759219372fe28ad9ca176382402a8fc30285..f2e7887ab5d2a77a91e99eef443ad42057bf994e 100644 (file)
@@ -517,7 +517,7 @@ int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_s
                tap_state_t end_state;
                if (nextTap==NULL)
                {
-                       end_state = cmd_queue_end_state;
+                       end_state = state;
                } else
                {
                        end_state = TAP_IRSHIFT;
@@ -568,7 +568,7 @@ int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_s
 
 int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
 {
-       scanFields(num_fields, fields, TAP_IRSHIFT, cmd_queue_end_state);
+       scanFields(num_fields, fields, TAP_IRSHIFT, state);
 
        return ERROR_OK;
 }
@@ -587,7 +587,7 @@ int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_s
                tap_state_t end_state;
                if (nextTap==NULL)
                {
-                       end_state = cmd_queue_end_state;
+                       end_state = state;
                } else
                {
                        end_state = TAP_DRSHIFT;
@@ -621,7 +621,7 @@ int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_s
 
 int interface_jtag_add_plain_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
 {
-       scanFields(num_fields, fields, TAP_DRSHIFT, cmd_queue_end_state);
+       scanFields(num_fields, fields, TAP_DRSHIFT, state);
        return ERROR_OK;
 }
 
@@ -693,7 +693,7 @@ int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
 
 int interface_jtag_add_clocks(int num_cycles)
 {
-       return zy1000_jtag_add_clocks(num_cycles, cmd_queue_cur_state, cmd_queue_end_state);
+       return zy1000_jtag_add_clocks(num_cycles, cmd_queue_cur_state, cmd_queue_cur_state);
 }
 
 int interface_jtag_add_sleep(u32 us)