forked from auracaster/openocd
openocd: trivial replace of jim-nvp with new nvp
For some trivial case only, replace calls to jim-nvp with calls to the new OpenOCD nvp. Change-Id: Ifd9aff32b67748af8ab808e6a6b6e64f5271b888 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7553 Tested-by: jenkins
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "register.h"
|
||||
#include <helper/binarybuffer.h>
|
||||
#include <helper/command.h>
|
||||
#include <helper/nvp.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -1043,7 +1044,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
|
||||
unsigned int argp = 0;
|
||||
int retval;
|
||||
|
||||
static const struct jim_nvp nvp_ecatch_modes[] = {
|
||||
static const struct nvp nvp_ecatch_modes[] = {
|
||||
{ .name = "off", .value = 0 },
|
||||
{ .name = "nsec_el1", .value = (1 << 5) },
|
||||
{ .name = "nsec_el2", .value = (2 << 5) },
|
||||
@@ -1053,7 +1054,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
|
||||
{ .name = "sec_el13", .value = (5 << 1) },
|
||||
{ .name = NULL, .value = -1 },
|
||||
};
|
||||
const struct jim_nvp *n;
|
||||
const struct nvp *n;
|
||||
|
||||
if (CMD_ARGC == 0) {
|
||||
const char *sec = NULL, *nsec = NULL;
|
||||
@@ -1063,11 +1064,11 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
n = jim_nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0x0f);
|
||||
n = nvp_value2name(nvp_ecatch_modes, edeccr & 0x0f);
|
||||
if (n->name)
|
||||
sec = n->name;
|
||||
|
||||
n = jim_nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0xf0);
|
||||
n = nvp_value2name(nvp_ecatch_modes, edeccr & 0xf0);
|
||||
if (n->name)
|
||||
nsec = n->name;
|
||||
|
||||
@@ -1081,7 +1082,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
|
||||
}
|
||||
|
||||
while (argp < CMD_ARGC) {
|
||||
n = jim_nvp_name2value_simple(nvp_ecatch_modes, CMD_ARGV[argp]);
|
||||
n = nvp_name2value(nvp_ecatch_modes, CMD_ARGV[argp]);
|
||||
if (!n->name) {
|
||||
LOG_ERROR("Unknown option: %s", CMD_ARGV[argp]);
|
||||
return ERROR_FAIL;
|
||||
|
||||
Reference in New Issue
Block a user