openocd: fix SPDX tag format for files .c
[fw/openocd] / src / target / arc_cmd.c
index 59e1645d67cbfebf9c1db1caa8e8f2fc29fef834..7a8004678e4c5cbec3c2039578ea1d9279820e4c 100644 (file)
@@ -1,11 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
 /***************************************************************************
  *   Copyright (C) 2013-2015,2019-2020 Synopsys, Inc.                      *
  *   Frank Dols <frank.dols@synopsys.com>                                  *
  *   Mischa Jonker <mischa.jonker@synopsys.com>                            *
  *   Anton Kolesov <anton.kolesov@synopsys.com>                            *
  *   Evgeniy Didin <didin@synopsys.com>                                    *
- *                                                                         *
- *   SPDX-License-Identifier: GPL-2.0-or-later                             *
  ***************************************************************************/
 
 #ifdef HAVE_CONFIG_H
  * ------------------------------------------------------------------------- */
 
 
-static int arc_cmd_jim_get_uint32(Jim_GetOptInfo *goi, uint32_t *value)
+static int arc_cmd_jim_get_uint32(struct jim_getopt_info *goi, uint32_t *value)
 {
        jim_wide value_wide;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Wide(goi, &value_wide));
+       JIM_CHECK_RETVAL(jim_getopt_wide(goi, &value_wide));
        *value = (uint32_t)value_wide;
        return JIM_OK;
 }
@@ -40,7 +40,7 @@ enum add_reg_type_flags {
        CFG_ADD_REG_TYPE_FLAGS_FLAG,
 };
 
-static Jim_Nvp nvp_add_reg_type_flags_opts[] = {
+static struct jim_nvp nvp_add_reg_type_flags_opts[] = {
        { .name = "-name",  .value = CFG_ADD_REG_TYPE_FLAGS_NAME },
        { .name = "-flag",  .value = CFG_ADD_REG_TYPE_FLAGS_FLAG },
        { .name = NULL,     .value = -1 }
@@ -64,7 +64,7 @@ static const char *validate_register(const struct arc_reg_desc * const reg, bool
 
 /* Helper function to read the name of register type or register from
  * configure files  */
-static int jim_arc_read_reg_name_field(Jim_GetOptInfo *goi,
+static int jim_arc_read_reg_name_field(struct jim_getopt_info *goi,
        const char **name, int *name_len)
 {
        int e = JIM_OK;
@@ -73,12 +73,12 @@ static int jim_arc_read_reg_name_field(Jim_GetOptInfo *goi,
                Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-name <name> ...");
                return JIM_ERR;
        }
-       e = Jim_GetOpt_String(goi, name, name_len);
+       e = jim_getopt_string(goi, name, name_len);
        return e;
 }
 
 /* Helper function to read bitfields/flags of register type. */
-static int jim_arc_read_reg_type_field(Jim_GetOptInfo *goi, const char **field_name, int *field_name_len,
+static int jim_arc_read_reg_type_field(struct jim_getopt_info *goi, const char **field_name, int *field_name_len,
         struct arc_reg_bitfield *bitfields, int cur_field, int type)
 {
                jim_wide start_pos, end_pos;
@@ -86,29 +86,29 @@ static int jim_arc_read_reg_type_field(Jim_GetOptInfo *goi, const char **field_n
                int e = JIM_OK;
                if ((type == CFG_ADD_REG_TYPE_STRUCT && goi->argc < 3) ||
                 (type == CFG_ADD_REG_TYPE_FLAG && goi->argc < 2)) {
-                       Jim_SetResultFormatted(goi->interp, "Not enough argmunets after -flag/-bitfield");
+                       Jim_SetResultFormatted(goi->interp, "Not enough arguments after -flag/-bitfield");
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_String(goi, field_name, field_name_len);
+               e = jim_getopt_string(goi, field_name, field_name_len);
                if (e != JIM_OK)
                                        return e;
 
                /* read start position of bitfield/flag */
-               e = Jim_GetOpt_Wide(goi, &start_pos);
+               e = jim_getopt_wide(goi, &start_pos);
                if (e != JIM_OK)
                                        return e;
 
                end_pos = start_pos;
 
-               /* Check if any argnuments remain,
+               /* Check if any arguments remain,
                 * set bitfields[cur_field].end if flag is multibit */
                if (goi->argc > 0)
                        /* Check current argv[0], if it is equal to "-flag",
                         * than bitfields[cur_field].end remains start */
                        if ((strcmp(Jim_String(goi->argv[0]), "-flag") && type == CFG_ADD_REG_TYPE_FLAG)
                                        || (type == CFG_ADD_REG_TYPE_STRUCT)) {
-                                                               e = Jim_GetOpt_Wide(goi, &end_pos);
+                                                               e = jim_getopt_wide(goi, &end_pos);
                                                                if (e != JIM_OK) {
                                                                        Jim_SetResultFormatted(goi->interp, "Error reading end position");
                                                                        return e;
@@ -125,8 +125,8 @@ static int jim_arc_read_reg_type_field(Jim_GetOptInfo *goi, const char **field_n
 static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
        Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        LOG_DEBUG("-");
 
@@ -143,9 +143,9 @@ static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
 
        int e = JIM_OK;
 
-       /* Check if the amount of argnuments is not zero */
+       /* Check if the amount of arguments is not zero */
        if (goi.argc <= 0) {
-               Jim_SetResultFormatted(goi.interp, "The command has no argnuments");
+               Jim_SetResultFormatted(goi.interp, "The command has no arguments");
                return JIM_ERR;
        }
 
@@ -154,7 +154,7 @@ static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
        unsigned int fields_sz = (goi.argc - 2) / 3;
        unsigned int cur_field = 0;
 
-       /* Tha maximum amount of bitfilds is 32 */
+       /* The maximum amount of bitfields is 32 */
        if (fields_sz > 32) {
                Jim_SetResultFormatted(goi.interp, "The amount of bitfields exceed 32");
                return JIM_ERR;
@@ -179,10 +179,10 @@ static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
        flags->size = 4; /* For now ARC has only 32-bit registers */
 
        while (goi.argc > 0 && e == JIM_OK) {
-               Jim_Nvp *n;
-               e = Jim_GetOpt_Nvp(&goi, nvp_add_reg_type_flags_opts, &n);
+               struct jim_nvp *n;
+               e = jim_getopt_nvp(&goi, nvp_add_reg_type_flags_opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(&goi, nvp_add_reg_type_flags_opts, 0);
+                       jim_getopt_nvp_unknown(&goi, nvp_add_reg_type_flags_opts, 0);
                        continue;
                }
 
@@ -272,7 +272,7 @@ enum add_reg_type_struct {
        CFG_ADD_REG_TYPE_STRUCT_BITFIELD,
 };
 
-static Jim_Nvp nvp_add_reg_type_struct_opts[] = {
+static struct jim_nvp nvp_add_reg_type_struct_opts[] = {
        { .name = "-name",     .value = CFG_ADD_REG_TYPE_STRUCT_NAME },
        { .name = "-bitfield", .value = CFG_ADD_REG_TYPE_STRUCT_BITFIELD },
        { .name = NULL,     .value = -1 }
@@ -286,8 +286,8 @@ static int jim_arc_set_aux_reg(Jim_Interp *interp, int argc, Jim_Obj * const *ar
        uint32_t regnum;
        uint32_t value;
 
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        if (goi.argc != 2) {
                Jim_SetResultFormatted(goi.interp,
@@ -325,8 +325,8 @@ static int jim_arc_get_aux_reg(Jim_Interp *interp, int argc, Jim_Obj * const *ar
        uint32_t regnum;
        uint32_t value;
 
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        if (goi.argc != 1) {
                Jim_SetResultFormatted(goi.interp,
@@ -362,8 +362,8 @@ static int jim_arc_get_core_reg(Jim_Interp *interp, int argc, Jim_Obj * const *a
        uint32_t regnum;
        uint32_t value;
 
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        if (goi.argc != 1) {
                Jim_SetResultFormatted(goi.interp,
@@ -382,7 +382,7 @@ static int jim_arc_get_core_reg(Jim_Interp *interp, int argc, Jim_Obj * const *a
 
        /* Register number */
        JIM_CHECK_RETVAL(arc_cmd_jim_get_uint32(&goi, &regnum));
-       if (regnum > CORE_REG_MAX_NUMBER || regnum == CORE_R61_NUM || regnum == CORE_R62_NUM) {
+       if (regnum > CORE_REG_MAX_NUMBER || regnum == ARC_R61 || regnum == ARC_R62) {
                Jim_SetResultFormatted(goi.interp, "Core register number %i "
                        "is invalid. Must less then 64 and not 61 and 62.", regnum);
                return JIM_ERR;
@@ -405,8 +405,8 @@ static int jim_arc_set_core_reg(Jim_Interp *interp, int argc, Jim_Obj * const *a
        uint32_t regnum;
        uint32_t value;
 
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        if (goi.argc != 2) {
                Jim_SetResultFormatted(goi.interp,
@@ -425,7 +425,7 @@ static int jim_arc_set_core_reg(Jim_Interp *interp, int argc, Jim_Obj * const *a
 
        /* Register number */
        JIM_CHECK_RETVAL(arc_cmd_jim_get_uint32(&goi, &regnum));
-       if (regnum > CORE_REG_MAX_NUMBER || regnum == CORE_R61_NUM || regnum == CORE_R62_NUM) {
+       if (regnum > CORE_REG_MAX_NUMBER || regnum == ARC_R61 || regnum == ARC_R62) {
                Jim_SetResultFormatted(goi.interp, "Core register number %i "
                        "is invalid. Must less then 64 and not 61 and 62.", regnum);
                return JIM_ERR;
@@ -451,7 +451,7 @@ static const struct command_registration arc_jtag_command_group[] = {
                        "raw JTAG request that bypasses OpenOCD register cache "
                        "and thus is unsafe and can have unexpected consequences. "
                        "Use at your own risk.",
-               .usage = "arc jtag get-aux-reg <regnum>"
+               .usage = "<regnum>"
        },
        {
                .name = "set-aux-reg",
@@ -461,7 +461,7 @@ static const struct command_registration arc_jtag_command_group[] = {
                        "raw JTAG request that bypasses OpenOCD register cache "
                        "and thus is unsafe and can have unexpected consequences. "
                        "Use at your own risk.",
-               .usage = "arc jtag set-aux-reg <regnum> <value>"
+               .usage = "<regnum> <value>"
        },
        {
                .name = "get-core-reg",
@@ -471,7 +471,7 @@ static const struct command_registration arc_jtag_command_group[] = {
                        "raw JTAG request that bypasses OpenOCD register cache "
                        "and thus is unsafe and can have unexpected consequences. "
                        "Use at your own risk.",
-               .usage = "arc jtag get-core-reg <regnum> [<value>]"
+               .usage = "<regnum> [<value>]"
        },
        {
                .name = "set-core-reg",
@@ -481,7 +481,7 @@ static const struct command_registration arc_jtag_command_group[] = {
                        "raw JTAG request that bypasses OpenOCD register cache "
                        "and thus is unsafe and can have unexpected consequences. "
                        "Use at your own risk.",
-               .usage = "arc jtag set-core-reg <regnum> [<value>]"
+               .usage = "<regnum> [<value>]"
        },
        COMMAND_REGISTRATION_DONE
 };
@@ -491,8 +491,8 @@ static const struct command_registration arc_jtag_command_group[] = {
 static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
        Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        LOG_DEBUG("-");
 
@@ -509,9 +509,9 @@ static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
 
        int e = JIM_OK;
 
-       /* Check if the amount of argnuments is not zero */
+       /* Check if the amount of arguments is not zero */
        if (goi.argc <= 0) {
-               Jim_SetResultFormatted(goi.interp, "The command has no argnuments");
+               Jim_SetResultFormatted(goi.interp, "The command has no arguments");
                return JIM_ERR;
        }
 
@@ -520,7 +520,7 @@ static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
        unsigned int fields_sz = (goi.argc - 2) / 4;
        unsigned int cur_field = 0;
 
-       /* Tha maximum amount of bitfilds is 32 */
+       /* The maximum amount of bitfields is 32 */
        if (fields_sz > 32) {
                        Jim_SetResultFormatted(goi.interp, "The amount of bitfields exceed 32");
                        return JIM_ERR;
@@ -545,10 +545,10 @@ static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
        struct_type->size = 4; /* For now ARC has only 32-bit registers */
 
        while (goi.argc > 0 && e == JIM_OK) {
-               Jim_Nvp *n;
-               e = Jim_GetOpt_Nvp(&goi, nvp_add_reg_type_struct_opts, &n);
+               struct jim_nvp *n;
+               e = jim_getopt_nvp(&goi, nvp_add_reg_type_struct_opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(&goi, nvp_add_reg_type_struct_opts, 0);
+                       jim_getopt_nvp_unknown(&goi, nvp_add_reg_type_struct_opts, 0);
                        continue;
                }
 
@@ -642,7 +642,7 @@ enum opts_add_reg {
        CFG_ADD_REG_GENERAL,
 };
 
-static Jim_Nvp opts_nvp_add_reg[] = {
+static struct jim_nvp opts_nvp_add_reg[] = {
        { .name = "-name",    .value = CFG_ADD_REG_NAME },
        { .name = "-num",     .value = CFG_ADD_REG_ARCH_NUM },
        { .name = "-core",    .value = CFG_ADD_REG_IS_CORE },
@@ -662,8 +662,8 @@ void free_reg_desc(struct arc_reg_desc *r)
 
 static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        struct arc_reg_desc *reg = calloc(1, sizeof(*reg));
        if (!reg) {
@@ -672,19 +672,19 @@ static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
        }
 
        /* There is no architecture number that we could treat as invalid, so
-        * separate variable requried to ensure that arch num has been set. */
+        * separate variable required to ensure that arch num has been set. */
        bool arch_num_set = false;
        const char *type_name = "int"; /* Default type */
        int type_name_len = strlen(type_name);
        int e = ERROR_OK;
 
        /* At least we need to specify 4 parameters: name, number and gdb_feature,
-        * which means there should be 6 arguments. Also there can be additional paramters
+        * which means there should be 6 arguments. Also there can be additional parameters
         * "-type <type>", "-g" and  "-core" or "-bcr" which makes maximum 10 parameters. */
        if (goi.argc < 6 || goi.argc > 10) {
                free_reg_desc(reg);
                Jim_SetResultFormatted(goi.interp,
-                       "Should be at least 6 argnuments and not greater than 10: "
+                       "Should be at least 6 arguments and not greater than 10: "
                        " -name <name> -num <num> -feature <gdb_feature> "
                        " [-type <type_name>] [-core|-bcr] [-g].");
                return JIM_ERR;
@@ -692,10 +692,10 @@ static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 
        /* Parse options. */
        while (goi.argc > 0) {
-               Jim_Nvp *n;
-               e = Jim_GetOpt_Nvp(&goi, opts_nvp_add_reg, &n);
+               struct jim_nvp *n;
+               e = jim_getopt_nvp(&goi, opts_nvp_add_reg, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(&goi, opts_nvp_add_reg, 0);
+                       jim_getopt_nvp_unknown(&goi, opts_nvp_add_reg, 0);
                        free_reg_desc(reg);
                        return e;
                }
@@ -732,7 +732,7 @@ static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
                                        return JIM_ERR;
                                }
 
-                               e = Jim_GetOpt_Wide(&goi, &archnum);
+                               e = jim_getopt_wide(&goi, &archnum);
                                if (e != JIM_OK) {
                                        free_reg_desc(reg);
                                        return e;
@@ -845,12 +845,12 @@ COMMAND_HANDLER(arc_set_reg_exists)
  * Reads struct type register field */
 static int jim_arc_get_reg_field(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
+       struct jim_getopt_info goi;
        const char *reg_name, *field_name;
        uint32_t value;
        int retval;
 
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        LOG_DEBUG("Reading register field");
        if (goi.argc != 2) {
@@ -863,8 +863,8 @@ static int jim_arc_get_reg_field(Jim_Interp *interp, int argc, Jim_Obj * const *
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       JIM_CHECK_RETVAL(Jim_GetOpt_String(&goi, &reg_name, NULL));
-       JIM_CHECK_RETVAL(Jim_GetOpt_String(&goi, &field_name, NULL));
+       JIM_CHECK_RETVAL(jim_getopt_string(&goi, &reg_name, NULL));
+       JIM_CHECK_RETVAL(jim_getopt_string(&goi, &field_name, NULL));
        assert(reg_name);
        assert(field_name);
 
@@ -929,9 +929,53 @@ COMMAND_HANDLER(arc_l2_cache_disable_auto_cmd)
                &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;
+}
+
 /* ----- Exported target commands ------------------------------------------ */
 
-const struct command_registration arc_l2_cache_group_handlers[] = {
+static const struct command_registration arc_l2_cache_group_handlers[] = {
        {
                .name = "auto",
                .handler = arc_l2_cache_disable_auto_cmd,
@@ -942,7 +986,7 @@ const struct command_registration arc_l2_cache_group_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-const struct command_registration arc_cache_group_handlers[] = {
+static const struct command_registration arc_cache_group_handlers[] = {
        {
                .name = "auto",
                .handler = arc_l1_cache_disable_auto_cmd,
@@ -966,7 +1010,7 @@ static const struct command_registration arc_core_command_handlers[] = {
                .name = "add-reg-type-flags",
                .jim_handler = jim_arc_add_reg_type_flags,
                .mode = COMMAND_CONFIG,
-               .usage = "arc ardd-reg-type-flags -name <string> -flag <name> <position> "
+               .usage = "-name <string> -flag <name> <position> "
                        "[-flag <name> <position>]...",
                .help = "Add new 'flags' register data type. Only single bit flags "
                        "are supported. Type name is global. Bitsize of register is fixed "
@@ -976,7 +1020,7 @@ static const struct command_registration arc_core_command_handlers[] = {
                .name = "add-reg-type-struct",
                .jim_handler = jim_arc_add_reg_type_struct,
                .mode = COMMAND_CONFIG,
-               .usage = "arc add-reg-type-struct -name <string> -bitfield <name> <start> <end> "
+               .usage = "-name <string> -bitfield <name> <start> <end> "
                        "[-bitfield <name> <start> <end>]...",
                .help = "Add new 'struct' register data type. Only bit-fields are "
                        "supported so far, which means that for each bitfield start and end "
@@ -988,10 +1032,10 @@ static const struct command_registration arc_core_command_handlers[] = {
                .name = "add-reg",
                .jim_handler = jim_arc_add_reg,
                .mode = COMMAND_CONFIG,
-               .usage = "arc add-reg -name <string> -num <int> -feature <string> [-gdbnum <int>] "
+               .usage = "-name <string> -num <int> -feature <string> [-gdbnum <int>] "
                        "[-core|-bcr] [-type <type_name>] [-g]",
                .help = "Add new register. Name, architectural number and feature name "
-                       "are requried options. GDB regnum will default to previous register "
+                       "are required options. GDB regnum will default to previous register "
                        "(gdbnum + 1) and shouldn't be specified in most cases. Type "
                        "defaults to default GDB 'int'.",
        },
@@ -999,7 +1043,7 @@ static const struct command_registration arc_core_command_handlers[] = {
                .name = "set-reg-exists",
                .handler = arc_set_reg_exists,
                .mode = COMMAND_ANY,
-               .usage = "arc set-reg-exists <register-name> [<register-name>]...",
+               .usage = "<register-name> [<register-name>]...",
                .help = "Set that register exists. Accepts multiple register names as "
                        "arguments.",
        },
@@ -1007,7 +1051,7 @@ static const struct command_registration arc_core_command_handlers[] = {
                .name = "get-reg-field",
                .jim_handler = jim_arc_get_reg_field,
                .mode = COMMAND_ANY,
-               .usage = "arc get-reg-field <regname> <field_name>",
+               .usage = "<regname> <field_name>",
                .help = "Returns value of field in a register with 'struct' type.",
        },
        {
@@ -1024,6 +1068,13 @@ static const struct command_registration arc_core_command_handlers[] = {
                .usage = "",
                .chain = arc_cache_group_handlers,
        },
+       {
+               .name = "num-actionpoints",
+               .jim_handler = jim_handle_actionpoints_num,
+               .mode = COMMAND_ANY,
+               .usage = "[<unsigned integer>]",
+               .help = "Prints or sets amount of actionpoints in the processor.",
+       },
        COMMAND_REGISTRATION_DONE
 };
 
@@ -1032,7 +1083,7 @@ const struct command_registration arc_monitor_command_handlers[] = {
                .name = "arc",
                .mode = COMMAND_ANY,
                .help = "ARC monitor command group",
-               .usage = "Help info ...",
+               .usage = "",
                .chain = arc_core_command_handlers,
        },
        COMMAND_REGISTRATION_DONE