aboutsummaryrefslogtreecommitdiff
path: root/src/target/mem_ap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/mem_ap.c')
-rw-r--r--src/target/mem_ap.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/target/mem_ap.c b/src/target/mem_ap.c
index 61a9475..fdc52c3 100644
--- a/src/target/mem_ap.c
+++ b/src/target/mem_ap.c
@@ -34,13 +34,13 @@ static int mem_ap_target_create(struct target *target, Jim_Interp *interp)
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;
}
@@ -58,7 +58,7 @@ static int mem_ap_target_create(struct target *target, Jim_Interp *interp)
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;
@@ -68,19 +68,18 @@ static void mem_ap_deinit_target(struct target *target)
{
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);
free(target->private_config);
free(target->arch_info);
- return;
}
static int mem_ap_arch_state(struct target *target)
{
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
return ERROR_OK;
}
@@ -96,26 +95,27 @@ static int mem_ap_poll(struct target *target)
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);
return ERROR_OK;
}
-static int mem_ap_resume(struct target *target, int current, target_addr_t address,
- int handle_breakpoints, int debug_execution)
+static int mem_ap_resume(struct target *target, bool current,
+ target_addr_t address, bool handle_breakpoints,
+ bool 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)
+static int mem_ap_step(struct target *target, bool current,
+ target_addr_t address, bool 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);
@@ -127,7 +127,7 @@ static int mem_ap_assert_reset(struct target *target)
target->state = TARGET_RESET;
target->debug_reason = DBG_REASON_UNDEFINED;
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
return ERROR_OK;
}
@@ -139,7 +139,7 @@ static int mem_ap_examine(struct target *target)
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;
}
}
@@ -163,7 +163,7 @@ static int mem_ap_deassert_reset(struct target *target)
target->debug_reason = DBG_REASON_NOTHALTED;
}
- LOG_DEBUG("%s", __func__);
+ LOG_TARGET_DEBUG(target, "%s", __func__);
return ERROR_OK;
}
@@ -213,7 +213,7 @@ static int mem_ap_get_gdb_reg_list(struct target *target, struct reg **reg_list[
{
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;
}
@@ -238,7 +238,7 @@ static int mem_ap_read_memory(struct target *target, target_addr_t address,
{
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)
@@ -253,7 +253,7 @@ static int mem_ap_write_memory(struct target *target, target_addr_t address,
{
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)