Rewrites the dap_* command helpers to use the COMMAND_HELPER paradigm.
Uses CALL_COMMAND_HELPER to hide inherited calling conventions.
return ERROR_OK;
}
-int dap_baseaddr_command(struct command_context_s *cmd_ctx,
- swjdp_common_t *swjdp, char **args, int argc)
+DAP_COMMAND_HANDLER(dap_baseaddr_command)
{
uint32_t apsel, apselsave, baseaddr;
int retval;
return retval;
}
-int dap_memaccess_command(struct command_context_s *cmd_ctx,
- swjdp_common_t *swjdp, char **args, int argc)
+DAP_COMMAND_HANDLER(dap_memaccess_command)
{
uint32_t memaccess_tck;
return ERROR_OK;
}
-int dap_apsel_command(struct command_context_s *cmd_ctx,
- swjdp_common_t *swjdp, char **args, int argc)
+DAP_COMMAND_HANDLER(dap_apsel_command)
{
uint32_t apsel, apid;
int retval;
return retval;
}
-int dap_apid_command(struct command_context_s *cmd_ctx,
- swjdp_common_t *swjdp, char **args, int argc)
+DAP_COMMAND_HANDLER(dap_apid_command)
{
uint32_t apsel, apselsave, apid;
int retval;
/* Commands for user dap access */
int dap_info_command(struct command_context_s *cmd_ctx,
swjdp_common_t *swjdp, int apsel);
-int dap_baseaddr_command(struct command_context_s *cmd_ctx,
- swjdp_common_t *swjdp, char **args, int argc);
-int dap_memaccess_command(struct command_context_s *cmd_ctx,
- swjdp_common_t *swjdp, char **args, int argc);
-int dap_apsel_command(struct command_context_s *cmd_ctx,
- swjdp_common_t *swjdp, char **args, int argc);
-int dap_apid_command(struct command_context_s *cmd_ctx,
- swjdp_common_t *swjdp, char **args, int argc);
+
+#define DAP_COMMAND_HANDLER(name) \
+ COMMAND_HELPER(name, swjdp_common_t *swjdp)
+DAP_COMMAND_HANDLER(dap_baseaddr_command);
+DAP_COMMAND_HANDLER(dap_memaccess_command);
+DAP_COMMAND_HANDLER(dap_apsel_command);
+DAP_COMMAND_HANDLER(dap_apid_command);
#endif
struct armv7a_common_s *armv7a = target_to_armv7a(target);
swjdp_common_t *swjdp = &armv7a->swjdp_info;
- return dap_baseaddr_command(cmd_ctx, swjdp, args, argc);
+ return CALL_COMMAND_HANDLER(dap_baseaddr_command, swjdp);
}
COMMAND_HANDLER(handle_dap_memaccess_command)
struct armv7a_common_s *armv7a = target_to_armv7a(target);
swjdp_common_t *swjdp = &armv7a->swjdp_info;
- return dap_memaccess_command(cmd_ctx, swjdp, args, argc);
+ return CALL_COMMAND_HANDLER(dap_memaccess_command, swjdp);
}
COMMAND_HANDLER(handle_dap_apsel_command)
struct armv7a_common_s *armv7a = target_to_armv7a(target);
swjdp_common_t *swjdp = &armv7a->swjdp_info;
- return dap_apsel_command(cmd_ctx, swjdp, args, argc);
+ return CALL_COMMAND_HANDLER(dap_apsel_command, swjdp);
}
COMMAND_HANDLER(handle_dap_apid_command)
struct armv7a_common_s *armv7a = target_to_armv7a(target);
swjdp_common_t *swjdp = &armv7a->swjdp_info;
- return dap_apid_command(cmd_ctx, swjdp, args, argc);
+ return CALL_COMMAND_HANDLER(dap_apid_command, swjdp);
}
COMMAND_HANDLER(handle_dap_info_command)
struct armv7m_common_s *armv7m = target_to_armv7m(target);
swjdp_common_t *swjdp = &armv7m->swjdp_info;
- return dap_apid_command(cmd_ctx, swjdp, args, argc);
+ return CALL_COMMAND_HANDLER(dap_apid_command, swjdp);
}
COMMAND_HANDLER(handle_dap_apsel_command)
struct armv7m_common_s *armv7m = target_to_armv7m(target);
swjdp_common_t *swjdp = &armv7m->swjdp_info;
- return dap_apsel_command(cmd_ctx, swjdp, args, argc);
+ return CALL_COMMAND_HANDLER(dap_apsel_command, swjdp);
}
COMMAND_HANDLER(handle_dap_memaccess_command)
struct armv7m_common_s *armv7m = target_to_armv7m(target);
swjdp_common_t *swjdp = &armv7m->swjdp_info;
- return dap_memaccess_command(cmd_ctx, swjdp, args, argc);
+ return CALL_COMMAND_HANDLER(dap_memaccess_command, swjdp);
}