/* We want any events to be processed before the prompt */
retval = target_call_timer_callbacks_now();
+ struct target *target;
+ for (target = all_targets; target; target = target->next) {
+ target->type->check_reset(target);
+ }
+
return retval;
}
return ERROR_OK;
}
+/* no check by default */
+static int default_check_reset(struct target *target)
+{
+ return ERROR_OK;
+}
+
int target_examine_one(struct target *target)
{
return target->type->examine(target);
if (type->examine == NULL)
type->examine = default_examine;
+ if (type->check_reset== NULL)
+ type->check_reset = default_check_reset;
+
int retval = type->init_target(cmd_ctx, target);
if (ERROR_OK != retval)
{
return register_commands(cmd_ctx, NULL, target_command_handlers);
}
+static bool target_reset_nag = true;
+
+bool get_target_reset_nag(void)
+{
+ return target_reset_nag;
+}
+
+COMMAND_HANDLER(handle_target_reset_nag)
+{
+ return CALL_COMMAND_HANDLER(handle_command_parse_bool,
+ &target_reset_nag, "Nag after each reset about options to improve "
+ "performance");
+}
+
static const struct command_registration target_exec_command_handlers[] = {
{
.name = "fast_load_image",
"and write the 8/16/32 bit values",
.usage = "arrayname bitwidth address count",
},
+ {
+ .name = "reset_nag",
+ .handler = handle_target_reset_nag,
+ .mode = COMMAND_ANY,
+ .help = "Nag after each reset about options that could have been "
+ "enabled to improve performance. ",
+ .usage = "['enable'|'disable']",
+ },
COMMAND_REGISTRATION_DONE
};
int target_register_user_commands(struct command_context *cmd_ctx)
* Copyright (C) 2005 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
- * Copyright (C) 2007,2008,2009 Øyvind Harboe *
+ * Copyright (C) 2007-9 Øyvind Harboe *
* oyvind.harboe@zylin.com *
* *
* Copyright (C) 2008 by Spencer Oliver *
const char *target_strerror_safe(int err);
+extern bool get_target_reset_nag(void);
+
#endif /* TARGET_H */
int (*mmu)(struct target *target, int *enabled);
+ /* after reset is complete, the target can check if things are properly set up.
+ *
+ * This can be used to check if e.g. DCC memory writes have been enabled for
+ * arm7/9 targets, which they really should except in the most contrived
+ * circumstances.
+ */
+ int (*check_reset)(struct target *target);
};
#endif // TARGET_TYPE_H