X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Ftarget.c;h=75555c167a447fc9bd48dfc4394b33357e0e23aa;hb=cad39b73904dfe8f5270603aa54a628e59f507d3;hp=ac2e1d030abed103e52c9de79e20aafb945ddd6e;hpb=6eba3777fca4a3e8c0d91dce9caedfeb9c08dc67;p=openocd.git diff --git a/src/target/target.c b/src/target/target.c index ac2e1d030a..75555c167a 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1910,6 +1910,18 @@ static void target_destroy(struct target *target) free(target->working_areas); } + /* release the targets SMP list */ + if (target->smp) { + struct target_list *head = target->head; + while (head != NULL) { + struct target_list *pos = head->next; + head->target->smp = 0; + free(head); + head = pos; + } + target->smp = 0; + } + free(target->type); free(target->trace_info); free(target->fileio_info); @@ -2239,21 +2251,19 @@ int target_checksum_memory(struct target *target, target_addr_t address, uint32_ return retval; } -int target_blank_check_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t* blank, +int target_blank_check_memory(struct target *target, + struct target_memory_check_block *blocks, int num_blocks, uint8_t erased_value) { - int retval; if (!target_was_examined(target)) { LOG_ERROR("Target not examined yet"); return ERROR_FAIL; } - if (target->type->blank_check_memory == 0) + if (target->type->blank_check_memory == NULL) return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; - retval = target->type->blank_check_memory(target, address, size, blank, erased_value); - - return retval; + return target->type->blank_check_memory(target, blocks, num_blocks, erased_value); } int target_read_u64(struct target *target, target_addr_t address, uint64_t *value)