Skip to content

Commit 5bd746e

Browse files
rth7680pm215
authored andcommitted
target/arm: Move endianness fixup for 32-bit registers
Move the test outside of the banked register block, and repeat the AA32 test. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1 parent 415e21a commit 5bd746e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

target/arm/helper.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7438,14 +7438,21 @@ static void add_cpreg_to_hashtable(ARMCPU *cpu, ARMCPRegInfo *r,
74387438
*/
74397439
r->type |= ARM_CP_ALIAS;
74407440
}
7441-
7442-
if (HOST_BIG_ENDIAN &&
7443-
r->state == ARM_CP_STATE_BOTH && r->fieldoffset) {
7444-
r->fieldoffset += sizeof(uint32_t);
7445-
}
74467441
}
74477442
}
74487443

7444+
/*
7445+
* For 32-bit AArch32 regs shared with 64-bit AArch64 regs,
7446+
* adjust the field offset for endianness. This had to be
7447+
* delayed until banked registers were resolved.
7448+
*/
7449+
if (HOST_BIG_ENDIAN &&
7450+
state == ARM_CP_STATE_AA32 &&
7451+
r->state == ARM_CP_STATE_BOTH &&
7452+
r->fieldoffset) {
7453+
r->fieldoffset += sizeof(uint32_t);
7454+
}
7455+
74497456
/*
74507457
* Special registers (ie NOP/WFI) are never migratable and
74517458
* are not even raw-accessible.

0 commit comments

Comments
 (0)