This is an automated email from Gerrit.

Andrey Smirnov ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/2085

-- gerrit

commit 42427359fed4b8f0d9ca337f4129a42661317b2e
Author: Andrey Smirnov <[email protected]>
Date:   Thu Apr 3 14:03:04 2014 -0700

    arm_adi_v5: Add two convenience "atomic"" functions
    
    Add two convenience "atomic"" functions:
      - dap_dp_read_atomic_u32()
      - dap_ap_abort_atomic()
    
    Change-Id: Ic9ebb58959d2f14bbf03be42a26b0fe58ecfeddb
    Signed-off-by: Andrey Smirnov <[email protected]>

diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h
index cdcf928..df9ceed 100644
--- a/src/target/arm_adi_v5.h
+++ b/src/target/arm_adi_v5.h
@@ -380,6 +380,31 @@ static inline int dap_run(struct adiv5_dap *dap)
        return dap->ops->run(dap);
 }
 
+static inline int dap_dp_read_atomic_u32(struct adiv5_dap *dap, unsigned reg,
+                                        uint32_t *value)
+{
+       int retval;
+
+       retval = dap_queue_dp_read(dap, reg, value);
+       if (retval != ERROR_OK)
+               return retval;
+
+       return dap_run(dap);
+}
+
+static inline int dap_ap_abort_atomic(struct adiv5_dap *dap, uint8_t *ack)
+{
+       int ret;
+       assert(dap->ops != NULL);
+
+       ret = dap->ops->queue_ap_abort(dap, ack);
+       if (ret != ERROR_OK)
+               return ret;
+
+       return dap_run(dap);
+}
+
+
 /** Accessor for currently selected DAP-AP number (0..255) */
 static inline uint8_t dap_ap_get_select(struct adiv5_dap *swjdp)
 {

-- 

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to