diff options
author | Tomek CEDRO <cederom@tlen.pl> | 2012-02-09 18:36:39 +0100 |
---|---|---|
committer | Tomek CEDRO <cederom@tlen.pl> | 2012-02-09 18:36:39 +0100 |
commit | 4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3 (patch) | |
tree | d44bfb76d46d32fe35fbd6b2a993f19104982400 | |
parent | 0b12d8ce85e24b769893b020829cb2eda2b5cd6d (diff) | |
download | openocd_libswd-4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3.tar.gz openocd_libswd-4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3.tar.bz2 openocd_libswd-4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3.tar.xz openocd_libswd-4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3.zip |
EXPERIMENTAL - many read operations can be enqueued and flushed at once. Target read functions should now work with double pointers in order to return data on flush and not produce flush on read.
-rw-r--r-- | src/transport/swd_core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/transport/swd_core.c b/src/transport/swd_core.c index 544e6277..f4ae8bea 100644 --- a/src/transport/swd_core.c +++ b/src/transport/swd_core.c @@ -53,7 +53,7 @@ extern struct jtag_interface *jtag_interface; int oocd_swd_queue_idcode_read(struct adiv5_dap *dap, uint8_t *ack, uint32_t *data){ int retval; - retval=swd_dp_read_idcode(dap->ctx, SWD_OPERATION_EXECUTE, (int**) &data); + retval=swd_dp_read_idcode(dap->ctx, SWD_OPERATION_ENQUEUE, (int**) &data); if (retval<0) { LOG_ERROR("swd_dp_read_idcode() error: %s ", swd_error_string(retval)); return ERROR_FAIL; @@ -62,12 +62,12 @@ int oocd_swd_queue_idcode_read(struct adiv5_dap *dap, uint8_t *ack, uint32_t *da int oocd_swd_queue_dp_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data){ int retval, *rdata; - retval=swd_dp_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, reg, &rdata); + retval=swd_dp_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_ENQUEUE, reg, &rdata); if (retval<0){ LOG_ERROR("swd_dp_read() error: %s ", swd_error_string(retval)); return ERROR_FAIL; } - if (data!=NULL) *data=(uint32_t)*rdata; + if (data!=NULL) data=(uint32_t*)rdata; return ERROR_OK; } @@ -83,12 +83,12 @@ int oocd_swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg, uint32_t data){ int oocd_swd_queue_ap_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data){ int retval, *rdata; - retval=swd_ap_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, (char) reg, &rdata); + retval=swd_ap_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_ENQUEUE, (char) reg, &rdata); if (retval<0){ LOG_ERROR("swd_ap_read() error: %s ", swd_error_string(retval)); return ERROR_FAIL; } - if (data!=NULL) *data=*rdata; + if (data!=NULL) data=(uint32_t*)rdata; return ERROR_OK; } @@ -106,7 +106,7 @@ int oocd_swd_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack){ int retval; int abort_flags = SWD_DP_ABORT_ORUNERRCLR | SWD_DP_ABORT_WDERRCLR | SWD_DP_ABORT_STKERRCLR \ | SWD_DP_ABORT_STKCMPCLR | SWD_DP_ABORT_DAPABORT; - retval=swd_dp_write((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, SWD_DP_ABORT_ADDR, &abort_flags); + retval=swd_dp_write((swd_ctx_t *)dap->ctx, SWD_OPERATION_ENQUEUE, SWD_DP_ABORT_ADDR, &abort_flags); if (retval<0){ LOG_ERROR("swd_dp_write(ABORT) error: %s ", swd_error_string(retval)); return ERROR_FAIL; |