summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomek CEDRO <cederom@tlen.pl>2011-11-04 01:52:23 +0000
committerTomek CEDRO <cederom@tlen.pl>2011-11-04 01:52:23 +0000
commit86854fe604ec8dc52cd03379d7e15f69e9fb6f38 (patch)
tree43951f679a50b71b3b9a42583b84c54b0c9d5a9c
parentad9f081b6152a9c36bfb4bf74299f6ad959088c9 (diff)
downloadopenocd_libswd-86854fe604ec8dc52cd03379d7e15f69e9fb6f38.tar.gz
openocd_libswd-86854fe604ec8dc52cd03379d7e15f69e9fb6f38.tar.bz2
openocd_libswd-86854fe604ec8dc52cd03379d7e15f69e9fb6f38.tar.xz
openocd_libswd-86854fe604ec8dc52cd03379d7e15f69e9fb6f38.zip
transport/swd: Read operation forces queue flush, as multiple operations cannot be queued up and fulshed at later time because OpenOCD use single pointers for data return from function and it is impossible to read out dynamically allocated memory this way in C.
-rw-r--r--src/transport/swd_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/transport/swd_core.c b/src/transport/swd_core.c
index f1d4168d..cc9109d6 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_ENQUEUE, (int **)&data);
+ retval=swd_dp_read_idcode(dap->ctx, SWD_OPERATION_EXECUTE, (int**) &data);
if (retval<0) {
LOG_ERROR("swd_dp_read_idcode() error: %s ", swd_error_string(retval));
return ERROR_FAIL;
@@ -62,7 +62,7 @@ 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;
- retval=swd_dp_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_ENQUEUE, reg, (int **)&data);
+ retval=swd_dp_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, reg, (int**) &data);
if (retval<0){
LOG_ERROR("swd_dp_read() error: %s ", swd_error_string(retval));
return ERROR_FAIL;
@@ -82,7 +82,7 @@ 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;
- retval=swd_ap_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_ENQUEUE, (char) reg, (int **) &data);
+ retval=swd_ap_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, (char) reg, (int**) &data);
if (retval<0){
LOG_ERROR("swd_ap_read() error: %s ", swd_error_string(retval));
return ERROR_FAIL;