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/3290

-- gerrit

commit 6ca9c0aab91b63250b3bfc258d97ea7ae7e4293e
Author: Alamy Liu <[email protected]>
Date:   Fri Aug 21 11:25:54 2015 -0700

    all: use target_type_64, TYPE_FUNC_xxx
    
    Change-Id: Ib86083cb73761cd1cf1801b2123c7f7bdc1b5570
    Signed-off-by: Alamy Liu <[email protected]>

diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c
index ac8f395..a56763c 100644
--- a/src/target/arm_dpm.c
+++ b/src/target/arm_dpm.c
@@ -27,6 +27,7 @@
 #include "register.h"
 #include "breakpoints.h"
 #include "target_type.h"
+#include "target_type64.h"
 #include "arm_opcodes.h"
 
 
@@ -609,7 +610,8 @@ int arm_dpm_write_dirty_registers(struct arm_dpm *dpm, bool 
bpwp)
         * we should be able to assume we handle them; but until then,
         * cope with the hand-crafted breakpoint code.
         */
-       if (arm->target->type->add_breakpoint == dpm_add_breakpoint) {
+       struct target *target = arm->target;    /* for TYPE_FUNC_xxx */
+       if (TYPE_FUNC_IS(add_breakpoint, dpm_add_breakpoint, 
dpm_add_breakpoint)) {
                for (unsigned i = 0; i < dpm->nbp; i++) {
                        struct dpm_bp *dbp = dpm->dbp + i;
                        struct breakpoint *bp = dbp->bp;
@@ -1129,14 +1131,14 @@ int arm_dpm_setup(struct arm_dpm *dpm)
        arm->mcr = dpm_mcr;
 
        /* breakpoint setup -- optional until it works everywhere */
-       if (!target->type->add_breakpoint) {
-               target->type->add_breakpoint = dpm_add_breakpoint;
-               target->type->remove_breakpoint = dpm_remove_breakpoint;
+       if (!TYPE_FUNC_VALIDATE(add_breakpoint)) {
+               TYPE_FUNC_SET(add_breakpoint,    dpm_add_breakpoint,    
dpm_add_breakpoint);
+               TYPE_FUNC_SET(remove_breakpoint, dpm_remove_breakpoint, 
dpm_remove_breakpoint);
        }
 
        /* watchpoint setup */
-       target->type->add_watchpoint = dpm_add_watchpoint;
-       target->type->remove_watchpoint = dpm_remove_watchpoint;
+       TYPE_FUNC_SET(add_watchpoint,    dpm_add_watchpoint,    
dpm_add_watchpoint);
+       TYPE_FUNC_SET(remove_watchpoint, dpm_remove_watchpoint, 
dpm_remove_watchpoint);
 
 
        if (dpm->arm_reg_current == 0)
diff --git a/src/target/target_request.c b/src/target/target_request.c
index df2fc34..6832653 100644
--- a/src/target/target_request.c
+++ b/src/target/target_request.c
@@ -34,6 +34,7 @@
 #include "target.h"
 #include "target_request.h"
 #include "target_type.h"
+#include "target_type64.h"
 #include "trace.h"
 
 static bool got_message;
@@ -52,7 +53,7 @@ static int target_asciimsg(struct target *target, uint32_t 
length)
        char *msg = malloc(DIV_ROUND_UP(length + 1, 4) * 4);
        struct debug_msg_receiver *c = target->dbgmsg;
 
-       target->type->target_request_data(target, DIV_ROUND_UP(length, 4), 
(uint8_t *)msg);
+       TYPE_FUNC_CALL(target_request_data, target, DIV_ROUND_UP(length, 4), 
(uint8_t *)msg);
        msg[length] = 0;
 
        LOG_DEBUG("%s", msg);
@@ -82,7 +83,7 @@ static int target_hexmsg(struct target *target, int size, 
uint32_t length)
 
        LOG_DEBUG("size: %i, length: %i", (int)size, (int)length);
 
-       target->type->target_request_data(target, DIV_ROUND_UP(length * size, 
4), (uint8_t *)data);
+       TYPE_FUNC_CALL(target_request_data, target, DIV_ROUND_UP(length * size, 
4), (uint8_t *)data);
 
        line_len = 0;
        for (i = 0; i < length; i++) {
@@ -122,7 +123,7 @@ int target_request(struct target *target, uint32_t request)
 {
        target_req_cmd_t target_req_cmd = request & 0xff;
 
-       assert(target->type->target_request_data);
+       TYPE_FUNC_ASSERT(target_request_data);
 
        /* Record that we got a target message for back-off algorithm */
        got_message = true;
@@ -258,7 +259,7 @@ COMMAND_HANDLER(handle_target_request_debugmsgs_command)
 
        int receiving = 0;
 
-       if (target->type->target_request_data == NULL) {
+       if (!TYPE_FUNC_VALIDATE(target_request_data)) {
                LOG_ERROR("Target %s does not support target requests", 
target_name(target));
                return ERROR_OK;
        }

-- 

------------------------------------------------------------------------------
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