This is an automated email from Gerrit.

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

-- gerrit

commit 9fba73711d9bdbee488394e2c1da4fceedce8ee5
Author: Alamy Liu <[email protected]>
Date:   Fri Aug 21 11:59:58 2015 -0700

    target.h: (type64): #define TYPE_FUNC_xxx
    
    Change-Id: I6b47302110d06ef6cdcf2253ebb87381307ae910
    Signed-off-by: Alamy Liu <[email protected]>

diff --git a/src/target/target.h b/src/target/target.h
index b1edea4..b7a3c81 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -389,6 +389,51 @@ int target_call_timer_callbacks_now(void);
 struct target *get_current_target(struct command_context *cmd_ctx);
 struct target *get_target(const char *id);
 
+/* TODO: This 32-/64-bit wrapping should be solved by OOP in the future */
+#define TYPE_FUNC_ASSERT(func, ...) \
+       is_aarch64(target) \
+       ? assert(target->type64->func) \
+       : assert(target->type->func)
+
+#define TYPE_FUNC_VALIDATE(func) \
+       ((is_aarch64(target) && target->type64->func) \
+       || (!is_aarch64(target) && target->type->func))
+
+#define TYPE_FUNC_CALL(func, ...) \
+       is_aarch64(target) \
+       ? target->type64->func(__VA_ARGS__) \
+       : target->type->func(__VA_ARGS__)
+
+#define TYPE_FUNC_AVAIL_CALL(func, ...) \
+       if (is_aarch64(target)) { \
+               if (target->type64->func) \
+                       target->type64->func(__VA_ARGS__); \
+       } else { \
+               if (target->type->func) \
+                       target->type->func(__VA_ARGS__); \
+       }
+
+#define TYPE_VAR_GET(v) \
+       is_aarch64(target) \
+       ? target->type64->v \
+       : target->type->v
+
+#define TYPE_VAR_SET(v, v32, v64) \
+       if (is_aarch64(target)) \
+               target->type64->v = v64; \
+       else \
+               target->type->v = v32;
+
+#define TYPE_VAR_IS(v, v32, v64) \
+       is_aarch64(target) \
+       ? (target->type64->v == v32) \
+       : (target->type->v == v64)
+
+#define TYPE_FUNC_GET  TYPE_VAR_GET
+#define TYPE_FUNC_SET  TYPE_VAR_SET
+#define TYPE_FUNC_IS   TYPE_VAR_IS
+
+
 /**
  * Get the target type name.
  *

-- 

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to