This is an automated email from Gerrit. "JC Delaunay <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9512
-- gerrit commit a932b526e9afd4a390bec593a0f849c763153194 Author: JC Delaunay <[email protected]> Date: Thu Mar 5 15:43:19 2026 +0100 src/target/{many} Changes 'arm_reg' struct name Files modified: src/target/arm_dpm.c src/target/arm7_9_common.c src/target/armv4_5.c src/target/armv7m.c src/target/armv8.c src/target/armv8_dpm.c src/target/arm.h 'arm_reg' is both, and differently, defined in OpenOCD and Capstone. Thus, including "capstone.h" raises an error because of conflicting types. This commit addresses this conflict by renaming 'struct arm_reg' to 'struct arm_reg_t'. Change-Id: I2b4d2d802dfe60088d510d36f669c8593733ba0f Signed-off-by: JC Delaunay <[email protected]> diff --git a/src/target/arm.h b/src/target/arm.h index 6d6412219e..4e9f5698be 100644 --- a/src/target/arm.h +++ b/src/target/arm.h @@ -278,7 +278,7 @@ struct arm_algorithm { enum arm_state core_state; }; -struct arm_reg { +struct arm_reg_t { int num; enum arm_mode mode; struct target *target; diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 06e76ac0d2..dfe96b802a 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -1535,7 +1535,7 @@ static int arm7_9_restore_context(struct target *target) if (reg->valid) { dirty = true; LOG_DEBUG("examining dirty reg: %s", reg->name); - struct arm_reg *reg_arch_info; + struct arm_reg_t *reg_arch_info; reg_arch_info = reg->arch_info; if ((reg_arch_info->mode != ARM_MODE_ANY) && (reg_arch_info->mode != current_mode) @@ -1591,7 +1591,7 @@ static int arm7_9_restore_context(struct target *target) reg = &ARMV4_5_CORE_REG_MODE(arm->core_cache, armv4_5_number_to_mode( i), 16); - struct arm_reg *reg_arch_info; + struct arm_reg_t *reg_arch_info; reg_arch_info = reg->arch_info; if ((reg->dirty) && (reg_arch_info->mode != ARM_MODE_ANY)) { LOG_DEBUG("writing SPSR of mode %i with value 0x%8.8" PRIx32, @@ -1993,7 +1993,7 @@ static int arm7_9_read_core_reg(struct target *target, struct reg *r, { uint32_t *reg_p[16]; int retval; - struct arm_reg *areg = r->arch_info; + struct arm_reg_t *areg = r->arch_info; struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm *arm = &arm7_9->arm; @@ -2048,7 +2048,7 @@ static int arm7_9_write_core_reg(struct target *target, struct reg *r, int num, enum arm_mode mode, uint8_t *value) { uint32_t reg[16]; - struct arm_reg *areg = r->arch_info; + struct arm_reg_t *areg = r->arch_info; struct arm7_9_common *arm7_9 = target_to_arm7_9(target); struct arm *arm = &arm7_9->arm; diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c index 63c41c5835..51e1284068 100644 --- a/src/target/arm_dpm.c +++ b/src/target/arm_dpm.c @@ -538,7 +538,7 @@ int arm_dpm_write_dirty_registers(struct arm_dpm *dpm, bool bpwp) /* check everything except our scratch registers R0 and R1 */ for (unsigned int i = 2; i < cache->num_regs; i++) { - struct arm_reg *r; + struct arm_reg_t *r; unsigned int regnum; /* also skip PC, CPSR, and non-dirty */ @@ -793,7 +793,7 @@ static int arm_dpm_full_context(struct target *target) * Repeat until done. */ for (unsigned int i = 0; i < cache->num_regs; i++) { - struct arm_reg *r; + struct arm_reg_t *r; if (!cache->reg_list[i].exist || cache->reg_list[i].valid) continue; diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 4f61c58e2d..c810328e8f 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -589,7 +589,7 @@ static void arm_gdb_dummy_init(void) static int armv4_5_get_core_reg(struct reg *reg) { int retval; - struct arm_reg *reg_arch_info = reg->arch_info; + struct arm_reg_t *reg_arch_info = reg->arch_info; struct target *target = reg_arch_info->target; if (target->state != TARGET_HALTED) { @@ -609,7 +609,7 @@ static int armv4_5_get_core_reg(struct reg *reg) static int armv4_5_set_core_reg(struct reg *reg, uint8_t *buf) { - struct arm_reg *reg_arch_info = reg->arch_info; + struct arm_reg_t *reg_arch_info = reg->arch_info; struct target *target = reg_arch_info->target; struct arm *armv4_5_target = target_to_arm(target); uint32_t value = buf_get_u32(buf, 0, 32); @@ -667,7 +667,7 @@ struct reg_cache *arm_build_reg_cache(struct target *target, struct arm *arm) struct reg_cache *cache = malloc(sizeof(struct reg_cache)); struct reg *reg_list = calloc(num_regs, sizeof(struct reg)); - struct arm_reg *reg_arch_info = calloc(num_regs, sizeof(struct arm_reg)); + struct arm_reg_t *reg_arch_info = calloc(num_regs, sizeof(struct arm_reg_t)); if (!cache || !reg_list || !reg_arch_info) { free(cache); diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 07f1f6fc90..1d435b60c7 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -244,7 +244,7 @@ const char *armv7m_exception_string(int number) static int armv7m_get_core_reg(struct reg *reg) { int retval; - struct arm_reg *armv7m_reg = reg->arch_info; + struct arm_reg_t *armv7m_reg = reg->arch_info; struct target *target = armv7m_reg->target; struct arm *arm = target_to_arm(target); @@ -258,7 +258,7 @@ static int armv7m_get_core_reg(struct reg *reg) static int armv7m_set_core_reg(struct reg *reg, uint8_t *buf) { - struct arm_reg *armv7m_reg = reg->arch_info; + struct arm_reg_t *armv7m_reg = reg->arch_info; struct target *target = armv7m_reg->target; if (target->state != TARGET_HALTED) @@ -386,7 +386,7 @@ static int armv7m_read_core_reg(struct target *target, struct reg *r, } else { assert(r->size == 32 || r->size == 64); - struct arm_reg *armv7m_core_reg = r->arch_info; + struct arm_reg_t *armv7m_core_reg = r->arch_info; uint32_t regsel = armv7m_map_id_to_regsel(armv7m_core_reg->num); retval = armv7m->load_core_reg_u32(target, regsel, ®_value); @@ -458,7 +458,7 @@ static int armv7m_write_core_reg(struct target *target, struct reg *r, } else { assert(r->size == 32 || r->size == 64); - struct arm_reg *armv7m_core_reg = r->arch_info; + struct arm_reg_t *armv7m_core_reg = r->arch_info; uint32_t regsel = armv7m_map_id_to_regsel(armv7m_core_reg->num); t = buf_get_u32(value, 0, 32); @@ -806,7 +806,7 @@ struct reg_cache *armv7m_build_reg_cache(struct target *target) struct reg_cache **cache_p = register_get_last_cache_p(&target->reg_cache); struct reg_cache *cache = malloc(sizeof(struct reg_cache)); struct reg *reg_list = calloc(num_regs, sizeof(struct reg)); - struct arm_reg *arch_info = calloc(num_regs, sizeof(struct arm_reg)); + struct arm_reg_t *arch_info = calloc(num_regs, sizeof(struct arm_reg_t)); struct reg_feature *feature; int i; diff --git a/src/target/armv8.c b/src/target/armv8.c index a369a30418..33b5bfcea9 100644 --- a/src/target/armv8.c +++ b/src/target/armv8.c @@ -1711,7 +1711,7 @@ static const struct { static int armv8_get_core_reg(struct reg *reg) { - struct arm_reg *armv8_reg = reg->arch_info; + struct arm_reg_t *armv8_reg = reg->arch_info; struct target *target = armv8_reg->target; struct arm *arm = target_to_arm(target); @@ -1723,7 +1723,7 @@ static int armv8_get_core_reg(struct reg *reg) static int armv8_set_core_reg(struct reg *reg, uint8_t *buf) { - struct arm_reg *armv8_reg = reg->arch_info; + struct arm_reg_t *armv8_reg = reg->arch_info; struct target *target = armv8_reg->target; struct arm *arm = target_to_arm(target); @@ -1759,7 +1759,7 @@ static const struct reg_arch_type armv8_reg_type = { static int armv8_get_core_reg32(struct reg *reg) { - struct arm_reg *armv8_reg = reg->arch_info; + struct arm_reg_t *armv8_reg = reg->arch_info; struct target *target = armv8_reg->target; struct arm *arm = target_to_arm(target); struct reg_cache *cache = arm->core_cache; @@ -1785,7 +1785,7 @@ static int armv8_get_core_reg32(struct reg *reg) static int armv8_set_core_reg32(struct reg *reg, uint8_t *buf) { - struct arm_reg *armv8_reg = reg->arch_info; + struct arm_reg_t *armv8_reg = reg->arch_info; struct target *target = armv8_reg->target; struct arm *arm = target_to_arm(target); struct reg_cache *cache = arm->core_cache; @@ -1830,7 +1830,7 @@ struct reg_cache *armv8_build_reg_cache(struct target *target) struct reg_cache *cache32 = malloc(sizeof(struct reg_cache)); struct reg *reg_list = calloc(num_regs, sizeof(struct reg)); struct reg *reg_list32 = calloc(num_regs32, sizeof(struct reg)); - struct arm_reg *arch_info = calloc(num_regs, sizeof(struct arm_reg)); + struct arm_reg_t *arch_info = calloc(num_regs, sizeof(struct arm_reg_t)); struct reg_feature *feature; int i; diff --git a/src/target/armv8_dpm.c b/src/target/armv8_dpm.c index 508ec973e3..a16acec834 100644 --- a/src/target/armv8_dpm.c +++ b/src/target/armv8_dpm.c @@ -780,7 +780,7 @@ int armv8_dpm_read_current_registers(struct arm_dpm *dpm) /* read the remaining registers that would be required by GDB 'g' packet */ for (unsigned int i = ARMV8_R2; i <= ARMV8_PC ; i++) { - struct arm_reg *arm_reg; + struct arm_reg_t *arm_reg; /* in AArch32 skip AArch64 registers */ /* TODO: this should be detected below through arm_reg->mode */ @@ -926,7 +926,7 @@ int armv8_dpm_write_dirty_registers(struct arm_dpm *dpm, bool bpwp) /* check everything except our scratch register R0 */ for (unsigned int i = 1; i < cache->num_regs; i++) { - struct arm_reg *r; + struct arm_reg_t *r; /* skip non-existent */ if (!cache->reg_list[i].exist) @@ -1054,7 +1054,7 @@ static int armv8_dpm_full_context(struct target *target) * Repeat until done. */ for (unsigned int i = 0; i < cache->num_regs; i++) { - struct arm_reg *r; + struct arm_reg_t *r; if (!cache->reg_list[i].exist || cache->reg_list[i].valid) continue; --
