return ERROR_FAIL;
if (pc->ap_num == DP_APSEL_INVALID) {
- LOG_ERROR("AP number not specified");
+ LOG_TARGET_ERROR(target, "AP number not specified");
return ERROR_FAIL;
}
mem_ap = calloc(1, sizeof(struct mem_ap));
if (!mem_ap) {
- LOG_ERROR("Out of memory");
+ LOG_TARGET_ERROR(target, "Out of memory");
return ERROR_FAIL;
}
static int mem_ap_init_target(struct command_context *cmd_ctx, struct target *target)
{
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
target->state = TARGET_UNKNOWN;
target->debug_reason = DBG_REASON_UNDEFINED;
return ERROR_OK;
{
struct mem_ap *mem_ap = target->arch_info;
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
if (mem_ap->ap)
dap_put_ap(mem_ap->ap);
static int mem_ap_arch_state(struct target *target)
{
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
return ERROR_OK;
}
static int mem_ap_halt(struct target *target)
{
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
target->state = TARGET_HALTED;
target->debug_reason = DBG_REASON_DBGRQ;
target_call_event_callbacks(target, TARGET_EVENT_HALTED);
static int mem_ap_resume(struct target *target, int current, target_addr_t address,
int handle_breakpoints, int debug_execution)
{
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
target->state = TARGET_RUNNING;
target->debug_reason = DBG_REASON_NOTHALTED;
return ERROR_OK;
static int mem_ap_step(struct target *target, int current, target_addr_t address,
int handle_breakpoints)
{
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
target->state = TARGET_HALTED;
target->debug_reason = DBG_REASON_DBGRQ;
target_call_event_callbacks(target, TARGET_EVENT_HALTED);
target->state = TARGET_RESET;
target->debug_reason = DBG_REASON_UNDEFINED;
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
return ERROR_OK;
}
if (!mem_ap->ap) {
mem_ap->ap = dap_get_ap(mem_ap->dap, mem_ap->ap_num);
if (!mem_ap->ap) {
- LOG_ERROR("Cannot get AP");
+ LOG_TARGET_ERROR(target, "Cannot get AP");
return ERROR_FAIL;
}
}
target->debug_reason = DBG_REASON_NOTHALTED;
}
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
return ERROR_OK;
}
{
struct mem_ap_alloc_reg_list *mem_ap_alloc = calloc(1, sizeof(struct mem_ap_alloc_reg_list));
if (!mem_ap_alloc) {
- LOG_ERROR("Out of memory");
+ LOG_TARGET_ERROR(target, "Out of memory");
return ERROR_FAIL;
}
{
struct mem_ap *mem_ap = target->arch_info;
- LOG_DEBUG("Reading memory at physical address " TARGET_ADDR_FMT
+ LOG_TARGET_DEBUG(target, "Reading memory at physical address " TARGET_ADDR_FMT
"; size %" PRIu32 "; count %" PRIu32, address, size, count);
if (count == 0 || !buffer)
{
struct mem_ap *mem_ap = target->arch_info;
- LOG_DEBUG("Writing memory at physical address " TARGET_ADDR_FMT
+ LOG_TARGET_DEBUG(target, "Writing memory at physical address " TARGET_ADDR_FMT
"; size %" PRIu32 "; count %" PRIu32, address, size, count);
if (count == 0 || !buffer)