And make arm_state_strings[] be const.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
LOG_USER("target halted in %s state due to %s, current mode: %s\n"
"cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
"MMU: %s, Cache: %s",
- armv4_5_state_strings[armv4_5->core_state],
+ arm_state_strings[armv4_5->core_state],
Jim_Nvp_value2name_simple(nvp_target_debug_reason, target->debug_reason)->name ,
arm_mode_name(armv4_5->core_mode),
buf_get_u32(armv4_5->cpsr->value, 0, 32),
LOG_USER("target halted in %s state due to %s, current mode: %s\n"
"cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
"MMU: %s, D-Cache: %s, I-Cache: %s",
- armv4_5_state_strings[armv4_5->core_state],
+ arm_state_strings[armv4_5->core_state],
Jim_Nvp_value2name_simple(nvp_target_debug_reason, target->debug_reason)->name,
arm_mode_name(armv4_5->core_mode),
buf_get_u32(armv4_5->cpsr->value, 0, 32),
LOG_USER("target halted in %s state due to %s, current mode: %s\n"
"cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
"MMU: %s, D-Cache: %s, I-Cache: %s",
- armv4_5_state_strings[armv4_5->core_state],
+ arm_state_strings[armv4_5->core_state],
Jim_Nvp_value2name_simple(nvp_target_debug_reason,target->debug_reason)->name,
arm_mode_name(armv4_5->core_mode),
buf_get_u32(armv4_5->cpsr->value, 0, 32),
return buf_get_u32(armv4_5->cpsr->value, pos, bits);
}
-static enum armv4_5_state armv4_5_get_state(struct arm_sim_interface *sim)
+static enum arm_state armv4_5_get_state(struct arm_sim_interface *sim)
{
struct arm *armv4_5 = (struct arm *)sim->user_data;
return armv4_5->core_state;
}
-static void armv4_5_set_state(struct arm_sim_interface *sim, enum armv4_5_state mode)
+static void armv4_5_set_state(struct arm_sim_interface *sim, enum arm_state mode)
{
struct arm *armv4_5 = (struct arm *)sim->user_data;
uint32_t (*get_reg_mode)(struct arm_sim_interface *sim, int reg);
void (*set_reg_mode)(struct arm_sim_interface *sim, int reg, uint32_t value);
uint32_t (*get_cpsr)(struct arm_sim_interface *sim, int pos, int bits);
- enum armv4_5_state (*get_state)(struct arm_sim_interface *sim);
- void (*set_state)(struct arm_sim_interface *sim, enum armv4_5_state mode);
+ enum arm_state (*get_state)(struct arm_sim_interface *sim);
+ void (*set_state)(struct arm_sim_interface *sim, enum arm_state mode);
enum arm_mode (*get_mode)(struct arm_sim_interface *sim);
};
}
}
-char* armv4_5_state_strings[] =
+const char *arm_state_strings[] =
{
"ARM", "Thumb", "Jazelle", "ThumbEE",
};
: arm->core_cache->reg_list + arm->map[16];
/* Older ARMs won't have the J bit */
- enum armv4_5_state state;
+ enum arm_state state;
if (cpsr & (1 << 5)) { /* T */
if (cpsr & (1 << 24)) { /* J */
LOG_DEBUG("set CPSR %#8.8x: %s mode, %s state", (unsigned) cpsr,
arm_mode_name(mode),
- armv4_5_state_strings[arm->core_state]);
+ arm_state_strings[arm->core_state]);
}
/**
LOG_USER("target halted in %s state due to %s, current mode: %s\n"
"cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "%s",
- armv4_5_state_strings[armv4_5->core_state],
+ arm_state_strings[armv4_5->core_state],
Jim_Nvp_value2name_simple(nvp_target_debug_reason,
target->debug_reason)->name,
arm_mode_name(armv4_5->core_mode),
}
}
- command_print(CMD_CTX, "core state: %s", armv4_5_state_strings[armv4_5->core_state]);
+ command_print(CMD_CTX, "core state: %s", arm_state_strings[armv4_5->core_state]);
return ERROR_OK;
}
{
struct arm *armv4_5 = target_to_armv4_5(target);
struct armv4_5_algorithm *armv4_5_algorithm_info = arch_info;
- enum armv4_5_state core_state = armv4_5->core_state;
+ enum arm_state core_state = armv4_5->core_state;
uint32_t context[17];
uint32_t cpsr;
int exit_breakpoint_size = 0;
int arm_mode_to_number(enum arm_mode mode);
enum arm_mode armv4_5_number_to_mode(int number);
-typedef enum armv4_5_state
+typedef enum arm_state
{
ARM_STATE_ARM,
ARM_STATE_THUMB,
ARM_STATE_JAZELLE,
ARM_STATE_THUMB_EE,
-} armv4_5_state_t;
+} arm_state_t;
-extern char* armv4_5_state_strings[];
+extern const char *arm_state_strings[];
extern const int armv4_5_core_reg_map[8][17];
enum arm_mode core_type;
enum arm_mode core_mode;
- enum armv4_5_state core_state;
+ enum arm_state core_state;
/** Flag reporting unavailability of the BKPT instruction. */
bool is_armv4;
int common_magic;
enum arm_mode core_mode;
- enum armv4_5_state core_state;
+ enum arm_state core_state;
};
struct arm_reg
int common_magic;
enum arm_mode core_mode;
- enum armv4_5_state core_state;
+ enum arm_state core_state;
};
struct armv7a_core_reg
uint32_t trace_depth; /* number of cycles to be analyzed, 0 if no data available */
etm_portmode_t portmode; /* normal, multiplexed or demultiplexed */
etmv1_tracemode_t tracemode; /* type of info trace contains */
- int /*armv4_5_state_t*/ core_state; /* current core state */
+ int /*arm_state_t*/ core_state; /* current core state */
struct image *image; /* source for target opcodes */
uint32_t pipe_index; /* current trace cycle */
uint32_t data_index; /* cycle holding next data packet */
int retval;
struct arm *armv4_5 = target->arch_info;
struct arm7_9_common *arm7_9 = armv4_5->arch_info;
- enum armv4_5_state core_state = armv4_5->core_state;
+ enum arm_state core_state = armv4_5->core_state;
uint32_t x, flip, shift, save[7];
uint32_t i;
"cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
"MMU: %s, D-Cache: %s, I-Cache: %s"
"%s",
- armv4_5_state_strings[armv4_5->core_state],
+ arm_state_strings[armv4_5->core_state],
Jim_Nvp_value2name_simple(nvp_target_debug_reason, target->debug_reason)->name ,
arm_mode_name(armv4_5->core_mode),
buf_get_u32(armv4_5->cpsr->value, 0, 32),
int buffer_fill; /* maximum number of trace runs to read (-1 for wrap-around) */
int pc_ok;
uint32_t current_pc;
- armv4_5_state_t core_state; /* current core state (ARM, Thumb, Jazelle) */
+ arm_state_t core_state; /* current core state (ARM, Thumb, Jazelle) */
};
struct xscale_common