+COMMAND_HANDLER(arc_l1_cache_disable_auto_cmd)
+{
+ bool value;
+ int retval = 0;
+ struct arc_common *arc = target_to_arc(get_current_target(CMD_CTX));
+ retval = CALL_COMMAND_HANDLER(handle_command_parse_bool,
+ &value, "target has caches enabled");
+ arc->has_l2cache = value;
+ arc->has_dcache = value;
+ arc->has_icache = value;
+ return retval;
+}
+
+COMMAND_HANDLER(arc_l2_cache_disable_auto_cmd)
+{
+ struct arc_common *arc = target_to_arc(get_current_target(CMD_CTX));
+ return CALL_COMMAND_HANDLER(handle_command_parse_bool,
+ &arc->has_l2cache, "target has l2 cache enabled");
+}
+
+static int jim_handle_actionpoints_num(Jim_Interp *interp, int argc,
+ Jim_Obj * const *argv)
+{
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
+
+ LOG_DEBUG("-");
+
+ if (goi.argc >= 2) {
+ Jim_WrongNumArgs(interp, goi.argc, goi.argv, "[<unsigned integer>]");
+ return JIM_ERR;
+ }
+
+ struct command_context *context = current_command_context(interp);
+ assert(context);
+
+ struct target *target = get_current_target(context);
+
+ if (!target) {
+ Jim_SetResultFormatted(goi.interp, "No current target");
+ return JIM_ERR;
+ }
+
+ struct arc_common *arc = target_to_arc(target);
+ /* It is not possible to pass &arc->actionpoints_num directly to
+ * handle_command_parse_uint, because this value should be valid during
+ * "actionpoint reset, initiated by arc_set_actionpoints_num. */
+ uint32_t ap_num = arc->actionpoints_num;
+
+ if (goi.argc == 1) {
+ JIM_CHECK_RETVAL(arc_cmd_jim_get_uint32(&goi, &ap_num));
+ int e = arc_set_actionpoints_num(target, ap_num);
+ if (e != ERROR_OK) {
+ Jim_SetResultFormatted(goi.interp,
+ "Failed to set number of actionpoints");
+ return JIM_ERR;
+ }
+ }
+
+ Jim_SetResultInt(interp, ap_num);
+
+ return JIM_OK;
+}
+