From d044affba5b0f6c0f5d866f7f2022663ba32a596 Mon Sep 17 00:00:00 2001 From: Tomas Vanek Date: Mon, 10 Nov 2025 19:30:44 +0100 Subject: [PATCH] target/armv4_5: fix register numbering overlap Commit b5d2b1224fed ("target/cortex_a: add hypervisor mode") added sp_hyp, spsr_hyp registers with gdb_index 51 and 52 but did not moved FP regs enum base starting from 51. Move FP registers indices to make room for added registers. Change-Id: I4338777545918fdf62016e06764308dacea61e98 Signed-off-by: Tomas Vanek Reviewed-on: https://review.openocd.org/c/openocd/+/9235 Tested-by: jenkins Reviewed-by: Antonio Borneo --- src/target/arm.h | 3 ++- src/target/armv4_5.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/target/arm.h b/src/target/arm.h index 79ec99d11..54a25731c 100644 --- a/src/target/arm.h +++ b/src/target/arm.h @@ -108,7 +108,8 @@ enum arm_mode { /* VFPv3 internal register numbers mapping to d0:31 */ enum { - ARM_VFP_V3_D0 = 51, + ARM_VFP_V3_D0 = 53, + // numbering should not overlap with e.g. armv4_5.c arm_core_regs .gdb_index ARM_VFP_V3_D1, ARM_VFP_V3_D2, ARM_VFP_V3_D3, diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index d1a81614e..e1a46bad3 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -355,6 +355,7 @@ static const struct { /* These exist only when the Virtualization Extensions is present */ [42] = { .name = "sp_hyp", .cookie = 13, .mode = ARM_MODE_HYP, .gdb_index = 51, }, [43] = { .name = "spsr_hyp", .cookie = 16, .mode = ARM_MODE_HYP, .gdb_index = 52, }, + // .gdb_index numbering continues by ARM_VFP_V3_D0 }; static const struct {